From cd1cfe69577d98c86aab27ebdec8f4ac8679e320 Mon Sep 17 00:00:00 2001 From: dcode Date: Tue, 5 Feb 2019 17:12:10 +0100 Subject: [PATCH] Update Binaryen to latest and rebuild dist files --- dist/asc.js | 2 +- dist/asc.js.map | 2 +- dist/assemblyscript.js | 4 +- dist/assemblyscript.js.map | 2 +- package-lock.json | 1528 +- package.json | 2 +- tests/compiler/abi.optimized.wat | 8 +- tests/compiler/abi.untouched.wat | 56 +- tests/compiler/asc-constants.optimized.wat | 2 +- tests/compiler/asc-constants.untouched.wat | 2 +- tests/compiler/assert.optimized.wat | 2 +- tests/compiler/assert.untouched.wat | 6 +- tests/compiler/binary.optimized.wat | 616 +- tests/compiler/binary.untouched.wat | 2666 ++-- tests/compiler/bool.optimized.wat | 16 +- tests/compiler/bool.untouched.wat | 16 +- tests/compiler/builtins.optimized.wat | 194 +- tests/compiler/builtins.untouched.wat | 514 +- tests/compiler/call-inferred.optimized.wat | 2 +- tests/compiler/call-inferred.untouched.wat | 10 +- tests/compiler/call-optional.optimized.wat | 54 +- tests/compiler/call-optional.untouched.wat | 36 +- tests/compiler/call-super.optimized.wat | 112 +- tests/compiler/call-super.untouched.wat | 216 +- tests/compiler/class-extends.optimized.wat | 10 +- tests/compiler/class-extends.untouched.wat | 10 +- .../compiler/class-overloading.optimized.wat | 2 +- .../compiler/class-overloading.untouched.wat | 4 +- .../class-with-boolean-field.optimized.wat | 2 +- .../class-with-boolean-field.untouched.wat | 6 +- tests/compiler/class.optimized.wat | 16 +- tests/compiler/class.untouched.wat | 58 +- tests/compiler/closure.optimized.wat | 2 +- tests/compiler/closure.untouched.wat | 2 +- tests/compiler/comma.optimized.wat | 82 +- tests/compiler/comma.untouched.wat | 80 +- tests/compiler/declare.optimized.wat | 6 +- tests/compiler/declare.untouched.wat | 6 +- tests/compiler/do.optimized.wat | 62 +- tests/compiler/do.untouched.wat | 62 +- tests/compiler/empty.optimized.wat | 2 +- tests/compiler/empty.untouched.wat | 2 +- tests/compiler/enum.optimized.wat | 6 +- tests/compiler/enum.untouched.wat | 10 +- tests/compiler/export.optimized.wat | 14 +- tests/compiler/export.untouched.wat | 14 +- tests/compiler/exports.optimized.wat | 86 +- tests/compiler/exports.untouched.wat | 174 +- tests/compiler/external.optimized.wat | 2 +- tests/compiler/external.untouched.wat | 2 +- tests/compiler/for.optimized.wat | 68 +- tests/compiler/for.untouched.wat | 70 +- .../function-expression.optimized.wat | 20 +- .../function-expression.untouched.wat | 22 +- tests/compiler/function-types.optimized.wat | 48 +- tests/compiler/function-types.untouched.wat | 68 +- tests/compiler/function.optimized.wat | 2 +- tests/compiler/function.untouched.wat | 28 +- tests/compiler/getter-call.optimized.wat | 44 +- tests/compiler/getter-call.untouched.wat | 90 +- tests/compiler/getter-setter.optimized.wat | 12 +- tests/compiler/getter-setter.untouched.wat | 8 +- tests/compiler/i64-polyfill.optimized.wat | 680 +- tests/compiler/i64-polyfill.untouched.wat | 766 +- tests/compiler/if.optimized.wat | 8 +- tests/compiler/if.untouched.wat | 10 +- tests/compiler/import.optimized.wat | 2 +- tests/compiler/import.untouched.wat | 38 +- tests/compiler/infer-type.optimized.wat | 16 +- tests/compiler/infer-type.untouched.wat | 54 +- .../compiler/inlining-recursive.optimized.wat | 2 +- .../compiler/inlining-recursive.untouched.wat | 2 +- tests/compiler/inlining.optimized.wat | 6 +- tests/compiler/inlining.untouched.wat | 96 +- tests/compiler/instanceof.optimized.wat | 8 +- tests/compiler/instanceof.untouched.wat | 8 +- tests/compiler/limits.optimized.wat | 2 +- tests/compiler/limits.untouched.wat | 54 +- tests/compiler/literals.optimized.wat | 2 +- tests/compiler/literals.untouched.wat | 2 +- tests/compiler/logical.optimized.wat | 34 +- tests/compiler/logical.untouched.wat | 42 +- tests/compiler/main.optimized.wat | 10 +- tests/compiler/main.untouched.wat | 10 +- tests/compiler/mandelbrot.optimized.wat | 440 +- tests/compiler/mandelbrot.untouched.wat | 594 +- tests/compiler/many-locals.optimized.wat | 6 +- tests/compiler/many-locals.untouched.wat | 1030 +- tests/compiler/memcpy.optimized.wat | 738 +- tests/compiler/memcpy.untouched.wat | 992 +- tests/compiler/memmove.optimized.wat | 146 +- tests/compiler/memmove.untouched.wat | 196 +- tests/compiler/memset.optimized.wat | 212 +- tests/compiler/memset.untouched.wat | 238 +- .../named-export-default.optimized.wat | 2 +- .../named-export-default.untouched.wat | 2 +- .../named-import-default.optimized.wat | 2 +- .../named-import-default.untouched.wat | 2 +- tests/compiler/namespace.optimized.wat | 2 +- tests/compiler/namespace.untouched.wat | 10 +- .../new-without-allocator.optimized.wat | 2 +- .../new-without-allocator.untouched.wat | 10 +- tests/compiler/nonNullAssertion.optimized.wat | 32 +- tests/compiler/nonNullAssertion.untouched.wat | 84 +- tests/compiler/number.optimized.wat | 2020 +-- tests/compiler/number.untouched.wat | 2866 ++-- tests/compiler/object-literal.optimized.wat | 100 +- tests/compiler/object-literal.untouched.wat | 170 +- .../optional-typeparameters.optimized.wat | 46 +- .../optional-typeparameters.untouched.wat | 110 +- tests/compiler/overflow.optimized.wat | 2 +- tests/compiler/overflow.untouched.wat | 274 +- .../portable-conversions.optimized.wat | 178 +- .../portable-conversions.untouched.wat | 178 +- tests/compiler/recursive.optimized.wat | 8 +- tests/compiler/recursive.untouched.wat | 8 +- tests/compiler/reexport.optimized.wat | 14 +- tests/compiler/reexport.untouched.wat | 14 +- tests/compiler/rereexport.optimized.wat | 2 +- tests/compiler/rereexport.untouched.wat | 10 +- tests/compiler/retain-i32.optimized.wat | 82 +- tests/compiler/retain-i32.untouched.wat | 296 +- tests/compiler/scoped.optimized.wat | 16 +- tests/compiler/scoped.untouched.wat | 30 +- tests/compiler/static-this.optimized.wat | 4 +- tests/compiler/static-this.untouched.wat | 4 +- .../std/allocator_arena.optimized.wat | 1074 +- .../std/allocator_arena.untouched.wat | 1500 +- tests/compiler/std/array-access.optimized.wat | 94 +- tests/compiler/std/array-access.untouched.wat | 168 +- .../compiler/std/array-literal.optimized.wat | 376 +- .../compiler/std/array-literal.untouched.wat | 710 +- tests/compiler/std/array.optimized.wat | 8162 +++++----- tests/compiler/std/array.untouched.wat | 12542 ++++++++-------- tests/compiler/std/arraybuffer.optimized.wat | 1288 +- tests/compiler/std/arraybuffer.untouched.wat | 1782 +-- tests/compiler/std/constructor.optimized.wat | 82 +- tests/compiler/std/constructor.untouched.wat | 180 +- tests/compiler/std/dataview.optimized.wat | 826 +- tests/compiler/std/dataview.untouched.wat | 1400 +- tests/compiler/std/date.optimized.wat | 86 +- tests/compiler/std/date.untouched.wat | 218 +- tests/compiler/std/gc-array.optimized.wat | 1368 +- tests/compiler/std/gc-array.untouched.wat | 1846 +-- tests/compiler/std/gc-basics.optimized.wat | 296 +- tests/compiler/std/gc-basics.untouched.wat | 424 +- .../compiler/std/gc-integration.optimized.wat | 18 +- .../compiler/std/gc-integration.untouched.wat | 32 +- tests/compiler/std/gc-object.optimized.wat | 288 +- tests/compiler/std/gc-object.untouched.wat | 404 +- tests/compiler/std/hash.optimized.wat | 58 +- tests/compiler/std/hash.untouched.wat | 244 +- tests/compiler/std/libm.optimized.wat | 2704 ++-- tests/compiler/std/libm.untouched.wat | 3498 ++--- tests/compiler/std/map.optimized.wat | 3590 ++--- tests/compiler/std/map.untouched.wat | 5368 +++---- tests/compiler/std/math.optimized.wat | 6866 ++++----- tests/compiler/std/math.untouched.wat | 11256 +++++++------- tests/compiler/std/mod.optimized.wat | 370 +- tests/compiler/std/mod.untouched.wat | 474 +- tests/compiler/std/new.optimized.wat | 54 +- tests/compiler/std/new.untouched.wat | 98 +- .../std/operator-overloading.optimized.wat | 1566 +- .../std/operator-overloading.untouched.wat | 1804 +-- tests/compiler/std/pointer.optimized.wat | 990 +- tests/compiler/std/pointer.untouched.wat | 1566 +- tests/compiler/std/polyfills.optimized.wat | 2 +- tests/compiler/std/polyfills.untouched.wat | 118 +- tests/compiler/std/set.optimized.wat | 3038 ++-- tests/compiler/std/set.untouched.wat | 4784 +++--- tests/compiler/std/static-array.optimized.wat | 1156 +- tests/compiler/std/static-array.untouched.wat | 1718 +-- tests/compiler/std/string-utf8.optimized.wat | 1350 +- tests/compiler/std/string-utf8.untouched.wat | 1704 +-- tests/compiler/std/string.optimized.wat | 4290 +++--- tests/compiler/std/string.untouched.wat | 5624 +++---- tests/compiler/std/symbol.optimized.wat | 1756 +-- tests/compiler/std/symbol.untouched.wat | 2408 +-- tests/compiler/std/trace.optimized.wat | 6 +- tests/compiler/std/trace.untouched.wat | 6 +- tests/compiler/std/typedarray.optimized.wat | 4462 +++--- tests/compiler/std/typedarray.untouched.wat | 7320 ++++----- tests/compiler/switch.optimized.wat | 20 +- tests/compiler/switch.untouched.wat | 50 +- tests/compiler/ternary.optimized.wat | 8 +- tests/compiler/ternary.untouched.wat | 8 +- tests/compiler/typealias.optimized.wat | 4 +- tests/compiler/typealias.untouched.wat | 4 +- tests/compiler/unary.optimized.wat | 254 +- tests/compiler/unary.untouched.wat | 330 +- tests/compiler/void.optimized.wat | 2 +- tests/compiler/void.untouched.wat | 6 +- tests/compiler/while.optimized.wat | 76 +- tests/compiler/while.untouched.wat | 76 +- 194 files changed, 68272 insertions(+), 68272 deletions(-) diff --git a/dist/asc.js b/dist/asc.js index 5eb7060a..50fcfa62 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(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},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 r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(n){return e[n]}.bind(null,i));return r},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 r,i;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)")},i="/",n.cwd=function(){return i},n.chdir=function(e){r||(r=t(1)),i=r.resolve(e,i)},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,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),t++):t&&(e.splice(r,1),t--)}if(n)for(;t--;t)e.unshift("..");return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return r.exec(e).slice(1)};function a(e,n){if(e.filter)return e.filter(n);for(var t=[],r=0;r=-1&&!r;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,r="/"===s.charAt(0))}return(r?"/":"")+(n=t(a(n.split("/"),function(e){return!!e}),!r).join("/"))||"."},n.normalize=function(e){var r=n.isAbsolute(e),i="/"===s(e,-1);return(e=t(a(e.split("/"),function(e){return!!e}),!r).join("/"))||r||(e="."),e&&i&&(e+="/"),(r?"/":"")+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 r(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 i=r(e.split("/")),a=r(t.split("/")),s=Math.min(i.length,a.length),o=s,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.5.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 = end - begin;\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\n@sealed\nexport class ArrayBuffer {\n\n readonly byteLength: i32; // capped to [0, MAX_LENGTH]\n\n // @unsafe\n 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 if (begin < 0) begin = max(len + begin, 0);\n else begin = min(begin, len);\n if (end < 0) end = max(len + end, 0);\n else end = min(end, len);\n var newLen = max(end - begin, 0);\n var buffer = allocateUnsafe(newLen);\n memory.copy(changetype(buffer) + HEADER_SIZE, changetype(this) + HEADER_SIZE + begin, newLen);\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",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 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, constantOffset?: usize): T;\n@builtin export declare function store(offset: usize, value: void, constantOffset?: 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\n@builtin export declare function i8(value: void): i8;\nexport namespace i8 {\n export const MIN_VALUE: i8 = -128;\n export const MAX_VALUE: i8 = 127;\n}\n\n@builtin export declare function i16(value: void): i16;\nexport namespace i16 {\n export const MIN_VALUE: i16 = -32768;\n export const MAX_VALUE: i16 = 32767;\n}\n\n@builtin export declare function i32(value: void): i32;\nexport namespace i32 {\n export const MIN_VALUE: i32 = -2147483648;\n 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, constantOffset?: usize): i32;\n @builtin export declare function load8_u(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function load16_s(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function load16_u(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function load(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function store8(offset: usize, value: i32, constantOffset?: usize): void;\n @builtin export declare function store16(offset: usize, value: i32, constantOffset?: usize): void;\n @builtin export declare function store(offset: usize, value: i32, constantOffset?: usize): void;\n}\n\n@builtin export declare function i64(value: void): i64;\nexport namespace i64 {\n export const MIN_VALUE: i64 = -9223372036854775808;\n 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, constantOffset?: usize): i64;\n @builtin export declare function load8_u(offset: usize, constantOffset?: usize): u64;\n @builtin export declare function load16_s(offset: usize, constantOffset?: usize): i64;\n @builtin export declare function load16_u(offset: usize, constantOffset?: usize): u64;\n @builtin export declare function load32_s(offset: usize, constantOffset?: usize): i64;\n @builtin export declare function load32_u(offset: usize, constantOffset?: usize): u64;\n @builtin export declare function load(offset: usize, constantOffset?: 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, constantOffset?: usize): void;\n @builtin export declare function store16(offset: usize, value: i64, constantOffset?: usize): void;\n @builtin export declare function store32(offset: usize, value: i64, constantOffset?: usize): void;\n @builtin export declare function store(offset: usize, value: i64, constantOffset?: usize): void;\n}\n\n@builtin export declare function isize(value: void): isize;\nexport namespace isize {\n export const MIN_VALUE: isize = sizeof() == sizeof()\n ? -2147483648\n : -9223372036854775808;\n 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 export const MIN_VALUE: u8 = 0;\n export const MAX_VALUE: u8 = 255;\n}\n\n@builtin export declare function u16(value: void): u16;\nexport namespace u16 {\n export const MIN_VALUE: u16 = 0;\n export const MAX_VALUE: u16 = 65535;\n}\n\n@builtin export declare function u32(value: void): u32;\nexport namespace u32 {\n export const MIN_VALUE: u32 = 0;\n export const MAX_VALUE: u32 = 4294967295;\n}\n\n@builtin export declare function u64(value: void): u64;\nexport namespace u64 {\n export const MIN_VALUE: u64 = 0;\n export const MAX_VALUE: u64 = 18446744073709551615;\n}\n\n@builtin export declare function usize(value: void): usize;\nexport namespace usize {\n export const MIN_VALUE: usize = 0;\n 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 export const MIN_VALUE: bool = false;\n export const MAX_VALUE: bool = true;\n}\n\n@builtin export declare function f32(value: void): f32;\nexport namespace f32 {\n export const EPSILON = reinterpret(0x34000000); // 0x1p-23f\n export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f\n export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f\n export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f\n export const MIN_SAFE_INTEGER: f32 = -16777215;\n 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, constantOffset?: 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, constantOffset?: 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 export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52\n export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0\n export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023\n export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022\n export const MIN_SAFE_INTEGER: f64 = -9007199254740991;\n 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, constantOffset?: 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, constantOffset?: usize): void;\n @builtin export declare function trunc(value: f64): f64;\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\nconst TRACE = false;\n\n/** Size of a managed object header. */\nexport 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. */\nexport const AL_BITS: u32 = 3;\n/** Number of possible alignment values. */\nexport const AL_SIZE: usize = 1 << AL_BITS;\n/** Mask to obtain just the alignment bits. */\nexport const AL_MASK: usize = AL_SIZE - 1;\n/** Maximum 32-bit allocation size. */\nexport 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. */\nexport const HEADER_SIZE: usize = (offsetof() + AL_MASK) & ~AL_MASK;\n/** Maximum byte length of an ArrayBuffer. */\nexport 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\nconst FNV_OFFSET: u32 = 2166136261;\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 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":'\nimport {\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\nexport const MAX_DOUBLE_LENGTH = 28;\n\n@inline\nexport function POWERS10(): u32[] {\n const table: u32[] = [\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000\n ];\n return table; // inlines to a constant memory offset\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@inline\nexport function DIGITS(): u32[] {\n const table: 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 return table; // inlines to a constant memory offset\n}\n\n@inline\nfunction EXP_POWERS(): i16[] {\n const table: 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 return table;\n}\n\n// 1e-348, 1e-340, ..., 1e340\n@inline\nfunction FRC_POWERS(): u64[] {\n const table: 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 return table;\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\nvar _K: i32 = 0;\n\nvar _frc: u64 = 0;\nvar _exp: i32 = 0;\n\nvar _frc_minus: u64 = 0;\nvar _frc_plus: u64 = 0;\n\nvar _frc_pow: u64 = 0;\nvar _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 var sa = a, sb = b;\n return compareUnsafe(sa, 0, sb, 0, min(sa.length, sb.length));\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. */\nexport const HEADER_SIZE = (offsetof() + 1) & ~1; // 2 byte aligned\n/** Maximum length of a String. */\nexport 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\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: 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',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\nconst INITIAL_CAPACITY = 4;\nconst FILL_FACTOR: f64 = 8 / 3;\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. */\nconst EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\nconst 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\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 /** @internal */\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\nvar random_seeded = false;\nvar random_state0_64: u64;\nvar random_state1_64: u64;\nvar random_state0_32: u32;\nvar random_state1_32: u32;\n\n/** @internal */\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\n/** @internal */\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 export const E = reinterpret(0x4005BF0A8B145769); // 2.7182818284590452354\n export const LN2 = reinterpret(0x3FE62E42FEFA39EF); // 0.69314718055994530942\n export const LN10 = reinterpret(0x40026BB1BBB55516); // 2.30258509299404568402\n export const LOG2E = reinterpret(0x3FF71547652B82FE); // 1.4426950408889634074\n export const LOG10E = reinterpret(0x3FDBCB7B1526E50E); // 0.43429448190325182765\n export const PI = reinterpret(0x400921FB54442D18); // 3.14159265358979323846\n export const SQRT1_2 = reinterpret(0x3FE6A09E667F3BCD); // 0.70710678118654752440\n 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 var w = t + t;\n r = (r - t) / (w + 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 @inline\n export function clz32(x: f64): f64 {\n return builtin_clz(x);\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) {\n x *= Ox1p1023;\n return x;\n }\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 approachas 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 offset = select(52, 20, k > 20) - k;\n let Ly = select(ly, iy, k > 20);\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 == 0x7FF00000 || ix == 0 || ix == 0x3FF00000) {\n z = ax;\n if (hy < 0) z = 1.0 / z;\n if (hx < 0) {\n if (((ix - 0x3FF00000) | yisint) == 0) z = (z - z) / (z - z);\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) return (x - x) / (x - x);\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 /** @internal */\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\t\t 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)) return (x * y) / (x * y);\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)) return (x * y) / (x * y);\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 */\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 /** @internal */\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 / 2) << 23);\n return NativeMathf.exp(x - kln2) * scale * scale;\n}\n\nexport namespace NativeMathf {\n\n export const E = NativeMath.E;\n export const LN2 = NativeMath.LN2;\n export const LN10 = NativeMath.LN10;\n export const LOG2E = NativeMath.LOG2E;\n export const LOG10E = NativeMath.LOG10E;\n export const PI = NativeMath.PI;\n export const SQRT1_2 = NativeMath.SQRT1_2;\n export const SQRT2 = NativeMath.SQRT2;\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 @inline\n export function clz32(x: f32): f32 {\n return builtin_clz(x);\n }\n\n export function cos(x: f32): f32 { // TODO\n unreachable();\n return 0;\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_) {\n x *= Ox1p127f;\n return x;\n } else {\n if (hx >= 0x42CFF1B5) return 0;\n }\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 return (x * y);\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 j = iy >> (23 - k);\n if ((j << (23 - k)) == 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) z = (z - z) / (z - z);\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) return (x - x) / (x - x);\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 { // TODO\n unreachable();\n return 0;\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 { // TODO\n unreachable();\n return 0;\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 /** @internal */\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)) return (x * y) / (x * y);\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\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',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 @inline export function fill(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset\n if (isDefined(__memory_fill)) { __memory_fill(dest, c, n); return; }\n memset(dest, c, n);\n }\n\n @inline export function copy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c\n if (isDefined(__memory_copy)) { __memory_copy(dest, src, n); return; }\n memmove(dest, src, n);\n }\n\n @inline export function compare(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c\n if (isDefined(__memory_compare)) return __memory_compare(vl, vr, n);\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 static readonly MIN_VALUE: i8 = i8.MIN_VALUE;\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\nexport abstract class I16 {\n\n static readonly MIN_VALUE: i16 = i16.MIN_VALUE;\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\nexport abstract class I32 {\n\n static readonly MIN_VALUE: i32 = i32.MIN_VALUE;\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\nexport abstract class I64 {\n\n static readonly MIN_VALUE: i64 = i64.MIN_VALUE;\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\nexport abstract class Isize {\n\n static readonly MIN_VALUE: isize = isize.MIN_VALUE;\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\nexport abstract class U8 {\n\n static readonly MIN_VALUE: u8 = u8.MIN_VALUE;\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\nexport abstract class U16 {\n\n static readonly MIN_VALUE: u16 = u16.MIN_VALUE;\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\nexport abstract class U32 {\n\n static readonly MIN_VALUE: u32 = u32.MIN_VALUE;\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\nexport abstract class U64 {\n\n static readonly MIN_VALUE: u64 = u64.MIN_VALUE;\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\nexport abstract class Usize {\n\n static readonly MIN_VALUE: usize = usize.MIN_VALUE;\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\nexport abstract class Bool {\n\n static readonly MIN_VALUE: bool = bool.MIN_VALUE;\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\n@sealed\nexport abstract class Boolean extends Bool {}\n\n@sealed\nexport abstract class F32 {\n\n static readonly EPSILON: f32 = f32.EPSILON;\n static readonly MIN_VALUE: f32 = f32.MIN_VALUE;\n static readonly MAX_VALUE: f32 = f32.MAX_VALUE;\n static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER;\n static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER;\n static readonly POSITIVE_INFINITY: f32 = Infinity;\n static readonly NEGATIVE_INFINITY: f32 = -Infinity;\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\nexport abstract class F64 {\n\n static readonly EPSILON: f64 = f64.EPSILON;\n static readonly MIN_VALUE: f64 = f64.MIN_VALUE;\n static readonly MAX_VALUE: f64 = f64.MAX_VALUE;\n static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER;\n static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER;\n static readonly POSITIVE_INFINITY: f64 = Infinity;\n static readonly NEGATIVE_INFINITY: f64 = -Infinity;\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\n@sealed\nexport abstract class Number extends F64 {}\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\nconst INITIAL_CAPACITY = 4;\nconst FILL_FACTOR: f64 = 8 / 3;\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. */\nconst EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\nconst 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("!=")\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 if (left === right) return true;\n if (left === null || right === null) return false;\n\n var leftLength = left.length;\n var rightLength = right.length;\n\n if (!leftLength) return !rightLength;\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 __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 if (left === right) return true;\n if (left === null || right === null) return false;\n\n var leftLength = left.length;\n var rightLength = right.length;\n\n if (!rightLength) return !leftLength;\n if (!leftLength) return true;\n\n var length = min(leftLength, rightLength);\n return compareUnsafe(left, 0, right, 0, length) <= 0;\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 length = this.length;\n var begin = (beginIndex < 0) ? max(beginIndex + length, 0) : min(beginIndex, length);\n var end = (endIndex < 0) ? max(endIndex + length, 0) : min(endIndex, length);\n var 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 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\nvar stringToId: Map;\nvar idToString: Map;\nvar 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\ntype Symbol = symbol;\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 export const hasInstance = changetype(1);\n export const isConcatSpreadable = changetype(2);\n export const isRegExp = changetype(3);\n export const iterator = changetype(3);\n export const match = changetype(4);\n export const replace = changetype(5);\n export const search = changetype(6);\n export const species = changetype(7);\n export const split = changetype(8);\n export const toPrimitive = changetype(9);\n export const toStringTag = changetype(10);\n 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} from \"./internal/typedarray\";\n\nimport {\n COMPARATOR\n} from \"./internal/sort\";\n\nexport class Int8Array extends TypedArray {\n 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\nexport class Uint8Array extends TypedArray {\n 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\nexport class Uint8ClampedArray extends Uint8Array {\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n @inline @operator(\"[]=\")\n protected __set(index: i32, value: i32): void {\n super.__set(index, max(min(value, 255), 0));\n }\n\n @inline @operator(\"{}=\")\n protected __unchecked_set(index: i32, value: i32): void {\n super.__unchecked_set(index, max(min(value, 255), 0));\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 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\nexport class Int16Array extends TypedArray {\n 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\nexport class Uint16Array extends TypedArray {\n 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\nexport class Int32Array extends TypedArray {\n 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\nexport class Uint32Array extends TypedArray {\n 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\nexport class Int64Array extends TypedArray {\n 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\nexport class Uint64Array extends TypedArray {\n 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\nexport class Float32Array extends TypedArray {\n 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\nexport class Float64Array extends TypedArray {\n 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"}):(()=>{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\n// Compiler hints\n\n/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */\ndeclare const ASC_TARGET: i32;\n/** Provided noTreeshaking option. */\ndeclare const ASC_NO_TREESHAKING: bool;\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 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, constantOffset?: 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, constantOffset?: 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 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/** 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 /** 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 | 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 /** 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 | 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 from memory and returns it as a 32-bit integer. */\n export function load8_s(offset: usize, constantOffset?: usize): i32;\n /** Loads an 8-bit unsigned integer from memory and returns it as a 32-bit integer. */\n export function load8_u(offset: usize, constantOffset?: usize): i32;\n /** Loads a 16-bit signed integer from memory and returns it as a 32-bit integer. */\n export function load16_s(offset: usize, constantOffset?: usize): i32;\n /** Loads a 16-bit unsigned integer from memory and returns it as a 32-bit integer. */\n export function load16_u(offset: usize, constantOffset?: usize): i32;\n /** Loads a 32-bit integer from memory. */\n export function load(offset: usize, constantOffset?: usize): i32;\n /** Stores a 32-bit integer to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i32, constantOffset?: usize): void;\n /** Stores a 32-bit integer to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i32, constantOffset?: usize): void;\n /** Stores a 32-bit integer to memory. */\n export function store(offset: usize, value: i32, constantOffset?: usize): void;\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 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 from memory and returns it as a 64-bit signed integer. */\n export function load8_s(offset: usize, constantOffset?: usize): i64;\n /** Loads an 8-bit unsigned integer from memory and returns it as a 64-bit unsigned integer. */\n export function load8_u(offset: usize, constantOffset?: usize): u64;\n /** Loads a 16-bit signed integer from memory and returns it as a 64-bit signed integer. */\n export function load16_s(offset: usize, constantOffset?: usize): i64;\n /** Loads a 16-bit unsigned integer from memory and returns it as a 64-bit unsigned integer. */\n export function load16_u(offset: usize, constantOffset?: usize): u64;\n /** Loads a 32-bit signed integer from memory and returns it as a 64-bit signed integer. */\n export function load32_s(offset: usize, constantOffset?: usize): i64;\n /** Loads a 32-bit unsigned integer from memory and returns it as a 64-bit unsigned integer. */\n export function load32_u(offset: usize, constantOffset?: usize): u64;\n /** Loads a 64-bit unsigned integer from memory. */\n export function load(offset: usize, constantOffset?: usize): i64;\n /** Stores a 64-bit integer to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i64, constantOffset?: usize): void;\n /** Stores a 64-bit integer to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i64, constantOffset?: usize): void;\n /** Stores a 64-bit integer to memory as a 32-bit integer. */\n export function store32(offset: usize, value: i64, constantOffset?: usize): void;\n /** Stores a 64-bit integer to memory. */\n export function store(offset: usize, value: i64, constantOffset?: usize): void;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i64;\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 /** 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 | 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 /** 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 | 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 /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u64;\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 /** Converts a string to a floating-point number. */\n export function parseFloat(string: string): u64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): 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 /** Returns the floating-point remainder of `x / y` (rounded towards zero). */\n export function mod(x: f32, y: f32): f32;\n /** Returns the floating-point remainder of `x / y` (rounded to nearest). */\n export function rem(x: f32, y: f32): f32;\n /** Loads a 32-bit float from memory. */\n export function load(offset: usize, constantOffset?: usize): f32;\n /** Stores a 32-bit float to memory. */\n export function store(offset: usize, value: f32, constantOffset?: usize): void;\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 | 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, constantOffset?: usize): f64;\n /** Stores a 64-bit float to memory. */\n export function store(offset: usize, value: f64, constantOffset?: usize): void;\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 /** 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}\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\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): i32;\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 /** 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}\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: string): (\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: string): (\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: string): (\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: string): (\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 or function 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",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 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 bool = boolean;\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\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 reference type. */\ndeclare function isReference(value: any): value is object | string;\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 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 /** 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\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 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 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 r=["--binaryFile","binary","--textFile","text"];return Object.keys(n||{}).forEach(e=>{var t=n[e];Array.isArray(t)?t.forEach(n=>r.push("--"+e,String(n))):r.push("--"+e,String(t))}),exports.main(r.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 r=n.stdout||process.stdout,i=n.stderr||process.stderr,a=n.readFile||F,s=n.writeFile||S,o=n.listFiles||I,l=n.stats||createStats();if(!r)throw Error("'options.stdout' must be specified");if(!i)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(r),colorsUtil.stderr=colorsUtil.from(i)),f.unknown.length&&f.unknown.forEach(e=>{i.write(colorsUtil.stderr.yellow("WARN: ")+"Unknown option '"+e+"'"+EOL)}),f.trailing.length&&i.write(colorsUtil.stderr.yellow("WARN: ")+"Unsupported trailing arguments: "+f.trailing.join(" ")+EOL),t||(t=function(e){var n=0;return e&&(i.write(colorsUtil.stderr.red("ERROR: ")+e.stack.replace(/^ERROR: /i,"")+EOL),n=1),n}),u.version)return r.write("Version "+exports.version+(isDev?"-dev":"")+EOL),t(null);if(u.help||!e.length){var c=u.help?r:i,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(s===S)throw Error("'options.writeFile' must be specified");if(o===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(s,exports.libraryPrefix+i,!1,x)})}}}function g(){for(var e,n;null!=(e=x.nextFile());){if(e.startsWith(exports.libraryPrefix)){const t=e.substring(exports.libraryPrefix.length),r=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(r))n=exports.libraryFiles[r],e=exports.libraryPrefix+r+".ts";else for(let i=0,s=b.length;i{assemblyscript.parseFile(n,e,!1,x)})}if(checkDiagnostics(x,i))return t(Error("Parse error"))}for(let n=0,r=e.length;n{x=assemblyscript.parseFile(s,i,!0,x)});let o=g();if(o)return o}!function(e,...n){h.forEach(t=>{"function"==typeof t[e]&&t[e](...n)})}("afterParse",x);{let e=g();if(e)return e}const y=assemblyscript.finishParsing(x);var m=0,v=0;u.optimize&&(m=exports.defaultOptimizeLevel,v=exports.defaultShrinkLevel),"number"==typeof u.optimizeLevel&&(m=u.optimizeLevel),"number"==typeof u.shrinkLevel&&(v=u.shrinkLevel),m=Math.min(Math.max(m,0),3),v=Math.min(Math.max(v,0),2);const E=assemblyscript.createOptions();if(assemblyscript.setTarget(E,0),assemblyscript.setNoTreeShaking(E,u.noTreeShaking),assemblyscript.setNoAssert(E,u.noAssert),assemblyscript.setImportMemory(E,u.importMemory),assemblyscript.setImportTable(E,u.importTable),assemblyscript.setMemoryBase(E,u.memoryBase>>>0),assemblyscript.setSourceMap(E,null!=u.sourceMap),assemblyscript.setOptimizeLevelHints(E,m,v),u.noLib||(assemblyscript.setGlobalAlias(E,"Math","NativeMath"),assemblyscript.setGlobalAlias(E,"Mathf","NativeMathf"),assemblyscript.setGlobalAlias(E,"abort","~lib/env/abort"),assemblyscript.setGlobalAlias(E,"trace","~lib/env/trace")),u.use){let e=u.use;for(let n=0,r=e.length;n{try{l.compileTime+=measure(()=>{_=assemblyscript.compileProgram(y,E)})}catch(e){return t(e)}})(),checkDiagnostics(x,i))return _&&_.dispose(),t(Error("Compile error"));if(u.validate&&(l.validateCount++,l.validateTime+=measure(()=>{if(!_.validate())return _.dispose(),t(Error("Validate error"))})),"clamp"===u.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{_.runPasses(["trap-mode-clamp"])});else if("js"===u.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{_.runPasses(["trap-mode-js"])});else if("allow"!==u.trapMode)return _.dispose(),t(Error("Unsupported trap mode"));(m>=3||v>=2)&&(m=4),_.setOptimizeLevel(m),_.setShrinkLevel(v),_.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||v>0)&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{_.optimize()})),A.length&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{_.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 r,o=null!=u.sourceMap?u.sourceMap.length?u.sourceMap:path.basename(u.binaryFile)+".map":null;if(l.emitCount++,l.emitTime+=measure(()=>{r=_.toBinary(o)}),u.binaryFile.length?s(u.binaryFile,r.output,d):(z(r.output),e=!0),n=!0,null!=r.sourceMap)if(u.binaryFile.length){let e=JSON.parse(r.sourceMap);e.sourceRoot=exports.sourceMapRoot,e.sources.forEach((n,r)=>{let i=null;if(n.startsWith(exports.libraryPrefix)){let e=n.substring(exports.libraryPrefix.length).replace(/\.ts$/,"");if(exports.libraryFiles.hasOwnProperty(e))i=exports.libraryFiles[e];else for(let e=0,t=b.length;e{t=_.toAsmjs()}),s(u.asmjsFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=_.toAsmjs()}),z(t),e=!0),n=!0}if(null!=u.idlFile){let t;u.idlFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(y)}),s(u.idlFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(y)}),z(t),e=!0),n=!0}if(null!=u.tsdFile){let t;u.tsdFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(y)}),s(u.tsdFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(y)}),z(t),e=!0),n=!0}if(null!=u.textFile||!n){let n;u.textFile&&u.textFile.length?(l.emitCount++,l.emitTime+=measure(()=>{n=_.toText()}),s(u.textFile,n,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{n=_.toText()}),z(n))}}return _.dispose(),u.measure&&printStats(l,i),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 S(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 z(e){z.used||(l.writeCount++,z.used=!0),l.writeTime+=measure(()=>{"string"==typeof e?r.write(e,{encoding:"utf8"}):r.write(e)})}};var argumentSubstitutions={"-O":["--optimize"],"-Os":["--optimize","--shrinkLevel","1"],"-Oz":["--optimize","--shrinkLevel","2"],"-O0":["--optimizeLevel","0","--shrinkLevel","0"],"-O0s":["--optimizeLevel","0","--shrinkLevel","1"],"-O0z":["--optimizeLevel","0","--shrinkLevel","2"],"-O1":["--optimizeLevel","1","--shrinkLevel","0"],"-O1s":["--optimizeLevel","1","--shrinkLevel","1"],"-O1z":["--optimizeLevel","1","--shrinkLevel","2"],"-O2":["--optimizeLevel","2","--shrinkLevel","0"],"-O2s":["--optimizeLevel","2","--shrinkLevel","1"],"-O2z":["--optimizeLevel","2","--shrinkLevel","2"],"-O3":["--optimizeLevel","3","--shrinkLevel","0"],"-O3s":["--optimizeLevel","3","--shrinkLevel","1"],"-O3z":["--optimizeLevel","3","--shrinkLevel","2"]};function checkDiagnostics(e,n){for(var t,r=!1;null!=(t=assemblyscript.nextDiagnostic(e));)n&&n.write(assemblyscript.formatDiagnostic(t,n.isTTY,!0)+EOL+EOL),assemblyscript.isError(t)&&(r=!0);return r}function createStats(){return{readTime:0,readCount:0,writeTime:0,writeCount:0,parseTime:0,parseCount:0,compileTime:0,compileCount:0,emitTime:0,emitCount:0,validateTime:0,validateCount:0,optimizeTime:0,optimizeCount:0}}function measure(e){const n=process.hrtime();e();const t=process.hrtime(n);return 1e9*t[0]+t[1]}function formatTime(e){return e?(e/1e6).toFixed(3)+" ms":"N/A"}function printStats(e,n){function t(e,n){return formatTime(e)}(n||process.stdout).write(["I/O Read : "+t(e.readTime,e.readCount),"I/O Write : "+t(e.writeTime,e.writeCount),"Parse : "+t(e.parseTime,e.parseCount),"Compile : "+t(e.compileTime,e.compileCount),"Emit : "+t(e.emitTime,e.emitCount),"Validate : "+t(e.validateTime,e.validateCount),"Optimize : "+t(e.optimizeTime,e.optimizeCount)].join(EOL)+EOL)}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&&r<224?a[s++]=(31&r)<<6|63&e[n++]:r>239&&r<365?(r=((7&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,a[s++]=55296+(r>>10),a[s++]=56320+(1023&r)):a[s++]=(15&r)<<12|(63&e[n++])<<6|63&e[n++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))},r.write=function(e,n,t){for(var r,i,a=t,s=0;s>6|192,n[t++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&i),++s,n[t++]=r>>18|240,n[t++]=r>>12&63|128,n[t++]=r>>6&63|128,n[t++]=63&r|128):(n[t++]=r>>12|224,n[t++]=r>>6&63|128,n[t++]=63&r|128);return t-a}},function(e,n,t){(function(e){var t=void 0!==e&&e||{},r=t.env&&"CI"in t.env;function i(e,t){var i=t||{};return i.supported=e&&!!e.isTTY||r,i.gray=(e=>i.supported?n.GRAY+e+n.RESET:e),i.red=(e=>i.supported?n.RED+e+n.RESET:e),i.green=(e=>i.supported?n.GREEN+e+n.RESET:e),i.yellow=(e=>i.supported?n.YELLOW+e+n.RESET:e),i.blue=(e=>i.supported?n.BLUE+e+n.RESET:e),i.magenta=(e=>i.supported?n.MAGENTA+e+n.RESET:e),i.cyan=(e=>i.supported?n.CYAN+e+n.RESET:e),i.white=(e=>i.supported?n.WHITE+e+n.RESET:e),i}n.stdout=i(t.stdout,n),n.stderr=i(t.stderr),n.from=i,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={},r=[],arguments=[],i=[],a={};Object.keys(n).forEach(e=>{var r=n[e];null!=r.alias&&("string"==typeof r.alias?a[r.alias]=e:Array.isArray(r.alias)&&r.alias.forEach(n=>a[n]=e)),null!=r.default&&(t[e]=r.default)});for(var s=0,o=(e=e.slice()).length;st[e]=o.value[e])}else r.push(i)}for(;s{var s=e[n];if(null!=s.description){for(var o="";o.length{for(let n=0;n=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),t++):t&&(e.splice(r,1),t--)}if(n)for(;t--;t)e.unshift("..");return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return r.exec(e).slice(1)};function a(e,n){if(e.filter)return e.filter(n);for(var t=[],r=0;r=-1&&!r;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,r="/"===s.charAt(0))}return(r?"/":"")+(n=t(a(n.split("/"),function(e){return!!e}),!r).join("/"))||"."},n.normalize=function(e){var r=n.isAbsolute(e),i="/"===s(e,-1);return(e=t(a(e.split("/"),function(e){return!!e}),!r).join("/"))||r||(e="."),e&&i&&(e+="/"),(r?"/":"")+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 r(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 i=r(e.split("/")),a=r(t.split("/")),s=Math.min(i.length,a.length),o=s,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.5.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 = end - begin;\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 if (begin < 0) begin = max(len + begin, 0);\n else begin = min(begin, len);\n if (end < 0) end = max(len + end, 0);\n else end = min(end, len);\n var newLen = max(end - begin, 0);\n var buffer = allocateUnsafe(newLen);\n memory.copy(changetype(buffer) + HEADER_SIZE, changetype(this) + HEADER_SIZE + begin, newLen);\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",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 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, constantOffset?: usize): T;\n@builtin export declare function store(offset: usize, value: void, constantOffset?: 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\n@builtin export declare function i8(value: void): i8;\nexport namespace i8 {\n export const MIN_VALUE: i8 = -128;\n export const MAX_VALUE: i8 = 127;\n}\n\n@builtin export declare function i16(value: void): i16;\nexport namespace i16 {\n export const MIN_VALUE: i16 = -32768;\n export const MAX_VALUE: i16 = 32767;\n}\n\n@builtin export declare function i32(value: void): i32;\nexport namespace i32 {\n export const MIN_VALUE: i32 = -2147483648;\n 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, constantOffset?: usize): i32;\n @builtin export declare function load8_u(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function load16_s(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function load16_u(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function load(offset: usize, constantOffset?: usize): i32;\n @builtin export declare function store8(offset: usize, value: i32, constantOffset?: usize): void;\n @builtin export declare function store16(offset: usize, value: i32, constantOffset?: usize): void;\n @builtin export declare function store(offset: usize, value: i32, constantOffset?: usize): void;\n}\n\n@builtin export declare function i64(value: void): i64;\nexport namespace i64 {\n export const MIN_VALUE: i64 = -9223372036854775808;\n 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, constantOffset?: usize): i64;\n @builtin export declare function load8_u(offset: usize, constantOffset?: usize): u64;\n @builtin export declare function load16_s(offset: usize, constantOffset?: usize): i64;\n @builtin export declare function load16_u(offset: usize, constantOffset?: usize): u64;\n @builtin export declare function load32_s(offset: usize, constantOffset?: usize): i64;\n @builtin export declare function load32_u(offset: usize, constantOffset?: usize): u64;\n @builtin export declare function load(offset: usize, constantOffset?: 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, constantOffset?: usize): void;\n @builtin export declare function store16(offset: usize, value: i64, constantOffset?: usize): void;\n @builtin export declare function store32(offset: usize, value: i64, constantOffset?: usize): void;\n @builtin export declare function store(offset: usize, value: i64, constantOffset?: usize): void;\n}\n\n@builtin export declare function isize(value: void): isize;\nexport namespace isize {\n export const MIN_VALUE: isize = sizeof() == sizeof()\n ? -2147483648\n : -9223372036854775808;\n 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 export const MIN_VALUE: u8 = 0;\n export const MAX_VALUE: u8 = 255;\n}\n\n@builtin export declare function u16(value: void): u16;\nexport namespace u16 {\n export const MIN_VALUE: u16 = 0;\n export const MAX_VALUE: u16 = 65535;\n}\n\n@builtin export declare function u32(value: void): u32;\nexport namespace u32 {\n export const MIN_VALUE: u32 = 0;\n export const MAX_VALUE: u32 = 4294967295;\n}\n\n@builtin export declare function u64(value: void): u64;\nexport namespace u64 {\n export const MIN_VALUE: u64 = 0;\n export const MAX_VALUE: u64 = 18446744073709551615;\n}\n\n@builtin export declare function usize(value: void): usize;\nexport namespace usize {\n export const MIN_VALUE: usize = 0;\n 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 export const MIN_VALUE: bool = false;\n export const MAX_VALUE: bool = true;\n}\n\n@builtin export declare function f32(value: void): f32;\nexport namespace f32 {\n export const EPSILON = reinterpret(0x34000000); // 0x1p-23f\n export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f\n export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f\n export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f\n export const MIN_SAFE_INTEGER: f32 = -16777215;\n 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, constantOffset?: 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, constantOffset?: 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 export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52\n export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0\n export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023\n export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022\n export const MIN_SAFE_INTEGER: f64 = -9007199254740991;\n 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, constantOffset?: 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, constantOffset?: usize): void;\n @builtin export declare function trunc(value: f64): f64;\n}\n\n@builtin export declare function start(): void;\n\n@builtin export function NATIVE_CODE(): void { unreachable(); }\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\nconst TRACE = false;\n\n/** Size of a managed object header. */\nexport 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. */\nexport const AL_BITS: u32 = 3;\n/** Number of possible alignment values. */\nexport const AL_SIZE: usize = 1 << AL_BITS;\n/** Mask to obtain just the alignment bits. */\nexport const AL_MASK: usize = AL_SIZE - 1;\n/** Maximum 32-bit allocation size. */\nexport 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. */\nexport const HEADER_SIZE: usize = (offsetof() + AL_MASK) & ~AL_MASK;\n/** Maximum byte length of an ArrayBuffer. */\nexport 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\nconst FNV_OFFSET: u32 = 2166136261;\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 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":'\nimport {\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\nexport const MAX_DOUBLE_LENGTH = 28;\n\n@inline\nexport function POWERS10(): u32[] {\n const table: u32[] = [\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000\n ];\n return table; // inlines to a constant memory offset\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@inline\nexport function DIGITS(): u32[] {\n const table: 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 return table; // inlines to a constant memory offset\n}\n\n@inline\nfunction EXP_POWERS(): i16[] {\n const table: 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 return table;\n}\n\n// 1e-348, 1e-340, ..., 1e340\n@inline\nfunction FRC_POWERS(): u64[] {\n const table: 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 return table;\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\nvar _K: i32 = 0;\n\nvar _frc: u64 = 0;\nvar _exp: i32 = 0;\n\nvar _frc_minus: u64 = 0;\nvar _frc_plus: u64 = 0;\n\nvar _frc_pow: u64 = 0;\nvar _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 var sa = a, sb = b;\n return compareUnsafe(sa, 0, sb, 0, min(sa.length, sb.length));\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. */\nexport const HEADER_SIZE = (offsetof() + 1) & ~1; // 2 byte aligned\n/** Maximum length of a String. */\nexport 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\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: 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',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\nconst INITIAL_CAPACITY = 4;\nconst FILL_FACTOR: f64 = 8 / 3;\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. */\nconst EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\nconst 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\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 /** @internal */\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\nvar random_seeded = false;\nvar random_state0_64: u64;\nvar random_state1_64: u64;\nvar random_state0_32: u32;\nvar random_state1_32: u32;\n\n/** @internal */\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\n/** @internal */\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 export const E = reinterpret(0x4005BF0A8B145769); // 2.7182818284590452354\n export const LN2 = reinterpret(0x3FE62E42FEFA39EF); // 0.69314718055994530942\n export const LN10 = reinterpret(0x40026BB1BBB55516); // 2.30258509299404568402\n export const LOG2E = reinterpret(0x3FF71547652B82FE); // 1.4426950408889634074\n export const LOG10E = reinterpret(0x3FDBCB7B1526E50E); // 0.43429448190325182765\n export const PI = reinterpret(0x400921FB54442D18); // 3.14159265358979323846\n export const SQRT1_2 = reinterpret(0x3FE6A09E667F3BCD); // 0.70710678118654752440\n 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 @inline\n export function clz32(x: f64): f64 {\n return builtin_clz(x);\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 approachas 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 /** @internal */\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\t\t 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 */\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 /** @internal */\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\nexport namespace NativeMathf {\n\n export const E = NativeMath.E;\n export const LN2 = NativeMath.LN2;\n export const LN10 = NativeMath.LN10;\n export const LOG2E = NativeMath.LOG2E;\n export const LOG10E = NativeMath.LOG10E;\n export const PI = NativeMath.PI;\n export const SQRT1_2 = NativeMath.SQRT1_2;\n export const SQRT2 = NativeMath.SQRT2;\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 @inline\n export function clz32(x: f32): f32 {\n return builtin_clz(x);\n }\n\n export function cos(x: f32): f32 { // TODO\n unreachable();\n return 0;\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 return (x * y);\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 { // TODO\n unreachable();\n return 0;\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 { // TODO\n unreachable();\n return 0;\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 /** @internal */\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\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 @inline export function fill(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset\n if (isDefined(__memory_fill)) { __memory_fill(dest, c, n); return; }\n memset(dest, c, n);\n }\n\n @inline export function copy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c\n if (isDefined(__memory_copy)) { __memory_copy(dest, src, n); return; }\n memmove(dest, src, n);\n }\n\n @inline export function compare(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c\n if (isDefined(__memory_compare)) return __memory_compare(vl, vr, n);\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 static readonly MIN_VALUE: i8 = i8.MIN_VALUE;\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\nexport abstract class I16 {\n\n static readonly MIN_VALUE: i16 = i16.MIN_VALUE;\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\nexport abstract class I32 {\n\n static readonly MIN_VALUE: i32 = i32.MIN_VALUE;\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\nexport abstract class I64 {\n\n static readonly MIN_VALUE: i64 = i64.MIN_VALUE;\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\nexport abstract class Isize {\n\n static readonly MIN_VALUE: isize = isize.MIN_VALUE;\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\nexport abstract class U8 {\n\n static readonly MIN_VALUE: u8 = u8.MIN_VALUE;\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\nexport abstract class U16 {\n\n static readonly MIN_VALUE: u16 = u16.MIN_VALUE;\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\nexport abstract class U32 {\n\n static readonly MIN_VALUE: u32 = u32.MIN_VALUE;\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\nexport abstract class U64 {\n\n static readonly MIN_VALUE: u64 = u64.MIN_VALUE;\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\nexport abstract class Usize {\n\n static readonly MIN_VALUE: usize = usize.MIN_VALUE;\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\nexport abstract class Bool {\n\n static readonly MIN_VALUE: bool = bool.MIN_VALUE;\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\n@sealed\nexport abstract class Boolean extends Bool {}\n\n@sealed\nexport abstract class F32 {\n\n static readonly EPSILON: f32 = f32.EPSILON;\n static readonly MIN_VALUE: f32 = f32.MIN_VALUE;\n static readonly MAX_VALUE: f32 = f32.MAX_VALUE;\n static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER;\n static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER;\n static readonly POSITIVE_INFINITY: f32 = Infinity;\n static readonly NEGATIVE_INFINITY: f32 = -Infinity;\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\nexport abstract class F64 {\n\n static readonly EPSILON: f64 = f64.EPSILON;\n static readonly MIN_VALUE: f64 = f64.MIN_VALUE;\n static readonly MAX_VALUE: f64 = f64.MAX_VALUE;\n static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER;\n static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER;\n static readonly POSITIVE_INFINITY: f64 = Infinity;\n static readonly NEGATIVE_INFINITY: f64 = -Infinity;\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\n@sealed\nexport abstract class Number extends F64 {}\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\nconst INITIAL_CAPACITY = 4;\nconst FILL_FACTOR: f64 = 8 / 3;\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. */\nconst EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\nconst 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("!=")\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 if (left === right) return true;\n if (left === null || right === null) return false;\n\n var leftLength = left.length;\n var rightLength = right.length;\n\n if (!leftLength) return !rightLength;\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 __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 if (left === right) return true;\n if (left === null || right === null) return false;\n\n var leftLength = left.length;\n var rightLength = right.length;\n\n if (!rightLength) return !leftLength;\n if (!leftLength) return true;\n\n var length = min(leftLength, rightLength);\n return compareUnsafe(left, 0, right, 0, length) <= 0;\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 length = this.length;\n var begin = (beginIndex < 0) ? max(beginIndex + length, 0) : min(beginIndex, length);\n var end = (endIndex < 0) ? max(endIndex + length, 0) : min(endIndex, length);\n var 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 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\nvar stringToId: Map;\nvar idToString: Map;\nvar 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\ntype Symbol = symbol;\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 export const hasInstance = changetype(1);\n export const isConcatSpreadable = changetype(2);\n export const isRegExp = changetype(3);\n export const iterator = changetype(3);\n export const match = changetype(4);\n export const replace = changetype(5);\n export const search = changetype(6);\n export const species = changetype(7);\n export const split = changetype(8);\n export const toPrimitive = changetype(9);\n export const toStringTag = changetype(10);\n 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} from \"./internal/typedarray\";\n\nimport {\n COMPARATOR\n} from \"./internal/sort\";\n\nexport class Int8Array extends TypedArray {\n 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\nexport class Uint8Array extends TypedArray {\n 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\nexport class Uint8ClampedArray extends Uint8Array {\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n @inline @operator(\"[]=\")\n protected __set(index: i32, value: i32): void {\n super.__set(index, max(min(value, 255), 0));\n }\n\n @inline @operator(\"{}=\")\n protected __unchecked_set(index: i32, value: i32): void {\n super.__unchecked_set(index, max(min(value, 255), 0));\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 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\nexport class Int16Array extends TypedArray {\n 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\nexport class Uint16Array extends TypedArray {\n 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\nexport class Int32Array extends TypedArray {\n 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\nexport class Uint32Array extends TypedArray {\n 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\nexport class Int64Array extends TypedArray {\n 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\nexport class Uint64Array extends TypedArray {\n 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\nexport class Float32Array extends TypedArray {\n 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\nexport class Float64Array extends TypedArray {\n 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"}):(()=>{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\n// Compiler hints\n\n/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */\ndeclare const ASC_TARGET: i32;\n/** Provided noTreeshaking option. */\ndeclare const ASC_NO_TREESHAKING: bool;\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 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, constantOffset?: 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, constantOffset?: 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 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/** 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 /** 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 | 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 /** 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 | 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 from memory and returns it as a 32-bit integer. */\n export function load8_s(offset: usize, constantOffset?: usize): i32;\n /** Loads an 8-bit unsigned integer from memory and returns it as a 32-bit integer. */\n export function load8_u(offset: usize, constantOffset?: usize): i32;\n /** Loads a 16-bit signed integer from memory and returns it as a 32-bit integer. */\n export function load16_s(offset: usize, constantOffset?: usize): i32;\n /** Loads a 16-bit unsigned integer from memory and returns it as a 32-bit integer. */\n export function load16_u(offset: usize, constantOffset?: usize): i32;\n /** Loads a 32-bit integer from memory. */\n export function load(offset: usize, constantOffset?: usize): i32;\n /** Stores a 32-bit integer to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i32, constantOffset?: usize): void;\n /** Stores a 32-bit integer to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i32, constantOffset?: usize): void;\n /** Stores a 32-bit integer to memory. */\n export function store(offset: usize, value: i32, constantOffset?: usize): void;\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 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 from memory and returns it as a 64-bit signed integer. */\n export function load8_s(offset: usize, constantOffset?: usize): i64;\n /** Loads an 8-bit unsigned integer from memory and returns it as a 64-bit unsigned integer. */\n export function load8_u(offset: usize, constantOffset?: usize): u64;\n /** Loads a 16-bit signed integer from memory and returns it as a 64-bit signed integer. */\n export function load16_s(offset: usize, constantOffset?: usize): i64;\n /** Loads a 16-bit unsigned integer from memory and returns it as a 64-bit unsigned integer. */\n export function load16_u(offset: usize, constantOffset?: usize): u64;\n /** Loads a 32-bit signed integer from memory and returns it as a 64-bit signed integer. */\n export function load32_s(offset: usize, constantOffset?: usize): i64;\n /** Loads a 32-bit unsigned integer from memory and returns it as a 64-bit unsigned integer. */\n export function load32_u(offset: usize, constantOffset?: usize): u64;\n /** Loads a 64-bit unsigned integer from memory. */\n export function load(offset: usize, constantOffset?: usize): i64;\n /** Stores a 64-bit integer to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i64, constantOffset?: usize): void;\n /** Stores a 64-bit integer to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i64, constantOffset?: usize): void;\n /** Stores a 64-bit integer to memory as a 32-bit integer. */\n export function store32(offset: usize, value: i64, constantOffset?: usize): void;\n /** Stores a 64-bit integer to memory. */\n export function store(offset: usize, value: i64, constantOffset?: usize): void;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i64;\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 /** 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 | 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 /** 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 | 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 /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u64;\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 /** Converts a string to a floating-point number. */\n export function parseFloat(string: string): u64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): 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 /** Returns the floating-point remainder of `x / y` (rounded towards zero). */\n export function mod(x: f32, y: f32): f32;\n /** Returns the floating-point remainder of `x / y` (rounded to nearest). */\n export function rem(x: f32, y: f32): f32;\n /** Loads a 32-bit float from memory. */\n export function load(offset: usize, constantOffset?: usize): f32;\n /** Stores a 32-bit float to memory. */\n export function store(offset: usize, value: f32, constantOffset?: usize): void;\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 | 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, constantOffset?: usize): f64;\n /** Stores a 64-bit float to memory. */\n export function store(offset: usize, value: f64, constantOffset?: usize): void;\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\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): i32;\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 /** 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}\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: string): (\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: string): (\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: string): (\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: string): (\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 or function 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",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 noTreeshaking option. */\ndeclare const ASC_NO_TREESHAKING: bool;\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 reference type. */\ndeclare function isReference(value: any): value is object | string;\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 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\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 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 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 r=["--binaryFile","binary","--textFile","text"];return Object.keys(n||{}).forEach(e=>{var t=n[e];Array.isArray(t)?t.forEach(n=>r.push("--"+e,String(n))):r.push("--"+e,String(t))}),exports.main(r.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 r=n.stdout||process.stdout,i=n.stderr||process.stderr,a=n.readFile||F,s=n.writeFile||S,o=n.listFiles||I,l=n.stats||createStats();if(!r)throw Error("'options.stdout' must be specified");if(!i)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(r),colorsUtil.stderr=colorsUtil.from(i)),f.unknown.length&&f.unknown.forEach(e=>{i.write(colorsUtil.stderr.yellow("WARN: ")+"Unknown option '"+e+"'"+EOL)}),f.trailing.length&&i.write(colorsUtil.stderr.yellow("WARN: ")+"Unsupported trailing arguments: "+f.trailing.join(" ")+EOL),t||(t=function(e){var n=0;return e&&(i.write(colorsUtil.stderr.red("ERROR: ")+e.stack.replace(/^ERROR: /i,"")+EOL),n=1),n}),u.version)return r.write("Version "+exports.version+(isDev?"-dev":"")+EOL),t(null);if(u.help||!e.length){var c=u.help?r:i,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(s===S)throw Error("'options.writeFile' must be specified");if(o===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(s,exports.libraryPrefix+i,!1,x)})}}}function g(){for(var e,n;null!=(e=x.nextFile());){if(e.startsWith(exports.libraryPrefix)){const t=e.substring(exports.libraryPrefix.length),r=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(r))n=exports.libraryFiles[r],e=exports.libraryPrefix+r+".ts";else for(let i=0,s=b.length;i{assemblyscript.parseFile(n,e,!1,x)})}if(checkDiagnostics(x,i))return t(Error("Parse error"))}for(let n=0,r=e.length;n{x=assemblyscript.parseFile(s,i,!0,x)});let o=g();if(o)return o}!function(e,...n){h.forEach(t=>{"function"==typeof t[e]&&t[e](...n)})}("afterParse",x);{let e=g();if(e)return e}const y=assemblyscript.finishParsing(x);var m=0,v=0;u.optimize&&(m=exports.defaultOptimizeLevel,v=exports.defaultShrinkLevel),"number"==typeof u.optimizeLevel&&(m=u.optimizeLevel),"number"==typeof u.shrinkLevel&&(v=u.shrinkLevel),m=Math.min(Math.max(m,0),3),v=Math.min(Math.max(v,0),2);const E=assemblyscript.createOptions();if(assemblyscript.setTarget(E,0),assemblyscript.setNoTreeShaking(E,u.noTreeShaking),assemblyscript.setNoAssert(E,u.noAssert),assemblyscript.setImportMemory(E,u.importMemory),assemblyscript.setImportTable(E,u.importTable),assemblyscript.setMemoryBase(E,u.memoryBase>>>0),assemblyscript.setSourceMap(E,null!=u.sourceMap),assemblyscript.setOptimizeLevelHints(E,m,v),u.noLib||(assemblyscript.setGlobalAlias(E,"Math","NativeMath"),assemblyscript.setGlobalAlias(E,"Mathf","NativeMathf"),assemblyscript.setGlobalAlias(E,"abort","~lib/env/abort"),assemblyscript.setGlobalAlias(E,"trace","~lib/env/trace")),u.use){let e=u.use;for(let n=0,r=e.length;n{try{l.compileTime+=measure(()=>{_=assemblyscript.compileProgram(y,E)})}catch(e){return t(e)}})(),checkDiagnostics(x,i))return _&&_.dispose(),t(Error("Compile error"));if(u.validate&&(l.validateCount++,l.validateTime+=measure(()=>{if(!_.validate())return _.dispose(),t(Error("Validate error"))})),"clamp"===u.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{_.runPasses(["trap-mode-clamp"])});else if("js"===u.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{_.runPasses(["trap-mode-js"])});else if("allow"!==u.trapMode)return _.dispose(),t(Error("Unsupported trap mode"));(m>=3||v>=2)&&(m=4),_.setOptimizeLevel(m),_.setShrinkLevel(v),_.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||v>0)&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{_.optimize()})),A.length&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{_.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 r,o=null!=u.sourceMap?u.sourceMap.length?u.sourceMap:path.basename(u.binaryFile)+".map":null;if(l.emitCount++,l.emitTime+=measure(()=>{r=_.toBinary(o)}),u.binaryFile.length?s(u.binaryFile,r.output,d):(z(r.output),e=!0),n=!0,null!=r.sourceMap)if(u.binaryFile.length){let e=JSON.parse(r.sourceMap);e.sourceRoot=exports.sourceMapRoot,e.sources.forEach((n,r)=>{let i=null;if(n.startsWith(exports.libraryPrefix)){let e=n.substring(exports.libraryPrefix.length).replace(/\.ts$/,"");if(exports.libraryFiles.hasOwnProperty(e))i=exports.libraryFiles[e];else for(let e=0,t=b.length;e{t=_.toAsmjs()}),s(u.asmjsFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=_.toAsmjs()}),z(t),e=!0),n=!0}if(null!=u.idlFile){let t;u.idlFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(y)}),s(u.idlFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(y)}),z(t),e=!0),n=!0}if(null!=u.tsdFile){let t;u.tsdFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(y)}),s(u.tsdFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(y)}),z(t),e=!0),n=!0}if(null!=u.textFile||!n){let n;u.textFile&&u.textFile.length?(l.emitCount++,l.emitTime+=measure(()=>{n=_.toText()}),s(u.textFile,n,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{n=_.toText()}),z(n))}}return _.dispose(),u.measure&&printStats(l,i),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 S(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 z(e){z.used||(l.writeCount++,z.used=!0),l.writeTime+=measure(()=>{"string"==typeof e?r.write(e,{encoding:"utf8"}):r.write(e)})}};var argumentSubstitutions={"-O":["--optimize"],"-Os":["--optimize","--shrinkLevel","1"],"-Oz":["--optimize","--shrinkLevel","2"],"-O0":["--optimizeLevel","0","--shrinkLevel","0"],"-O0s":["--optimizeLevel","0","--shrinkLevel","1"],"-O0z":["--optimizeLevel","0","--shrinkLevel","2"],"-O1":["--optimizeLevel","1","--shrinkLevel","0"],"-O1s":["--optimizeLevel","1","--shrinkLevel","1"],"-O1z":["--optimizeLevel","1","--shrinkLevel","2"],"-O2":["--optimizeLevel","2","--shrinkLevel","0"],"-O2s":["--optimizeLevel","2","--shrinkLevel","1"],"-O2z":["--optimizeLevel","2","--shrinkLevel","2"],"-O3":["--optimizeLevel","3","--shrinkLevel","0"],"-O3s":["--optimizeLevel","3","--shrinkLevel","1"],"-O3z":["--optimizeLevel","3","--shrinkLevel","2"]};function checkDiagnostics(e,n){for(var t,r=!1;null!=(t=assemblyscript.nextDiagnostic(e));)n&&n.write(assemblyscript.formatDiagnostic(t,n.isTTY,!0)+EOL+EOL),assemblyscript.isError(t)&&(r=!0);return r}function createStats(){return{readTime:0,readCount:0,writeTime:0,writeCount:0,parseTime:0,parseCount:0,compileTime:0,compileCount:0,emitTime:0,emitCount:0,validateTime:0,validateCount:0,optimizeTime:0,optimizeCount:0}}function measure(e){const n=process.hrtime();e();const t=process.hrtime(n);return 1e9*t[0]+t[1]}function formatTime(e){return e?(e/1e6).toFixed(3)+" ms":"N/A"}function printStats(e,n){function t(e,n){return formatTime(e)}(n||process.stdout).write(["I/O Read : "+t(e.readTime,e.readCount),"I/O Write : "+t(e.writeTime,e.writeCount),"Parse : "+t(e.parseTime,e.parseCount),"Compile : "+t(e.compileTime,e.compileCount),"Emit : "+t(e.emitTime,e.emitCount),"Validate : "+t(e.validateTime,e.validateCount),"Optimize : "+t(e.optimizeTime,e.optimizeCount)].join(EOL)+EOL)}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&&r<224?a[s++]=(31&r)<<6|63&e[n++]:r>239&&r<365?(r=((7&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,a[s++]=55296+(r>>10),a[s++]=56320+(1023&r)):a[s++]=(15&r)<<12|(63&e[n++])<<6|63&e[n++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))},r.write=function(e,n,t){for(var r,i,a=t,s=0;s>6|192,n[t++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&i),++s,n[t++]=r>>18|240,n[t++]=r>>12&63|128,n[t++]=r>>6&63|128,n[t++]=63&r|128):(n[t++]=r>>12|224,n[t++]=r>>6&63|128,n[t++]=63&r|128);return t-a}},function(e,n,t){(function(e){var t=void 0!==e&&e||{},r=t.env&&"CI"in t.env;function i(e,t){var i=t||{};return i.supported=e&&!!e.isTTY||r,i.gray=(e=>i.supported?n.GRAY+e+n.RESET:e),i.red=(e=>i.supported?n.RED+e+n.RESET:e),i.green=(e=>i.supported?n.GREEN+e+n.RESET:e),i.yellow=(e=>i.supported?n.YELLOW+e+n.RESET:e),i.blue=(e=>i.supported?n.BLUE+e+n.RESET:e),i.magenta=(e=>i.supported?n.MAGENTA+e+n.RESET:e),i.cyan=(e=>i.supported?n.CYAN+e+n.RESET:e),i.white=(e=>i.supported?n.WHITE+e+n.RESET:e),i}n.stdout=i(t.stdout,n),n.stderr=i(t.stderr),n.from=i,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={},r=[],arguments=[],i=[],a={};Object.keys(n).forEach(e=>{var r=n[e];null!=r.alias&&("string"==typeof r.alias?a[r.alias]=e:Array.isArray(r.alias)&&r.alias.forEach(n=>a[n]=e)),null!=r.default&&(t[e]=r.default)});for(var s=0,o=(e=e.slice()).length;st[e]=o.value[e])}else r.push(i)}for(;s{var s=e[n];if(null!=s.description){for(var o="";o.length{for(let n=0;n 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.setNoTreeShaking(compilerOptions, args.noTreeShaking);\r\n assemblyscript.setNoAssert(compilerOptions, args.noAssert);\r\n assemblyscript.setImportMemory(compilerOptions, args.importMemory);\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\nvar argumentSubstitutions = {\r\n \"-O\" : [ \"--optimize\" ],\r\n \"-Os\" : [ \"--optimize\", \"--shrinkLevel\", \"1\" ],\r\n \"-Oz\" : [ \"--optimize\", \"--shrinkLevel\", \"2\" ],\r\n \"-O0\" : [ \"--optimizeLevel\", \"0\", \"--shrinkLevel\", \"0\" ],\r\n \"-O0s\": [ \"--optimizeLevel\", \"0\", \"--shrinkLevel\", \"1\" ],\r\n \"-O0z\": [ \"--optimizeLevel\", \"0\", \"--shrinkLevel\", \"2\" ],\r\n \"-O1\" : [ \"--optimizeLevel\", \"1\", \"--shrinkLevel\", \"0\" ],\r\n \"-O1s\": [ \"--optimizeLevel\", \"1\", \"--shrinkLevel\", \"1\" ],\r\n \"-O1z\": [ \"--optimizeLevel\", \"1\", \"--shrinkLevel\", \"2\" ],\r\n \"-O2\" : [ \"--optimizeLevel\", \"2\", \"--shrinkLevel\", \"0\" ],\r\n \"-O2s\": [ \"--optimizeLevel\", \"2\", \"--shrinkLevel\", \"1\" ],\r\n \"-O2z\": [ \"--optimizeLevel\", \"2\", \"--shrinkLevel\", \"2\" ],\r\n \"-O3\" : [ \"--optimizeLevel\", \"3\", \"--shrinkLevel\", \"0\" ],\r\n \"-O3s\": [ \"--optimizeLevel\", \"3\", \"--shrinkLevel\", \"1\" ],\r\n \"-O3z\": [ \"--optimizeLevel\", \"3\", \"--shrinkLevel\", \"2\" ],\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 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","code","register","project","e_ts","eval","stack","isBundle","version","options","sourceMapRoot","libraryPrefix","LIBRARY_PREFIX","defaultOptimizeLevel","defaultShrinkLevel","libraryFiles","allocator/arena","allocator/buddy","allocator/emscripten","allocator/system","allocator/tlsf","array","arraybuffer","bindings/Date","bindings/Math","builtins","collector/itcm","dataview","date","diagnostics","error","gc","internal/allocator","internal/arraybuffer","internal/hash","internal/memory","internal/number","internal/sort","internal/string","internal/typedarray","iterator","map","math","memory","number","polyfills","regexp","set","string","symbol","table","typedarray","libDir","libFiles","sync","bundled","forEach","file","replace","readFileSync","definitionFiles","assembly","portable","stdDir","compileString","sources","input.ts","output","stdout","createMemoryStream","stderr","keys","val","isArray","String","main","readFile","writeFile","contents","listFiles","callback","readFileNode","writeFileNode","listFilesNode","stats","createStats","opts","parse","args","noColors","supported","unknown","arg","write","yellow","trailing","err","red","help","out","color","white","cyan","baseDir","transforms","transform","parser","noLib","parseCount","parseTime","measure","parseFile","libPath","indexOf","customLibDirs","lib","apply","k","endsWith","j","libText","parseBacklog","sourcePath","sourceText","nextFile","startsWith","plainName","substring","indexName","checkDiagnostics","applyTransform","program","finishParsing","optimizeLevel","shrinkLevel","optimize","max","compilerOptions","createOptions","setTarget","setNoTreeShaking","noTreeShaking","setNoAssert","noAssert","setImportMemory","importMemory","setImportTable","importTable","setMemoryBase","memoryBase","setSourceMap","sourceMap","setOptimizeLevelHints","setGlobalAlias","use","aliases","part","alias","enable","flag","toUpperCase","enableFeature","compileCount","compileTime","compileProgram","dispose","validate","validateCount","validateTime","trapMode","optimizeCount","optimizeTime","runPasses","setOptimizeLevel","setShrinkLevel","setDebugInfo","debug","pass","noEmit","hasStdout","hasOutput","outFile","test","textFile","asmjsFile","binaryFile","wasm","sourceMapURL","emitCount","emitTime","toBinary","writeStdout","JSON","sourceRoot","text","stdName","sourceContents","stringify","asm","toAsmjs","idlFile","idl","buildIDL","tsdFile","tsd","buildTSD","wat","toText","printStats","readCount","readTime","encoding","writeCount","writeTime","writeFileSync","files","readdirSync","used","argumentSubstitutions","-O","-Os","-Oz","-O0","-O0s","-O0z","-O1","-O1s","-O1z","-O2","-O2s","-O2z","-O3","-O3s","-O3z","emitter","diagnostic","hasErrors","nextDiagnostic","formatDiagnostic","isTTY","isError","hrtime","times","formatTime","time","toFixed","format","count","allocBuffer","Buffer","allocUnsafe","Uint8Array","stream","chunk","buffer","reset","toBuffer","offset","toString","read","tscOptions","alwaysStrict","noImplicitAny","noImplicitReturns","noImplicitThis","noEmitOnError","strictNullChecks","experimentalDecorators","target","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,IAAAD,EAAA,WAA0E,IAAM,OAAAG,QAAA,kBAAoC,MAAAC,KAApH,IAEAL,EAAA,IAAAC,EAAAD,EAAA,gBARA,CASC,oBAAAQ,UAAAC,KAAA,SAAAC,iCACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAX,QAGA,IAAAC,EAAAQ,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAb,QAAA,IAUA,OANAc,EAAAH,GAAAI,KAAAd,EAAAD,QAAAC,IAAAD,QAAAU,GAGAT,EAAAY,GAAA,EAGAZ,EAAAD,QA0DA,OArDAU,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAlB,EAAAmB,EAAAC,GACAV,EAAAW,EAAArB,EAAAmB,IACAG,OAAAC,eAAAvB,EAAAmB,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAA1B,GACA,oBAAA2B,eAAAC,aACAN,OAAAC,eAAAvB,EAAA2B,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAvB,EAAA,cAAiD6B,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAAnB,EAAAmB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG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,oCC1DA,YAAApb,gCAAA,CAA4D,IAAAL,EAAA,IAAAuD,MAAA,uCAAsF,MAA7BvD,EAAAwI,KAAA,mBAA6BxI,EAClJF,EAAAD,QAAAQ,yyICDA,SAAA4b,EAAAC,GACA,IAAAlc,EAAA,IAAAuD,MAAA,uBAAA2Y,EAAA,KAEA,MADAlc,EAAAwI,KAAA,mBACAxI,EAEAic,EAAAnP,KAAA,WAAuC,UACvCmP,EAAAvY,QAAAuY,EACAnc,EAAAD,QAAAoc,EACAA,EAAAE,GAAA,qBCRA,SAAAhY,EAAA2D,GAAAhI,EAAAD,QAAAsE,EAAAqT,QAcA,SAAA4E,GACA,IAAAC,EAAA,KAAAC,EAAA1b,KAAA2b,GACAC,EAAA3V,KAAA4V,MAAAJ,GACAK,EAAA7V,KAAA4V,MAAAJ,EAAA,OACAD,IACAI,GAAAJ,EAAA,IACAM,GAAAN,EAAA,IACA,IACAI,IACAE,GAAA,MAGA,OAAAF,EAAAE,IAvBA,IAAAH,EAAAzU,EAAAyU,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// 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.setNoTreeShaking(compilerOptions, args.noTreeShaking);\r\n assemblyscript.setNoAssert(compilerOptions, args.noAssert);\r\n assemblyscript.setImportMemory(compilerOptions, args.importMemory);\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\nvar argumentSubstitutions = {\r\n \"-O\" : [ \"--optimize\" ],\r\n \"-Os\" : [ \"--optimize\", \"--shrinkLevel\", \"1\" ],\r\n \"-Oz\" : [ \"--optimize\", \"--shrinkLevel\", \"2\" ],\r\n \"-O0\" : [ \"--optimizeLevel\", \"0\", \"--shrinkLevel\", \"0\" ],\r\n \"-O0s\": [ \"--optimizeLevel\", \"0\", \"--shrinkLevel\", \"1\" ],\r\n \"-O0z\": [ \"--optimizeLevel\", \"0\", \"--shrinkLevel\", \"2\" ],\r\n \"-O1\" : [ \"--optimizeLevel\", \"1\", \"--shrinkLevel\", \"0\" ],\r\n \"-O1s\": [ \"--optimizeLevel\", \"1\", \"--shrinkLevel\", \"1\" ],\r\n \"-O1z\": [ \"--optimizeLevel\", \"1\", \"--shrinkLevel\", \"2\" ],\r\n \"-O2\" : [ \"--optimizeLevel\", \"2\", \"--shrinkLevel\", \"0\" ],\r\n \"-O2s\": [ \"--optimizeLevel\", \"2\", \"--shrinkLevel\", \"1\" ],\r\n \"-O2z\": [ \"--optimizeLevel\", \"2\", \"--shrinkLevel\", \"2\" ],\r\n \"-O3\" : [ \"--optimizeLevel\", \"3\", \"--shrinkLevel\", \"0\" ],\r\n \"-O3s\": [ \"--optimizeLevel\", \"3\", \"--shrinkLevel\", \"1\" ],\r\n \"-O3z\": [ \"--optimizeLevel\", \"3\", \"--shrinkLevel\", \"2\" ],\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 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.js b/dist/assemblyscript.js index 2f0662ff..8f8c6d3a 100644 --- a/dist/assemblyscript.js +++ b/dist/assemblyscript.js @@ -1,3 +1,3 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("binaryen")):"function"==typeof define&&define.amd?define(["binaryen"],t):"object"==typeof exports?exports.assemblyscript=t(require("binaryen")):e.assemblyscript=t(e.binaryen)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=15)}([function(e,t,r){"use strict";Object.defineProperty(t,"__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.ARROW=524288]="ARROW",e[e.MODULE_EXPORT=1048576]="MODULE_EXPORT",e[e.MODULE_IMPORT=2097152]="MODULE_IMPORT",e[e.RESOLVED=4194304]="RESOLVED",e[e.COMPILED=8388608]="COMPILED",e[e.INLINED=16777216]="INLINED",e[e.SCOPED=33554432]="SCOPED",e[e.TRAMPOLINE=67108864]="TRAMPOLINE",e[e.VIRTUAL=134217728]="VIRTUAL",e[e.MAIN=268435456]="MAIN",e[e.QUOTED=536870912]="QUOTED"}(t.CommonFlags||(t.CommonFlags={})),t.PATH_DELIMITER="/",t.PARENT_SUBST="..",t.GETTER_PREFIX="get:",t.SETTER_PREFIX="set:",t.INSTANCE_DELIMITER="#",t.STATIC_DELIMITER=".",t.INNER_DELIMITER="~",t.LIBRARY_SUBST="~lib",t.LIBRARY_PREFIX=t.LIBRARY_SUBST+t.PATH_DELIMITER,t.FILESPACE_PREFIX="file:"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(10),a=r(2),s=r(10);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 t.COLOR_BLUE;case n.WARNING:return t.COLOR_YELLOW;case n.ERROR:return t.COLOR_RED;default:return assert(!1),""}}t.DiagnosticCode=s.DiagnosticCode,t.diagnosticCodeToString=s.diagnosticCodeToString,function(e){e[e.INFO=0]="INFO",e[e.WARNING=1]="WARNING",e[e.ERROR=2]="ERROR"}(n=t.DiagnosticCategory||(t.DiagnosticCategory={})),t.diagnosticCategoryToString=o,t.COLOR_BLUE="",t.COLOR_YELLOW="",t.COLOR_RED="",t.COLOR_RESET="",t.diagnosticCategoryToColor=c;var l=function(){function e(e,t,r){this.range=null,this.code=e,this.category=t,this.message=r}return e.create=function(t,r,n,a,s){void 0===n&&(n=null),void 0===a&&(a=null),void 0===s&&(s=null);var o=i.diagnosticCodeToString(t);return null!=n&&(o=o.replace("{0}",n)),null!=a&&(o=o.replace("{1}",a)),null!=s&&(o=o.replace("{2}",s)),new e(t,r,o)},e.createInfo=function(t,r,i){return void 0===r&&(r=null),void 0===i&&(i=null),e.create(t,n.INFO,r,i)},e.createWarning=function(t,r,i){return void 0===r&&(r=null),void 0===i&&(i=null),e.create(t,n.WARNING,r,i)},e.createError=function(t,r,i){return void 0===r&&(r=null),void 0===i&&(i=null),e.create(t,n.ERROR,r,i)},e.prototype.withRange=function(e){return this.range=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,r){void 0===r&&(r=!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=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==j.ENTRY},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLibrary",{get:function(){return this.sourceKind==j.LIBRARY},enumerable:!0,configurable:!0}),t}(l);t.Source=J;var $=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.decorators=null,t.cachedProgramLevelInternalName=null,t.cachedFileLevelInternalName=null,t}return i(t,e),Object.defineProperty(t.prototype,"programLevelInternalName",{get:function(){return this.cachedProgramLevelInternalName||(this.cachedProgramLevelInternalName=Fe(this,!0)),this.cachedProgramLevelInternalName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fileLevelInternalName",{get:function(){return this.cachedFileLevelInternalName||(this.cachedFileLevelInternalName=Fe(this,!1)),this.cachedFileLevelInternalName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTopLevel",{get:function(){var e=this.parent;return!!e&&(!(e.kind==o.VARIABLE&&!(e=e.parent))&&e.kind==o.SOURCE)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTopLevelExport",{get:function(){var e=this.parent;return!(!e||e.kind==o.VARIABLE&&!(e=e.parent))&&(e.kind==o.NAMESPACEDECLARATION?this.is(a.CommonFlags.EXPORT)&&e.isTopLevelExport:e.kind==o.CLASSDECLARATION?this.is(a.CommonFlags.STATIC)&&e.isTopLevelExport:e.kind==o.SOURCE&&this.is(a.CommonFlags.EXPORT))},enumerable:!0,configurable:!0}),t.prototype.needsExplicitExport=function(e){return e.name.text!=e.externalName.text||this.range.source!=e.range.source||!this.isTopLevelExport},t}(Z);t.DeclarationStatement=$;var ee=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.INDEXSIGNATUREDECLARATION,t}return i(t,e),t}($);t.IndexSignatureDeclaration=ee;var te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}($);t.VariableLikeDeclarationStatement=te;var re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.BLOCK,t}return i(t,e),t}(Z);t.BlockStatement=re;var ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.BREAK,t}return i(t,e),t}(Z);t.BreakStatement=ne;var ie=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}($);t.ClassDeclaration=ie;var ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.CONTINUE,t}return i(t,e),t}(Z);t.ContinueStatement=ae;var se=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.DO,t}return i(t,e),t}(Z);t.DoStatement=se;var oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EMPTY,t}return i(t,e),t}(Z);t.EmptyStatement=oe;var ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.ENUMDECLARATION,t}return i(t,e),t}($);t.EnumDeclaration=ce;var le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.ENUMVALUEDECLARATION,t}return i(t,e),t}($);t.EnumValueDeclaration=le;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 ue=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=ue;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}(Z);t.ExportStatement=he;var de=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EXPRESSION,t}return i(t,e),t}(Z);t.ExpressionStatement=de;var _e=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}(te);t.FieldDeclaration=_e;var me=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.FOR,t}return i(t,e),t}(Z);t.ForStatement=me;var ge=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}($);t.FunctionDeclaration=ge;var ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IF,t}return i(t,e),t}(Z);t.IfStatement=ye;var fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IMPORTDECLARATION,t}return i(t,e),t}($);t.ImportDeclaration=fe;var Ee=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IMPORT,t}return i(t,e),t}(Z);t.ImportStatement=Ee;var Te=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.INTERFACEDECLARATION,t}return i(t,e),t}(ie);t.InterfaceDeclaration=Te;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}(ge);t.MethodDeclaration=Ie;var ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.NAMESPACEDECLARATION,t}return i(t,e),t}($);t.NamespaceDeclaration=ve;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}(Z);t.ReturnStatement=Ae;var Ce=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=Ce;var Ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.SWITCH,t}return i(t,e),t}(Z);t.SwitchStatement=Ne;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}(Z);t.ThrowStatement=Oe;var Se=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.TRY,t}return i(t,e),t}(Z);t.TryStatement=Se;var Le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.TYPEDECLARATION,t}return i(t,e),t}($);t.TypeDeclaration=Le;var ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VARIABLEDECLARATION,t}return i(t,e),t}(te);t.VariableDeclaration=ke;var be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VARIABLE,t}return i(t,e),t}(Z);t.VariableStatement=be;var Re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VOID,t}return i(t,e),t}(Z);t.VoidStatement=Re;var xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.WHILE,t}return i(t,e),t}(Z);function Fe(e,t){void 0===t&&(t=!1);var r=e.name.text,n=e.parent;return n&&(e.kind!=o.VARIABLEDECLARATION||n.kind!=o.VARIABLE||(n=n.parent))?n.kind==o.CLASSDECLARATION?Fe(n,t)+(e.is(a.CommonFlags.STATIC)?a.STATIC_DELIMITER:a.INSTANCE_DELIMITER)+r:n.kind==o.NAMESPACEDECLARATION||n.kind==o.ENUMDECLARATION?Fe(n,t)+a.STATIC_DELIMITER+r:t?r:e.range.source.internalPath+a.PATH_DELIMITER+r:r}function De(e){return e.endsWith(".ts")&&(e=e.substring(0,e.length-3)),e}function Be(e,t){for(var r=0,n=e.length;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(0),l=r(1),p=r(7),u=r(3),h=r(5),d=r(11),_=function(){return function(){}}(),m=function(){return function(){}}(),g=function(){return function(){}}();function y(e,t){switch(assert(t.length),e){case u.DecoratorKind.OPERATOR:case u.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 u.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 u.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 f,E,T=new Map,I=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this,t)||this;return r.diagnosticsOffset=0,r.elementsLookup=new Map,r.instancesLookup=new Map,r.typesLookup=T,r.typeAliases=new Map,r.fileLevelExports=new Map,r.moduleLevelExports=new Map,r.basicClasses=new Map,r.arrayBufferInstance=null,r.arrayPrototype=null,r.stringInstance=null,r.mainFunction=null,r.abortInstance=null,r.memoryAllocateInstance=null,r.hasGC=!1,r.gcAllocateInstance=null,r.gcLinkInstance=null,r.gcMarkInstance=null,r.gcHeaderSize=0,r.gcHookOffset=0,r.resolver=new d.Resolver(r),r.sources=[],r}return i(t,e),t.prototype.getSource=function(e){for(var t=this.sources,r=0,n=t.length;r=0),assert(null!=e.type),e.type.toNativeType()){case 1:t=this.tempI32s||(this.tempI32s=[]);break;case 2:t=this.tempI64s||(this.tempI64s=[]);break;case 3:t=this.tempF32s||(this.tempF32s=[]);break;case 4:t=this.tempF64s||(this.tempF64s=[]);break;default:throw new Error("concrete type expected")}assert(e.index>=0),t.push(e)}},t.prototype.getAndFreeTempLocal=function(e,t){var r,n;switch(e.toNativeType()){case 1:r=this.tempI32s||(this.tempI32s=[]);break;case 2:r=this.tempI64s||(this.tempI64s=[]);break;case 3:r=this.tempF32s||(this.tempF32s=[]);break;case 4:r=this.tempF64s||(this.tempF64s=[]);break;default:throw new Error("concrete type expected")}return r.length?(n=r[r.length-1]).type=e:(n=this.addLocal(e),r.push(n)),e.is(36)&&this.flow.setLocalWrapped(n.index,t),n},t.prototype.enterBreakContext=function(){var e=this.nextBreakId++;return this.breakStack?this.breakStack.push(e):this.breakStack=[e],this.breakContext=e.toString(10)},t.prototype.leaveBreakContext=function(){assert(null!=this.breakStack);var e=this.breakStack.length;assert(e>0),this.breakStack.pop(),e>1?this.breakContext=this.breakStack[e-2].toString(10):(this.breakContext=null,this.breakStack=null)},t.prototype.finalize=function(e,t){if(this.ref=t,assert(!this.breakStack||!this.breakStack.length),this.breakStack=null,this.breakContext=null,this.tempI32s=this.tempI64s=this.tempF32s=this.tempF64s=null,this.program.options.sourceMap)for(var r=this.debugLocations,n=0,i=r.length;n=r.length)return!1;t=r[n],e-=64*(n+1)}return i64_ne(i64_and(t,i64_shl(i64_one,i64_new(e))),i64_zero)},e.prototype.setLocalWrapped=function(e,t){var r,n=-1;if(e<64){if(e<0)return;r=this.wrappedLocals}else{var i=this.wrappedLocalsExt;for(n=(e-64)/64|0,i||(this.wrappedLocalsExt=i=new Array(n+1),i.length=0);i.length<=n;)i.push(i64_new(0));r=i[n],e-=64*(n+1)}r=t?i64_or(r,i64_shl(i64_one,i64_new(e))):i64_and(r,i64_not(i64_shl(i64_one,i64_new(e)))),n>=0?this.wrappedLocalsExt[n]=r:this.wrappedLocals=r},e.prototype.inherit=function(e){this.flags|=2047&e.flags,this.wrappedLocals=e.wrappedLocals,this.wrappedLocalsExt=e.wrappedLocalsExt},e.prototype.inheritConditional=function(e){e.is(1)&&this.set(64),e.is(4)&&this.set(128),e.is(8)&&e.breakLabel==this.breakLabel&&this.set(256),e.is(16)&&e.continueLabel==this.continueLabel&&this.set(512),e.is(32)&&this.set(1024)},e.prototype.inheritMutual=function(e,t){this.flags|=e.flags&t.flags&63,this.flags|=1984&e.flags,this.flags|=1984&t.flags,this.wrappedLocals=i64_and(e.wrappedLocals,t.wrappedLocals);var r=e.wrappedLocalsExt,n=t.wrappedLocalsExt;if(null!=r&&null!=n){var i=this.wrappedLocalsExt,a=min(r.length,n.length);if(a){if(i)for(;i.lengths):this.canOverflow(h.getBinaryLeft(e),t)&&!(h.getExpressionId(r=h.getBinaryRight(e))==h.ExpressionId.Const&&h.getConstValueI32(r)>=s);case h.BinaryOp.DivU32:case h.BinaryOp.RemI32:case h.BinaryOp.RemU32:return this.canOverflow(h.getBinaryLeft(e),t)||this.canOverflow(h.getBinaryRight(e),t)}break;case h.ExpressionId.Unary:switch(h.getUnaryOp(e)){case h.UnaryOp.EqzI32:case h.UnaryOp.EqzI64:return!1;case h.UnaryOp.ClzI32:case h.UnaryOp.CtzI32:case h.UnaryOp.PopcntI32:return t.size<7}break;case h.ExpressionId.Const:var o=0;switch(h.getExpressionType(e)){case 1:o=h.getConstValueI32(e);break;case 2:o=h.getConstValueI64Low(e);break;case 3:o=i32(h.getConstValueF32(e));break;case 4:o=i32(h.getConstValueF64(e));break;default:assert(!1)}switch(t.kind){case 0:return oi8.MAX_VALUE;case 1:return oi16.MAX_VALUE;case 5:return o<0||o>u8.MAX_VALUE;case 6:return o<0||o>u16.MAX_VALUE;case 10:return 0!=(-2&o)}break;case h.ExpressionId.Load:var c=void 0;switch(h.getLoadBytes(e)){case 1:c=h.isLoadSigned(e)?p.Type.i8:p.Type.u8;break;case 2:c=h.isLoadSigned(e)?p.Type.i16:p.Type.u16;break;default:c=h.isLoadSigned(e)?p.Type.i32:p.Type.u32}return V(c,t);case h.ExpressionId.Block:if(!h.getBlockName(e)){var l=assert(h.getBlockChildCount(e)),u=h.getBlockChild(e,l-1);return this.canOverflow(u,t)}break;case h.ExpressionId.If:return this.canOverflow(h.getIfTrue(e),t)||this.canOverflow(assert(h.getIfFalse(e)),t);case h.ExpressionId.Select:return this.canOverflow(h.getSelectThen(e),t)||this.canOverflow(h.getSelectElse(e),t);case h.ExpressionId.Call:var d=this.currentFunction.program,_=assert(d.instancesLookup.get(assert(h.getCallTarget(e))));assert(_.kind==f.FUNCTION);var m=_.signature.returnType;return!_.flow.is(2)||V(m,t);case h.ExpressionId.Unreachable:return!1}return!0},e.prototype.finalize=function(){assert(null==this.parent),this.continueLabel=null,this.breakLabel=null,this.returnLabel=null,this.contextualTypeArguments=null},e}();function V(e,t){return!e.is(4)||e.size>t.size||e.is(1)!=t.is(1)}t.Flow=z},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(9);!function(e){e[e.None=0]="None",e[e.I32=1]="I32",e[e.I64=2]="I64",e[e.F32=3]="F32",e[e.F64=4]="F64",e[e.Unreachable=5]="Unreachable",e[e.Auto=-1]="Auto"}(t.NativeType||(t.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.AtomicWake=_BinaryenAtomicWakeId()]="AtomicWake"}(n=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"}(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"}(t.BinaryOp||(t.BinaryOp={})),function(e){e[e.CurrentMemory=_BinaryenCurrentMemory()]="CurrentMemory",e[e.GrowMemory=_BinaryenGrowMemory()]="GrowMemory"}(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={}));var a=function(){function e(){}return e.create=function(t,r){var n=new e;return n.buffer=t,n.offset=r,n},e}();t.MemorySegment=a;var s=function(){function e(){this.cachedTemporaryName=0,this.hasTemporaryFunction=!1,this.cachedPrecomputeName=0,this.cachedPrecomputeNames=0}return e.create=function(){var t=new e;return t.ref=_BinaryenModuleCreate(),t.cachedByValue=memory.allocate(16),t},e.createFrom=function(t){var r=c(t);try{var n=new e;return n.ref=_BinaryenModuleRead(r,t.length),n.cachedByValue=memory.allocate(24),n}finally{memory.free(changetype(r))}},e.prototype.addFunctionType=function(e,t,r){var n=u(e),i=l(r);try{return _BinaryenAddFunctionType(this.ref,n,t,i,r?r.length:0)}finally{memory.free(i),memory.free(n)}},e.prototype.getFunctionTypeBySignature=function(e,t){var r=l(t);try{return _BinaryenGetFunctionTypeBySignature(this.ref,e,r,t?t.length:0)}finally{memory.free(r)}},e.prototype.removeFunctionType=function(e){var t=u(e);try{_BinaryenRemoveFunctionType(this.ref,t)}finally{memory.free(t)}},e.prototype.createI32=function(e){var t=this.cachedByValue;return _BinaryenLiteralInt32(t,e),_BinaryenConst(this.ref,t)},e.prototype.createI64=function(e,t){void 0===t&&(t=0);var r=this.cachedByValue;return _BinaryenLiteralInt64(r,e,t),_BinaryenConst(this.ref,r)},e.prototype.createF32=function(e){var t=this.cachedByValue;return _BinaryenLiteralFloat32(t,e),_BinaryenConst(this.ref,t)},e.prototype.createF64=function(e){var t=this.cachedByValue;return _BinaryenLiteralFloat64(t,e),_BinaryenConst(this.ref,t)},e.prototype.createUnary=function(e,t){return _BinaryenUnary(this.ref,e,t)},e.prototype.createBinary=function(e,t,r){return _BinaryenBinary(this.ref,e,t,r)},e.prototype.createHost=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);var n=u(t),i=p(r);try{return _BinaryenHost(this.ref,e,n,i,r?r.length:0)}finally{memory.free(i),memory.free(n)}},e.prototype.createGetLocal=function(e,t){return _BinaryenGetLocal(this.ref,e,t)},e.prototype.createTeeLocal=function(e,t){return _BinaryenTeeLocal(this.ref,e,t)},e.prototype.createGetGlobal=function(e,t){var r=u(e);try{return _BinaryenGetGlobal(this.ref,r,t)}finally{memory.free(r)}},e.prototype.createLoad=function(e,t,r,n,i){return void 0===i&&(i=0),_BinaryenLoad(this.ref,e,t?1:0,i,e,n,r)},e.prototype.createStore=function(e,t,r,n,i){return void 0===i&&(i=0),_BinaryenStore(this.ref,e,i,e,t,r,n)},e.prototype.createAtomicLoad=function(e,t,r,n){return void 0===n&&(n=0),_BinaryenAtomicLoad(this.ref,e,n,r,t)},e.prototype.createAtomicStore=function(e,t,r,n,i){return void 0===i&&(i=0),_BinaryenAtomicStore(this.ref,e,i,t,r,n)},e.prototype.createAtomicRMW=function(e,t,r,n,i,a){return _BinaryenAtomicRMW(this.ref,e,t,r,n,i,a)},e.prototype.createAtomicCmpxchg=function(e,t,r,n,i,a){return _BinaryenAtomicCmpxchg(this.ref,e,t,r,n,i,a)},e.prototype.createAtomicWait=function(e,t,r,n){return _BinaryenAtomicWait(this.ref,e,t,r,n)},e.prototype.createAtomicWake=function(e,t){return _BinaryenAtomicWake(this.ref,e,t)},e.prototype.createSetLocal=function(e,t){return _BinaryenSetLocal(this.ref,e,t)},e.prototype.createSetGlobal=function(e,t){var r=u(e);try{return _BinaryenSetGlobal(this.ref,r,t)}finally{memory.free(r)}},e.prototype.createBlock=function(e,t,r){void 0===r&&(r=0);var n=u(e),i=p(t);try{return _BinaryenBlock(this.ref,n,i,t.length,r)}finally{memory.free(i),memory.free(n)}},e.prototype.createBreak=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0);var n=u(e);try{return _BinaryenBreak(this.ref,n,t,r)}finally{memory.free(n)}},e.prototype.createDrop=function(e){return _BinaryenDrop(this.ref,e)},e.prototype.createLoop=function(e,t){var r=u(e);try{return _BinaryenLoop(this.ref,r,t)}finally{memory.free(r)}},e.prototype.createIf=function(e,t,r){return void 0===r&&(r=0),_BinaryenIf(this.ref,e,t,r)},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,t,r){return _BinaryenSelect(this.ref,r,e,t)},e.prototype.createSwitch=function(e,t,r,n){void 0===n&&(n=0);for(var i=e.length,a=new Array(i),s=0;s=0;--s)memory.free(a[s])}},e.prototype.createCall=function(e,t,r){var n=u(e),i=p(t);try{return _BinaryenCall(this.ref,n,i,t&&t.length||0,r)}finally{memory.free(i),memory.free(n)}},e.prototype.createCallIndirect=function(e,t,r){var n=p(t),i=u(r);try{return _BinaryenCallIndirect(this.ref,e,n,t&&t.length||0,i)}finally{memory.free(i),memory.free(n)}},e.prototype.createUnreachable=function(){return _BinaryenUnreachable(this.ref)},e.prototype.addGlobal=function(e,t,r,n){var i=u(e);try{return _BinaryenAddGlobal(this.ref,i,t,r?1:0,n)}finally{memory.free(i)}},e.prototype.removeGlobal=function(e){var t=u(e);try{_BinaryenRemoveGlobal(this.ref,t)}finally{memory.free(t)}},e.prototype.addFunction=function(e,t,r,n){var i=u(e),a=l(r);try{return _BinaryenAddFunction(this.ref,i,t,a,r?r.length:0,n)}finally{memory.free(a),memory.free(i)}},e.prototype.removeFunction=function(e){var t=u(e);try{_BinaryenRemoveFunction(this.ref,t)}finally{memory.free(t)}},e.prototype.addTemporaryFunction=function(e,t,r){this.hasTemporaryFunction=assert(!this.hasTemporaryFunction);var n=this.cachedTemporaryName;n||(this.cachedTemporaryName=n=u(""));var i=l(t);try{var a=_BinaryenAddFunctionType(this.ref,n,e,i,t?t.length:0);return _BinaryenAddFunction(this.ref,n,a,0,0,r)}finally{memory.free(i)}},e.prototype.removeTemporaryFunction=function(){this.hasTemporaryFunction=!assert(this.hasTemporaryFunction);var e=assert(this.cachedTemporaryName);_BinaryenRemoveFunction(this.ref,e),_BinaryenRemoveFunctionType(this.ref,e)},e.prototype.addFunctionExport=function(e,t){var r=u(e),n=u(t);try{return _BinaryenAddFunctionExport(this.ref,r,n)}finally{memory.free(n),memory.free(r)}},e.prototype.addTableExport=function(e,t){var r=u(e),n=u(t);try{return _BinaryenAddTableExport(this.ref,r,n)}finally{memory.free(n),memory.free(r)}},e.prototype.addMemoryExport=function(e,t){var r=u(e),n=u(t);try{return _BinaryenAddMemoryExport(this.ref,r,n)}finally{memory.free(n),memory.free(r)}},e.prototype.addGlobalExport=function(e,t){var r=u(e),n=u(t);try{return _BinaryenAddGlobalExport(this.ref,r,n)}finally{memory.free(n),memory.free(r)}},e.prototype.removeExport=function(e){var t=u(e);try{_BinaryenRemoveExport(this.ref,t)}finally{memory.free(t)}},e.prototype.addFunctionImport=function(e,t,r,n){var i=u(e),a=u(t),s=u(r);try{return _BinaryenAddFunctionImport(this.ref,i,a,s,n)}finally{memory.free(s),memory.free(a),memory.free(i)}},e.prototype.addTableImport=function(e,t,r){var n=u(e),i=u(t),a=u(r);try{return _BinaryenAddTableImport(this.ref,n,i,a)}finally{memory.free(a),memory.free(i),memory.free(n)}},e.prototype.addMemoryImport=function(e,t,r){var n=u(e),i=u(t),a=u(r);try{return _BinaryenAddMemoryImport(this.ref,n,i,a)}finally{memory.free(a),memory.free(i),memory.free(n)}},e.prototype.addGlobalImport=function(e,t,r,n){var i=u(e),a=u(t),s=u(r);try{return _BinaryenAddGlobalImport(this.ref,i,a,s,n)}finally{memory.free(s),memory.free(a),memory.free(i)}},e.prototype.setMemory=function(e,t,r,n,a){void 0===a&&(a=null);for(var s=u(a),o=r.length,p=new Array(o),h=new Array(o),d=new Array(o),_=0;_=0;--_)memory.free(p[_]);memory.free(s)}},e.prototype.setFunctionTable=function(e,t,r){for(var n=r.length,i=new Array(n),a=0;a=0;--a)memory.free(i[a])}},e.prototype.setStart=function(e){_BinaryenSetStart(this.ref,e)},e.prototype.getOptimizeLevel=function(){return _BinaryenGetOptimizeLevel()},e.prototype.setOptimizeLevel=function(e){void 0===e&&(e=2),_BinaryenSetOptimizeLevel(e)},e.prototype.getShrinkLevel=function(){return _BinaryenGetShrinkLevel()},e.prototype.setShrinkLevel=function(e){void 0===e&&(e=1),_BinaryenSetShrinkLevel(e)},e.prototype.setDebugInfo=function(e){void 0===e&&(e=!1),_BinaryenSetDebugInfo(e)},e.prototype.optimize=function(e){void 0===e&&(e=0),e?_BinaryenFunctionOptimize(e,this.ref):_BinaryenModuleOptimize(this.ref)},e.prototype.runPasses=function(e,t){void 0===t&&(t=0);for(var r=e.length,n=new Array(r),i=0;i=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;if(!s){var o=u("precompute");this.cachedPrecomputeName=o,this.cachedPrecomputeNames=s=l([o])}return _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.cachedByValue,r=u(e),n=0,i=0;try{_BinaryenModuleAllocateAndWrite(t,this.ref,r),n=h(t);var a=h(t+4);i=h(t+8);var s=new _;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 p(e){return l(e)}function u(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 h(e){return load(e)|load(e+1)<<8|load(e+2)<<16|load(e+3)<<24}function d(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=o,t.readString=d;var _=function(){return function(){}}();t.BinaryModule=_,t.needsExplicitUnreachable=function e(t){switch(_BinaryenExpressionGetType(t)){case 1:case 2:case 3:case 4:return!1}switch(_BinaryenExpressionGetId(t)){case n.Unreachable:case n.Return:return!1;case n.Break:return 0!=_BinaryenBreakGetCondition(t);case n.Block:if(!_BinaryenBlockGetName(t)){var r=_BinaryenBlockGetNumChildren(t);return r>0&&e(_BinaryenBlockGetChild(t,r-1))}}return!0}},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(1),c=r(3),l=r(2);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=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=p,t.tokenIsAlsoIdentifier=u,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 h=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=h;var d=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=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=this.end){n+=e.substring(r,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(r-1,this.end));break}var i=e.charCodeAt(this.pos);if(i==t){n+=e.substring(r,this.pos++);break}if(92!=i){if(l.isLineBreak(i)){n+=e.substring(r,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(r-1,this.pos));break}++this.pos}else n+=e.substring(r,this.pos),n+=this.readEscapeSequence(),r=this.pos}return n},t.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,t=e.charCodeAt(this.pos++);switch(t){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(t,this.end));break}if(92!=e.charCodeAt(this.pos)){var n=e.charCodeAt(this.pos);if(47==n&&!r)break;if(l.isLineBreak(n)){this.error(o.DiagnosticCode.Unterminated_regular_expression_literal,this.range(t,this.pos));break}++this.pos,r=!1}else++this.pos,r=!0}return e.substring(t,this.pos)},t.prototype.readRegexpFlags=function(){for(var e=this.source.text,t=this.pos,r=0;this.pos57)&&95!=r)break;t++}return!0},t.prototype.readInteger=function(){var e=this.source.text;if(48==e.charCodeAt(this.pos)&&this.pos+2=48&&s<=57)r=i64_add(i64_mul(r,n),i64_new(s-48,0));else if(s>=65&&s<=70)r=i64_add(i64_mul(r,n),i64_new(10+s-65,0));else if(s>=97&&s<=102)r=i64_add(i64_mul(r,n),i64_new(10+s-97,0));else{if(95!=s)break;i==a&&this.error(i==t?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==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=i64_new(0,0),n=i64_new(10,0),i=t;this.pos=48&&s<=57)r=i64_add(i64_mul(r,n),i64_new(s-48,0));else{if(95!=s)break;i==a&&this.error(i==t?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==t?this.error(o.DiagnosticCode.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.readOctalInteger=function(){for(var e=this.source.text,t=this.pos,r=i64_new(0,0),n=i64_new(8,0),i=t;this.pos=48&&s<=55)r=i64_add(i64_mul(r,n),i64_new(s-48,0));else{if(95!=s)break;i==a&&this.error(i==t?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==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,0),n=i64_new(2,0),i=i64_new(1,0),a=t;this.pos=48&&n<=57)t=16*t+n-48;else if(n>=65&&n<=70)t=16*t+10+n-65;else{if(!(n>=97&&n<=102))return this.error(o.DiagnosticCode.Hexadecimal_digit_expected,this.range(this.pos-1,this.pos)),"";t=16*t+10+n-97}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.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?"":r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-65536)/1024|0),(r-65536)%1024+56320)},t.prototype.finish=function(){},t}(o.DiagnosticEmitter);t.Tokenizer=d;var _=function(){return function(){}}();t.State=_;var m=null},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4);!function(e){e[e.I8=0]="I8",e[e.I16=1]="I16",e[e.I32=2]="I32",e[e.I64=3]="I64",e[e.ISIZE=4]="ISIZE",e[e.U8=5]="U8",e[e.U16=6]="U16",e[e.U32=7]="U32",e[e.U64=8]="U64",e[e.USIZE=9]="USIZE",e[e.BOOL=10]="BOOL",e[e.F32=11]="F32",e[e.F64=12]="F64",e[e.VOID=13]="VOID"}(t.TypeKind||(t.TypeKind={})),function(e){e[e.NONE=0]="NONE",e[e.SIGNED=1]="SIGNED",e[e.UNSIGNED=2]="UNSIGNED",e[e.INTEGER=4]="INTEGER",e[e.FLOAT=8]="FLOAT",e[e.POINTER=16]="POINTER",e[e.SHORT=32]="SHORT",e[e.LONG=64]="LONG",e[e.VALUE=128]="VALUE",e[e.REFERENCE=256]="REFERENCE",e[e.NULLABLE=512]="NULLABLE"}(t.TypeFlags||(t.TypeFlags={}));var i=function(){function e(e,t,r){this.cachedNullableType=null,this.kind=e,this.flags=t,this.size=r,this.byteSize=ceil(r/8),this.classReference=null,this.signatureReference=null,this.nonNullableType=this}return Object.defineProperty(e.prototype,"intType",{get:function(){switch(this.kind){case 0:return e.i8;case 1:return e.i16;case 11:case 2:return e.i32;case 12:case 3:return e.i64;case 4:return 64==this.size?e.isize64:e.isize32;case 5:return e.u8;case 6:return e.u16;case 7:return e.u32;case 8:return e.u64;case 9:return 64==this.size?e.usize64:e.usize32;case 10:default:return e.i32}},enumerable:!0,configurable:!0}),e.prototype.isManaged=function(e){if(e.hasGC){var t=this.classReference;return null!==t&&!t.hasDecorator(n.DecoratorFlags.UNMANAGED)}return!1},e.prototype.computeSmallIntegerShift=function(e){return e.size-this.size},e.prototype.computeSmallIntegerMask=function(e){var t=this.is(2)?this.size:this.size-1;return-1>>>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)&&t.is(8))return this.size<=t.size;return!1},e.commonCompatible=function(e,t,r){return t.isAssignableTo(e,r)?e:e.isAssignableTo(t,r)?t:null},e.prototype.toString=function(e){if(void 0===e&&(e=!1),!e&&this.is(256)){var t=this.classReference;if(t)return this.is(512)?t.toString()+" | null":t.toString();var r=this.signatureReference;if(r)return this.is(512)?"("+r.toString(!0)+") | null":r.toString(!0);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";default:assert(!1);case 13:return"void"}},e.prototype.toNativeType=function(){switch(this.kind){default:return 1;case 3:case 8:return 2;case 4:case 9:return 64==this.size?2:1;case 11:return 3;case 12:return 4;case 13:return 0}},e.prototype.toNativeZero=function(e){switch(this.kind){case 13: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)}},e.prototype.toNativeOne=function(e){switch(this.kind){case 13: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: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){default:return"i";case 3:case 8:return"I";case 4:case 9:return 64==this.size?"I":"i";case 11:return"f";case 12:return"F";case 13:return"v"}},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.void=new e(13,0,0),e}();t.Type=i,t.typesToNativeTypes=function(e){for(var t=e.length,r=new Array(t),n=0;ne?t[e]:o(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=l&&u!=p?t.push("?: "):t.push(": "),t.push(i[u].toString());return t.push(") => "),t.push(this.returnType.toString()),t.join("")},e}();t.Signature=a;var s=null;function o(e){s||(s=[]);for(var t=s.length;t<=e;++t)s.push("arg$"+t.toString(10));return s[e-1]}t.getDefaultParameterName=o},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(23),l=r(1),p=r(5),u=r(0),h=r(4),d=r(6),_=r(3),m=r(7),g=r(2);!function(e){e[e.WASM32=0]="WASM32",e[e.WASM64=1]="WASM64"}(o=t.Target||(t.Target={}));var y=function(){function e(){this.target=o.WASM32,this.noTreeShaking=!1,this.noAssert=!1,this.importMemory=!1,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?m.Type.usize64:m.Type.usize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isizeType",{get:function(){return this.target==o.WASM64?m.Type.isize64:m.Type.isize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nativeSizeType",{get:function(){return this.target==o.WASM64?2:1},enumerable:!0,configurable:!0}),e.prototype.hasFeature=function(e){return 0!=(this.features&e)},e}();t.Options=y,function(e){e[e.NONE=0]="NONE",e[e.SIGN_EXTENSION=1]="SIGN_EXTENSION",e[e.MUTABLE_GLOBAL=2]="MUTABLE_GLOBAL"}(t.Feature||(t.Feature={})),function(e){e[e.NONE=0]="NONE",e[e.IMPLICIT=1]="IMPLICIT",e[e.EXPLICIT=2]="EXPLICIT"}(t.ConversionKind||(t.ConversionKind={})),function(e){e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP"}(t.WrapMode||(t.WrapMode={}));var f,E,T=function(e){function t(t,r){void 0===r&&(r=null);var n=e.call(this,t.diagnostics)||this;return n.currentOuterFunction=null,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.needsIterateRoots=!1,n.f32ModInstance=null,n.f64ModInstance=null,n.f32PowInstance=null,n.f64PowInstance=null,n.program=t,n.resolver=t.resolver,r||(r=new y),n.options=r,n.memoryOffset=i64_new(max(r.memoryBase,8)),n.module=p.Module.create(),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=this.options,n=this.module,i=this.program;i.initialize(r);var o=new h.Function(i.startFunction,"start",new m.Signature([],m.Type.void));this.startFunctionInstance=o;var l=new Array;this.startFunctionBody=l,this.currentFunction=o,r.isWasm64?n.addGlobal("HEAP_BASE",2,!0,n.createI64(0,0)):n.addGlobal("HEAP_BASE",1,!1,n.createI32(0));for(var u=i.sources,d=0,_=u.length;d<_;++d)u[d].isEntry&&this.compileSource(u[d]);if(l.length||null!==i.mainFunction){var g=o.signature,y=n.addFunction(o.internalName,this.ensureFunctionType(g.parameterTypes,g.returnType,g.thisType),m.typesToNativeTypes(o.additionalLocals),n.createBlock(null,l));o.finalize(n,y),i.mainFunction||n.setStart(y)}var f=this.memoryOffset;f=i64_align(f,r.usizeType.byteSize),this.memoryOffset=f,n.removeGlobal("HEAP_BASE"),r.isWasm64?n.addGlobal("HEAP_BASE",2,!1,n.createI64(i64_low(f),i64_high(f))):n.addGlobal("HEAP_BASE",1,!1,n.createI32(i64_low(f))),n.setMemory(this.options.memoryBase||this.memorySegments.length?i64_low(i64_shr_u(i64_align(f,65536),i64_new(16,0))):0,p.Module.UNLIMITED_MEMORY,this.memorySegments,r.target,"memory"),r.importMemory&&n.addMemoryImport("0","env","memory");var E=this.functionTable;n.setFunctionTable(E.length,4294967295,E),n.addTableExport("0","table"),n.addFunction("null",this.ensureFunctionType(null,m.Type.void),null,n.createBlock(null,[])),r.importTable&&n.addTableImport("0","env","table");try{for(var T=a(i.moduleLevelExports),I=T.next();!I.done;I=T.next()){var v=s(I.value,2),A=v[0],C=v[1];this.makeModuleExport(A,C.element)}}catch(t){e={error:t}}finally{try{I&&!I.done&&(t=T.return)&&t.call(T)}finally{if(e)throw e.error}}return this.needsIterateRoots&&c.compileIterateRoots(this),n},t.prototype.makeModuleExport=function(e,t,r){var n,i,s,o,c,p,d,_,g,y;void 0===r&&(r="");var f=t.members;if(f){var E=r+e+(t.kind==h.ElementKind.CLASS?u.INSTANCE_DELIMITER:u.STATIC_DELIMITER);if(t.kind==h.ElementKind.NAMESPACE)try{for(var T=a(f.values()),I=T.next();!I.done;I=T.next()){(C=I.value).is(u.CommonFlags.EXPORT)&&this.makeModuleExport(C.simpleName,C,E)}}catch(e){n={error:e}}finally{try{I&&!I.done&&(i=T.return)&&i.call(T)}finally{if(n)throw n.error}}else try{for(var v=a(f.values()),A=v.next();!A.done;A=v.next()){var C;(C=A.value).is(u.CommonFlags.PRIVATE)||this.makeModuleExport(C.simpleName,C,E)}}catch(e){s={error:e}}finally{try{A&&!A.done&&(o=v.return)&&o.call(v)}finally{if(s)throw s.error}}}switch(t.kind){case h.ElementKind.GLOBAL:if(t.is(u.CommonFlags.CONST)||t.is(u.CommonFlags.STATIC|u.CommonFlags.READONLY)||this.options.hasFeature(2))this.module.addGlobalExport(t.internalName,r+e);else(N=t.declaration)&&this.error(l.DiagnosticCode.Cannot_export_a_mutable_global,N.name.range);break;case h.ElementKind.ENUMVALUE:var N;if(assert(t.parent).is(u.CommonFlags.CONST)||this.options.hasFeature(2))this.module.addGlobalExport(t.internalName,r+e);else(N=t.declaration)&&this.error(l.DiagnosticCode.Cannot_export_a_mutable_global,N.name.range);break;case h.ElementKind.FUNCTION:var O=(z=t).signature;O.requiredParameters"),!1;e.type=this.currentType,e.set(u.CommonFlags.RESOLVED)}else assert(!1);if(e.is(u.CommonFlags.AMBIENT)&&e.hasDecorator(h.DecoratorFlags.BUILTIN))return!0;var a=e.type.toNativeType(),s=e.is(u.CommonFlags.CONST)||e.is(u.CommonFlags.STATIC|u.CommonFlags.READONLY);if(e.is(u.CommonFlags.AMBIENT))return s||this.options.hasFeature(2)?(e.set(u.CommonFlags.MODULE_IMPORT),r?I(e,r):(f="env",E=e.simpleName),t.addGlobalImport(e.internalName,f,E,a),e.set(u.CommonFlags.COMPILED),!0):(this.error(l.DiagnosticCode.Operation_not_supported,assert(r).range),!1);var o=!1;if(null!==r&&null!==r.initializer){if(n||(n=this.compileExpression(r.initializer,e.type,1,1)),p.getExpressionId(n)!=p.ExpressionId.Const&&(s?(n=t.precomputeExpression(n),p.getExpressionId(n)!=p.ExpressionId.Const&&(this.warning(l.DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,r.range),o=!0)):o=!0),e.hasDecorator(h.DecoratorFlags.INLINE)&&!o){switch(assert(p.getExpressionId(n)==p.ExpressionId.Const),p.getExpressionType(n)){case 1:e.constantValueKind=1,e.constantIntegerValue=i64_new(p.getConstValueI32(n),0);break;case 2:e.constantValueKind=1,e.constantIntegerValue=i64_new(p.getConstValueI64Low(n),p.getConstValueI64High(n));break;case 3:e.constantValueKind=2,e.constantFloatValue=p.getConstValueF32(n);break;case 4:e.constantValueKind=2,e.constantFloatValue=p.getConstValueF64(n);break;default:return assert(!1),!1}e.set(u.CommonFlags.INLINED)}}else n=e.type.toNativeZero(t);var c=e.internalName;return o?(t.addGlobal(c,a,!0,e.type.toNativeZero(t)),this.startFunctionBody.push(t.createSetGlobal(c,n))):t.addGlobal(c,a,!s,n),!0},t.prototype.compileEnumDeclaration=function(e){var t=assert(this.program.elementsLookup.get(e.fileLevelInternalName));return assert(t.kind==h.ElementKind.ENUM),this.compileEnum(t)?t:null},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;if(e.members)try{for(var o=a(e.members.values()),c=o.next();!c.done;c=o.next()){var d=c.value;if(d.kind==h.ElementKind.ENUMVALUE){var _=!1,g=d,y=g.declaration;g.set(u.CommonFlags.COMPILED);var f=void 0;y.value?(f=this.compileExpression(y.value,m.Type.i32,1,0),p.getExpressionId(f)!=p.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)?(f=n.precomputeExpression(f),p.getExpressionId(f)!=p.ExpressionId.Const&&(this.error(l.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,y.value.range),_=!0)):_=!0)):null==i?f=n.createI32(0):(s&&this.error(l.DiagnosticCode.Enum_member_must_have_initializer,y.range),f=n.createBinary(p.BinaryOp.AddI32,n.createGetGlobal(i.internalName,1),n.createI32(1)),f=n.precomputeExpression(f),p.getExpressionId(f)!=p.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)&&this.error(l.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,y.range),_=!0)),_?(n.addGlobal(g.internalName,1,!0,n.createI32(0)),this.startFunctionBody.push(n.createSetGlobal(g.internalName,f)),s=!0):(n.addGlobal(g.internalName,1,!e.is(u.CommonFlags.CONST),f),s=!1),i=g}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return this.currentEnum=null,!0},t.prototype.compileFunctionDeclaration=function(e,t){var r=assert(this.program.elementsLookup.get(e.fileLevelInternalName));return assert(r.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.compileFunctionUsingTypeArguments(r,t,g.makeMap(),null,r.declaration.name)},t.prototype.compileFunctionUsingTypeArguments=function(e,t,r,n,i){var a=this.resolver.resolveFunctionInclTypeArguments(e,t,r,i);return a?(a.outerScope=n,this.compileFunction(a)?a:null):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;s=0)return e.functionTableIndex;var t=this.functionTable,r=t.length;return!e.is(u.CommonFlags.TRAMPOLINE)&&e.signature.requiredParameters=0?"case"+h.toString(10):"break")+"|"+a);var g=t.createBlock("case0|"+a,l,0),y=!0,f=!0,E=!0,T=!0;for(d=0;d=0&&(y&&s.set(1),f&&s.set(2),E&&s.set(4),T&&s.set(32)),g},t.prototype.compileThrowStatement=function(e){var t=this.currentFunction.flow;return t.set(4),t.set(1),c.compileAbort(this,null,e)},t.prototype.compileTryStatement=function(e){return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()},t.prototype.compileVariableStatement=function(e,t){void 0===t&&(t=!1);var r=this.program,n=this.currentFunction,i=e.declarations,a=i.length;if(t||n==this.startFunctionInstance&&e.parent&&e.parent.kind==_.NodeKind.SOURCE){for(var s=0;s");continue}f=this.currentType}var T=!1;if(g.is(u.CommonFlags.CONST))if(E)if(E=this.module.precomputeExpression(E),p.getExpressionId(E)==p.ExpressionId.Const){var I=new h.Local(r,y,-1,f);switch(p.getExpressionType(E)){case 1:I=I.withConstantIntegerValue(i64_new(p.getConstValueI32(E),0));break;case 2:I=I.withConstantIntegerValue(i64_new(p.getConstValueI64Low(E),p.getConstValueI64High(E)));break;case 3:I=I.withConstantFloatValue(p.getConstValueF32(E));break;case 4:I=I.withConstantFloatValue(p.getConstValueF64(E));break;default:return assert(!1),this.module.createUnreachable()}var v=n.flow.scopedLocals;if(v){if(v.has(y))return this.error(l.DiagnosticCode.Duplicate_identifier_0,g.name.range,y),this.module.createUnreachable()}else n.flow.scopedLocals=v=new Map;v.set(y,I),T=!0}else this.warning(l.DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,g.range);else this.error(l.DiagnosticCode._const_declarations_must_be_initialized,g.range);if(!T){I=void 0;I=g.isAny(u.CommonFlags.LET|u.CommonFlags.CONST)||c.is(2048)?c.addScopedLocal(f,y,!1,g):n.addLocal(f,y,g),E?(o.push(this.compileAssignmentWithValue(g.name,E)),I.type.is(36)&&c.setLocalWrapped(I.index,!c.canOverflow(E,f))):I.type.is(36)&&c.setLocalWrapped(I.index,!0)}}return o.length?1==o.length?o[0]:this.module.createBlock(null,o,0):0},t.prototype.compileVoidStatement=function(e){return this.compileExpression(e.expression,m.Type.void,2,0)},t.prototype.compileWhileStatement=function(e){var t=this.module,r=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,m.Type.bool,0),this.currentType);if(!this.options.noTreeShaking||this.currentFunction.isAny(u.CommonFlags.GENERIC|u.CommonFlags.GENERIC_CONTEXT)){var n=t.precomputeExpression(r);if(p.getExpressionId(n)==p.ExpressionId.Const&&1==p.getExpressionType(n)){if(!p.getConstValueI32(n))return t.createNop()}else r=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,m.Type.bool,0),this.currentType)}var i=this.currentFunction,a=i.enterBreakContext(),s=i.flow,o=s.fork();i.flow=o;var c="break|"+a;o.breakLabel=c;var l="continue|"+a;o.continueLabel=l;var h=this.compileStatement(e.statement),d=o.isAny(29);return i.flow=o.free(),i.leaveBreakContext(),o.unset(792),s.inheritConditional(o),t.createBlock(c,[t.createLoop(l,t.createIf(r,d?h:t.createBlock(null,[h,t.createBreak(l)],0)))])},t.prototype.compileInlineConstant=function(e,t,r){assert(e.is(u.CommonFlags.INLINED));var n=e.type;switch(!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.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(h.DecoratorFlags.BUILTIN)||t!=m.Type.f32)return this.module.createF64(e.constantFloatValue);this.currentType=m.Type.f32;case 11:return this.module.createF32(e.constantFloatValue);default:return assert(!1),this.module.createUnreachable()}},t.prototype.compileExpression=function(e,t,r,n){var i;switch(this.currentType=t,e.kind){case _.NodeKind.ASSERTION:i=this.compileAssertionExpression(e,t);break;case _.NodeKind.BINARY:i=this.compileBinaryExpression(e,t);break;case _.NodeKind.CALL:i=this.compileCallExpression(e,t);break;case _.NodeKind.COMMA:i=this.compileCommaExpression(e,t);break;case _.NodeKind.ELEMENTACCESS:i=this.compileElementAccessExpression(e,t);break;case _.NodeKind.FUNCTION:i=this.compileFunctionExpression(e,t);break;case _.NodeKind.IDENTIFIER:case _.NodeKind.FALSE:case _.NodeKind.NULL:case _.NodeKind.THIS:case _.NodeKind.SUPER:case _.NodeKind.TRUE:i=this.compileIdentifierExpression(e,t,0==r);break;case _.NodeKind.INSTANCEOF:i=this.compileInstanceOfExpression(e,t);break;case _.NodeKind.LITERAL:i=this.compileLiteralExpression(e,t);break;case _.NodeKind.NEW:i=this.compileNewExpression(e,t);break;case _.NodeKind.PARENTHESIZED:i=this.compileParenthesizedExpression(e,t);break;case _.NodeKind.PROPERTYACCESS:i=this.compilePropertyAccessExpression(e,t,0==r);break;case _.NodeKind.TERNARY:i=this.compileTernaryExpression(e,t);break;case _.NodeKind.UNARYPOSTFIX:i=this.compileUnaryPostfixExpression(e,t);break;case _.NodeKind.UNARYPREFIX:i=this.compileUnaryPrefixExpression(e,t);break;default:this.error(l.DiagnosticCode.Operation_not_supported,e.range),i=this.module.createUnreachable()}var a=this.currentType;return 0!=r&&a!=t?(i=this.convertExpression(i,a,t,r,n,e),this.currentType=t):1==n&&(i=this.ensureSmallIntegerWrap(i,a)),this.options.sourceMap&&this.addDebugLocation(i,e.range),i},t.prototype.compileExpressionRetainType=function(e,t,r){return this.compileExpression(e,t==m.Type.void?m.Type.i32:t,0,r)},t.prototype.precomputeExpression=function(e,t,r,n){return this.module.precomputeExpression(this.compileExpression(e,t,r,n))},t.prototype.convertExpression=function(e,t,r,n,i,a){assert(0!=n);var s=this.module;return 13==t.kind?(assert(13!=r.kind),this.error(l.DiagnosticCode.Type_0_is_not_assignable_to_type_1,a.range,t.toString(),r.toString()),s.createUnreachable()):13==r.kind?s.createDrop(e):(t.isAssignableTo(r)||1==n&&this.error(l.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.createUnary(p.UnaryOp.PromoteF32,e)):11==r.kind&&(e=s.createUnary(p.UnaryOp.DemoteF64,e)):r.is(4)?11==t.kind?r==m.Type.bool?(e=s.createBinary(p.BinaryOp.NeF32,e,s.createF32(0)),i=0):e=r.is(1)?r.is(64)?s.createUnary(p.UnaryOp.TruncF32ToI64,e):s.createUnary(p.UnaryOp.TruncF32ToI32,e):r.is(64)?s.createUnary(p.UnaryOp.TruncF32ToU64,e):s.createUnary(p.UnaryOp.TruncF32ToU32,e):r==m.Type.bool?(e=s.createBinary(p.BinaryOp.NeF64,e,s.createF64(0)),i=0):e=r.is(1)?r.is(64)?s.createUnary(p.UnaryOp.TruncF64ToI64,e):s.createUnary(p.UnaryOp.TruncF64ToI32,e):r.is(64)?s.createUnary(p.UnaryOp.TruncF64ToU64,e):s.createUnary(p.UnaryOp.TruncF64ToU32,e):(assert(0==r.flags,"void type expected"),e=s.createDrop(e)):t.is(4)&&r.is(8)?e=11==r.kind?t.is(64)?s.createUnary(t.is(1)?p.UnaryOp.ConvertI64ToF32:p.UnaryOp.ConvertU64ToF32,e):s.createUnary(t.is(1)?p.UnaryOp.ConvertI32ToF32:p.UnaryOp.ConvertU32ToF32,e):t.is(64)?s.createUnary(t.is(1)?p.UnaryOp.ConvertI64ToF64:p.UnaryOp.ConvertU64ToF64,e):s.createUnary(t.is(1)?p.UnaryOp.ConvertI32ToF64:p.UnaryOp.ConvertU32ToF64,e):t.is(64)?r==m.Type.bool?(e=s.createBinary(p.BinaryOp.NeI64,e,s.createI64(0)),i=0):r.is(64)||(e=s.createUnary(p.UnaryOp.WrapI64,e)):r.is(64)?(e=s.createUnary(t.is(1)?p.UnaryOp.ExtendI32:p.UnaryOp.ExtendU32,this.ensureSmallIntegerWrap(e,t)),i=0):t.is(32)&&t.size",n.toString(),a.toString()),this.currentType=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.GtI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GtI64:p.BinaryOp.GtI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.GtI64,r,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.GtU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GtU64:p.BinaryOp.GtU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.GtU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.GtF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.GtF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=m.Type.bool;break;case d.Token.LESSTHAN_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.LE)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.LeI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.LeI64:p.BinaryOp.LeI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.LeI64,r,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.LeU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.LeU64:p.BinaryOp.LeU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.LeU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.LeF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.LeF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=m.Type.bool;break;case d.Token.GREATERTHAN_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.GE)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.GeI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GeI64:p.BinaryOp.GeI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.GeI64,r,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.GeU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GeU64:p.BinaryOp.GeU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.GeU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.GeF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.GeF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=m.Type.bool;break;case d.Token.EQUALS_EQUALS_EQUALS:case d.Token.EQUALS_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,y==d.Token.EQUALS_EQUALS&&this.currentType.is(256))if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.EQ)){o=this.compileBinaryOverload(v,u,r,_,e);break}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,d.operatorTokenToString(e.operator),n.toString(),a.toString()),this.currentType=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.EqI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.EqI64:p.BinaryOp.EqI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.EqI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.EqF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.EqF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=m.Type.bool;break;case d.Token.EXCLAMATION_EQUALS_EQUALS:case d.Token.EXCLAMATION_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,y==d.Token.EXCLAMATION_EQUALS&&this.currentType.is(256))if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.NE)){o=this.compileBinaryOverload(v,u,r,_,e);break}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,d.operatorTokenToString(e.operator),n.toString(),a.toString()),this.currentType=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.NeI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.NeI64:p.BinaryOp.NeI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.NeI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.NeF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.NeF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=m.Type.bool;break;case d.Token.EQUALS:return this.compileAssignment(u,_,t);case d.Token.PLUS_EQUALS:g=!0;case d.Token.PLUS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.ADD)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)i=this.compileExpression(_,n,1,0);else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.AddI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.AddI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.AddF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.AddF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.MINUS_EQUALS:g=!0;case d.Token.MINUS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.SUB)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.SubI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.SubI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.SubF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.SubF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.ASTERISK_EQUALS:g=!0;case d.Token.ASTERISK:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.MUL)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1);else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.MulI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.MulI64:p.BinaryOp.MulI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.MulI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.MulF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.MulF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.ASTERISK_ASTERISK_EQUALS:g=!0;case d.Token.ASTERISK_ASTERISK:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.POW)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}var f=void 0;if(11==this.currentType.kind){if(i=this.compileExpression(_,m.Type.f32,1,0),a=this.currentType,!(f=this.f32PowInstance)){if(!(E=this.program.elementsLookup.get("Mathf"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),o=c.createUnreachable();break}if(!(T=E.members?E.members.get("pow"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.pow"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f32PowInstance=f=this.resolver.resolveFunction(T,null)}}else if(r=this.convertExpression(r,this.currentType,m.Type.f64,1,0,u),n=this.currentType,i=this.compileExpression(_,m.Type.f64,1,0),a=this.currentType,!(f=this.f64PowInstance)){if(!(E=this.program.elementsLookup.get("Math"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),o=c.createUnreachable();break}if(!(T=E.members?E.members.get("pow"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math.pow"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f64PowInstance=f=this.resolver.resolveFunction(T,null)}o=f&&this.compileFunction(f)?this.makeCallDirect(f,[r,i]):c.createUnreachable();break;case d.Token.SLASH_EQUALS:g=!0;case d.Token.SLASH:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.DIV)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_)}switch(this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.DivI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.DivI64:p.BinaryOp.DivI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.DivI64,r,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.DivU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.DivU64:p.BinaryOp.DivU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.DivU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.DivF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.DivF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.PERCENT_EQUALS:g=!0;case d.Token.PERCENT:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.REM)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_)}switch(this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.RemI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.RemI64:p.BinaryOp.RemI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.RemI64,r,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.RemU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.RemU64:p.BinaryOp.RemU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.RemU64,r,i);break;case 11:if(!(f=this.f32ModInstance)){if(!(E=this.program.elementsLookup.get("Mathf"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),o=c.createUnreachable();break}if(!(T=E.members?E.members.get("mod"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.mod"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f32ModInstance=f=this.resolver.resolveFunction(T,null)}o=f&&this.compileFunction(f)?this.makeCallDirect(f,[r,i]):c.createUnreachable();break;case 12:if(!(f=this.f64ModInstance)){var E,T;if(!(E=this.program.elementsLookup.get("Math"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),o=c.createUnreachable();break}if(!(T=E.members?E.members.get("mod"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math.mod"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f64ModInstance=f=this.resolver.resolveFunction(T,null)}o=f&&this.compileFunction(f)?this.makeCallDirect(f,[r,i]):c.createUnreachable();break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.LESSTHAN_LESSTHAN_EQUALS:g=!0;case d.Token.LESSTHAN_LESSTHAN:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_SHL)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(i=this.compileExpression(_,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,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.ShlI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShlI64:p.BinaryOp.ShlI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.GREATERTHAN_GREATERTHAN_EQUALS:g=!0;case d.Token.GREATERTHAN_GREATERTHAN:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_SHR)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1),a=this.currentType,this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.ShrI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.ShrI64,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrI64:p.BinaryOp.ShrI32,r,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.ShrU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.ShrU64,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrU64:p.BinaryOp.ShrU32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:g=!0;case d.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_SHR_U)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,0),a=this.currentType,this.currentType.kind){case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.ShrU32,r,i);case 0:case 1:case 2:case 7:o=c.createBinary(p.BinaryOp.ShrU32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.ShrU64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrU64:p.BinaryOp.ShrU32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.AMPERSAND_EQUALS:g=!0;case d.Token.AMPERSAND:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_AND)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.AndI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.AndI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.AndI64:p.BinaryOp.AndI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.BAR_EQUALS:g=!0;case d.Token.BAR:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_OR)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.OrI32,r,i);break;case 2:case 7:o=c.createBinary(p.BinaryOp.OrI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.OrI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.OrI64:p.BinaryOp.OrI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.CARET_EQUALS:g=!0;case d.Token.CARET:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){var I,v;if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_XOR)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(g)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=m.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.XorI32,r,i);break;case 2:case 7:o=c.createBinary(p.BinaryOp.XorI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.XorI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.XorI64:p.BinaryOp.XorI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.AMPERSAND_AMPERSAND:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,i=this.compileExpression(_,n,1,0),a=this.currentType,o=c.cloneExpression(r,!0,0))this.makeIsTrueish(r,this.currentType),o=c.createIf(this.makeIsTrueish(r,this.currentType),i,o);else{var A=this.currentFunction.flow,C=this.currentFunction.getAndFreeTempLocal(this.currentType,!A.canOverflow(r,this.currentType));o=c.createIf(this.makeIsTrueish(c.createTeeLocal(C.index,r),this.currentType),i,c.createGetLocal(assert(C).index,this.currentType.toNativeType()))}break;case d.Token.BAR_BAR:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,i=this.compileExpression(_,n,1,0),a=this.currentType,o=this.module.cloneExpression(r,!0,0))o=this.module.createIf(this.makeIsTrueish(r,this.currentType),o,i);else{A=this.currentFunction.flow,C=this.currentFunction.getAndFreeTempLocal(this.currentType,!A.canOverflow(r,this.currentType));o=c.createIf(this.makeIsTrueish(c.createTeeLocal(C.index,r),this.currentType),c.createGetLocal(assert(C).index,this.currentType.toNativeType()),i)}break;default:assert(!1),o=this.module.createUnreachable()}return g?this.compileAssignmentWithValue(u,o,t!=m.Type.void):o},t.prototype.compileUnaryOverload=function(e,t,r,n){var i,a=0;return e.is(u.CommonFlags.INSTANCE)?(a=r,i=[]):i=[t],this.compileCallDirect(e,i,n,a,e.hasDecorator(h.DecoratorFlags.INLINE))},t.prototype.compileBinaryOverload=function(e,t,r,n,i){var a,s=0;if(e.is(u.CommonFlags.INSTANCE)){var o=assert(e.parent);assert(o.kind==h.ElementKind.CLASS),s=r,a=[n]}else a=[t,n];return this.compileCallDirect(e,a,i,s,e.hasDecorator(h.DecoratorFlags.INLINE))},t.prototype.compileAssignment=function(e,t,r){var n,i=this.program.resolver,a=this.currentFunction,s=i.resolveExpression(e,a);if(!s)return this.module.createUnreachable();switch(s.kind){case h.ElementKind.GLOBAL:if(!this.compileGlobal(s))return this.module.createUnreachable();assert(s.type!=m.Type.void);case h.ElementKind.LOCAL:case h.ElementKind.FIELD:n=s.type;break;case h.ElementKind.PROPERTY:var o=s.setterPrototype;if(o){var c=this.resolver.resolveFunction(o,null);if(!c)return this.module.createUnreachable();assert(1==c.signature.parameterTypes.length),n=c.signature.parameterTypes[0];break}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();case h.ElementKind.CLASS:if(i.currentElementExpression){var p=a.flow.is(4096),u=s.lookupOverload(h.OperatorKind.INDEXED_SET,p);if(!u)return s.lookupOverload(h.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!=m.Type.void);var d=this.compileExpression(t,n,1,0);return this.compileAssignmentWithValue(e,d,r!=m.Type.void)},t.prototype.compileAssignmentWithValue=function(e,t,r){void 0===r&&(r=!1);var n=this.module,i=this.resolver.resolveExpression(e,this.currentFunction);if(!i)return n.createUnreachable();switch(i.kind){case h.ElementKind.LOCAL:var a=i.type;if(assert(a!=m.Type.void),this.currentType=r?a:m.Type.void,i.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,i.internalName),n.createUnreachable();var s=this.currentFunction.flow;return a.is(36)&&s.setLocalWrapped(i.index,!s.canOverflow(t,a)),r?n.createTeeLocal(i.index,t):n.createSetLocal(i.index,t);case h.ElementKind.GLOBAL:if(!this.compileGlobal(i))return n.createUnreachable();a=i.type;if(assert(a!=m.Type.void),this.currentType=r?a:m.Type.void,i.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,i.internalName),n.createUnreachable();if(t=this.ensureSmallIntegerWrap(t,a),r){var o=a.toNativeType(),c=i.internalName;return n.createBlock(null,[n.createSetGlobal(c,t),n.createGetGlobal(c,o)],o)}return n.createSetGlobal(i.internalName,t);case h.ElementKind.FIELD:var p=i.declaration;if(i.is(u.CommonFlags.READONLY)&&!this.currentFunction.is(u.CommonFlags.CONSTRUCTOR)&&null!=p&&null==p.initializer)return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,i.internalName),n.createUnreachable();var d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0);a=i.type;this.currentType=r?a:m.Type.void;o=a.toNativeType();if(10==a.kind&&(t=this.ensureSmallIntegerWrap(t,a)),r){s=(L=this.currentFunction).flow;var g=L.getAndFreeTempLocal(a,!s.canOverflow(t,a)).index;return n.createBlock(null,[n.createSetLocal(g,t),n.createStore(a.byteSize,_,n.createGetLocal(g,o),o,i.memoryOffset),n.createGetLocal(g,o)],o)}return n.createStore(a.byteSize,_,t,o,i.memoryOffset);case h.ElementKind.PROPERTY:var y=i.setterPrototype;if(y){var f=this.resolver.resolveFunction(y,null);if(!f)return n.createUnreachable();if(!r){if(f.is(u.CommonFlags.INSTANCE)){d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0);return this.makeCallDirect(f,[_,t])}return this.makeCallDirect(f,[t])}var E=i.getterPrototype;assert(null!=E);var T=this.resolver.resolveFunction(E,null);if(!T)return n.createUnreachable();var I=(R=T.signature.returnType).toNativeType();if(f.is(u.CommonFlags.INSTANCE)){d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0),g=this.currentFunction.getAndFreeTempLocal(R,!1).index;return n.createBlock(null,[this.makeCallDirect(f,[n.createTeeLocal(g,_),t]),this.makeCallDirect(T,[n.createGetLocal(g,I)])],I)}return n.createBlock(null,[this.makeCallDirect(f,[t]),this.makeCallDirect(T)],I)}return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,i.internalName),n.createUnreachable();case h.ElementKind.CLASS:var v=this.resolver.currentElementExpression;if(v){var A=this.currentFunction.flow.is(4096),C=i.lookupOverload(h.OperatorKind.INDEXED_GET,A);if(!C)return this.error(l.DiagnosticCode.Index_signature_is_missing_in_type_0,e.range,i.internalName),n.createUnreachable();var N=i.lookupOverload(h.OperatorKind.INDEXED_SET,A);if(!N)return this.error(l.DiagnosticCode.Index_signature_in_type_0_only_permits_reading,e.range,i.internalName),this.currentType=r?C.signature.returnType:m.Type.void,n.createUnreachable();var O=i.type,S=(d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0),this.compileExpression(v,m.Type.i32,1,0));if(r){var L,k=(L=this.currentFunction).getTempLocal(O,!1),b=L.getAndFreeTempLocal(this.currentType,!1),R=C.signature.returnType;return this.currentFunction.freeTempLocal(k),n.createBlock(null,[this.makeCallDirect(N,[n.createTeeLocal(k.index,_),n.createTeeLocal(b.index,S),t]),this.makeCallDirect(C,[n.createGetLocal(k.index,k.type.toNativeType()),n.createGetLocal(b.index,b.type.toNativeType())])],R.toNativeType())}return this.makeCallDirect(N,[_,S,t])}}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()},t.prototype.compileCallExpression=function(e,t){var r,n,i=this.module,a=this.currentFunction,s=this.resolver.resolveExpression(e.expression,a);if(!s)return i.createUnreachable();switch(s.kind){case h.ElementKind.FUNCTION_PROTOTYPE:var o=s,c=e.typeArguments;if(o.hasDecorator(h.DecoratorFlags.BUILTIN))return this.compileCallExpressionBuiltin(o,e,t);var p=null;if(c){if(!o.is(u.CommonFlags.GENERIC))return this.error(l.DiagnosticCode.Type_0_is_not_generic,e.expression.range,o.internalName),i.createUnreachable();p=this.resolver.resolveFunctionInclTypeArguments(o,c,g.makeMap(this.currentFunction.flow.contextualTypeArguments),e)}else{if(o.is(u.CommonFlags.GENERIC)){for(var d=new Map,y=assert(o.declaration.typeParameters),f=y.length,E=0;Es&&!i)||(this.error(l.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=!1);var a=t.length,s=e.signature;if(!this.checkCallSignature(s,a,0!=n,r))return this.module.createUnreachable();if(i){if(assert(!e.is(u.CommonFlags.TRAMPOLINE)),!this.currentInlineFunctions.includes(e)){this.currentInlineFunctions.push(e);var o=this.compileCallInlineUnchecked(e,t,r,n);return this.currentInlineFunctions.pop(),o}this.warning(l.DiagnosticCode.Function_0_cannot_be_inlined_into_itself,r.range,e.internalName)}var c=n?a+1:a,p=new Array(c),h=0;n&&(p[0]=n,h=1);for(var d=s.parameterTypes,_=0;_1?g.createBlock(null,v,T.toNativeType()):v.length?v[0]:g.createNop():(this.error(l.DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,y.signature.returnType.range),g.createUnreachable())},t.prototype.ensureTrampoline=function(e){var t=e.trampoline;if(t)return t;var r=e.signature,n=e.internalName,i=r.parameterTypes,a=e.prototype.declaration.signature.parameters,s=r.returnType,o=r.thisType,c=e.is(u.CommonFlags.INSTANCE),d=r.requiredParameters,_=d,g=i.length,y=g;c&&(++_,++y);var f=assert(y-_),E=new Array(_),T=0,I=this.module;c&&(E[0]=I.createGetLocal(0,this.options.nativeSizeType),T=1);for(var v=0;v=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(r=a),this.ensureFunctionType(e.parameterTypes,e.returnType,e.thisType);var c=this.module;if(n=0),this.currentType=E,this.module.createGetLocal(T,E.toNativeType());case h.ElementKind.GLOBAL:if(!this.compileGlobal(f))return this.module.createUnreachable();var I=f.type;return assert(I!=m.Type.void),f.is(u.CommonFlags.INLINED)?this.compileInlineConstant(f,t,r):(this.currentType=I,this.module.createGetGlobal(f.internalName,I.toNativeType()));case h.ElementKind.ENUMVALUE:return f.is(u.CommonFlags.COMPILED)?(this.currentType=m.Type.i32,f.is(u.CommonFlags.INLINED)?this.module.createI32(f.constantValue):this.module.createGetGlobal(f.internalName,1)):(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=m.Type.i32,this.module.createUnreachable());case h.ElementKind.FUNCTION_PROTOTYPE:var v=this.resolver.resolveFunction(f,null,g.makeMap(i.flow.contextualTypeArguments));if(!v||!this.compileFunction(v))return n.createUnreachable();var A=this.ensureFunctionTableEntry(v);return this.currentType=v.signature.type,this.module.createI32(A)}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()},t.prototype.compileInstanceOfExpression=function(e,t){var r=this.module,n=this.compileExpressionRetainType(e.expression,this.options.usizeType,0),i=this.currentType,a=this.resolver.resolveType(e.isType);return this.currentType=m.Type.bool,a?i.is(512)&&!a.is(512)?i.nonNullableType.isAssignableTo(a)?r.createBinary(i.is(64)?p.BinaryOp.NeI64:p.BinaryOp.NeI32,n,i.toNativeZero(r)):r.createI32(0):r.createI32(i.isAssignableTo(a,!0)?1:0):r.createUnreachable()},t.prototype.compileLiteralExpression=function(e,t,r){void 0===r&&(r=!1);var n=this.module;switch(e.literalKind){case _.LiteralKind.ARRAY:assert(!r);var i=t.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 _.LiteralKind.FLOAT:var a=e.value;return r&&(a=-a),t==m.Type.f32?n.createF32(a):(this.currentType=m.Type.f64,n.createF64(a));case _.LiteralKind.INTEGER:var s=e.value;r&&(s=i64_sub(i64_new(0),s));var o=this.resolver.determineIntegerLiteralType(s,t);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 _.LiteralKind.STRING:return assert(!r),this.compileStringLiteral(e);case _.LiteralKind.OBJECT:return assert(!r),this.compileObjectLiteral(e,t)}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.currentType=t,n.createUnreachable()},t.prototype.ensureStaticString=function(e){var t,r=this.program,n=r.hasGC,i=r.gcHeaderSize,a=assert(r.stringInstance),s=this.stringSegments;if(s.has(e))t=s.get(e);else{var o=e.length,l=a.currentMemoryOffset+1&-2,p=l+2*o,u=void 0,h=void 0;n?(u=new Uint8Array(i+p),h=i,g.writeI32(c.ensureGCHook(this,a),u,r.gcHookOffset)):(u=new Uint8Array(p),h=0),g.writeI32(o,u,h+a.offsetof("length")),h+=l;for(var d=0;d",t.toString()),r.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()),r.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()),r.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()),r.createUnreachable()}var a=e.names,s=a.length,o=e.values,p=n.members,d=!1,_=new Array(s+2),m=this.currentFunction.getTempLocal(this.options.usizeType);assert(s==o.length);for(var g=0,y=s;g=0);var c=this.compileExpressionRetainType(o,this.options.usizeType,0);return this.currentType=i.type,n.createLoad(i.type.byteSize,i.type.is(5),c,i.type.toNativeType(),i.memoryOffset);case h.ElementKind.PROPERTY:return this.compileGetter(i,e);case h.ElementKind.FUNCTION_PROTOTYPE:return this.error(l.DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set,e.range,i.simpleName),n.createUnreachable()}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()},t.prototype.compileGetter=function(e,t){var r=e.getterPrototype;if(r){var n=this.resolver.resolveFunction(r,null);if(!n)return this.module.createUnreachable();var i=n.signature;if(!this.checkCallSignature(i,0,n.is(u.CommonFlags.INSTANCE),t))return this.module.createUnreachable();var a=0!=(n.decoratorFlags&h.DecoratorFlags.INLINE);if(n.is(u.CommonFlags.INSTANCE)){var s=assert(n.parent);assert(s.kind==h.ElementKind.CLASS);var o=assert(this.resolver.currentThisExpression),c=this.compileExpressionRetainType(o,this.options.usizeType,0);//!!! -return this.currentType=i.returnType,this.compileCallDirect(n,[],t,c,a)}return this.currentType=i.returnType,this.compileCallDirect(n,[],t,0,a)}return this.error(l.DiagnosticCode.Property_0_does_not_exist_on_type_1,t.range,e.simpleName,e.parent.toString()),this.module.createUnreachable()},t.prototype.compileTernaryExpression=function(e,t){var r=e.ifThen,n=e.ifElse,i=this.currentFunction,a=i.flow,s=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,m.Type.bool,0),this.currentType);if(!this.options.noTreeShaking||this.currentFunction.isAny(u.CommonFlags.GENERIC|u.CommonFlags.GENERIC_CONTEXT)){var o=this.module.precomputeExpression(s);if(p.getExpressionId(o)==p.ExpressionId.Const&&1==p.getExpressionType(o))return p.getConstValueI32(o)?this.compileExpressionRetainType(r,t,0):this.compileExpressionRetainType(n,t,0);s=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,m.Type.bool,0),this.currentType)}var c=a.fork();i.flow=c;var h=this.compileExpressionRetainType(r,t,0),d=this.currentType;c.free();var _=a.fork();i.flow=_;var g=this.compileExpressionRetainType(n,t,0),y=this.currentType;i.flow=_.free(),a.inheritMutual(c,_);var f=m.Type.commonCompatible(d,y,!1);return f?(h=this.convertExpression(h,d,f,1,0,r),g=this.convertExpression(g,y,f,1,0,n),this.currentType=f,this.module.createIf(s,h,g)):(this.error(l.DiagnosticCode.Type_0_is_not_assignable_to_type_1,e.range,d.toString(),y.toString()),this.currentType=t,this.module.createUnreachable())},t.prototype.compileUnaryPostfixExpression=function(e,t){var r=this.module,n=this.currentFunction,i=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0,0);if(p.getExpressionId(i)==p.ExpressionId.Unreachable)return i;var a,s=this.currentType,o=null;switch(t!=m.Type.void&&(o=n.getTempLocal(s,!1),i=r.createTeeLocal(o.index,i)),e.operator){case d.Token.PLUS_PLUS:switch(s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:a=r.createBinary(p.BinaryOp.AddI32,i,r.createI32(1));break;case 9:if(this.currentType.is(256)){if(u=this.currentType.classReference)if(_=u.lookupOverload(h.OperatorKind.POSTFIX_INC)){a=this.compileUnaryOverload(_,e.operand,i,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),r.createUnreachable()}case 4:var c=this.options;a=r.createBinary(c.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,i,s.toNativeOne(r));break;case 3:case 8:a=r.createBinary(p.BinaryOp.AddI64,i,r.createI64(1));break;case 11:a=r.createBinary(p.BinaryOp.AddF32,i,r.createF32(1));break;case 12:a=r.createBinary(p.BinaryOp.AddF64,i,r.createF64(1));break;default:return assert(!1),r.createUnreachable()}break;case d.Token.MINUS_MINUS:switch(s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:a=r.createBinary(p.BinaryOp.SubI32,i,r.createI32(1));break;case 9:if(this.currentType.is(256)){var u,_;if(u=this.currentType.classReference)if(_=u.lookupOverload(h.OperatorKind.POSTFIX_DEC)){a=this.compileUnaryOverload(_,e.operand,i,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),r.createUnreachable()}case 4:c=this.options;a=r.createBinary(c.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,i,s.toNativeOne(r));break;case 3:case 8:a=r.createBinary(p.BinaryOp.SubI64,i,r.createI64(1));break;case 11:a=r.createBinary(p.BinaryOp.SubF32,i,r.createF32(1));break;case 12:a=r.createBinary(p.BinaryOp.SubF64,i,r.createF64(1));break;default:return assert(!1),r.createUnreachable()}break;default:return assert(!1),r.createUnreachable()}if(!o)return this.currentType=m.Type.void,this.compileAssignmentWithValue(e.operand,a,!1);var g=this.compileAssignmentWithValue(e.operand,a,!1);this.currentType=o.type,n.freeTempLocal(o);var y=o.type.toNativeType();return r.createBlock(null,[g,r.createGetLocal(o.index,y)],y)},t.prototype.compileUnaryPrefixExpression=function(e,t){var r,n=this.module,i=!1;switch(e.operator){case d.Token.PLUS:if(r=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.PLUS)){r=this.compileUnaryOverload(s,e.operand,r,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}break;case d.Token.MINUS:if(e.operand.kind==_.NodeKind.LITERAL&&(e.operand.literalKind==_.LiteralKind.INTEGER||e.operand.literalKind==_.LiteralKind.FLOAT)){r=this.compileLiteralExpression(e.operand,t,!0),this.options.sourceMap&&this.addDebugLocation(r,e.range);break}if(r=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.MINUS)){r=this.compileUnaryOverload(s,e.operand,r,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:r=n.createBinary(p.BinaryOp.SubI32,n.createI32(0),r);break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,this.currentType.toNativeZero(n),r);break;case 3:case 8:r=n.createBinary(p.BinaryOp.SubI64,n.createI64(0),r);break;case 11:r=n.createUnary(p.UnaryOp.NegF32,r);break;case 12:r=n.createUnary(p.UnaryOp.NegF64,r);break;default:assert(!1),r=n.createUnreachable()}break;case d.Token.PLUS_PLUS:if(i=!0,r=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.PREFIX_INC)){r=this.compileUnaryOverload(s,e.operand,r,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:r=n.createBinary(p.BinaryOp.AddI32,r,this.module.createI32(1));break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,r,this.currentType.toNativeOne(n));break;case 3:case 8:r=n.createBinary(p.BinaryOp.AddI64,r,n.createI64(1));break;case 11:r=n.createBinary(p.BinaryOp.AddF32,r,n.createF32(1));break;case 12:r=n.createBinary(p.BinaryOp.AddF64,r,n.createF64(1));break;default:assert(!1),r=n.createUnreachable()}break;case d.Token.MINUS_MINUS:if(i=!0,r=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.PREFIX_DEC)){r=this.compileUnaryOverload(s,e.operand,r,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:r=n.createBinary(p.BinaryOp.SubI32,r,n.createI32(1));break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,r,this.currentType.toNativeOne(n));break;case 3:case 8:r=n.createBinary(p.BinaryOp.SubI64,r,n.createI64(1));break;case 11:r=n.createBinary(p.BinaryOp.SubF32,r,n.createF32(1));break;case 12:r=n.createBinary(p.BinaryOp.SubF64,r,n.createF64(1));break;default:assert(!1),r=n.createUnreachable()}break;case d.Token.EXCLAMATION:if(r=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0,0),this.currentType.is(256))if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.NOT)){r=this.compileUnaryOverload(s,e.operand,r,e);break}r=this.makeIsFalseish(r,this.currentType),this.currentType=m.Type.bool;break;case d.Token.TILDE:if(r=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t.is(8)?m.Type.i64:t,0,0),this.currentType.is(256)){var a,s;if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.BITWISE_NOT)){r=this.compileUnaryOverload(s,e.operand,r,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}switch(r=this.convertExpression(r,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:r=n.createBinary(p.BinaryOp.XorI32,r,n.createI32(-1));break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.XorI64:p.BinaryOp.XorI32,r,this.currentType.toNativeNegOne(n));break;case 3:case 8:r=n.createBinary(p.BinaryOp.XorI64,r,n.createI64(-1,-1));break;default:assert(!1),r=n.createUnreachable()}break;case d.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,r,t!=m.Type.void):r},t.prototype.ensureSmallIntegerWrap=function(e,t){var r=this.module,n=this.currentFunction.flow;switch(t.kind){case 0:n.canOverflow(e,t)&&(e=this.options.hasFeature(1)?r.createUnary(p.UnaryOp.ExtendI8ToI32,e):r.createBinary(p.BinaryOp.ShrI32,r.createBinary(p.BinaryOp.ShlI32,e,r.createI32(24)),r.createI32(24)));break;case 1:n.canOverflow(e,t)&&(e=this.options.hasFeature(1)?r.createUnary(p.UnaryOp.ExtendI16ToI32,e):r.createBinary(p.BinaryOp.ShrI32,r.createBinary(p.BinaryOp.ShlI32,e,r.createI32(16)),r.createI32(16)));break;case 5:n.canOverflow(e,t)&&(e=r.createBinary(p.BinaryOp.AndI32,e,r.createI32(255)));break;case 6:n.canOverflow(e,t)&&(e=r.createBinary(p.BinaryOp.AndI32,e,r.createI32(65535)));break;case 10:n.canOverflow(e,t)&&(e=r.createBinary(p.BinaryOp.NeI32,e,r.createI32(0)))}return e},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.createUnary(p.UnaryOp.EqzI32,e);case 3:case 8:return r.createUnary(p.UnaryOp.EqzI64,e);case 9:case 4:return r.createUnary(64==t.size?p.UnaryOp.EqzI64:p.UnaryOp.EqzI32,e);case 11:return r.createBinary(p.BinaryOp.EqF32,e,r.createF32(0));case 12:return r.createBinary(p.BinaryOp.EqF64,e,r.createF64(0));default:return assert(!1),r.createI32(1)}},t.prototype.makeIsTrueish=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 e;case 3:case 8:return r.createBinary(p.BinaryOp.NeI64,e,r.createI64(0));case 9:case 4:return 64==t.size?r.createBinary(p.BinaryOp.NeI64,e,r.createI64(0)):e;case 11:return r.createBinary(p.BinaryOp.NeF32,e,r.createF32(0));case 12:return r.createBinary(p.BinaryOp.NeF64,e,r.createF64(0));default:return assert(!1),r.createI32(0)}},t.prototype.makeAllocate=function(e,t){var r,n,i=this.module,s=this.currentFunction,o=this.options.nativeSizeType,l=s.getTempLocal(e.type,!1),p=new Array;if(p.push(i.createSetLocal(l.index,c.compileAllocate(this,e,t))),e.members)try{for(var d=a(e.members.values()),_=d.next();!_.done;_=d.next()){var m=_.value;if(m.kind==h.ElementKind.FIELD){var g=m,y=g.type,f=y.toNativeType(),E=g.prototype.declaration;if(assert(!g.isAny(u.CommonFlags.CONST)),E.initializer)p.push(i.createStore(y.byteSize,i.createGetLocal(l.index,o),this.compileExpression(E.initializer,y,1,0),f,g.memoryOffset));else{var T=g.prototype.declaration.parameterIndex;p.push(i.createStore(y.byteSize,i.createGetLocal(l.index,o),T>=0?i.createGetLocal(1+T,f):y.toNativeZero(i),f,g.memoryOffset))}}}}catch(e){r={error:e}}finally{try{_&&!_.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return p.push(i.createGetLocal(l.index,o)),s.freeTempLocal(l),this.currentType=e.type,i.createBlock(null,p,o)},t.prototype.makeConditionalAllocate=function(e,t){var r=this.module,n=this.options.nativeSizeType;return this.currentType=e.type,r.createIf(2==n?r.createBinary(p.BinaryOp.NeI64,r.createGetLocal(0,2),r.createI64(0)):r.createGetLocal(0,1),r.createGetLocal(0,n),r.createTeeLocal(0,this.makeAllocate(e,t)))},t.prototype.addDebugLocation=function(e,t){var r=this.currentFunction,n=t.source;n.debugInfoIndex<0&&(n.debugInfoIndex=this.module.addDebugInfoFile(n.normalizedPath)),t.debugInfoRef=e,r.debugLocations.push(t)},t}(l.DiagnosticEmitter);function I(e,t){if(f=t.range.source.simplePath,E=t.programLevelInternalName,e.hasDecorator(h.DecoratorFlags.EXTERNAL)){var r=e.program,n=assert(_.findDecorator(_.DecoratorKind.EXTERNAL,t.decorators)),i=n.arguments;if(i&&i.length){var a=i[0];a.kind==_.NodeKind.LITERAL&&a.literalKind==_.LiteralKind.STRING?(E=a.value,i.length>=2&&((a=i[1]).kind==_.NodeKind.LITERAL&&a.literalKind==_.LiteralKind.STRING?(f=E,E=a.value,i.length>2&&r.error(l.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,"2",i.length.toString())):r.error(l.DiagnosticCode.String_literal_expected,a.range))):r.error(l.DiagnosticCode.String_literal_expected,a.range)}else r.error(l.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,n.range,"1","0")}}t.Compiler=T},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.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.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.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.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._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.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.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"}(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"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 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 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 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 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 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 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.";default:return""}}},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(1),l=r(4),p=r(3),u=r(7),h=r(0),d=r(2),_=r(6);!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){if(void 0===t&&(t=null),void 0===r&&(r=o.REPORT),e.kind==p.NodeKind.SIGNATURE){var n=this.resolveSignature(e,t,r);return n?e.isNullable?n.type.asNullable():n.type:null}assert(e.kind==p.NodeKind.TYPE);var i=e,a=i.name.text,s=a,_=i.range.source.internalPath+h.PATH_DELIMITER+a,m=this.program.elementsLookup,g=void 0;if((g=m.get(_))||(g=m.get(s)))switch(g.kind){case l.ElementKind.ENUM:return null!==i.typeArguments&&i.typeArguments.length?(r==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,e.range,g.internalName),null):u.Type.i32;case l.ElementKind.CLASS_PROTOTYPE:var y=this.resolveClassInclTypeArguments(g,i.typeArguments,d.makeMap(t),e);return y?e.isNullable?y.type.asNullable():y.type:null}var f=this.program.typeAliases.get(a);if(f)return this.resolveType(f.type,t,r);var E=i.typeArguments,T=null;if(E){var I=E.length;T=new Array(I);for(var v=0;v",s+="<"+C+">")}else if(t){var N=t.get(s);if(N)return N}}var O=this.program.typesLookup,S=void 0;if((S=O.get(_))||(S=O.get(s)))return S;if("NATIVE"==a){if(!T||1!=T.length)return r==o.REPORT&&this.error(c.DiagnosticCode.Expected_0_type_arguments_but_got_1,i.range,"1",(E?E.length:1).toString(10)),null;switch(T[0].kind){case 0:case 1:case 2:return u.Type.i32;case 4:if(!this.program.options.isWasm64)return u.Type.i32;case 3:return u.Type.i64;case 5:case 6:case 7:case 10:return u.Type.u32;case 9:if(!this.program.options.isWasm64)return u.Type.u32;case 8:return u.Type.u64;case 11:return u.Type.f32;case 12:return u.Type.f64;case 13:return u.Type.void;default:assert(!1)}}return r==o.REPORT&&this.error(c.DiagnosticCode.Cannot_find_name_0,i.name.range,s),null},t.prototype.resolveSignature=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=o.REPORT);var n=e.explicitThisType,i=null;if(n&&!(i=this.resolveType(n,t,r)))return null;for(var a=e.parameters,s=a.length,c=new Array(s),l=new Array(s),h=0,d=!1,_=0;_s)return this.error(c.DiagnosticCode.Expected_0_type_arguments_but_got_1,u?p.Range.join(t[0].range,t[u-1].range):assert(n).range.atEnd,(u");var w=new l.Function(e,P,U,A||f,r);return _||e.instances.set(a,_=new Map),_.set(s,w),this.program.instancesLookup.set(P,w),w},t.prototype.resolveFunctionPartially=function(e,t,r){void 0===r&&(r=o.REPORT),assert(e.is(h.CommonFlags.INSTANCE));var n=assert(e.classPrototype);if(!t||!t.length)return e;var i=e.simpleName,a=u.typesToString(t),s=new l.FunctionPrototype(this.program,i,n.internalName+"<"+a+">"+h.INSTANCE_DELIMITER+i,e.declaration,n,e.decoratorFlags);return s.flags=e.flags,s.operatorKind=e.operatorKind,s.classTypeArguments=t,s.instances=e.instances,s},t.prototype.resolveFunctionInclTypeArguments=function(e,t,r,n,i){void 0===i&&(i=o.REPORT);var a=null;if(e.is(h.CommonFlags.GENERIC)){if(e.classTypeArguments&&e.applyClassTypeArguments(r),!(a=this.resolveTypeArguments(assert(e.declaration.typeParameters),t,r,n,i)))return null}else if(null!==t&&t.length)return i==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,n.range,e.internalName),null;return this.resolveFunction(e,a,r,i)},t.prototype.resolveClass=function(e,t,r,n){var i,_,m,g,y,f;void 0===r&&(r=d.makeMap()),void 0===n&&(n=o.REPORT);var E=t?u.typesToString(t):"",T=e.instances.get(E);if(T)return T;var I=e.declaration;if(t){var v=I.typeParameters,A=v.length,C=t.length;assert(C==A);for(var N=0;N",k+="<"+E+">"),(T=new l.Class(e,L,k,t,O)).contextualTypeArguments=r,e.instances.set(E,T),this.program.instancesLookup.set(k,T);var b=0;if(O){if(O.members){T.members||(T.members=new Map);try{for(var R=a(O.members.values()),x=R.next();!x.done;x=R.next()){var F=x.value;T.members.set(F.simpleName,F)}}catch(e){i={error:e}}finally{try{x&&!x.done&&(_=R.return)&&_.call(R)}finally{if(i)throw i.error}}}b=O.currentMemoryOffset}var D=e.constructorPrototype;if(D){var B=this.resolveFunctionPartially(D,t,n);if(!B)return null;T.constructorInstance=this.resolveFunction(B,null,d.makeMap(),n)}if(e.instanceMembers)try{for(var U=a(e.instanceMembers.values()),P=U.next();!P.done;P=U.next()){var w=P.value;switch(w.kind){case l.ElementKind.FIELD_PROTOTYPE:T.members||(T.members=new Map);var M=w.declaration,G=null;if(M.type)G=this.resolveType(M.type,T.contextualTypeArguments,n);else{if(null!==O&&null!==O.members){var K=O.members.get(w.simpleName);K&&!K.is(h.CommonFlags.PRIVATE)&&(assert(K.kind==l.ElementKind.FIELD),G=K.type)}G||n==o.REPORT&&this.error(c.DiagnosticCode.Type_expected,M.name.range.atEnd)}if(!G)break;var z=new l.Field(w,k+h.INSTANCE_DELIMITER+w.simpleName,G,M,T);switch(G.byteSize){case 1:break;case 2:1&b&&++b;break;case 4:3&b&&(b=1+(3|b));break;case 8:7&b&&(b=1+(7|b));break;default:assert(!1)}z.memoryOffset=b,b+=G.byteSize,T.members.set(w.simpleName,z);break;case l.ElementKind.FUNCTION_PROTOTYPE:T.members||(T.members=new Map);var V=this.resolveFunctionPartially(w,t,n);if(!V)return null;V.internalName=k+h.INSTANCE_DELIMITER+V.simpleName,T.members.set(w.simpleName,V);break;case l.ElementKind.PROPERTY:T.members||(T.members=new Map);var H=assert(w.getterPrototype),X=w.setterPrototype,W=new l.Property(this.program,w.simpleName,k+h.INSTANCE_DELIMITER+w.simpleName,e),Y=this.resolveFunctionPartially(H,t,n);if(!Y)return null;if(Y.internalName=k+h.INSTANCE_DELIMITER+Y.simpleName,W.getterPrototype=Y,X){var Q=this.resolveFunctionPartially(X,t,n);if(!Q)return null;Q.internalName=k+h.INSTANCE_DELIMITER+Q.simpleName,W.setterPrototype=Q}T.members.set(w.simpleName,W);break;default:assert(!1)}}}catch(e){m={error:e}}finally{try{P&&!P.done&&(g=U.return)&&g.call(U)}finally{if(m)throw m.error}}T.currentMemoryOffset=b;try{for(var q=a(e.overloadPrototypes),j=q.next();!j.done;j=q.next()){var Z=s(j.value,2),J=Z[0],$=Z[1];assert(J!=l.OperatorKind.INVALID);var ee=void 0;if($.is(h.CommonFlags.INSTANCE)){var te=this.resolveFunctionPartially($,t,n);if(!te)continue;ee=this.resolveFunction(te,null,d.makeMap(),n)}else ee=this.resolveFunction($,null,d.makeMap(),n);if(ee){var re=T.overloads;re||(T.overloads=re=new Map),re.set(J,ee)}}}catch(e){y={error:e}}finally{try{j&&!j.done&&(f=q.return)&&f.call(q)}finally{if(y)throw y.error}}return T},t.prototype.resolveClassInclTypeArguments=function(e,t,r,n,i){void 0===i&&(i=o.REPORT);var a=null;if(e.is(h.CommonFlags.GENERIC)){if(!(a=this.resolveTypeArguments(assert(e.declaration.typeParameters),t,r,n,i)))return null}else if(null!==t&&t.length)return i==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,n.range,e.internalName),null;return this.resolveClass(e,a,r,i)},t}(c.DiagnosticEmitter);t.Resolver=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),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 1:return void this.push(n.getConstValueI32(e).toString(10));case 2:return void this.push(i64_to_string(i64_new(n.getConstValueI64Low(e),n.getConstValueI64High(e))));case 3:return void this.push(n.getConstValueF32(e).toString(10));case 4: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.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.AtomicWake:}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 0:return"void";case 1:return"i32";case 2:return"i64";case 3:return"f32";case 4:return"f64";case 5:throw new Error("unreachable type");case-1: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(4),l=r(2),p=function(){function e(e,t){void 0===t&&(t=!1),this.todo=[],this.seen=new Set,this.program=e,this.includePrivate}return e.prototype.walk=function(){var e,t;try{for(var r=a(this.program.moduleLevelExports.values()),n=r.next();!n.done;n=r.next()){var i=n.value;this.visitElement(i.element)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}for(var s=this.todo;0"),null}if(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;_=!0}n=p.Node.createType(h,d,_,e.range(a,e.pos))}for(;e.skip(o.Token.OPENBRACKET);){var g=e.tokenPos;if(!e.skip(o.Token.CLOSEBRACKET))return r||this.error(c.DiagnosticCode._0_expected,e.range(),"]"),null;var y=e.range(g,e.pos);_=!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;_=!0}if(n=p.Node.createType(p.Node.createIdentifierExpression("Array",y),[n],_,e.range(a,e.pos)),_)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=p.ParameterKind.DEFAULT;if(e.skip(o.Token.DOT_DOT_DOT)&&(s=!0,e.discard(r),l=p.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 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(r),this.tryParseSignatureIsSignature=s,null;var h=p.Node.createIdentifierExpression(e.readIdentifier(),e.range(e.tokenPos,e.pos));if(e.skip(o.Token.QUESTION)&&(s=!0,e.discard(r),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(r);var d=this.parseType(e);if(!d)return this.tryParseSignatureIsSignature=s,null;var _=new p.ParameterNode;_.parameterKind=l,_.name=h,_.type=d,i?i.push(_):i=[_]}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,p.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=p.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=p.Node.createPropertyAccessExpression(n,p.Node.createIdentifierExpression(r,e.range()),e.range(t,e.pos))}var i=void 0;if(!e.skip(o.Token.OPENPAREN))return p.Node.createDecorator(n,null,e.range(t,e.pos));if(i=this.parseArguments(e))return p.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=p.Node.createVariableStatement(i,r,t,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=p.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 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,r,i,u)},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=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,r,t,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),u},t.prototype.parseEnumValue=function(e,t){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var r=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),n=null;return e.skip(o.Token.EQUALS)&&!(n=this.parseExpression(e,2))?null:p.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=p.Node.createReturnStatement(t,e.range());return e.skip(o.Token.SEMICOLON),r},t.prototype.parseTypeParameters=function(e){for(var t=new Array,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.push(n),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.GREATERTHAN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),">"),null}}return 0===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=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),r=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;r=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(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==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)?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 p.ParameterKind.OPTIONAL:i=!0;break;case p.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 u=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),h=null;if((n=e.skip(o.Token.QUESTION))&&r&&this.error(c.DiagnosticCode.A_rest_parameter_cannot_be_optional,u.range),e.skip(o.Token.COLON)){if(!(h=this.parseType(e)))return null}else h=p.Node.createOmittedType(e.range(e.pos));var d=null;if(e.skip(o.Token.EQUALS)&&(r&&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,!(d=this.parseExpression(e,2))))return null;var _=p.Node.createParameter(u,h,d,r?p.ParameterKind.REST:n?p.ParameterKind.OPTIONAL:p.ParameterKind.DEFAULT,o.Range.join(i,e.range()));return _.flags|=s,_}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=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;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 u=this.parseParameters(e);if(!u)return null;var h=this.parseParametersThis,d=0!=(t&a.CommonFlags.SET);d&&(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)),t&a.CommonFlags.GET&&u.length&&this.error(c.DiagnosticCode.A_get_accessor_cannot_have_parameters,i.range);var _=null;if(e.skip(o.Token.COLON)&&!(_=this.parseType(e,!0,d)))return null;_||(_=p.Node.createOmittedType(e.range(e.pos)),d||this.error(c.DiagnosticCode.Type_expected,_.range));var m=p.Node.createSignature(u,_,h,!1,e.range(s,e.pos)),g=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()),!(g=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 y=p.Node.createFunctionDeclaration(i,l,m,g,r,t,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),y},t.prototype.parseFunctionExpression=function(e){var t,r=e.tokenPos,n=!1;if(e.token==o.Token.FUNCTION){if(t=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=!0,assert(e.token==o.Token.OPENPAREN),t=p.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(e.skip(o.Token.COLON)){if(!(l=this.parseType(e)))return null}else l=p.Node.createOmittedType(e.range(e.pos)),this.error(c.DiagnosticCode.Type_expected,l.range);if(n&&!e.skip(o.Token.EQUALS_GREATERTHAN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"=>"),null;var u,h=p.Node.createSignature(r,l,null,!1,e.range(s,e.pos));if(n)u=this.parseStatement(e,!1);else{if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"{"),null;u=this.parseBlockStatement(e,!1)}if(!u)return null;var d=p.Node.createFunctionDeclaration(t,null,h,u,null,n?a.CommonFlags.ARROW:a.CommonFlags.NONE,e.range(i,e.pos));return p.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,l=p.Node.createIdentifierExpression(e.readIdentifier(),e.range());if(e.skip(o.Token.LESSTHAN)){if(!(s=this.parseTypeParameters(e)))return null;t|=a.CommonFlags.GENERIC}else s=[];var u=null;if(e.skip(o.Token.EXTENDS)){var h=this.parseType(e);if(!h)return null;if(h.kind!=p.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,h.range),null;u=h}var d=null;if(e.skip(o.Token.IMPLEMENTS)){i&&this.error(c.DiagnosticCode.Interface_declaration_cannot_have_implements_clause,e.range());do{var _=this.parseType(e);if(!_)return null;i||(d||(d=[]),d.push(_))}while(e.skip(o.Token.COMMA))}if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(),"{"),null;var m,g=new Array;if(i?(assert(!d),m=p.Node.createInterfaceDeclaration(l,s,u,g,r,t,e.range(n,e.pos))):m=p.Node.createClassDeclaration(l,s,u,d,g,r,t,e.range(n,e.pos)),!e.skip(o.Token.CLOSEBRACE))do{var y=this.parseClassMember(e,m);if(!y)return null;y.parent=m,g.push(y)}while(!e.skip(o.Token.CLOSEBRACE));return m},t.prototype.parseClassExpression=function(e){var t,r=e.tokenPos;if(t=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(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)return null;s.parent=i,n.push(s)}while(!e.skip(o.Token.CLOSEBRACE));return p.Node.createClassExpression(i)},t.prototype.parseClassMember=function(e,t){var r=e.pos,n=t.kind==p.NodeKind.INTERFACEDECLARATION,i=new Array;if(e.skip(o.Token.AT)){do{var s=this.parseDecorator(e);if(!s)break;i.push(s)}while(e.skip(o.Token.AT));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 u=0,h=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,h=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,h=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,h=e.pos);var d=0,_=0,m=0,g=0;e.skip(o.Token.STATIC)?(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"static"),l|=a.CommonFlags.STATIC,d=e.tokenPos,_=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,m=e.tokenPos,g=e.pos),t.flags&a.CommonFlags.GENERIC&&(l|=a.CommonFlags.GENERIC_CONTEXT));var y=0,f=0;e.skip(o.Token.READONLY)&&(l|=a.CommonFlags.READONLY,y=e.tokenPos,f=e.pos);var E,T=e.mark(),I=!1,v=!1,A=!1,C=0,N=0;if(n||(e.skip(o.Token.GET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(T):(l|=a.CommonFlags.GET,v=!0,C=e.tokenPos,N=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,f),"readonly")):e.skip(o.Token.SET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(T):(l|=a.CommonFlags.SET,A=!0,C=e.tokenPos,N=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,f),"readonly")):e.skip(o.Token.CONSTRUCTOR)&&(I=!0,(l|=a.CommonFlags.CONSTRUCTOR)&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(d,_),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(m,g),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,f),"readonly"))),I)E=p.Node.createConstructorExpression(e.range());else{if(!v&&!A&&e.skip(o.Token.OPENBRACKET)){l&a.CommonFlags.PUBLIC?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,h),"public"):l&a.CommonFlags.PROTECTED?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,h),"protected"):l&a.CommonFlags.PRIVATE&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,h),"protected"),l&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(d,_),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(m,g),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,f),"readonly");var O=this.parseIndexSignatureDeclaration(e,i);return O?(e.skip(o.Token.SEMICOLON),O):null}if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;E=p.Node.createIdentifierExpression(e.readIdentifier(),e.range())}var S=null;if(e.skip(o.Token.LESSTHAN)){var L=e.tokenPos;if(!(S=this.parseTypeParameters(e)))return null;I?this.error(c.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration,e.range(L,e.pos)):v||A?this.error(c.DiagnosticCode.An_accessor_cannot_have_type_parameters,e.range(L,e.pos)):l|=a.CommonFlags.GENERIC}if(e.skip(o.Token.OPENPAREN)){var k=e.tokenPos,b=this.parseParameters(e,I);if(!b)return null;var R=this.parseParametersThis;if(I)for(var x=0,F=b.length;x"),null):null;case o.Token.IDENTIFIER:return p.Node.createIdentifierExpression(e.readIdentifier(),e.range(r,e.pos));case o.Token.THIS:return p.Node.createThisExpression(e.range(r,e.pos));case o.Token.CONSTRUCTOR:return p.Node.createConstructorExpression(e.range(r,e.pos));case o.Token.SUPER:return p.Node.createSuperExpression(e.range(r,e.pos));case o.Token.STRINGLITERAL:return p.Node.createStringLiteralExpression(e.readString(),e.range(r,e.pos));case o.Token.INTEGERLITERAL:return p.Node.createIntegerLiteralExpression(e.readInteger(),e.range(r,e.pos));case o.Token.FLOATLITERAL:return p.Node.createFloatLiteralExpression(e.readFloat(),e.range(r,e.pos));case o.Token.SLASH:var E=e.readRegexpPattern();return e.skip(o.Token.SLASH)?p.Node.createRegexpLiteralExpression(E,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=new Array;do{if(e.peek()===o.Token.GREATERTHAN)break;var n=this.parseType(e,!0,!0);if(!n)return e.reset(t),null;r.push(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=h(n=e.peek()))>=t;){switch(e.next(),n){case o.Token.AS:var l=this.parseType(e);if(!l)return null;r=p.Node.createAssertionExpression(p.AssertionKind.AS,r,l,e.range(a,e.pos));break;case o.Token.INSTANCEOF:var u=this.parseType(e);if(!u)return null;r=p.Node.createInstanceOfExpression(r,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;r=p.Node.createElementAccessExpression(r,s,e.range(a,e.pos));break;case o.Token.PLUS_PLUS:case o.Token.MINUS_MINUS:r.kind!=p.NodeKind.IDENTIFIER&&r.kind!=p.NodeKind.ELEMENTACCESS&&r.kind!=p.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=p.Node.createUnaryPostfixExpression(n,r,e.range(a,e.pos));break;case o.Token.QUESTION:var _=this.parseExpression(e);if(!_)return null;if(!e.skip(o.Token.COLON))return this.error(c.DiagnosticCode._0_expected,e.range(),":"),null;var m=this.parseExpression(e,t>1?2:1);if(!m)return null;r=p.Node.createTernaryExpression(r,_,m,e.range(a,e.pos));break;case o.Token.COMMA:var g=[r];do{if(!(r=this.parseExpression(e,2)))return null;g.push(r)}while(e.skip(o.Token.COMMA));r=p.Node.createCommaExpression(g,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,d(n)?i:i+1)))return null;if(s.kind==p.NodeKind.IDENTIFIER)r=p.Node.createPropertyAccessExpression(r,s,e.range(a,e.pos));else{if(s.kind!=p.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,d(n)?i:i+1)))return null;r=p.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 p.NodeKind.IDENTIFIER:n.expression=p.Node.createPropertyAccessExpression(r,i,e.range(t,e.pos));break;case p.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(p.nodeIsCallable(t.kind))for(var r=null;e.skip(o.Token.OPENPAREN)||p.nodeIsGenericCallable(t.kind)&&null!==(r=this.tryParseTypeArgumentsBeforeArguments(e));){var n=this.parseArguments(e);if(!n)break;t=p.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()}}},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 h(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:return 20}return 0}function d(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=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"}(t.Precedence||(t.Precedence={}))},function(e,t,r){r(16),e.exports=r(29)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(17),r(19),r(20),r(21);var n=r(5);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(18);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=0;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.isReference=function(e){return"object"==typeof e||"string"==typeof e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isArray=Array.isArray,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,t.JSMath.signbit=function(e){return r[0]=e,Boolean(n[1]>>>31&e==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)]}}).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(22);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?f:y;if(t){if(e<0)return f;if(e>=_)return A}else{if(e<=-m)return C;if(e+1>=m)return v}return e<0?c(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=o,n.fromNumber=c,n.fromBits=l;var p=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return y;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=c(p(r,8)),a=y,s=0;s>>0:this.low},N.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},N.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}},N.getHighBits=function(){return this.high},N.getHighBitsUnsigned=function(){return this.high>>>0},N.getLowBits=function(){return this.low},N.getLowBitsUnsigned=function(){return this.low>>>0},N.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},N.isOdd=function(){return 1==(1&this.low)},N.isEven=function(){return 0==(1&this.low)},N.equals=function(e){return i(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},N.eq=N.equals,N.notEquals=function(e){return!this.eq(e)},N.neq=N.notEquals,N.ne=N.notEquals,N.lessThan=function(e){return this.comp(e)<0},N.lt=N.lessThan,N.lessThanOrEqual=function(e){return this.comp(e)<=0},N.lte=N.lessThanOrEqual,N.le=N.lessThanOrEqual,N.greaterThan=function(e){return this.comp(e)>0},N.gt=N.greaterThan,N.greaterThanOrEqual=function(e){return this.comp(e)>=0},N.gte=N.greaterThanOrEqual,N.ge=N.greaterThanOrEqual,N.compare=function(e){if(i(e)||(e=h(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},N.comp=N.compare,N.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(E)},N.neg=N.negate,N.add=function(e){i(e)||(e=h(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,p=0,u=0,d=0,_=0;return d+=(_+=a+(65535&e.low))>>>16,u+=(d+=n+c)>>>16,p+=(u+=r+o)>>>16,p+=t+s,l((d&=65535)<<16|(_&=65535),(p&=65535)<<16|(u&=65535),this.unsigned)},N.subtract=function(e){return i(e)||(e=h(e)),this.add(e.neg())},N.sub=N.subtract,N.multiply=function(e){if(this.isZero())return y;if(i(e)||(e=h(e)),r)return l(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(C))return e.isOdd()?C:y;if(e.eq(C))return this.isOdd()?C:y;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(g)&&e.lt(g))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,p=65535&e.high,u=e.low>>>16,d=65535&e.low,_=0,m=0,f=0,E=0;return f+=(E+=s*d)>>>16,m+=(f+=a*d)>>>16,f&=65535,m+=(f+=s*u)>>>16,_+=(m+=n*d)>>>16,m&=65535,_+=(m+=a*u)>>>16,m&=65535,_+=(m+=s*p)>>>16,_+=t*d+n*u+a*p+s*o,l((f&=65535)<<16|(E&=65535),(_&=65535)<<16|(m&=65535),this.unsigned)},N.mul=N.multiply,N.divide=function(e){if(i(e)||(e=h(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?f:y;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return f;if(e.gt(this.shru(1)))return T;a=f}else{if(this.eq(C))return e.eq(E)||e.eq(I)?C:e.eq(C)?E:(t=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?E:I:(n=this.sub(e.mul(t)),a=t.add(n.div(e)));if(e.eq(C))return this.unsigned?f:y;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=y}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:p(2,s-48),u=c(t),d=u.mul(e);d.isNegative()||d.gt(n);)d=(u=c(t-=o,this.unsigned)).mul(e);u.isZero()&&(u=E),a=a.add(u),n=n.sub(d)}return a},N.div=N.divide,N.modulo=function(e){return i(e)||(e=h(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))},N.mod=N.modulo,N.rem=N.modulo,N.not=function(){return l(~this.low,~this.high,this.unsigned)},N.and=function(e){return i(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},N.or=function(e){return i(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},N.xor=function(e){return i(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},N.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)},N.shr=N.shiftRight,N.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)},N.shru=N.shiftRightUnsigned,N.shr_u=N.shiftRightUnsigned,N.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},N.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},N.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},N.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]},N.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";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=r(1),a=r(3),s=r(7),o=r(5),c=r(4),l=r(11),p=r(0);function u(e,t,r,n,p,u){var g,y,f,E,T=e.module;switch(t.internalName){case"isInteger":var I=d(e,r,n,u);return e.currentType=s.Type.bool,I?I.is(4)&&!I.is(256)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isFloat":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?I.is(8)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isSigned":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?I.is(1)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isReference":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?(e.currentType=s.Type.bool,I.is(256)?T.createI32(1):T.createI32(0)):T.createUnreachable();case"isString":I=d(e,r,n,u);if(e.currentType=s.Type.bool,!I)return T.createUnreachable();if(B=I.classReference){var v=e.program.stringInstance;if(v&&B.isAssignableTo(v))return T.createI32(1)}return T.createI32(0);case"isArray":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?null!==(B=I.classReference)&&null!==B.lookupOverload(c.OperatorKind.INDEXED_GET)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isDefined":if(e.currentType=s.Type.bool,r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),1!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();var A=e.resolver.resolveExpression(n[0],e.currentFunction,s.Type.void,l.ReportMode.SWALLOW);return T.createI32(A?1:0);case"isConstant":if(e.currentType=s.Type.bool,r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),1!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();var C=e.compileExpressionRetainType(n[0],s.Type.i32,0);return e.currentType=s.Type.bool,T.createI32(o.getExpressionId(C)==o.ExpressionId.Const?1:0);case"isManaged":if(!e.program.hasGC)return e.currentType=s.Type.bool,T.createI32(0);I=d(e,r,n,u);return e.currentType=s.Type.bool,I?null===(B=I.classReference)||B.hasDecorator(c.DecoratorFlags.UNMANAGED)?T.createI32(0):T.createI32(1):T.createUnreachable();case"clz":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpression(n[0],s.Type.i32,0,1);switch(e.currentType.kind){case 0:case 1:case 5:case 6:E=T.createUnary(o.UnaryOp.ClzI32,g);break;case 10:case 2:case 7:E=T.createUnary(o.UnaryOp.ClzI32,g);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}case 4:E=T.createUnary(e.options.isWasm64?o.UnaryOp.ClzI64:o.UnaryOp.ClzI32,g);break;case 3:case 8:E=T.createUnary(o.UnaryOp.ClzI64,g);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"ctz":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],0,1)}else g=e.compileExpression(n[0],s.Type.i32,0,1);switch(e.currentType.kind){case 0:case 1:case 5:case 6:E=T.createUnary(o.UnaryOp.CtzI32,g);break;case 10:case 2:case 7:E=T.createUnary(o.UnaryOp.CtzI32,g);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}case 4:E=T.createUnary(e.options.isWasm64?o.UnaryOp.CtzI64:o.UnaryOp.CtzI32,g);break;case 3:case 8:E=T.createUnary(o.UnaryOp.CtzI64,g);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"popcnt":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpression(n[0],s.Type.i32,0,1);switch(e.currentType.kind){case 0:case 1:case 5:case 6:E=T.createUnary(o.UnaryOp.PopcntI32,g);break;case 10:case 2:case 7:E=T.createUnary(o.UnaryOp.PopcntI32,g);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}case 4:E=T.createUnary(e.options.isWasm64?o.UnaryOp.PopcntI64:o.UnaryOp.PopcntI32,g);break;case 3:case 8:E=T.createUnary(o.UnaryOp.PopcntI64,g);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"rotl":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpression(n[0],s.Type.i32,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,0),e.currentType.kind){case 0:case 1:case 5:case 6:case 10:E=e.ensureSmallIntegerWrap(T.createBinary(o.BinaryOp.RotlI32,g,y),e.currentType);case 2:case 7:E=T.createBinary(o.BinaryOp.RotlI32,g,y);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}case 4:E=T.createBinary(e.options.isWasm64?o.BinaryOp.RotlI64:o.BinaryOp.RotlI32,g,y);break;case 3:case 8:E=T.createBinary(o.BinaryOp.RotlI64,g,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"rotr":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpression(n[0],s.Type.i32,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,0),e.currentType.kind){case 0:case 1:case 5:case 6:case 10:E=e.ensureSmallIntegerWrap(T.createBinary(o.BinaryOp.RotrI32,g,y),e.currentType);break;case 2:case 7:E=T.createBinary(o.BinaryOp.RotrI32,g,y);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}case 4:E=T.createBinary(e.options.isWasm64?o.BinaryOp.RotrI64:o.BinaryOp.RotrI32,g,y);break;case 3:case 8:E=T.createBinary(o.BinaryOp.RotrI64,g,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"abs":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpression(n[0],s.Type.f64,0,1);switch(e.currentType.kind){case 0:case 1:case 2:var N=(k=e.currentFunction).getTempLocal(s.Type.i32,!1),O=k.getAndFreeTempLocal(s.Type.i32,!1).index,S=N.index;E=T.createBinary(o.BinaryOp.XorI32,T.createBinary(o.BinaryOp.AddI32,T.createTeeLocal(O,T.createBinary(o.BinaryOp.ShrI32,T.createTeeLocal(S,g),T.createI32(31))),T.createGetLocal(S,1)),T.createGetLocal(O,1)),k.freeTempLocal(N);break;case 4:var L=e.options,k=e.currentFunction,b=L.isWasm64;N=k.getTempLocal(L.usizeType,!1),O=k.getAndFreeTempLocal(L.usizeType,!1).index,S=N.index;E=T.createBinary(b?o.BinaryOp.XorI64:o.BinaryOp.XorI32,T.createBinary(b?o.BinaryOp.AddI64:o.BinaryOp.AddI32,T.createTeeLocal(O,T.createBinary(b?o.BinaryOp.ShrI64:o.BinaryOp.ShrI32,T.createTeeLocal(S,g),b?T.createI64(63):T.createI32(31))),T.createGetLocal(S,L.nativeSizeType)),T.createGetLocal(O,L.nativeSizeType)),k.freeTempLocal(N);break;case 3:N=(k=e.currentFunction).getTempLocal(s.Type.i64,!1),O=k.getAndFreeTempLocal(s.Type.i64,!1).index,S=N.index;E=T.createBinary(o.BinaryOp.XorI64,T.createBinary(o.BinaryOp.AddI64,T.createTeeLocal(O,T.createBinary(o.BinaryOp.ShrI64,T.createTeeLocal(S,g),T.createI64(63))),T.createGetLocal(S,2)),T.createGetLocal(O,2)),k.freeTempLocal(N);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}case 5:case 6:case 7:case 8:case 10:E=g;break;case 11:E=T.createUnary(o.UnaryOp.AbsF32,g);break;case 12:E=T.createUnary(o.UnaryOp.AbsF64,g);break;case 13:E=T.createUnreachable();break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"max":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpression(n[0],s.Type.f64,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,1),e.currentType.kind){case 0:case 1:case 2:var R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(g,e.currentType));N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtI32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 5:case 6:case 7:case 10:R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(g,e.currentType)),N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtU32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 3:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtI64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 8:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtU64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 4:x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.GtI64:o.BinaryOp.GtI32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.GtU64:o.BinaryOp.GtU32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 11:E=T.createBinary(o.BinaryOp.MaxF32,g,y);break;case 12:E=T.createBinary(o.BinaryOp.MaxF64,g,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"min":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpression(n[0],s.Type.f64,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,1),e.currentType.kind){case 0:case 1:case 2:R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(g,e.currentType)),N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtI32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 5:case 6:case 7:case 10:R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(g,e.currentType)),N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtU32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 3:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtI64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 8:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtU64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 4:x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.LtI64:o.BinaryOp.LtI32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),E=T.createSelect(T.createTeeLocal(x.index,g),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.LtU64:o.BinaryOp.LtU32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 11:E=T.createBinary(o.BinaryOp.MinF32,g,y);break;case 12:E=T.createBinary(o.BinaryOp.MinF64,g,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"ceil":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,0)}else g=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}default:E=g;break;case 11:E=T.createUnary(o.UnaryOp.CeilF32,g);break;case 12:E=T.createUnary(o.UnaryOp.CeilF64,g);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"floor":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,0)}else g=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}default:E=g;break;case 11:E=T.createUnary(o.UnaryOp.FloorF32,g);break;case 12:E=T.createUnary(o.UnaryOp.FloorF64,g);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"copysign":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,0)}else g=e.compileExpression(n[0],s.Type.f64,0,0);switch(y=e.compileExpression(n[1],e.currentType,1,0),e.currentType.kind){case 11:E=T.createBinary(o.BinaryOp.CopysignF32,g,y);break;case 12:E=T.createBinary(o.BinaryOp.CopysignF64,g,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"nearest":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,0)}else g=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}default:E=g;break;case 11:E=T.createUnary(o.UnaryOp.NearestF32,g);break;case 12:E=T.createUnary(o.UnaryOp.NearestF64,g);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"reinterpret":if(1!=n.length)return r&&1==r.length||(r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0")),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(!r||1!=r.length)return r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable();switch(r[0].kind){case 2:case 7:g=e.compileExpression(n[0],s.Type.f32,1,0),E=T.createUnary(o.UnaryOp.ReinterpretF32,g);break;case 3:case 8:g=e.compileExpression(n[0],s.Type.f64,1,0),E=T.createUnary(o.UnaryOp.ReinterpretF64,g);break;case 9:if(r[0].is(256))return e.error(i.DiagnosticCode.Operation_not_supported,u.range),e.currentType=r[0],T.createUnreachable();case 4:g=e.compileExpression(n[0],e.options.isWasm64?s.Type.f64:s.Type.f32,1,0),E=T.createUnary(e.options.isWasm64?o.UnaryOp.ReinterpretF64:o.UnaryOp.ReinterpretF32,g);break;case 11:g=e.compileExpression(n[0],s.Type.i32,1,0),E=T.createUnary(o.UnaryOp.ReinterpretI32,g);break;case 12:g=e.compileExpression(n[0],s.Type.i64,1,0),E=T.createUnary(o.UnaryOp.ReinterpretI64,g);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return e.currentType=r[0],E;case"sqrt":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,0)}else g=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 11:E=T.createUnary(o.UnaryOp.SqrtF32,g);break;case 12:E=T.createUnary(o.UnaryOp.SqrtF64,g);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"trunc":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r&&r.length){if(e.currentType=r[0],1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,0)}else g=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable();break}default:E=g;break;case 11:E=T.createUnary(o.UnaryOp.TruncF32,g);break;case 12:E=T.createUnary(o.UnaryOp.TruncF64,g);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"load":return n.length<1||n.length>2?(r&&1==r.length||e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),n.length<1?e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"1",n.length.toString(10)):e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable()):r&&1==r.length?(g=e.compileExpression(n[0],e.options.usizeType,1,0),(U=2==n.length?_(e,n[1]):0)<0?T.createUnreachable():(e.currentType=r[0],T.createLoad(r[0].byteSize,r[0].is(5),g,r[0].is(4)&&p.is(4)&&p.size>r[0].size?(e.currentType=p).toNativeType():(e.currentType=r[0]).toNativeType(),U))):(r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable());case"store":if(e.currentType=s.Type.void,n.length<2||n.length>3)return r&&1==r.length||e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),n.length<2?e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"2",n.length.toString(10)):e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),T.createUnreachable();if(!r||1!=r.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable();g=e.compileExpression(n[0],e.options.usizeType,1,0),y=e.compileExpression(n[1],r[0],r[0].is(4)?0:1,0);I=void 0;return r[0].is(4)&&(!e.currentType.is(4)||e.currentType.size1)return r&&1==r.length||e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(!r||1!=r.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable();var B;if(!(B=r[0].classReference))return e.error(i.DiagnosticCode.Operation_not_supported,u.range),T.createUnreachable();var U=void 0;if(n.length){if(n[0].kind!=a.NodeKind.LITERAL||n[0].literalKind!=a.LiteralKind.STRING)return e.error(i.DiagnosticCode.String_literal_expected,n[0].range),T.createUnreachable();var P=n[0].value,w=B.members?B.members.get(P):null;if(!w||w.kind!=c.ElementKind.FIELD)return e.error(i.DiagnosticCode.Type_0_has_no_property_1,n[0].range,B.internalName,P),T.createUnreachable();U=w.memoryOffset}else U=B.currentMemoryOffset;return e.options.isWasm64?p.is(4)&&p.size<=32?(e.currentType=s.Type.u32,T.createI32(U)):T.createI64(U):p.is(4)&&64==p.size?(e.currentType=s.Type.u64,T.createI64(U)):T.createI32(U);case"select":if(3!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,0)}else g=e.compileExpressionRetainType(n[0],s.Type.i32,0);I=e.currentType;switch(y=e.compileExpression(n[1],I,1,0),f=e.makeIsTrueish(e.compileExpressionRetainType(n[2],s.Type.bool,0),e.currentType),e.currentType=I,e.currentType.kind){case 0:case 1:case 5:case 6:case 10:default:E=T.createSelect(g,y,f);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=T.createUnreachable()}return E;case"unreachable":return 0!=n.length&&e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"0",n.length.toString(10)),r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),T.createUnreachable();case"memory.size":return e.currentType=s.Type.i32,0!=n.length&&e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"0",n.length.toString(10)),r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),T.createHost(o.HostOp.CurrentMemory);case"memory.grow":return e.currentType=s.Type.i32,1!=n.length?(e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"0",n.length.toString(10)),g=T.createUnreachable()):g=e.compileExpression(n[0],s.Type.i32,1,0),r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),T.createHost(o.HostOp.GrowMemory,null,[g]);case"memory.copy":if(r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),3!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),e.currentType=s.Type.void,T.createUnreachable();throw g=e.compileExpression(n[0],e.options.usizeType,1,0),y=e.compileExpression(n[1],e.options.usizeType,1,0),f=e.compileExpression(n[2],e.options.usizeType,1,0),e.currentType=s.Type.void,new Error("not implemented");case"memory.fill":if(r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),3!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),e.currentType=s.Type.void,T.createUnreachable();throw g=e.compileExpression(n[0],e.options.usizeType,1,0),y=e.compileExpression(n[1],s.Type.u32,1,0),f=e.compileExpression(n[2],e.options.usizeType,1,0),e.currentType=s.Type.void,new Error("not implemented");case"changetype":return r&&1==r.length?1!=n.length?(e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),e.currentType=r[0],T.createUnreachable()):(g=e.compileExpressionRetainType(n[0],r[0],0),e.currentType=r[0],e.currentType.size!=r[0].size?(e.error(i.DiagnosticCode.Operation_not_supported,u.range),T.createUnreachable()):g):(r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable());case"assert":if(n.length<1||n.length>2)return r&&(r.length&&(e.currentType=r[0].nonNullableType),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),n.length<1?e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"1",n.length.toString(10)):n.length>2&&e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(r.length&&(e.currentType=r[0].nonNullableType),1!=r.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();g=e.compileExpression(n[0],r[0],1,1)}else g=e.compileExpressionRetainType(n[0],s.Type.bool,1);I=e.currentType;if(e.currentType=I.nonNullableType,e.options.noAssert)return p==s.Type.void?(e.currentType=s.Type.void,T.createNop()):g;var M=m(e,2==n.length?n[1]:null,u);if(e.currentType=I.nonNullableType,p==s.Type.void){switch(e.currentType.kind){default:E=T.createIf(T.createUnary(o.UnaryOp.EqzI32,g),M);break;case 3:case 8:E=T.createIf(T.createUnary(o.UnaryOp.EqzI64,g),M);break;case 4:case 9:E=T.createIf(T.createUnary(e.options.isWasm64?o.UnaryOp.EqzI64:o.UnaryOp.EqzI32,g),M);break;case 11:E=T.createIf(T.createBinary(o.BinaryOp.EqF32,g,T.createF32(0)),M);break;case 12:E=T.createIf(T.createBinary(o.BinaryOp.EqF64,g,T.createF64(0)),M);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=M}e.currentType=s.Type.void}else switch(e.currentType.kind){case 0:case 1:case 5:case 6:case 10:R=e.currentFunction.flow;var G=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(g,e.currentType));E=T.createIf(T.createTeeLocal(G.index,g),T.createGetLocal(G.index,1),M);break;case 2:case 7:default:G=e.currentFunction.getAndFreeTempLocal(s.Type.i32,!1);E=T.createIf(T.createTeeLocal(G.index,g),T.createGetLocal(G.index,1),M);break;case 3:case 8:G=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);E=T.createIf(T.createUnary(o.UnaryOp.EqzI64,T.createTeeLocal(G.index,g)),M,T.createGetLocal(G.index,2));break;case 4:case 9:G=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);E=T.createIf(T.createUnary(e.options.isWasm64?o.UnaryOp.EqzI64:o.UnaryOp.EqzI32,T.createTeeLocal(G.index,g)),M,T.createGetLocal(G.index,e.options.nativeSizeType));break;case 11:G=e.currentFunction.getAndFreeTempLocal(s.Type.f32,!1);E=T.createIf(T.createBinary(o.BinaryOp.EqF32,T.createTeeLocal(G.index,g),T.createF32(0)),M,T.createGetLocal(G.index,3));break;case 12:G=e.currentFunction.getAndFreeTempLocal(s.Type.f64,!1);E=T.createIf(T.createBinary(o.BinaryOp.EqF64,T.createTeeLocal(G.index,g),T.createF64(0)),M,T.createGetLocal(G.index,4));break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),E=M}return E;case"unchecked":return r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),1!=n.length?(e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable()):((R=e.currentFunction.flow).set(4096),E=e.compileExpressionRetainType(n[0],p,0),R.unset(4096),E);case"call_indirect":if(n.length<1)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();var K=void 0;if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();K=r[0]}else K=p;if(g=e.compileExpressionRetainType(n[0],s.Type.u32,0),7!=e.currentType.kind)return e.error(i.DiagnosticCode.Operation_not_supported,n[0].range),T.createUnreachable();for(var z=n.length-1,V=new Array(z),H=new Array(z+1),X=K.toNativeType(),W=new Array(z),Y=0;Y void"),T.createUnreachable())}var ee=function(e,t,r,n,i){switch(t.internalName){case"i32.clz":return h("clz",e,s.Type.i32,r,s.Type.i32,i);case"i64.clz":return h("clz",e,s.Type.i64,r,s.Type.i64,i);case"i32.ctz":return h("ctz",e,s.Type.i32,r,s.Type.i32,i);case"i64.ctz":return h("ctz",e,s.Type.i64,r,s.Type.i64,i);case"i32.popcnt":return h("popcnt",e,s.Type.i32,r,s.Type.i32,i);case"i64.popcnt":return h("popcnt",e,s.Type.i64,r,s.Type.i64,i);case"i32.rotl":return h("rotl",e,s.Type.i32,r,s.Type.i32,i);case"i64.rotl":return h("rotl",e,s.Type.i64,r,s.Type.i64,i);case"i32.rotr":return h("rotr",e,s.Type.i32,r,s.Type.i32,i);case"i64.rotr":return h("rotr",e,s.Type.i64,r,s.Type.i64,i);case"f32.abs":return h("abs",e,s.Type.f32,r,s.Type.f32,i);case"f64.abs":return h("abs",e,s.Type.f64,r,s.Type.f64,i);case"f32.max":return h("max",e,s.Type.f32,r,s.Type.f32,i);case"f64.max":return h("max",e,s.Type.f64,r,s.Type.f64,i);case"f32.min":return h("min",e,s.Type.f32,r,s.Type.f32,i);case"f64.min":return h("min",e,s.Type.f64,r,s.Type.f64,i);case"f32.ceil":return h("ceil",e,s.Type.f32,r,s.Type.f32,i);case"f64.ceil":return h("ceil",e,s.Type.f64,r,s.Type.f64,i);case"f32.floor":return h("floor",e,s.Type.f32,r,s.Type.f32,i);case"f64.floor":return h("floor",e,s.Type.f64,r,s.Type.f64,i);case"f32.copysign":return h("copysign",e,s.Type.f32,r,s.Type.f32,i);case"f64.copysign":return h("copysign",e,s.Type.f64,r,s.Type.f64,i);case"f32.nearest":return h("nearest",e,s.Type.f32,r,s.Type.f32,i);case"f64.nearest":return h("nearest",e,s.Type.f64,r,s.Type.f64,i);case"i32.reinterpret_f32":return h("reinterpret",e,s.Type.i32,r,s.Type.f32,i);case"i64.reinterpret_f64":return h("reinterpret",e,s.Type.i64,r,s.Type.f64,i);case"f32.reinterpret_i32":return h("reinterpret",e,s.Type.f32,r,s.Type.i32,i);case"f64.reinterpret_i64":return h("reinterpret",e,s.Type.f64,r,s.Type.i64,i);case"f32.sqrt":return h("sqrt",e,s.Type.f32,r,s.Type.f32,i);case"f64.sqrt":return h("sqrt",e,s.Type.f64,r,s.Type.f64,i);case"f32.trunc":return h("trunc",e,s.Type.f32,r,s.Type.f32,i);case"f64.trunc":return h("trunc",e,s.Type.f64,r,s.Type.f64,i);case"i32.load8_s":return h("load",e,s.Type.i8,r,s.Type.i32,i);case"i32.load8_u":return h("load",e,s.Type.u8,r,s.Type.u32,i);case"i32.load16_s":return h("load",e,s.Type.i16,r,s.Type.i32,i);case"i32.load16_u":return h("load",e,s.Type.u16,r,s.Type.u32,i);case"i32.load":return h("load",e,s.Type.i32,r,s.Type.i32,i);case"i64.load8_s":return h("load",e,s.Type.i8,r,s.Type.i64,i);case"i64.load8_u":return h("load",e,s.Type.u8,r,s.Type.u64,i);case"i64.load16_s":return h("load",e,s.Type.i16,r,s.Type.i64,i);case"i64.load16_u":return h("load",e,s.Type.u16,r,s.Type.u64,i);case"i64.load32_s":return h("load",e,s.Type.i32,r,s.Type.i64,i);case"i64.load32_u":return h("load",e,s.Type.u32,r,s.Type.u64,i);case"i64.load":return h("load",e,s.Type.i64,r,s.Type.i64,i);case"f32.load":return h("load",e,s.Type.f32,r,s.Type.f32,i);case"f64.load":return h("load",e,s.Type.f64,r,s.Type.f64,i);case"i32.store8":return h("store",e,s.Type.i8,r,s.Type.i32,i);case"i32.store16":return h("store",e,s.Type.i16,r,s.Type.i32,i);case"i32.store":return h("store",e,s.Type.i32,r,s.Type.i32,i);case"i64.store8":return h("store",e,s.Type.i8,r,s.Type.i64,i);case"i64.store16":return h("store",e,s.Type.i16,r,s.Type.i64,i);case"i64.store32":return h("store",e,s.Type.i32,r,s.Type.i64,i);case"i64.store":return h("store",e,s.Type.i64,r,s.Type.i64,i);case"f32.store":return h("store",e,s.Type.f32,r,s.Type.f32,i);case"f64.store":return h("store",e,s.Type.f64,r,s.Type.f64,i)}return 0}(e,t,n,0,u);return ee?(r&&r.length&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),ee):(e.error(i.DiagnosticCode.Operation_not_supported,u.range),T.createUnreachable())}function h(e,t,r,n,i,a){var s=assert(t.program.elementsLookup.get(e));return assert(s.kind==c.ElementKind.FUNCTION_PROTOTYPE),u(t,s,[r],n,i,a)}function d(e,t,r,n){if(0==r.length)return t&&1==t.length?t[0]:(e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.range,"1",t?t.length.toString(10):"0"),null);if(1==r.length){if(t)if(1==t.length)e.compileExpression(r[0],t[0],1,0);else{if(t.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.range,"1",t.length.toString(10)),null;e.compileExpressionRetainType(r[0],s.Type.i32,0)}else e.compileExpressionRetainType(r[0],s.Type.i32,0);return e.currentType}return t&&t.length>1&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.range,"1",t.length.toString(10)),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,"1",r.length.toString(10)),null}function _(e,t){var r,n;return e.options.isWasm64?(r=e.precomputeExpression(t,s.Type.usize64,1,0),(o.getExpressionId(r)!=o.ExpressionId.Const||2!=o.getExpressionType(r)||0!=o.getConstValueI64High(r)||(n=o.getConstValueI64Low(r))<0)&&(e.error(i.DiagnosticCode.Operation_not_supported,t.range),n=-1)):(r=e.precomputeExpression(t,s.Type.usize32,1,0),(o.getExpressionId(r)!=o.ExpressionId.Const||1!=o.getExpressionType(r)||(n=o.getConstValueI32(r))<0)&&(e.error(i.DiagnosticCode.Operation_not_supported,t.range),n=-1)),n}function m(e,t,r){var n=e.program,i=e.module,a=n.typesLookup.get("string");if(!a)return i.createUnreachable();var o=n.abortInstance;if(!o||!e.compileFunction(o))return i.createUnreachable();var c=null!=t?e.compileExpression(t,a,1,0):a.toNativeZero(i),l=e.ensureStaticString(r.range.source.normalizedPath);return e.currentType=s.Type.void,i.createBlock(null,[i.createCall(o.internalName,[c,l,i.createI32(r.range.line),i.createI32(r.range.column)],0),i.createUnreachable()])}function g(e,t){var r,i,a=e.program;assert(t.type.isManaged(a));var l=t.gcHookIndex;if(-1!=l)return l;var u=t.members;if(t.prototype.declaration.range.source.isLibrary&&null!==u&&u.has("__gc")){var h=assert(u.get("__gc"));assert(h.kind==c.ElementKind.FUNCTION_PROTOTYPE);var d=assert(a.resolver.resolveFunction(h,null));assert(d.is(p.CommonFlags.PRIVATE|p.CommonFlags.INSTANCE)),assert(!d.isAny(p.CommonFlags.AMBIENT|p.CommonFlags.VIRTUAL)),assert(0==d.signature.parameterTypes.length),assert(d.signature.returnType==s.Type.void),d.internalName=t.internalName+"~gc",assert(e.compileFunction(d));var _=e.ensureFunctionTableEntry(d);return t.gcHookIndex=_,_}var m=e.module,y=e.options,f=y.nativeSizeType,E=y.usizeType.byteSize,T=new Array;T.push(m.createIf(m.createUnary(y.isWasm64?o.UnaryOp.EqzI64:o.UnaryOp.EqzI32,m.createGetLocal(0,f)),m.createReturn()));var I=e.functionTable,v=I.length;I.push(""),t.gcHookIndex=v;var A=t.base;if(A?(assert(A.type.isManaged(a)),T.push(m.createCallIndirect(m.createI32(g(e,A.type.classReference)),[m.createGetLocal(0,f)],2==f?"Iv":"iv"))):T.push(m.createCall(assert(a.gcMarkInstance).internalName,[m.createGetLocal(0,f)],0)),u)try{for(var C=n(u.values()),N=C.next();!N.done;N=C.next()){var O=N.value;if(O.kind==c.ElementKind.FIELD)if(O.parent===t)if(O.type.isManaged(a)){var S=O.memoryOffset;assert(S>=0),T.push(m.createCall(assert(a.gcMarkInstance).internalName,[m.createLoad(E,!1,m.createGetLocal(0,f),f,S)],0))}}}catch(e){r={error:e}}finally{try{N&&!N.done&&(i=C.return)&&i.call(C)}finally{if(r)throw r.error}}var L=t.internalName+"~gc";return m.addFunction(L,e.ensureFunctionType(null,s.Type.void,y.usizeType),null,m.createBlock(null,T)),I[v]=L,v}t.compileCall=u,t.compileAllocate=function(e,t,r){var n=e.program;assert(t.program==n);var a=e.module,s=e.options;if(n.hasGC&&t.type.isManaged(n)){var o=assert(n.gcAllocateInstance);return e.compileFunction(o)?(e.currentType=t.type,a.createCall(o.internalName,[s.isWasm64?a.createI64(t.currentMemoryOffset):a.createI32(t.currentMemoryOffset),a.createI32(g(e,t))],s.nativeSizeType)):a.createUnreachable()}return(o=n.memoryAllocateInstance)?e.compileFunction(o)?(e.currentType=t.type,a.createCall(o.internalName,[s.isWasm64?a.createI64(t.currentMemoryOffset):a.createI32(t.currentMemoryOffset)],s.nativeSizeType)):a.createUnreachable():(n.error(i.DiagnosticCode.Cannot_find_name_0,r.range,"memory.allocate"),a.createUnreachable())},t.compileAbort=m,t.compileIterateRoots=function(e){var t,r,i=e.module,a=new Array;try{for(var o=n(e.program.elementsLookup.values()),l=o.next();!l.done;l=o.next()){var u=l.value;if(u.kind==c.ElementKind.GLOBAL){var h=u,d=h.type.classReference;if(h.is(p.CommonFlags.COMPILED)&&null!==d&&!d.hasDecorator(c.DecoratorFlags.UNMANAGED))if(h.is(p.CommonFlags.INLINED)){var _=h.constantIntegerValue;a.push(i.createCallIndirect(i.createGetLocal(0,1),[e.options.isWasm64?i.createI64(i64_low(_),i64_high(_)):i.createI32(i64_low(_))],"iv"))}else a.push(i.createCallIndirect(i.createGetLocal(0,1),[i.createGetGlobal(h.internalName,e.options.nativeSizeType)],"iv"))}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}var m=e.ensureFunctionType([s.Type.i32],s.Type.void);i.addFunction("~iterateRoots",m,[],a.length?i.createBlock(null,a):i.createNop())},t.ensureGCHook=g},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>=65&&e<=90||e>=97&&e<=122||36==e||95==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>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36==e||95==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=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||i=0;)if(e.charCodeAt(a)==n){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),i-=r+3-a,r=a-1);break}if(a<0&&r>0&&(2!=r||46!=e.charCodeAt(0)||46!=e.charCodeAt(1))){i=(e=e.substring(r+4)).length;continue}}}r++}return i>0?e:"."}function a(e){for(var t=e.length;--t>0;)if(e.charCodeAt(t)==n)return e.substring(0,t);return"."}t.normalizePath=i,t.resolvePath=function(e,t){return e.startsWith("std/")?e:i(a(t)+String.fromCharCode(n)+e)},t.dirname=a},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)}},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),a=r(12),s=r(13),o=r(1);t.formatDiagnostic=o.formatDiagnosticMessage;var c=r(14);t.parseFile=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=null),n||(n=new c.Parser),n.parseFile(e,t,r),n},t.nextFile=function(e){return e.nextFile()},t.nextDiagnostic=function(e){var t=e.program;return t.diagnosticsOffset0&&!a.isLineBreak(n.charCodeAt(s-1));)s--;for(;o=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==j.ENTRY},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLibrary",{get:function(){return this.sourceKind==j.LIBRARY},enumerable:!0,configurable:!0}),t}(l);t.Source=J;var $=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.decorators=null,t.cachedProgramLevelInternalName=null,t.cachedFileLevelInternalName=null,t}return i(t,e),Object.defineProperty(t.prototype,"programLevelInternalName",{get:function(){return this.cachedProgramLevelInternalName||(this.cachedProgramLevelInternalName=Fe(this,!0)),this.cachedProgramLevelInternalName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fileLevelInternalName",{get:function(){return this.cachedFileLevelInternalName||(this.cachedFileLevelInternalName=Fe(this,!1)),this.cachedFileLevelInternalName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTopLevel",{get:function(){var e=this.parent;return!!e&&(!(e.kind==o.VARIABLE&&!(e=e.parent))&&e.kind==o.SOURCE)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTopLevelExport",{get:function(){var e=this.parent;return!(!e||e.kind==o.VARIABLE&&!(e=e.parent))&&(e.kind==o.NAMESPACEDECLARATION?this.is(a.CommonFlags.EXPORT)&&e.isTopLevelExport:e.kind==o.CLASSDECLARATION?this.is(a.CommonFlags.STATIC)&&e.isTopLevelExport:e.kind==o.SOURCE&&this.is(a.CommonFlags.EXPORT))},enumerable:!0,configurable:!0}),t.prototype.needsExplicitExport=function(e){return e.name.text!=e.externalName.text||this.range.source!=e.range.source||!this.isTopLevelExport},t}(Z);t.DeclarationStatement=$;var ee=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.INDEXSIGNATUREDECLARATION,t}return i(t,e),t}($);t.IndexSignatureDeclaration=ee;var te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}($);t.VariableLikeDeclarationStatement=te;var re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.BLOCK,t}return i(t,e),t}(Z);t.BlockStatement=re;var ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.BREAK,t}return i(t,e),t}(Z);t.BreakStatement=ne;var ie=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}($);t.ClassDeclaration=ie;var ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.CONTINUE,t}return i(t,e),t}(Z);t.ContinueStatement=ae;var se=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.DO,t}return i(t,e),t}(Z);t.DoStatement=se;var oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EMPTY,t}return i(t,e),t}(Z);t.EmptyStatement=oe;var ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.ENUMDECLARATION,t}return i(t,e),t}($);t.EnumDeclaration=ce;var le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.ENUMVALUEDECLARATION,t}return i(t,e),t}($);t.EnumValueDeclaration=le;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 ue=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=ue;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}(Z);t.ExportStatement=he;var de=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EXPRESSION,t}return i(t,e),t}(Z);t.ExpressionStatement=de;var _e=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}(te);t.FieldDeclaration=_e;var ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.FOR,t}return i(t,e),t}(Z);t.ForStatement=ge;var me=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}($);t.FunctionDeclaration=me;var ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IF,t}return i(t,e),t}(Z);t.IfStatement=ye;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}($);t.ImportDeclaration=Ee;var fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IMPORT,t}return i(t,e),t}(Z);t.ImportStatement=fe;var Te=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.INTERFACEDECLARATION,t}return i(t,e),t}(ie);t.InterfaceDeclaration=Te;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}(me);t.MethodDeclaration=Ie;var ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.NAMESPACEDECLARATION,t}return i(t,e),t}($);t.NamespaceDeclaration=ve;var Ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.RETURN,t}return i(t,e),t}(Z);t.ReturnStatement=Ce;var Ae=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=Ae;var Ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.SWITCH,t}return i(t,e),t}(Z);t.SwitchStatement=Ne;var Se=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.THROW,t}return i(t,e),t}(Z);t.ThrowStatement=Se;var Oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.TRY,t}return i(t,e),t}(Z);t.TryStatement=Oe;var Le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.TYPEDECLARATION,t}return i(t,e),t}($);t.TypeDeclaration=Le;var be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VARIABLEDECLARATION,t}return i(t,e),t}(te);t.VariableDeclaration=be;var ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VARIABLE,t}return i(t,e),t}(Z);t.VariableStatement=ke;var Re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VOID,t}return i(t,e),t}(Z);t.VoidStatement=Re;var xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.WHILE,t}return i(t,e),t}(Z);function Fe(e,t){void 0===t&&(t=!1);var r=e.name.text,n=e.parent;return n&&(e.kind!=o.VARIABLEDECLARATION||n.kind!=o.VARIABLE||(n=n.parent))?n.kind==o.CLASSDECLARATION?Fe(n,t)+(e.is(a.CommonFlags.STATIC)?a.STATIC_DELIMITER:a.INSTANCE_DELIMITER)+r:n.kind==o.NAMESPACEDECLARATION||n.kind==o.ENUMDECLARATION?Fe(n,t)+a.STATIC_DELIMITER+r:t?r:e.range.source.internalPath+a.PATH_DELIMITER+r:r}function De(e){return e.endsWith(".ts")&&(e=e.substring(0,e.length-3)),e}function Be(e,t){for(var r=0,n=e.length;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(0),l=r(1),p=r(7),u=r(3),h=r(5),d=r(11),_=function(){return function(){}}(),g=function(){return function(){}}(),m=function(){return function(){}}();function y(e,t){switch(assert(t.length),e){case u.DecoratorKind.OPERATOR:case u.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 u.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 u.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 E,f,T=new Map,I=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this,t)||this;return r.diagnosticsOffset=0,r.elementsLookup=new Map,r.instancesLookup=new Map,r.typesLookup=T,r.typeAliases=new Map,r.fileLevelExports=new Map,r.moduleLevelExports=new Map,r.basicClasses=new Map,r.arrayBufferInstance=null,r.arrayPrototype=null,r.stringInstance=null,r.mainFunction=null,r.abortInstance=null,r.memoryAllocateInstance=null,r.hasGC=!1,r.gcAllocateInstance=null,r.gcLinkInstance=null,r.gcMarkInstance=null,r.gcHeaderSize=0,r.gcHookOffset=0,r.resolver=new d.Resolver(r),r.sources=[],r}return i(t,e),t.prototype.getSource=function(e){for(var t=this.sources,r=0,n=t.length;r=0),assert(null!=e.type),e.type.toNativeType()){case 1:t=this.tempI32s||(this.tempI32s=[]);break;case 2:t=this.tempI64s||(this.tempI64s=[]);break;case 3:t=this.tempF32s||(this.tempF32s=[]);break;case 4:t=this.tempF64s||(this.tempF64s=[]);break;default:throw new Error("concrete type expected")}assert(e.index>=0),t.push(e)}},t.prototype.getAndFreeTempLocal=function(e,t){var r,n;switch(e.toNativeType()){case 1:r=this.tempI32s||(this.tempI32s=[]);break;case 2:r=this.tempI64s||(this.tempI64s=[]);break;case 3:r=this.tempF32s||(this.tempF32s=[]);break;case 4:r=this.tempF64s||(this.tempF64s=[]);break;default:throw new Error("concrete type expected")}return r.length?(n=r[r.length-1]).type=e:(n=this.addLocal(e),r.push(n)),e.is(36)&&this.flow.setLocalWrapped(n.index,t),n},t.prototype.enterBreakContext=function(){var e=this.nextBreakId++;return this.breakStack?this.breakStack.push(e):this.breakStack=[e],this.breakContext=e.toString(10)},t.prototype.leaveBreakContext=function(){assert(null!=this.breakStack);var e=this.breakStack.length;assert(e>0),this.breakStack.pop(),e>1?this.breakContext=this.breakStack[e-2].toString(10):(this.breakContext=null,this.breakStack=null)},t.prototype.finalize=function(e,t){if(this.ref=t,assert(!this.breakStack||!this.breakStack.length),this.breakStack=null,this.breakContext=null,this.tempI32s=this.tempI64s=this.tempF32s=this.tempF64s=null,this.program.options.sourceMap)for(var r=this.debugLocations,n=0,i=r.length;n=r.length)return!1;t=r[n],e-=64*(n+1)}return i64_ne(i64_and(t,i64_shl(i64_one,i64_new(e))),i64_zero)},e.prototype.setLocalWrapped=function(e,t){var r,n=-1;if(e<64){if(e<0)return;r=this.wrappedLocals}else{var i=this.wrappedLocalsExt;for(n=(e-64)/64|0,i||(this.wrappedLocalsExt=i=new Array(n+1),i.length=0);i.length<=n;)i.push(i64_new(0));r=i[n],e-=64*(n+1)}r=t?i64_or(r,i64_shl(i64_one,i64_new(e))):i64_and(r,i64_not(i64_shl(i64_one,i64_new(e)))),n>=0?this.wrappedLocalsExt[n]=r:this.wrappedLocals=r},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,t){this.flags|=e.flags&t.flags&127,this.flags|=3968&e.flags,this.flags|=3968&t.flags,this.wrappedLocals=i64_and(e.wrappedLocals,t.wrappedLocals);var r=e.wrappedLocalsExt,n=t.wrappedLocalsExt;if(null!=r&&null!=n){var i=this.wrappedLocalsExt,a=min(r.length,n.length);if(a){if(i)for(;i.lengths):this.canOverflow(h.getBinaryLeft(e),t)&&!(h.getExpressionId(r=h.getBinaryRight(e))==h.ExpressionId.Const&&h.getConstValueI32(r)>=s);case h.BinaryOp.DivU32:case h.BinaryOp.RemI32:case h.BinaryOp.RemU32:return this.canOverflow(h.getBinaryLeft(e),t)||this.canOverflow(h.getBinaryRight(e),t)}break;case h.ExpressionId.Unary:switch(h.getUnaryOp(e)){case h.UnaryOp.EqzI32:case h.UnaryOp.EqzI64:return!1;case h.UnaryOp.ClzI32:case h.UnaryOp.CtzI32:case h.UnaryOp.PopcntI32:return t.size<7}break;case h.ExpressionId.Const:var o=0;switch(h.getExpressionType(e)){case 1:o=h.getConstValueI32(e);break;case 2:o=h.getConstValueI64Low(e);break;case 3:o=i32(h.getConstValueF32(e));break;case 4:o=i32(h.getConstValueF64(e));break;default:assert(!1)}switch(t.kind){case 0:return oi8.MAX_VALUE;case 1:return oi16.MAX_VALUE;case 5:return o<0||o>u8.MAX_VALUE;case 6:return o<0||o>u16.MAX_VALUE;case 10:return 0!=(-2&o)}break;case h.ExpressionId.Load:var c=void 0;switch(h.getLoadBytes(e)){case 1:c=h.isLoadSigned(e)?p.Type.i8:p.Type.u8;break;case 2:c=h.isLoadSigned(e)?p.Type.i16:p.Type.u16;break;default:c=h.isLoadSigned(e)?p.Type.i32:p.Type.u32}return V(c,t);case h.ExpressionId.Block:if(!h.getBlockName(e)){var l=assert(h.getBlockChildCount(e)),u=h.getBlockChild(e,l-1);return this.canOverflow(u,t)}break;case h.ExpressionId.If:return this.canOverflow(h.getIfTrue(e),t)||this.canOverflow(assert(h.getIfFalse(e)),t);case h.ExpressionId.Select:return this.canOverflow(h.getSelectThen(e),t)||this.canOverflow(h.getSelectElse(e),t);case h.ExpressionId.Call:var d=this.currentFunction.program,_=assert(d.instancesLookup.get(assert(h.getCallTarget(e))));assert(_.kind==E.FUNCTION);var g=_.signature.returnType;return!_.flow.is(2)||V(g,t);case h.ExpressionId.Unreachable:return!1}return!0},e.prototype.finalize=function(){assert(null==this.parent),this.continueLabel=null,this.breakLabel=null,this.returnLabel=null,this.contextualTypeArguments=null},e}();function V(e,t){return!e.is(4)||e.size>t.size||e.is(1)!=t.is(1)}t.Flow=z},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(9);!function(e){e[e.None=0]="None",e[e.I32=1]="I32",e[e.I64=2]="I64",e[e.F32=3]="F32",e[e.F64=4]="F64",e[e.Unreachable=5]="Unreachable",e[e.Auto=-1]="Auto"}(t.NativeType||(t.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.AtomicWake=_BinaryenAtomicWakeId()]="AtomicWake"}(i=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"}(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"}(t.BinaryOp||(t.BinaryOp={})),function(e){e[e.CurrentMemory=_BinaryenCurrentMemory()]="CurrentMemory",e[e.GrowMemory=_BinaryenGrowMemory()]="GrowMemory"}(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={}));var s=function(){function e(){}return e.create=function(t,r){var n=new e;return n.buffer=t,n.offset=r,n},e}();t.MemorySegment=s;var o=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.cachedByValue=memory.allocate(16),t},e.createFrom=function(t){var r=l(t);try{var n=new e;return n.ref=_BinaryenModuleRead(r,t.length),n.cachedByValue=memory.allocate(24),n}finally{memory.free(changetype(r))}},e.prototype.addFunctionType=function(e,t,r){var n=this.allocStringCached(e),i=p(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=p(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.createI32=function(e){var t=this.cachedByValue;return _BinaryenLiteralInt32(t,e),_BinaryenConst(this.ref,t)},e.prototype.createI64=function(e,t){void 0===t&&(t=0);var r=this.cachedByValue;return _BinaryenLiteralInt64(r,e,t),_BinaryenConst(this.ref,r)},e.prototype.createF32=function(e){var t=this.cachedByValue;return _BinaryenLiteralFloat32(t,e),_BinaryenConst(this.ref,t)},e.prototype.createF64=function(e){var t=this.cachedByValue;return _BinaryenLiteralFloat64(t,e),_BinaryenConst(this.ref,t)},e.prototype.createUnary=function(e,t){return _BinaryenUnary(this.ref,e,t)},e.prototype.createBinary=function(e,t,r){return _BinaryenBinary(this.ref,e,t,r)},e.prototype.createHost=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);var n=this.allocStringCached(t),i=u(r);try{return _BinaryenHost(this.ref,e,n,i,r?r.length:0)}finally{memory.free(i)}},e.prototype.createGetLocal=function(e,t){return _BinaryenGetLocal(this.ref,e,t)},e.prototype.createTeeLocal=function(e,t){return _BinaryenTeeLocal(this.ref,e,t)},e.prototype.createGetGlobal=function(e,t){var r=this.allocStringCached(e);return _BinaryenGetGlobal(this.ref,r,t)},e.prototype.createLoad=function(e,t,r,n,i){return void 0===i&&(i=0),_BinaryenLoad(this.ref,e,t?1:0,i,e,n,r)},e.prototype.createStore=function(e,t,r,n,i){return void 0===i&&(i=0),_BinaryenStore(this.ref,e,i,e,t,r,n)},e.prototype.createAtomicLoad=function(e,t,r,n){return void 0===n&&(n=0),_BinaryenAtomicLoad(this.ref,e,n,r,t)},e.prototype.createAtomicStore=function(e,t,r,n,i){return void 0===i&&(i=0),_BinaryenAtomicStore(this.ref,e,i,t,r,n)},e.prototype.createAtomicRMW=function(e,t,r,n,i,a){return _BinaryenAtomicRMW(this.ref,e,t,r,n,i,a)},e.prototype.createAtomicCmpxchg=function(e,t,r,n,i,a){return _BinaryenAtomicCmpxchg(this.ref,e,t,r,n,i,a)},e.prototype.createAtomicWait=function(e,t,r,n){return _BinaryenAtomicWait(this.ref,e,t,r,n)},e.prototype.createAtomicWake=function(e,t){return _BinaryenAtomicWake(this.ref,e,t)},e.prototype.createSetLocal=function(e,t){return _BinaryenSetLocal(this.ref,e,t)},e.prototype.createSetGlobal=function(e,t){var r=this.allocStringCached(e);return _BinaryenSetGlobal(this.ref,r,t)},e.prototype.createBlock=function(e,t,r){void 0===r&&(r=0);var n=this.allocStringCached(e),i=u(t);try{return _BinaryenBlock(this.ref,n,i,t.length,r)}finally{memory.free(i)}},e.prototype.createBreak=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.createDrop=function(e){return _BinaryenDrop(this.ref,e)},e.prototype.createLoop=function(e,t){var r=this.allocStringCached(e);return _BinaryenLoop(this.ref,r,t)},e.prototype.createIf=function(e,t,r){return void 0===r&&(r=0),_BinaryenIf(this.ref,e,t,r)},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,t,r){return _BinaryenSelect(this.ref,r,e,t)},e.prototype.createSwitch=function(e,t,r,n){void 0===n&&(n=0);for(var i=e.length,a=new Array(i),s=0;s=0;--_)memory.free(u[_])}},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=p([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.cachedByValue,r=d(e),n=0,i=0;try{_BinaryenModuleAllocateAndWrite(t,this.ref,r),n=_(t);var a=_(t+4);i=_(t+8);var s=new m;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 u(e){return p(e)}t.Relooper=c;var h=new Map;function d(e){if(null==e)return 0;if(h.has(e))return h.get(e);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),h.set(e,t),t}function _(e){return load(e)|load(e+1)<<8|load(e+2)<<16|load(e+3)<<24}function g(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.readString=g;var m=function(){return function(){}}();t.BinaryModule=m,t.needsExplicitUnreachable=function e(t){switch(_BinaryenExpressionGetType(t)){case 1:case 2:case 3:case 4:return!1}switch(_BinaryenExpressionGetId(t)){case i.Unreachable:case i.Return:return!1;case i.Break:return 0!=_BinaryenBreakGetCondition(t);case i.Block:if(!_BinaryenBlockGetName(t)){var r=_BinaryenBlockGetNumChildren(t);return r>0&&e(_BinaryenBlockGetChild(t,r-1))}}return!0}},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(1),c=r(3),l=r(2);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=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=p,t.tokenIsAlsoIdentifier=u,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 h=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=h;var d=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=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=this.end){n+=e.substring(r,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(r-1,this.end));break}var i=e.charCodeAt(this.pos);if(i==t){n+=e.substring(r,this.pos++);break}if(92!=i){if(l.isLineBreak(i)){n+=e.substring(r,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(r-1,this.pos));break}++this.pos}else n+=e.substring(r,this.pos),n+=this.readEscapeSequence(),r=this.pos}return n},t.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,t=e.charCodeAt(this.pos++);switch(t){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(t,this.end));break}if(92!=e.charCodeAt(this.pos)){var n=e.charCodeAt(this.pos);if(47==n&&!r)break;if(l.isLineBreak(n)){this.error(o.DiagnosticCode.Unterminated_regular_expression_literal,this.range(t,this.pos));break}++this.pos,r=!1}else++this.pos,r=!0}return e.substring(t,this.pos)},t.prototype.readRegexpFlags=function(){for(var e=this.source.text,t=this.pos,r=0;this.pos57)&&95!=r)break;t++}return!0},t.prototype.readInteger=function(){var e=this.source.text;if(48==e.charCodeAt(this.pos)&&this.pos+2=48&&s<=57)r=i64_add(i64_mul(r,n),i64_new(s-48,0));else if(s>=65&&s<=70)r=i64_add(i64_mul(r,n),i64_new(10+s-65,0));else if(s>=97&&s<=102)r=i64_add(i64_mul(r,n),i64_new(10+s-97,0));else{if(95!=s)break;i==a&&this.error(i==t?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==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=i64_new(0,0),n=i64_new(10,0),i=t;this.pos=48&&s<=57)r=i64_add(i64_mul(r,n),i64_new(s-48,0));else{if(95!=s)break;i==a&&this.error(i==t?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==t?this.error(o.DiagnosticCode.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.readOctalInteger=function(){for(var e=this.source.text,t=this.pos,r=i64_new(0,0),n=i64_new(8,0),i=t;this.pos=48&&s<=55)r=i64_add(i64_mul(r,n),i64_new(s-48,0));else{if(95!=s)break;i==a&&this.error(i==t?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==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,0),n=i64_new(2,0),i=i64_new(1,0),a=t;this.pos=48&&n<=57)t=16*t+n-48;else if(n>=65&&n<=70)t=16*t+10+n-65;else{if(!(n>=97&&n<=102))return this.error(o.DiagnosticCode.Hexadecimal_digit_expected,this.range(this.pos-1,this.pos)),"";t=16*t+10+n-97}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.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?"":r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-65536)/1024|0),(r-65536)%1024+56320)},t.prototype.finish=function(){},t}(o.DiagnosticEmitter);t.Tokenizer=d;var _=function(){return function(){}}();t.State=_;var g=null},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4);!function(e){e[e.I8=0]="I8",e[e.I16=1]="I16",e[e.I32=2]="I32",e[e.I64=3]="I64",e[e.ISIZE=4]="ISIZE",e[e.U8=5]="U8",e[e.U16=6]="U16",e[e.U32=7]="U32",e[e.U64=8]="U64",e[e.USIZE=9]="USIZE",e[e.BOOL=10]="BOOL",e[e.F32=11]="F32",e[e.F64=12]="F64",e[e.VOID=13]="VOID"}(t.TypeKind||(t.TypeKind={})),function(e){e[e.NONE=0]="NONE",e[e.SIGNED=1]="SIGNED",e[e.UNSIGNED=2]="UNSIGNED",e[e.INTEGER=4]="INTEGER",e[e.FLOAT=8]="FLOAT",e[e.POINTER=16]="POINTER",e[e.SHORT=32]="SHORT",e[e.LONG=64]="LONG",e[e.VALUE=128]="VALUE",e[e.REFERENCE=256]="REFERENCE",e[e.NULLABLE=512]="NULLABLE"}(t.TypeFlags||(t.TypeFlags={}));var i=function(){function e(e,t,r){this.cachedNullableType=null,this.kind=e,this.flags=t,this.size=r,this.byteSize=ceil(r/8),this.classReference=null,this.signatureReference=null,this.nonNullableType=this}return Object.defineProperty(e.prototype,"intType",{get:function(){switch(this.kind){case 0:return e.i8;case 1:return e.i16;case 11:case 2:return e.i32;case 12:case 3:return e.i64;case 4:return 64==this.size?e.isize64:e.isize32;case 5:return e.u8;case 6:return e.u16;case 7:return e.u32;case 8:return e.u64;case 9:return 64==this.size?e.usize64:e.usize32;case 10:default:return e.i32}},enumerable:!0,configurable:!0}),e.prototype.isManaged=function(e){if(e.hasGC){var t=this.classReference;return null!==t&&!t.hasDecorator(n.DecoratorFlags.UNMANAGED)}return!1},e.prototype.computeSmallIntegerShift=function(e){return e.size-this.size},e.prototype.computeSmallIntegerMask=function(e){var t=this.is(2)?this.size:this.size-1;return-1>>>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)&&t.is(8))return this.size<=t.size;return!1},e.commonCompatible=function(e,t,r){return t.isAssignableTo(e,r)?e:e.isAssignableTo(t,r)?t:null},e.prototype.toString=function(e){if(void 0===e&&(e=!1),!e&&this.is(256)){var t=this.classReference;if(t)return this.is(512)?t.toString()+" | null":t.toString();var r=this.signatureReference;if(r)return this.is(512)?"("+r.toString(!0)+") | null":r.toString(!0);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";default:assert(!1);case 13:return"void"}},e.prototype.toNativeType=function(){switch(this.kind){default:return 1;case 3:case 8:return 2;case 4:case 9:return 64==this.size?2:1;case 11:return 3;case 12:return 4;case 13:return 0}},e.prototype.toNativeZero=function(e){switch(this.kind){case 13: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)}},e.prototype.toNativeOne=function(e){switch(this.kind){case 13: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: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){default:return"i";case 3:case 8:return"I";case 4:case 9:return 64==this.size?"I":"i";case 11:return"f";case 12:return"F";case 13:return"v"}},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.void=new e(13,0,0),e}();t.Type=i,t.typesToNativeTypes=function(e){for(var t=e.length,r=new Array(t),n=0;ne?t[e]:o(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=l&&u!=p?t.push("?: "):t.push(": "),t.push(i[u].toString());return t.push(") => "),t.push(this.returnType.toString()),t.join("")},e}();t.Signature=a;var s=null;function o(e){s||(s=[]);for(var t=s.length;t<=e;++t)s.push("arg$"+t.toString(10));return s[e-1]}t.getDefaultParameterName=o},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(23),l=r(1),p=r(5),u=r(0),h=r(4),d=r(6),_=r(3),g=r(7),m=r(2);!function(e){e[e.WASM32=0]="WASM32",e[e.WASM64=1]="WASM64"}(o=t.Target||(t.Target={}));var y=function(){function e(){this.target=o.WASM32,this.noTreeShaking=!1,this.noAssert=!1,this.importMemory=!1,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?g.Type.usize64:g.Type.usize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isizeType",{get:function(){return this.target==o.WASM64?g.Type.isize64:g.Type.isize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nativeSizeType",{get:function(){return this.target==o.WASM64?2:1},enumerable:!0,configurable:!0}),e.prototype.hasFeature=function(e){return 0!=(this.features&e)},e}();t.Options=y,function(e){e[e.NONE=0]="NONE",e[e.SIGN_EXTENSION=1]="SIGN_EXTENSION",e[e.MUTABLE_GLOBAL=2]="MUTABLE_GLOBAL"}(t.Feature||(t.Feature={})),function(e){e[e.NONE=0]="NONE",e[e.IMPLICIT=1]="IMPLICIT",e[e.EXPLICIT=2]="EXPLICIT"}(t.ConversionKind||(t.ConversionKind={})),function(e){e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP"}(t.WrapMode||(t.WrapMode={}));var E,f,T=function(e){function t(t,r){void 0===r&&(r=null);var n=e.call(this,t.diagnostics)||this;return n.currentOuterFunction=null,n.currentInlineFunctions=[],n.currentEnum=null,n.currentType=g.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=t,n.resolver=t.resolver,r||(r=new y),n.options=r,n.memoryOffset=i64_new(max(r.memoryBase,8)),n.module=p.Module.create(),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=this.options,n=this.module,i=this.program;i.initialize(r);var o=new h.Function(i.startFunction,"start",new g.Signature([],g.Type.void));this.startFunctionInstance=o;var l=new Array;this.startFunctionBody=l,this.currentFunction=o,r.isWasm64?n.addGlobal("HEAP_BASE",2,!0,n.createI64(0,0)):n.addGlobal("HEAP_BASE",1,!1,n.createI32(0));for(var u=i.sources,d=0,_=u.length;d<_;++d)u[d].isEntry&&this.compileSource(u[d]);if(l.length||null!==i.mainFunction){var m=o.signature,y=n.addFunction(o.internalName,this.ensureFunctionType(m.parameterTypes,m.returnType,m.thisType),g.typesToNativeTypes(o.additionalLocals),n.createBlock(null,l));o.finalize(n,y),i.mainFunction||n.setStart(y)}var E=this.memoryOffset;E=i64_align(E,r.usizeType.byteSize),this.memoryOffset=E,n.removeGlobal("HEAP_BASE"),r.isWasm64?n.addGlobal("HEAP_BASE",2,!1,n.createI64(i64_low(E),i64_high(E))):n.addGlobal("HEAP_BASE",1,!1,n.createI32(i64_low(E))),n.setMemory(this.options.memoryBase||this.memorySegments.length?i64_low(i64_shr_u(i64_align(E,65536),i64_new(16,0))):0,p.Module.UNLIMITED_MEMORY,this.memorySegments,r.target,"memory"),r.importMemory&&n.addMemoryImport("0","env","memory");var f=this.functionTable;n.setFunctionTable(f.length,4294967295,f),n.addTableExport("0","table"),n.addFunction("null",this.ensureFunctionType(null,g.Type.void),null,n.createBlock(null,[])),r.importTable&&n.addTableImport("0","env","table");try{for(var T=a(i.moduleLevelExports),I=T.next();!I.done;I=T.next()){var v=s(I.value,2),C=v[0],A=v[1];this.makeModuleExport(C,A.element)}}catch(t){e={error:t}}finally{try{I&&!I.done&&(t=T.return)&&t.call(T)}finally{if(e)throw e.error}}return this.needsIterateRoots&&c.compileIterateRoots(this),n},t.prototype.makeModuleExport=function(e,t,r){var n,i,s,o,c,p,d,_,m,y;void 0===r&&(r="");var E=t.members;if(E){var f=r+e+(t.kind==h.ElementKind.CLASS?u.INSTANCE_DELIMITER:u.STATIC_DELIMITER);if(t.kind==h.ElementKind.NAMESPACE)try{for(var T=a(E.values()),I=T.next();!I.done;I=T.next()){(A=I.value).is(u.CommonFlags.EXPORT)&&this.makeModuleExport(A.simpleName,A,f)}}catch(e){n={error:e}}finally{try{I&&!I.done&&(i=T.return)&&i.call(T)}finally{if(n)throw n.error}}else try{for(var v=a(E.values()),C=v.next();!C.done;C=v.next()){var A;(A=C.value).is(u.CommonFlags.PRIVATE)||this.makeModuleExport(A.simpleName,A,f)}}catch(e){s={error:e}}finally{try{C&&!C.done&&(o=v.return)&&o.call(v)}finally{if(s)throw s.error}}}switch(t.kind){case h.ElementKind.GLOBAL:if(t.is(u.CommonFlags.CONST)||t.is(u.CommonFlags.STATIC|u.CommonFlags.READONLY)||this.options.hasFeature(2))this.module.addGlobalExport(t.internalName,r+e);else(N=t.declaration)&&this.error(l.DiagnosticCode.Cannot_export_a_mutable_global,N.name.range);break;case h.ElementKind.ENUMVALUE:var N;if(assert(t.parent).is(u.CommonFlags.CONST)||this.options.hasFeature(2))this.module.addGlobalExport(t.internalName,r+e);else(N=t.declaration)&&this.error(l.DiagnosticCode.Cannot_export_a_mutable_global,N.name.range);break;case h.ElementKind.FUNCTION:var S=(z=t).signature;S.requiredParameters"),!1;e.type=this.currentType,e.set(u.CommonFlags.RESOLVED)}else assert(!1);if(e.is(u.CommonFlags.AMBIENT)&&e.hasDecorator(h.DecoratorFlags.BUILTIN))return!0;var a=e.type.toNativeType(),s=e.is(u.CommonFlags.CONST)||e.is(u.CommonFlags.STATIC|u.CommonFlags.READONLY);if(e.is(u.CommonFlags.AMBIENT))return s||this.options.hasFeature(2)?(e.set(u.CommonFlags.MODULE_IMPORT),r?I(e,r):(E="env",f=e.simpleName),t.addGlobalImport(e.internalName,E,f,a),e.set(u.CommonFlags.COMPILED),!0):(this.error(l.DiagnosticCode.Operation_not_supported,assert(r).range),!1);var o=!1;if(null!==r&&null!==r.initializer){if(n||(n=this.compileExpression(r.initializer,e.type,1,1)),p.getExpressionId(n)!=p.ExpressionId.Const&&(s?(n=t.precomputeExpression(n),p.getExpressionId(n)!=p.ExpressionId.Const&&(this.warning(l.DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,r.range),o=!0)):o=!0),e.hasDecorator(h.DecoratorFlags.INLINE)&&!o){switch(assert(p.getExpressionId(n)==p.ExpressionId.Const),p.getExpressionType(n)){case 1:e.constantValueKind=1,e.constantIntegerValue=i64_new(p.getConstValueI32(n),0);break;case 2:e.constantValueKind=1,e.constantIntegerValue=i64_new(p.getConstValueI64Low(n),p.getConstValueI64High(n));break;case 3:e.constantValueKind=2,e.constantFloatValue=p.getConstValueF32(n);break;case 4:e.constantValueKind=2,e.constantFloatValue=p.getConstValueF64(n);break;default:return assert(!1),!1}e.set(u.CommonFlags.INLINED)}}else n=e.type.toNativeZero(t);var c=e.internalName;return o?(t.addGlobal(c,a,!0,e.type.toNativeZero(t)),this.startFunctionBody.push(t.createSetGlobal(c,n))):t.addGlobal(c,a,!s,n),!0},t.prototype.compileEnumDeclaration=function(e){var t=assert(this.program.elementsLookup.get(e.fileLevelInternalName));return assert(t.kind==h.ElementKind.ENUM),this.compileEnum(t)?t:null},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;if(e.members)try{for(var o=a(e.members.values()),c=o.next();!c.done;c=o.next()){var d=c.value;if(d.kind==h.ElementKind.ENUMVALUE){var _=!1,m=d,y=m.declaration;m.set(u.CommonFlags.COMPILED);var E=void 0;y.value?(E=this.compileExpression(y.value,g.Type.i32,1,0),p.getExpressionId(E)!=p.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)?(E=n.precomputeExpression(E),p.getExpressionId(E)!=p.ExpressionId.Const&&(this.error(l.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,y.value.range),_=!0)):_=!0)):null==i?E=n.createI32(0):(s&&this.error(l.DiagnosticCode.Enum_member_must_have_initializer,y.range),E=n.createBinary(p.BinaryOp.AddI32,n.createGetGlobal(i.internalName,1),n.createI32(1)),E=n.precomputeExpression(E),p.getExpressionId(E)!=p.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)&&this.error(l.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,y.range),_=!0)),_?(n.addGlobal(m.internalName,1,!0,n.createI32(0)),this.startFunctionBody.push(n.createSetGlobal(m.internalName,E)),s=!0):(n.addGlobal(m.internalName,1,!e.is(u.CommonFlags.CONST),E),s=!1),i=m}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return this.currentEnum=null,!0},t.prototype.compileFunctionDeclaration=function(e,t){var r=assert(this.program.elementsLookup.get(e.fileLevelInternalName));return assert(r.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.compileFunctionUsingTypeArguments(r,t,m.makeMap(),null,r.declaration.name)},t.prototype.compileFunctionUsingTypeArguments=function(e,t,r,n,i){var a=this.resolver.resolveFunctionInclTypeArguments(e,t,r,i);return a?(a.outerScope=n,this.compileFunction(a)?a:null):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;s=0)return e.functionTableIndex;var t=this.functionTable,r=t.length;return!e.is(u.CommonFlags.TRAMPOLINE)&&e.signature.requiredParameters=0?"case"+h.toString(10):"break")+"|"+a);var m=t.createBlock("case0|"+a,l,0),y=!0,E=!0,f=!0,T=!0;for(d=0;d=0&&(y&&s.set(1),E&&s.set(2),f&&s.set(4),T&&s.set(32)),m},t.prototype.compileThrowStatement=function(e){var t=this.currentFunction.flow;return t.set(4),t.set(1),c.compileAbort(this,null,e)},t.prototype.compileTryStatement=function(e){return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()},t.prototype.compileVariableStatement=function(e,t){void 0===t&&(t=!1);var r=this.program,n=this.currentFunction,i=e.declarations,a=i.length;if(t||n==this.startFunctionInstance&&e.parent&&e.parent.kind==_.NodeKind.SOURCE){for(var s=0;s");continue}E=this.currentType}var T=!1;if(m.is(u.CommonFlags.CONST))if(f)if(f=this.module.precomputeExpression(f),p.getExpressionId(f)==p.ExpressionId.Const){var I=new h.Local(r,y,-1,E);switch(p.getExpressionType(f)){case 1:I=I.withConstantIntegerValue(i64_new(p.getConstValueI32(f),0));break;case 2:I=I.withConstantIntegerValue(i64_new(p.getConstValueI64Low(f),p.getConstValueI64High(f)));break;case 3:I=I.withConstantFloatValue(p.getConstValueF32(f));break;case 4:I=I.withConstantFloatValue(p.getConstValueF64(f));break;default:return assert(!1),this.module.createUnreachable()}var v=n.flow.scopedLocals;if(v){if(v.has(y))return this.error(l.DiagnosticCode.Duplicate_identifier_0,m.name.range,y),this.module.createUnreachable()}else n.flow.scopedLocals=v=new Map;v.set(y,I),T=!0}else this.warning(l.DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,m.range);else this.error(l.DiagnosticCode._const_declarations_must_be_initialized,m.range);if(!T){I=void 0;if(m.isAny(u.CommonFlags.LET|u.CommonFlags.CONST)||c.is(4096))I=c.addScopedLocal(E,y,!1,m);else{if(n.flow.getScopedLocal(y)){this.error(l.DiagnosticCode.Duplicate_identifier_0,m.name.range,y);continue}I=n.addLocal(E,y,m)}f?(o.push(this.compileAssignmentWithValue(m.name,f)),I.type.is(36)&&c.setLocalWrapped(I.index,!c.canOverflow(f,E))):I.type.is(36)&&c.setLocalWrapped(I.index,!0)}}return o.length?1==o.length?o[0]:this.module.createBlock(null,o,0):0},t.prototype.compileVoidStatement=function(e){return this.compileExpression(e.expression,g.Type.void,2,0)},t.prototype.compileWhileStatement=function(e){var t=this.module,r=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,g.Type.bool,0),this.currentType);if(!this.options.noTreeShaking||this.currentFunction.isAny(u.CommonFlags.GENERIC|u.CommonFlags.GENERIC_CONTEXT)){var n=t.precomputeExpression(r);if(p.getExpressionId(n)==p.ExpressionId.Const&&1==p.getExpressionType(n)){if(!p.getConstValueI32(n))return t.createNop()}else r=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,g.Type.bool,0),this.currentType)}var i=this.currentFunction,a=i.enterBreakContext(),s=i.flow,o=s.fork();i.flow=o;var c="break|"+a;o.breakLabel=c;var l="continue|"+a;o.continueLabel=l;var h=this.compileStatement(e.statement),d=o.isAny(29);return i.flow=o.free(),i.leaveBreakContext(),o.unset(1560),s.inheritConditional(o),t.createBlock(c,[t.createLoop(l,t.createIf(r,d?h:t.createBlock(null,[h,t.createBreak(l)],0)))])},t.prototype.compileInlineConstant=function(e,t,r){assert(e.is(u.CommonFlags.INLINED));var n=e.type;switch(!r&&n.is(4)&&t.is(4)&&n.size>i:0);case 5:case 6:case 10:var a=e.type.computeSmallIntegerMask(g.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(h.DecoratorFlags.BUILTIN)||t!=g.Type.f32)return this.module.createF64(e.constantFloatValue);this.currentType=g.Type.f32;case 11:return this.module.createF32(e.constantFloatValue);default:return assert(!1),this.module.createUnreachable()}},t.prototype.compileExpression=function(e,t,r,n){var i;switch(this.currentType=t,e.kind){case _.NodeKind.ASSERTION:i=this.compileAssertionExpression(e,t);break;case _.NodeKind.BINARY:i=this.compileBinaryExpression(e,t);break;case _.NodeKind.CALL:i=this.compileCallExpression(e,t);break;case _.NodeKind.COMMA:i=this.compileCommaExpression(e,t);break;case _.NodeKind.ELEMENTACCESS:i=this.compileElementAccessExpression(e,t);break;case _.NodeKind.FUNCTION:i=this.compileFunctionExpression(e,t);break;case _.NodeKind.IDENTIFIER:case _.NodeKind.FALSE:case _.NodeKind.NULL:case _.NodeKind.THIS:case _.NodeKind.SUPER:case _.NodeKind.TRUE:i=this.compileIdentifierExpression(e,t,0==r);break;case _.NodeKind.INSTANCEOF:i=this.compileInstanceOfExpression(e,t);break;case _.NodeKind.LITERAL:i=this.compileLiteralExpression(e,t);break;case _.NodeKind.NEW:i=this.compileNewExpression(e,t);break;case _.NodeKind.PARENTHESIZED:i=this.compileParenthesizedExpression(e,t);break;case _.NodeKind.PROPERTYACCESS:i=this.compilePropertyAccessExpression(e,t,0==r);break;case _.NodeKind.TERNARY:i=this.compileTernaryExpression(e,t);break;case _.NodeKind.UNARYPOSTFIX:i=this.compileUnaryPostfixExpression(e,t);break;case _.NodeKind.UNARYPREFIX:i=this.compileUnaryPrefixExpression(e,t);break;default:this.error(l.DiagnosticCode.Operation_not_supported,e.range),i=this.module.createUnreachable()}var a=this.currentType;return 0!=r&&a!=t?(i=this.convertExpression(i,a,t,r,n,e),this.currentType=t):1==n&&(i=this.ensureSmallIntegerWrap(i,a)),this.options.sourceMap&&this.addDebugLocation(i,e.range),i},t.prototype.compileExpressionRetainType=function(e,t,r){return this.compileExpression(e,t==g.Type.void?g.Type.i32:t,0,r)},t.prototype.precomputeExpression=function(e,t,r,n){return this.module.precomputeExpression(this.compileExpression(e,t,r,n))},t.prototype.convertExpression=function(e,t,r,n,i,a){assert(0!=n);var s=this.module;return 13==t.kind?(assert(13!=r.kind),this.error(l.DiagnosticCode.Type_0_is_not_assignable_to_type_1,a.range,t.toString(),r.toString()),s.createUnreachable()):13==r.kind?s.createDrop(e):(t.isAssignableTo(r)||1==n&&this.error(l.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.createUnary(p.UnaryOp.PromoteF32,e)):11==r.kind&&(e=s.createUnary(p.UnaryOp.DemoteF64,e)):r.is(4)?11==t.kind?r==g.Type.bool?(e=s.createBinary(p.BinaryOp.NeF32,e,s.createF32(0)),i=0):e=r.is(1)?r.is(64)?s.createUnary(p.UnaryOp.TruncF32ToI64,e):s.createUnary(p.UnaryOp.TruncF32ToI32,e):r.is(64)?s.createUnary(p.UnaryOp.TruncF32ToU64,e):s.createUnary(p.UnaryOp.TruncF32ToU32,e):r==g.Type.bool?(e=s.createBinary(p.BinaryOp.NeF64,e,s.createF64(0)),i=0):e=r.is(1)?r.is(64)?s.createUnary(p.UnaryOp.TruncF64ToI64,e):s.createUnary(p.UnaryOp.TruncF64ToI32,e):r.is(64)?s.createUnary(p.UnaryOp.TruncF64ToU64,e):s.createUnary(p.UnaryOp.TruncF64ToU32,e):(assert(0==r.flags,"void type expected"),e=s.createDrop(e)):t.is(4)&&r.is(8)?e=11==r.kind?t.is(64)?s.createUnary(t.is(1)?p.UnaryOp.ConvertI64ToF32:p.UnaryOp.ConvertU64ToF32,e):s.createUnary(t.is(1)?p.UnaryOp.ConvertI32ToF32:p.UnaryOp.ConvertU32ToF32,e):t.is(64)?s.createUnary(t.is(1)?p.UnaryOp.ConvertI64ToF64:p.UnaryOp.ConvertU64ToF64,e):s.createUnary(t.is(1)?p.UnaryOp.ConvertI32ToF64:p.UnaryOp.ConvertU32ToF64,e):t.is(64)?r==g.Type.bool?(e=s.createBinary(p.BinaryOp.NeI64,e,s.createI64(0)),i=0):r.is(64)||(e=s.createUnary(p.UnaryOp.WrapI64,e)):r.is(64)?(e=s.createUnary(t.is(1)?p.UnaryOp.ExtendI32:p.UnaryOp.ExtendU32,this.ensureSmallIntegerWrap(e,t)),i=0):t.is(32)&&t.size",n.toString(),a.toString()),this.currentType=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.GtI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GtI64:p.BinaryOp.GtI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.GtI64,r,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.GtU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GtU64:p.BinaryOp.GtU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.GtU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.GtF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.GtF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=g.Type.bool;break;case d.Token.LESSTHAN_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.LE)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.LeI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.LeI64:p.BinaryOp.LeI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.LeI64,r,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.LeU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.LeU64:p.BinaryOp.LeU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.LeU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.LeF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.LeF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=g.Type.bool;break;case d.Token.GREATERTHAN_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.GE)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.GeI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GeI64:p.BinaryOp.GeI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.GeI64,r,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.GeU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GeU64:p.BinaryOp.GeU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.GeU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.GeF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.GeF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=g.Type.bool;break;case d.Token.EQUALS_EQUALS_EQUALS:case d.Token.EQUALS_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,y==d.Token.EQUALS_EQUALS&&this.currentType.is(256))if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.EQ)){o=this.compileBinaryOverload(v,u,r,_,e);break}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,d.operatorTokenToString(e.operator),n.toString(),a.toString()),this.currentType=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.EqI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.EqI64:p.BinaryOp.EqI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.EqI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.EqF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.EqF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=g.Type.bool;break;case d.Token.EXCLAMATION_EQUALS_EQUALS:case d.Token.EXCLAMATION_EQUALS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,y==d.Token.EXCLAMATION_EQUALS&&this.currentType.is(256))if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.NE)){o=this.compileBinaryOverload(v,u,r,_,e);break}if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,d.operatorTokenToString(e.operator),n.toString(),a.toString()),this.currentType=t,c.createUnreachable();switch(r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_),s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.NeI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.NeI64:p.BinaryOp.NeI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.NeI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.NeF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.NeF64,r,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=g.Type.bool;break;case d.Token.EQUALS:return this.compileAssignment(u,_,t);case d.Token.PLUS_EQUALS:m=!0;case d.Token.PLUS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.ADD)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(_,n,1,0);else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.AddI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.AddI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.AddF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.AddF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.MINUS_EQUALS:m=!0;case d.Token.MINUS:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.SUB)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.SubI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.SubI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.SubF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.SubF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.ASTERISK_EQUALS:m=!0;case d.Token.ASTERISK:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.MUL)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1);else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.MulI32,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.MulI64:p.BinaryOp.MulI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.MulI64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.MulF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.MulF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.ASTERISK_ASTERISK_EQUALS:m=!0;case d.Token.ASTERISK_ASTERISK:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.POW)){o=this.compileBinaryOverload(v,u,r,_,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(_,g.Type.f32,1,0),a=this.currentType,!(E=this.f32PowInstance)){if(!(f=this.program.elementsLookup.get("Mathf"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),o=c.createUnreachable();break}if(!(T=f.members?f.members.get("pow"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.pow"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f32PowInstance=E=this.resolver.resolveFunction(T,null)}}else if(r=this.convertExpression(r,this.currentType,g.Type.f64,1,0,u),n=this.currentType,i=this.compileExpression(_,g.Type.f64,1,0),a=this.currentType,!(E=this.f64PowInstance)){if(!(f=this.program.elementsLookup.get("Math"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),o=c.createUnreachable();break}if(!(T=f.members?f.members.get("pow"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math.pow"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f64PowInstance=E=this.resolver.resolveFunction(T,null)}o=E&&this.compileFunction(E)?this.makeCallDirect(E,[r,i]):c.createUnreachable();break;case d.Token.SLASH_EQUALS:m=!0;case d.Token.SLASH:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.DIV)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_)}switch(this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.DivI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.DivI64:p.BinaryOp.DivI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.DivI64,r,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.DivU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.DivU64:p.BinaryOp.DivU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.DivU64,r,i);break;case 11:o=c.createBinary(p.BinaryOp.DivF32,r,i);break;case 12:o=c.createBinary(p.BinaryOp.DivF64,r,i);break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.PERCENT_EQUALS:m=!0;case d.Token.PERCENT:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.REM)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,1,u),i=this.convertExpression(i,a,a=s,1,1,_)}switch(this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.RemI32,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.RemI64:p.BinaryOp.RemI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.RemI64,r,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.RemU32,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.RemU64:p.BinaryOp.RemU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.RemU64,r,i);break;case 11:if(!(E=this.f32ModInstance)){if(!(f=this.program.elementsLookup.get("Mathf"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),o=c.createUnreachable();break}if(!(T=f.members?f.members.get("mod"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.mod"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f32ModInstance=E=this.resolver.resolveFunction(T,null)}o=E&&this.compileFunction(E)?this.makeCallDirect(E,[r,i]):c.createUnreachable();break;case 12:if(!(E=this.f64ModInstance)){var f,T;if(!(f=this.program.elementsLookup.get("Math"))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),o=c.createUnreachable();break}if(!(T=f.members?f.members.get("mod"):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math.mod"),o=c.createUnreachable();break}assert(T.kind==h.ElementKind.FUNCTION_PROTOTYPE),this.f64ModInstance=E=this.resolver.resolveFunction(T,null)}o=E&&this.compileFunction(E)?this.makeCallDirect(E,[r,i]):c.createUnreachable();break;default:assert(!1),o=c.createUnreachable()}break;case d.Token.LESSTHAN_LESSTHAN_EQUALS:m=!0;case d.Token.LESSTHAN_LESSTHAN:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_SHL)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(i=this.compileExpression(_,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,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.ShlI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShlI64:p.BinaryOp.ShlI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.GREATERTHAN_GREATERTHAN_EQUALS:m=!0;case d.Token.GREATERTHAN_GREATERTHAN:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_SHR)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,1),a=this.currentType,this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.ShrI32,r,i);break;case 3:o=c.createBinary(p.BinaryOp.ShrI64,r,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrI64:p.BinaryOp.ShrI32,r,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.ShrU32,r,i);break;case 8:o=c.createBinary(p.BinaryOp.ShrU64,r,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrU64:p.BinaryOp.ShrU32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:m=!0;case d.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_SHR_U)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(r=this.ensureSmallIntegerWrap(r,n),i=this.compileExpression(_,n,1,0),a=this.currentType,this.currentType.kind){case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.ShrU32,r,i);case 0:case 1:case 2:case 7:o=c.createBinary(p.BinaryOp.ShrU32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.ShrU64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrU64:p.BinaryOp.ShrU32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.AMPERSAND_EQUALS:m=!0;case d.Token.AMPERSAND:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_AND)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.AndI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.AndI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.AndI64:p.BinaryOp.AndI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.BAR_EQUALS:m=!0;case d.Token.BAR:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_OR)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.OrI32,r,i);break;case 2:case 7:o=c.createBinary(p.BinaryOp.OrI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.OrI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.OrI64:p.BinaryOp.OrI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.CARET_EQUALS:m=!0;case d.Token.CARET:if(r=this.compileExpressionRetainType(u,t.intType,0),n=this.currentType,this.currentType.is(256)){var I,v;if(I=n.classReference)if(v=I.lookupOverload(h.OperatorKind.BITWISE_XOR)){o=this.compileBinaryOverload(v,u,r,_,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(_,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(_,n,0),a=this.currentType,!(s=g.Type.commonCompatible(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=t,c.createUnreachable();r=this.convertExpression(r,n,n=s,1,0,u),i=this.convertExpression(i,a,a=s,1,0,_)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.XorI32,r,i);break;case 2:case 7:o=c.createBinary(p.BinaryOp.XorI32,r,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.XorI64,r,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.XorI64:p.BinaryOp.XorI32,r,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case d.Token.AMPERSAND_AMPERSAND:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,i=this.compileExpression(_,n,1,0),a=this.currentType,o=c.cloneExpression(r,!0,0))this.makeIsTrueish(r,this.currentType),o=c.createIf(this.makeIsTrueish(r,this.currentType),i,o);else{var C=this.currentFunction.flow,A=this.currentFunction.getAndFreeTempLocal(this.currentType,!C.canOverflow(r,this.currentType));o=c.createIf(this.makeIsTrueish(c.createTeeLocal(A.index,r),this.currentType),i,c.createGetLocal(assert(A).index,this.currentType.toNativeType()))}break;case d.Token.BAR_BAR:if(r=this.compileExpressionRetainType(u,t,0),n=this.currentType,i=this.compileExpression(_,n,1,0),a=this.currentType,o=this.module.cloneExpression(r,!0,0))o=this.module.createIf(this.makeIsTrueish(r,this.currentType),o,i);else{C=this.currentFunction.flow,A=this.currentFunction.getAndFreeTempLocal(this.currentType,!C.canOverflow(r,this.currentType));o=c.createIf(this.makeIsTrueish(c.createTeeLocal(A.index,r),this.currentType),c.createGetLocal(assert(A).index,this.currentType.toNativeType()),i)}break;default:assert(!1),o=this.module.createUnreachable()}return m?this.compileAssignmentWithValue(u,o,t!=g.Type.void):o},t.prototype.compileUnaryOverload=function(e,t,r,n){var i,a=0;return e.is(u.CommonFlags.INSTANCE)?(a=r,i=[]):i=[t],this.compileCallDirect(e,i,n,a,e.hasDecorator(h.DecoratorFlags.INLINE))},t.prototype.compileBinaryOverload=function(e,t,r,n,i){var a,s=0;if(e.is(u.CommonFlags.INSTANCE)){var o=assert(e.parent);assert(o.kind==h.ElementKind.CLASS),s=r,a=[n]}else a=[t,n];return this.compileCallDirect(e,a,i,s,e.hasDecorator(h.DecoratorFlags.INLINE))},t.prototype.compileAssignment=function(e,t,r){var n,i=this.program.resolver,a=this.currentFunction,s=i.resolveExpression(e,a);if(!s)return this.module.createUnreachable();switch(s.kind){case h.ElementKind.GLOBAL:if(!this.compileGlobal(s))return this.module.createUnreachable();assert(s.type!=g.Type.void);case h.ElementKind.LOCAL:case h.ElementKind.FIELD:n=s.type;break;case h.ElementKind.PROPERTY:var o=s.setterPrototype;if(o){var c=this.resolver.resolveFunction(o,null);if(!c)return this.module.createUnreachable();assert(1==c.signature.parameterTypes.length),n=c.signature.parameterTypes[0];break}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();case h.ElementKind.CLASS:if(i.currentElementExpression){var p=a.flow.is(8192),u=s.lookupOverload(h.OperatorKind.INDEXED_SET,p);if(!u)return s.lookupOverload(h.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!=g.Type.void);var d=this.compileExpression(t,n,1,0);return this.compileAssignmentWithValue(e,d,r!=g.Type.void)},t.prototype.compileAssignmentWithValue=function(e,t,r){void 0===r&&(r=!1);var n=this.module,i=this.resolver.resolveExpression(e,this.currentFunction);if(!i)return n.createUnreachable();switch(i.kind){case h.ElementKind.LOCAL:var a=i.type;if(assert(a!=g.Type.void),this.currentType=r?a:g.Type.void,i.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,i.internalName),n.createUnreachable();var s=this.currentFunction.flow;return a.is(36)&&s.setLocalWrapped(i.index,!s.canOverflow(t,a)),r?n.createTeeLocal(i.index,t):n.createSetLocal(i.index,t);case h.ElementKind.GLOBAL:if(!this.compileGlobal(i))return n.createUnreachable();a=i.type;if(assert(a!=g.Type.void),this.currentType=r?a:g.Type.void,i.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,i.internalName),n.createUnreachable();if(t=this.ensureSmallIntegerWrap(t,a),r){var o=a.toNativeType(),c=i.internalName;return n.createBlock(null,[n.createSetGlobal(c,t),n.createGetGlobal(c,o)],o)}return n.createSetGlobal(i.internalName,t);case h.ElementKind.FIELD:var p=i.declaration;if(i.is(u.CommonFlags.READONLY)&&!this.currentFunction.is(u.CommonFlags.CONSTRUCTOR)&&null!=p&&null==p.initializer)return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,i.internalName),n.createUnreachable();var d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0);a=i.type;this.currentType=r?a:g.Type.void;o=a.toNativeType();if(10==a.kind&&(t=this.ensureSmallIntegerWrap(t,a)),r){s=(L=this.currentFunction).flow;var m=L.getAndFreeTempLocal(a,!s.canOverflow(t,a)).index;return n.createBlock(null,[n.createSetLocal(m,t),n.createStore(a.byteSize,_,n.createGetLocal(m,o),o,i.memoryOffset),n.createGetLocal(m,o)],o)}return n.createStore(a.byteSize,_,t,o,i.memoryOffset);case h.ElementKind.PROPERTY:var y=i.setterPrototype;if(y){var E=this.resolver.resolveFunction(y,null);if(!E)return n.createUnreachable();if(!r){if(E.is(u.CommonFlags.INSTANCE)){d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0);return this.makeCallDirect(E,[_,t])}return this.makeCallDirect(E,[t])}var f=i.getterPrototype;assert(null!=f);var T=this.resolver.resolveFunction(f,null);if(!T)return n.createUnreachable();var I=(R=T.signature.returnType).toNativeType();if(E.is(u.CommonFlags.INSTANCE)){d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0),m=this.currentFunction.getAndFreeTempLocal(R,!1).index;return n.createBlock(null,[this.makeCallDirect(E,[n.createTeeLocal(m,_),t]),this.makeCallDirect(T,[n.createGetLocal(m,I)])],I)}return n.createBlock(null,[this.makeCallDirect(E,[t]),this.makeCallDirect(T)],I)}return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,i.internalName),n.createUnreachable();case h.ElementKind.CLASS:var v=this.resolver.currentElementExpression;if(v){var C=this.currentFunction.flow.is(8192),A=i.lookupOverload(h.OperatorKind.INDEXED_GET,C);if(!A)return this.error(l.DiagnosticCode.Index_signature_is_missing_in_type_0,e.range,i.internalName),n.createUnreachable();var N=i.lookupOverload(h.OperatorKind.INDEXED_SET,C);if(!N)return this.error(l.DiagnosticCode.Index_signature_in_type_0_only_permits_reading,e.range,i.internalName),this.currentType=r?A.signature.returnType:g.Type.void,n.createUnreachable();var S=i.type,O=(d=assert(this.resolver.currentThisExpression),_=this.compileExpressionRetainType(d,this.options.usizeType,0),this.compileExpression(v,g.Type.i32,1,0));if(r){var L,b=(L=this.currentFunction).getTempLocal(S,!1),k=L.getAndFreeTempLocal(this.currentType,!1),R=A.signature.returnType;return this.currentFunction.freeTempLocal(b),n.createBlock(null,[this.makeCallDirect(N,[n.createTeeLocal(b.index,_),n.createTeeLocal(k.index,O),t]),this.makeCallDirect(A,[n.createGetLocal(b.index,b.type.toNativeType()),n.createGetLocal(k.index,k.type.toNativeType())])],R.toNativeType())}return this.makeCallDirect(N,[_,O,t])}}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()},t.prototype.compileCallExpression=function(e,t){var r,n,i=this.module,a=this.currentFunction,s=this.resolver.resolveExpression(e.expression,a);if(!s)return i.createUnreachable();switch(s.kind){case h.ElementKind.FUNCTION_PROTOTYPE:var o=s,c=e.typeArguments;if(o.hasDecorator(h.DecoratorFlags.BUILTIN))return this.compileCallExpressionBuiltin(o,e,t);var p=null;if(c){if(!o.is(u.CommonFlags.GENERIC))return this.error(l.DiagnosticCode.Type_0_is_not_generic,e.expression.range,o.internalName),i.createUnreachable();p=this.resolver.resolveFunctionInclTypeArguments(o,c,m.makeMap(this.currentFunction.flow.contextualTypeArguments),e)}else{if(o.is(u.CommonFlags.GENERIC)){for(var d=new Map,y=assert(o.declaration.typeParameters),E=y.length,f=0;fs&&!i)||(this.error(l.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=!1);var a=t.length,s=e.signature;if(!this.checkCallSignature(s,a,0!=n,r))return this.module.createUnreachable();if(i){if(assert(!e.is(u.CommonFlags.TRAMPOLINE)),!this.currentInlineFunctions.includes(e)){this.currentInlineFunctions.push(e);var o=this.compileCallInlineUnchecked(e,t,r,n);return this.currentInlineFunctions.pop(),o}this.warning(l.DiagnosticCode.Function_0_cannot_be_inlined_into_itself,r.range,e.internalName)}var c=n?a+1:a,p=new Array(c),h=0;n&&(p[0]=n,h=1);for(var d=s.parameterTypes,_=0;_1?m.createBlock(null,v,T.toNativeType()):v.length?v[0]:m.createNop():(this.error(l.DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,y.signature.returnType.range),m.createUnreachable())},t.prototype.ensureTrampoline=function(e){var t=e.trampoline;if(t)return t;var r=e.signature,n=e.internalName,i=r.parameterTypes,a=e.prototype.declaration.signature.parameters,s=r.returnType,o=r.thisType,c=e.is(u.CommonFlags.INSTANCE),d=r.requiredParameters,_=d,m=i.length,y=m;c&&(++_,++y);var E=assert(y-_),f=new Array(_),T=0,I=this.module;c&&(f[0]=I.createGetLocal(0,this.options.nativeSizeType),T=1);for(var v=0;v=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(r=a),this.ensureFunctionType(e.parameterTypes,e.returnType,e.thisType);var c=this.module;if(n=0),this.currentType=A,this.module.createGetLocal(N,A.toNativeType());case h.ElementKind.GLOBAL:if(!this.compileGlobal(C))return this.module.createUnreachable();var S=C.type;return assert(S!=g.Type.void),C.is(u.CommonFlags.INLINED)?this.compileInlineConstant(C,t,r):(this.currentType=S,this.module.createGetGlobal(C.internalName,S.toNativeType()));case h.ElementKind.ENUMVALUE:return C.is(u.CommonFlags.COMPILED)?(this.currentType=g.Type.i32,C.is(u.CommonFlags.INLINED)?this.module.createI32(C.constantValue):this.module.createGetGlobal(C.internalName,1)):(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=g.Type.i32,this.module.createUnreachable());case h.ElementKind.FUNCTION_PROTOTYPE:var O=this.resolver.resolveFunction(C,null,m.makeMap(i.flow.contextualTypeArguments));if(!O||!this.compileFunction(O))return n.createUnreachable();var L=this.ensureFunctionTableEntry(O);return this.currentType=O.signature.type,this.module.createI32(L)}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()},t.prototype.compileInstanceOfExpression=function(e,t){var r=this.module,n=this.compileExpressionRetainType(e.expression,this.options.usizeType,0),i=this.currentType,a=this.resolver.resolveType(e.isType);return this.currentType=g.Type.bool,a?i.is(512)&&!a.is(512)?i.nonNullableType.isAssignableTo(a)?r.createBinary(i.is(64)?p.BinaryOp.NeI64:p.BinaryOp.NeI32,n,i.toNativeZero(r)):r.createI32(0):r.createI32(i.isAssignableTo(a,!0)?1:0):r.createUnreachable()},t.prototype.compileLiteralExpression=function(e,t,r){void 0===r&&(r=!1);var n=this.module;switch(e.literalKind){case _.LiteralKind.ARRAY:assert(!r);var i=t.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 _.LiteralKind.FLOAT:var a=e.value;return r&&(a=-a),t==g.Type.f32?n.createF32(a):(this.currentType=g.Type.f64,n.createF64(a));case _.LiteralKind.INTEGER:var s=e.value;r&&(s=i64_sub(i64_new(0),s));var o=this.resolver.determineIntegerLiteralType(s,t);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 _.LiteralKind.STRING:return assert(!r),this.compileStringLiteral(e);case _.LiteralKind.OBJECT:return assert(!r),this.compileObjectLiteral(e,t)}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.currentType=t,n.createUnreachable()},t.prototype.ensureStaticString=function(e){var t,r=this.program,n=r.hasGC,i=r.gcHeaderSize,a=assert(r.stringInstance),s=this.stringSegments;if(s.has(e))t=s.get(e);else{var o=e.length,l=a.currentMemoryOffset+1&-2,p=l+2*o,u=void 0,h=void 0;n?(u=new Uint8Array(i+p),h=i,m.writeI32(c.ensureGCHook(this,a),u,r.gcHookOffset)):(u=new Uint8Array(p),h=0),m.writeI32(o,u,h+a.offsetof("length")),h+=l;for(var d=0;d",t.toString()),r.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()),r.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()),r.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()),r.createUnreachable()}var a=e.names,s=a.length,o=e.values,c=n.members,p=!1,d=new Array(s+2),_=this.currentFunction.getTempLocal(this.options.usizeType);assert(s==o.length);for(var g=0,m=s;g=0);var c=this.compileExpressionRetainType(o,this.options.usizeType,0);return this.currentType=i.type,n.createLoad(i.type.byteSize,i.type.is(5),c,i.type.toNativeType(),i.memoryOffset);case h.ElementKind.PROPERTY:return this.compileGetter(i,e);case h.ElementKind.FUNCTION_PROTOTYPE:return this.error(l.DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set,e.range,i.simpleName),n.createUnreachable()}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()},t.prototype.compileGetter=function(e,t){var r=e.getterPrototype;if(r){var n=this.resolver.resolveFunction(r,null);if(!n)return this.module.createUnreachable();var i=n.signature;if(!this.checkCallSignature(i,0,n.is(u.CommonFlags.INSTANCE),t))return this.module.createUnreachable();var a=0!=(n.decoratorFlags&h.DecoratorFlags.INLINE);if(n.is(u.CommonFlags.INSTANCE)){var s=assert(n.parent);assert(s.kind==h.ElementKind.CLASS);var o=assert(this.resolver.currentThisExpression),c=this.compileExpressionRetainType(o,this.options.usizeType,0);//!!! +return this.currentType=i.returnType,this.compileCallDirect(n,[],t,c,a)}return this.currentType=i.returnType,this.compileCallDirect(n,[],t,0,a)}return this.error(l.DiagnosticCode.Property_0_does_not_exist_on_type_1,t.range,e.simpleName,e.parent.toString()),this.module.createUnreachable()},t.prototype.compileTernaryExpression=function(e,t){var r=e.ifThen,n=e.ifElse,i=this.currentFunction,a=i.flow,s=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,g.Type.bool,0),this.currentType);if(!this.options.noTreeShaking||this.currentFunction.isAny(u.CommonFlags.GENERIC|u.CommonFlags.GENERIC_CONTEXT)){var o=this.module.precomputeExpression(s);if(p.getExpressionId(o)==p.ExpressionId.Const&&1==p.getExpressionType(o))return p.getConstValueI32(o)?this.compileExpressionRetainType(r,t,0):this.compileExpressionRetainType(n,t,0);s=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,g.Type.bool,0),this.currentType)}var c=a.fork();i.flow=c;var h=this.compileExpressionRetainType(r,t,0),d=this.currentType;c.free();var _=a.fork();i.flow=_;var m=this.compileExpressionRetainType(n,t,0),y=this.currentType;i.flow=_.free(),a.inheritMutual(c,_);var E=g.Type.commonCompatible(d,y,!1);return E?(h=this.convertExpression(h,d,E,1,0,r),m=this.convertExpression(m,y,E,1,0,n),this.currentType=E,this.module.createIf(s,h,m)):(this.error(l.DiagnosticCode.Type_0_is_not_assignable_to_type_1,e.range,d.toString(),y.toString()),this.currentType=t,this.module.createUnreachable())},t.prototype.compileUnaryPostfixExpression=function(e,t){var r=this.module,n=this.currentFunction,i=this.compileExpression(e.operand,t==g.Type.void?g.Type.i32:t,0,0);if(p.getExpressionId(i)==p.ExpressionId.Unreachable)return i;var a,s=this.currentType,o=null;switch(t!=g.Type.void&&(o=n.getTempLocal(s,!1),i=r.createTeeLocal(o.index,i)),e.operator){case d.Token.PLUS_PLUS:switch(s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:a=r.createBinary(p.BinaryOp.AddI32,i,r.createI32(1));break;case 9:if(this.currentType.is(256)){if(u=this.currentType.classReference)if(_=u.lookupOverload(h.OperatorKind.POSTFIX_INC)){a=this.compileUnaryOverload(_,e.operand,i,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),r.createUnreachable()}case 4:var c=this.options;a=r.createBinary(c.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,i,s.toNativeOne(r));break;case 3:case 8:a=r.createBinary(p.BinaryOp.AddI64,i,r.createI64(1));break;case 11:a=r.createBinary(p.BinaryOp.AddF32,i,r.createF32(1));break;case 12:a=r.createBinary(p.BinaryOp.AddF64,i,r.createF64(1));break;default:return assert(!1),r.createUnreachable()}break;case d.Token.MINUS_MINUS:switch(s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:a=r.createBinary(p.BinaryOp.SubI32,i,r.createI32(1));break;case 9:if(this.currentType.is(256)){var u,_;if(u=this.currentType.classReference)if(_=u.lookupOverload(h.OperatorKind.POSTFIX_DEC)){a=this.compileUnaryOverload(_,e.operand,i,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),r.createUnreachable()}case 4:c=this.options;a=r.createBinary(c.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,i,s.toNativeOne(r));break;case 3:case 8:a=r.createBinary(p.BinaryOp.SubI64,i,r.createI64(1));break;case 11:a=r.createBinary(p.BinaryOp.SubF32,i,r.createF32(1));break;case 12:a=r.createBinary(p.BinaryOp.SubF64,i,r.createF64(1));break;default:return assert(!1),r.createUnreachable()}break;default:return assert(!1),r.createUnreachable()}if(!o)return this.currentType=g.Type.void,this.compileAssignmentWithValue(e.operand,a,!1);var m=this.compileAssignmentWithValue(e.operand,a,!1);this.currentType=o.type,n.freeTempLocal(o);var y=o.type.toNativeType();return r.createBlock(null,[m,r.createGetLocal(o.index,y)],y)},t.prototype.compileUnaryPrefixExpression=function(e,t){var r,n=this.module,i=!1;switch(e.operator){case d.Token.PLUS:if(r=this.compileExpression(e.operand,t==g.Type.void?g.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.PLUS)){r=this.compileUnaryOverload(s,e.operand,r,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}break;case d.Token.MINUS:if(e.operand.kind==_.NodeKind.LITERAL&&(e.operand.literalKind==_.LiteralKind.INTEGER||e.operand.literalKind==_.LiteralKind.FLOAT)){r=this.compileLiteralExpression(e.operand,t,!0),this.options.sourceMap&&this.addDebugLocation(r,e.range);break}if(r=this.compileExpression(e.operand,t==g.Type.void?g.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.MINUS)){r=this.compileUnaryOverload(s,e.operand,r,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:r=n.createBinary(p.BinaryOp.SubI32,n.createI32(0),r);break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,this.currentType.toNativeZero(n),r);break;case 3:case 8:r=n.createBinary(p.BinaryOp.SubI64,n.createI64(0),r);break;case 11:r=n.createUnary(p.UnaryOp.NegF32,r);break;case 12:r=n.createUnary(p.UnaryOp.NegF64,r);break;default:assert(!1),r=n.createUnreachable()}break;case d.Token.PLUS_PLUS:if(i=!0,r=this.compileExpression(e.operand,t==g.Type.void?g.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.PREFIX_INC)){r=this.compileUnaryOverload(s,e.operand,r,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:r=n.createBinary(p.BinaryOp.AddI32,r,this.module.createI32(1));break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,r,this.currentType.toNativeOne(n));break;case 3:case 8:r=n.createBinary(p.BinaryOp.AddI64,r,n.createI64(1));break;case 11:r=n.createBinary(p.BinaryOp.AddF32,r,n.createF32(1));break;case 12:r=n.createBinary(p.BinaryOp.AddF64,r,n.createF64(1));break;default:assert(!1),r=n.createUnreachable()}break;case d.Token.MINUS_MINUS:if(i=!0,r=this.compileExpression(e.operand,t==g.Type.void?g.Type.i32:t,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.PREFIX_DEC)){r=this.compileUnaryOverload(s,e.operand,r,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:r=n.createBinary(p.BinaryOp.SubI32,r,n.createI32(1));break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,r,this.currentType.toNativeOne(n));break;case 3:case 8:r=n.createBinary(p.BinaryOp.SubI64,r,n.createI64(1));break;case 11:r=n.createBinary(p.BinaryOp.SubF32,r,n.createF32(1));break;case 12:r=n.createBinary(p.BinaryOp.SubF64,r,n.createF64(1));break;default:assert(!1),r=n.createUnreachable()}break;case d.Token.EXCLAMATION:if(r=this.compileExpression(e.operand,t==g.Type.void?g.Type.i32:t,0,0),this.currentType.is(256))if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.NOT)){r=this.compileUnaryOverload(s,e.operand,r,e);break}r=this.makeIsFalseish(r,this.currentType),this.currentType=g.Type.bool;break;case d.Token.TILDE:if(r=this.compileExpression(e.operand,t==g.Type.void?g.Type.i32:t.is(8)?g.Type.i64:t,0,0),this.currentType.is(256)){var a,s;if(a=this.currentType.classReference)if(s=a.lookupOverload(h.OperatorKind.BITWISE_NOT)){r=this.compileUnaryOverload(s,e.operand,r,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}switch(r=this.convertExpression(r,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:r=n.createBinary(p.BinaryOp.XorI32,r,n.createI32(-1));break;case 9:case 4:r=n.createBinary(this.options.isWasm64?p.BinaryOp.XorI64:p.BinaryOp.XorI32,r,this.currentType.toNativeNegOne(n));break;case 3:case 8:r=n.createBinary(p.BinaryOp.XorI64,r,n.createI64(-1,-1));break;default:assert(!1),r=n.createUnreachable()}break;case d.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,r,t!=g.Type.void):r},t.prototype.ensureSmallIntegerWrap=function(e,t){var r=this.module,n=this.currentFunction.flow;switch(t.kind){case 0:n.canOverflow(e,t)&&(e=this.options.hasFeature(1)?r.createUnary(p.UnaryOp.ExtendI8ToI32,e):r.createBinary(p.BinaryOp.ShrI32,r.createBinary(p.BinaryOp.ShlI32,e,r.createI32(24)),r.createI32(24)));break;case 1:n.canOverflow(e,t)&&(e=this.options.hasFeature(1)?r.createUnary(p.UnaryOp.ExtendI16ToI32,e):r.createBinary(p.BinaryOp.ShrI32,r.createBinary(p.BinaryOp.ShlI32,e,r.createI32(16)),r.createI32(16)));break;case 5:n.canOverflow(e,t)&&(e=r.createBinary(p.BinaryOp.AndI32,e,r.createI32(255)));break;case 6:n.canOverflow(e,t)&&(e=r.createBinary(p.BinaryOp.AndI32,e,r.createI32(65535)));break;case 10:n.canOverflow(e,t)&&(e=r.createBinary(p.BinaryOp.NeI32,e,r.createI32(0)))}return e},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.createUnary(p.UnaryOp.EqzI32,e);case 3:case 8:return r.createUnary(p.UnaryOp.EqzI64,e);case 9:case 4:return r.createUnary(64==t.size?p.UnaryOp.EqzI64:p.UnaryOp.EqzI32,e);case 11:return r.createBinary(p.BinaryOp.EqF32,e,r.createF32(0));case 12:return r.createBinary(p.BinaryOp.EqF64,e,r.createF64(0));default:return assert(!1),r.createI32(1)}},t.prototype.makeIsTrueish=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 e;case 3:case 8:return r.createBinary(p.BinaryOp.NeI64,e,r.createI64(0));case 9:case 4:return 64==t.size?r.createBinary(p.BinaryOp.NeI64,e,r.createI64(0)):e;case 11:return r.createBinary(p.BinaryOp.NeF32,e,r.createF32(0));case 12:return r.createBinary(p.BinaryOp.NeF64,e,r.createF64(0));default:return assert(!1),r.createI32(0)}},t.prototype.makeAllocation=function(e){var t=this.program;assert(e.program==t);var r=this.module,n=this.options;if(t.hasGC&&e.type.isManaged(t)){var i=assert(t.gcAllocateInstance);return this.compileFunction(i)?(this.currentType=e.type,r.createCall(i.internalName,[n.isWasm64?r.createI64(e.currentMemoryOffset):r.createI32(e.currentMemoryOffset),r.createI32(c.ensureGCHook(this,e))],n.nativeSizeType)):r.createUnreachable()}return(i=t.memoryAllocateInstance)&&this.compileFunction(i)?(this.currentType=e.type,r.createCall(i.internalName,[n.isWasm64?r.createI64(e.currentMemoryOffset):r.createI32(e.currentMemoryOffset)],n.nativeSizeType)):r.createUnreachable()},t.prototype.makeFieldInitialization=function(e,t){var r,n;if(void 0===t&&(t=[]),assert(!this.currentFunction.flow.is(4096)),e.members){var i=this.module,s=this.options.nativeSizeType;try{for(var o=a(e.members.values()),c=o.next();!c.done;c=o.next()){var l=c.value;if(l.parent==e&&l.kind==h.ElementKind.FIELD){var p=l,d=p.type,_=d.toNativeType(),g=p.prototype.declaration;if(assert(!p.isAny(u.CommonFlags.CONST)),g.initializer)t.push(i.createStore(d.byteSize,i.createGetLocal(0,s),this.compileExpression(g.initializer,d,1,0),_,p.memoryOffset));else{var m=p.prototype.declaration.parameterIndex;t.push(i.createStore(d.byteSize,i.createGetLocal(0,s),m>=0?i.createGetLocal(1+m,_):d.toNativeZero(i),_,p.memoryOffset))}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return t},t.prototype.addDebugLocation=function(e,t){var r=this.currentFunction,n=t.source;n.debugInfoIndex<0&&(n.debugInfoIndex=this.module.addDebugInfoFile(n.normalizedPath)),t.debugInfoRef=e,r.debugLocations.push(t)},t}(l.DiagnosticEmitter);function I(e,t){if(E=t.range.source.simplePath,f=t.programLevelInternalName,e.hasDecorator(h.DecoratorFlags.EXTERNAL)){var r=e.program,n=assert(_.findDecorator(_.DecoratorKind.EXTERNAL,t.decorators)),i=n.arguments;if(i&&i.length){var a=i[0];a.kind==_.NodeKind.LITERAL&&a.literalKind==_.LiteralKind.STRING?(f=a.value,i.length>=2&&((a=i[1]).kind==_.NodeKind.LITERAL&&a.literalKind==_.LiteralKind.STRING?(E=f,f=a.value,i.length>2&&r.error(l.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,"2",i.length.toString())):r.error(l.DiagnosticCode.String_literal_expected,a.range))):r.error(l.DiagnosticCode.String_literal_expected,a.range)}else r.error(l.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,n.range,"1","0")}}t.Compiler=T},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.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.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.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.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"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 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 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 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,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(1),l=r(4),p=r(3),u=r(7),h=r(0),d=r(2),_=r(6);!function(e){e[e.REPORT=0]="REPORT",e[e.SWALLOW=1]="SWALLOW"}(o=t.ReportMode||(t.ReportMode={}));var g=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){if(void 0===t&&(t=null),void 0===r&&(r=o.REPORT),e.kind==p.NodeKind.SIGNATURE){var n=this.resolveSignature(e,t,r);return n?e.isNullable?n.type.asNullable():n.type:null}assert(e.kind==p.NodeKind.TYPE);var i=e,a=i.name.text,s=a,_=i.range.source.internalPath+h.PATH_DELIMITER+a,g=this.program.elementsLookup,m=void 0;if((m=g.get(_))||(m=g.get(s)))switch(m.kind){case l.ElementKind.ENUM:return null!==i.typeArguments&&i.typeArguments.length?(r==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,e.range,m.internalName),null):u.Type.i32;case l.ElementKind.CLASS_PROTOTYPE:var y=this.resolveClassInclTypeArguments(m,i.typeArguments,d.makeMap(t),e);return y?e.isNullable?y.type.asNullable():y.type:null}var E=this.program.typeAliases.get(a);if(E)return this.resolveType(E.type,t,r);var f=i.typeArguments,T=null;if(f){var I=f.length;T=new Array(I);for(var v=0;v",s+="<"+A+">")}else if(t){var N=t.get(s);if(N)return N}}var S=this.program.typesLookup,O=void 0;if((O=S.get(_))||(O=S.get(s)))return!O.is(256)&&e.isNullable&&r==o.REPORT&&this.error(c.DiagnosticCode.Basic_type_0_cannot_be_nullable,e.range,O.toString()),O;if("NATIVE"==a){if(!T||1!=T.length)return r==o.REPORT&&this.error(c.DiagnosticCode.Expected_0_type_arguments_but_got_1,i.range,"1",(f?f.length:1).toString(10)),null;switch(T[0].kind){case 0:case 1:case 2:return u.Type.i32;case 4:if(!this.program.options.isWasm64)return u.Type.i32;case 3:return u.Type.i64;case 5:case 6:case 7:case 10:return u.Type.u32;case 9:if(!this.program.options.isWasm64)return u.Type.u32;case 8:return u.Type.u64;case 11:return u.Type.f32;case 12:return u.Type.f64;case 13:return u.Type.void;default:assert(!1)}}return r==o.REPORT&&this.error(c.DiagnosticCode.Cannot_find_name_0,i.name.range,s),null},t.prototype.resolveSignature=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=o.REPORT);var n=e.explicitThisType,i=null;if(n&&!(i=this.resolveType(n,t,r)))return null;for(var a=e.parameters,s=a.length,c=new Array(s),l=new Array(s),h=0,d=!1,_=0;_s)return this.error(c.DiagnosticCode.Expected_0_type_arguments_but_got_1,u?p.Range.join(t[0].range,t[u-1].range):assert(n).range.atEnd,(u");var w=new l.Function(e,P,U,C||E,r);return _||e.instances.set(a,_=new Map),_.set(s,w),this.program.instancesLookup.set(P,w),w},t.prototype.resolveFunctionPartially=function(e,t,r){void 0===r&&(r=o.REPORT),assert(e.is(h.CommonFlags.INSTANCE));var n=assert(e.classPrototype);if(!t||!t.length)return e;var i=e.simpleName,a=u.typesToString(t),s=new l.FunctionPrototype(this.program,i,n.internalName+"<"+a+">"+h.INSTANCE_DELIMITER+i,e.declaration,n,e.decoratorFlags);return s.flags=e.flags,s.operatorKind=e.operatorKind,s.classTypeArguments=t,s.instances=e.instances,s},t.prototype.resolveFunctionInclTypeArguments=function(e,t,r,n,i){void 0===i&&(i=o.REPORT);var a=null;if(e.is(h.CommonFlags.GENERIC)){if(e.classTypeArguments&&e.applyClassTypeArguments(r),!(a=this.resolveTypeArguments(assert(e.declaration.typeParameters),t,r,n,i)))return null}else if(null!==t&&t.length)return i==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,n.range,e.internalName),null;return this.resolveFunction(e,a,r,i)},t.prototype.resolveClass=function(e,t,r,n){var i,_,g,m,y,E;void 0===r&&(r=d.makeMap()),void 0===n&&(n=o.REPORT);var f=t?u.typesToString(t):"",T=e.instances.get(f);if(T)return T;var I=e.declaration;if(t){var v=I.typeParameters,C=v.length,A=t.length;assert(A==C);for(var N=0;N",b+="<"+f+">"),(T=new l.Class(e,L,b,t,S)).contextualTypeArguments=r,e.instances.set(f,T),this.program.instancesLookup.set(b,T);var k=0;if(S){if(S.members){T.members||(T.members=new Map);try{for(var R=a(S.members.values()),x=R.next();!x.done;x=R.next()){var F=x.value;T.members.set(F.simpleName,F)}}catch(e){i={error:e}}finally{try{x&&!x.done&&(_=R.return)&&_.call(R)}finally{if(i)throw i.error}}}k=S.currentMemoryOffset}var D=e.constructorPrototype;if(D){var B=this.resolveFunctionPartially(D,t,n);if(!B)return null;T.constructorInstance=this.resolveFunction(B,null,d.makeMap(),n)}if(e.instanceMembers)try{for(var U=a(e.instanceMembers.values()),P=U.next();!P.done;P=U.next()){var w=P.value;switch(w.kind){case l.ElementKind.FIELD_PROTOTYPE:var M=w.declaration;if(T.members){if(T.members.has(w.simpleName)){this.error(c.DiagnosticCode.Duplicate_identifier_0,M.name.range,w.simpleName);break}}else T.members=new Map;var G=null;if(M.type)G=this.resolveType(M.type,T.contextualTypeArguments,n);else{if(null!==S&&null!==S.members){var K=S.members.get(w.simpleName);K&&!K.is(h.CommonFlags.PRIVATE)&&(assert(K.kind==l.ElementKind.FIELD),G=K.type)}G||n==o.REPORT&&this.error(c.DiagnosticCode.Type_expected,M.name.range.atEnd)}if(!G)break;var z=new l.Field(w,b+h.INSTANCE_DELIMITER+w.simpleName,G,M,T);switch(G.byteSize){case 1:break;case 2:1&k&&++k;break;case 4:3&k&&(k=1+(3|k));break;case 8:7&k&&(k=1+(7|k));break;default:assert(!1)}z.memoryOffset=k,k+=G.byteSize,T.members.set(w.simpleName,z);break;case l.ElementKind.FUNCTION_PROTOTYPE:T.members||(T.members=new Map);var V=this.resolveFunctionPartially(w,t,n);if(!V)return null;V.internalName=b+h.INSTANCE_DELIMITER+V.simpleName,T.members.set(w.simpleName,V);break;case l.ElementKind.PROPERTY:T.members||(T.members=new Map);var H=assert(w.getterPrototype),X=w.setterPrototype,W=new l.Property(this.program,w.simpleName,b+h.INSTANCE_DELIMITER+w.simpleName,e),Y=this.resolveFunctionPartially(H,t,n);if(!Y)return null;if(Y.internalName=b+h.INSTANCE_DELIMITER+Y.simpleName,W.getterPrototype=Y,X){var Q=this.resolveFunctionPartially(X,t,n);if(!Q)return null;Q.internalName=b+h.INSTANCE_DELIMITER+Q.simpleName,W.setterPrototype=Q}T.members.set(w.simpleName,W);break;default:assert(!1)}}}catch(e){g={error:e}}finally{try{P&&!P.done&&(m=U.return)&&m.call(U)}finally{if(g)throw g.error}}T.currentMemoryOffset=k;try{for(var q=a(e.overloadPrototypes),j=q.next();!j.done;j=q.next()){var Z=s(j.value,2),J=Z[0],$=Z[1];assert(J!=l.OperatorKind.INVALID);var ee=void 0;if($.is(h.CommonFlags.INSTANCE)){var te=this.resolveFunctionPartially($,t,n);if(!te)continue;ee=this.resolveFunction(te,null,d.makeMap(),n)}else ee=this.resolveFunction($,null,d.makeMap(),n);if(ee){var re=T.overloads;re||(T.overloads=re=new Map),re.set(J,ee)}}}catch(e){y={error:e}}finally{try{j&&!j.done&&(E=q.return)&&E.call(q)}finally{if(y)throw y.error}}return T},t.prototype.resolveClassInclTypeArguments=function(e,t,r,n,i){void 0===i&&(i=o.REPORT);var a=null;if(e.is(h.CommonFlags.GENERIC)){if(!(a=this.resolveTypeArguments(assert(e.declaration.typeParameters),t,r,n,i)))return null}else if(null!==t&&t.length)return i==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,n.range,e.internalName),null;return this.resolveClass(e,a,r,i)},t}(c.DiagnosticEmitter);t.Resolver=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),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 1:return void this.push(n.getConstValueI32(e).toString(10));case 2:return void this.push(i64_to_string(i64_new(n.getConstValueI64Low(e),n.getConstValueI64High(e))));case 3:return void this.push(n.getConstValueF32(e).toString(10));case 4: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.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.AtomicWake:}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 0:return"void";case 1:return"i32";case 2:return"i64";case 3:return"f32";case 4:return"f64";case 5:throw new Error("unreachable type");case-1: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(4),l=r(2),p=function(){function e(e,t){void 0===t&&(t=!1),this.todo=[],this.seen=new Set,this.program=e,this.includePrivate}return e.prototype.walk=function(){var e,t;try{for(var r=a(this.program.moduleLevelExports.values()),n=r.next();!n.done;n=r.next()){var i=n.value;this.visitElement(i.element)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}for(var s=this.todo;0"),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;_=!0}n=p.Node.createType(h,d,_,e.range(a,e.pos))}for(;e.skip(o.Token.OPENBRACKET);){var m=e.tokenPos;if(!e.skip(o.Token.CLOSEBRACKET))return r||this.error(c.DiagnosticCode._0_expected,e.range(),"]"),null;var y=e.range(m,e.pos);_=!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;_=!0}if(n=p.Node.createType(p.Node.createIdentifierExpression("Array",y),[n],_,e.range(a,e.pos)),_)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=p.ParameterKind.DEFAULT;if(e.skip(o.Token.DOT_DOT_DOT)&&(s=!0,e.discard(r),l=p.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 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(r),this.tryParseSignatureIsSignature=s,null;var h=p.Node.createIdentifierExpression(e.readIdentifier(),e.range(e.tokenPos,e.pos));if(e.skip(o.Token.QUESTION)&&(s=!0,e.discard(r),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(r);var d=this.parseType(e);if(!d)return this.tryParseSignatureIsSignature=s,null;var _=new p.ParameterNode;_.parameterKind=l,_.name=h,_.type=d,i?i.push(_):i=[_]}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,p.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=p.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=p.Node.createPropertyAccessExpression(n,p.Node.createIdentifierExpression(r,e.range()),e.range(t,e.pos))}var i=void 0;if(!e.skip(o.Token.OPENPAREN))return p.Node.createDecorator(n,null,e.range(t,e.pos));if(i=this.parseArguments(e))return p.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=p.Node.createVariableStatement(i,r,t,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=p.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 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,r,i,u)},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=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,r,t,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),u},t.prototype.parseEnumValue=function(e,t){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var r=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),n=null;return e.skip(o.Token.EQUALS)&&!(n=this.parseExpression(e,2))?null:p.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=p.Node.createReturnStatement(t,e.range());return e.skip(o.Token.SEMICOLON),r},t.prototype.parseTypeParameters=function(e){for(var t=new Array,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.push(n),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.GREATERTHAN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),">"),null}}return 0===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=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),r=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;r=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(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==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)?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 p.ParameterKind.OPTIONAL:i=!0;break;case p.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 u=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),h=null;if((n=e.skip(o.Token.QUESTION))&&r&&this.error(c.DiagnosticCode.A_rest_parameter_cannot_be_optional,u.range),e.skip(o.Token.COLON)){if(!(h=this.parseType(e)))return null}else h=p.Node.createOmittedType(e.range(e.pos));var d=null;if(e.skip(o.Token.EQUALS)&&(r&&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,!(d=this.parseExpression(e,2))))return null;var _=p.Node.createParameter(u,h,d,r?p.ParameterKind.REST:n?p.ParameterKind.OPTIONAL:p.ParameterKind.DEFAULT,o.Range.join(i,e.range()));return _.flags|=s,_}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=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;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 u=this.parseParameters(e);if(!u)return null;var h=this.parseParametersThis,d=0!=(t&a.CommonFlags.SET);d&&(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)),t&a.CommonFlags.GET&&u.length&&this.error(c.DiagnosticCode.A_get_accessor_cannot_have_parameters,i.range);var _=null;if(e.skip(o.Token.COLON)&&!(_=this.parseType(e,!0,d)))return null;_||(_=p.Node.createOmittedType(e.range(e.pos)),d||this.error(c.DiagnosticCode.Type_expected,_.range));var g=p.Node.createSignature(u,_,h,!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 y=p.Node.createFunctionDeclaration(i,l,g,m,r,t,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),y},t.prototype.parseFunctionExpression=function(e){var t,r=e.tokenPos,n=!1;if(e.token==o.Token.FUNCTION){if(t=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=!0,assert(e.token==o.Token.OPENPAREN),t=p.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(e.skip(o.Token.COLON)){if(!(l=this.parseType(e)))return null}else l=p.Node.createOmittedType(e.range(e.pos)),this.error(c.DiagnosticCode.Type_expected,l.range);if(n&&!e.skip(o.Token.EQUALS_GREATERTHAN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"=>"),null;var u,h=p.Node.createSignature(r,l,null,!1,e.range(s,e.pos));if(n)u=this.parseStatement(e,!1);else{if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"{"),null;u=this.parseBlockStatement(e,!1)}if(!u)return null;var d=p.Node.createFunctionDeclaration(t,null,h,u,null,n?a.CommonFlags.ARROW:a.CommonFlags.NONE,e.range(i,e.pos));return p.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,l=p.Node.createIdentifierExpression(e.readIdentifier(),e.range());if(e.skip(o.Token.LESSTHAN)){if(!(s=this.parseTypeParameters(e)))return null;t|=a.CommonFlags.GENERIC}else s=[];var u=null;if(e.skip(o.Token.EXTENDS)){var h=this.parseType(e);if(!h)return null;if(h.kind!=p.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,h.range),null;u=h}var d=null;if(e.skip(o.Token.IMPLEMENTS)){i&&this.error(c.DiagnosticCode.Interface_declaration_cannot_have_implements_clause,e.range());do{var _=this.parseType(e);if(!_)return null;i||(d||(d=[]),d.push(_))}while(e.skip(o.Token.COMMA))}if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(),"{"),null;var g,m=new Array;if(i?(assert(!d),g=p.Node.createInterfaceDeclaration(l,s,u,m,r,t,e.range(n,e.pos))):g=p.Node.createClassDeclaration(l,s,u,d,m,r,t,e.range(n,e.pos)),!e.skip(o.Token.CLOSEBRACE))do{var y=this.parseClassMember(e,g);if(!y)return null;y.parent=g,m.push(y)}while(!e.skip(o.Token.CLOSEBRACE));return g},t.prototype.parseClassExpression=function(e){var t,r=e.tokenPos;if(t=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(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)return null;s.parent=i,n.push(s)}while(!e.skip(o.Token.CLOSEBRACE));return p.Node.createClassExpression(i)},t.prototype.parseClassMember=function(e,t){var r=e.pos,n=t.kind==p.NodeKind.INTERFACEDECLARATION,i=new Array;if(e.skip(o.Token.AT)){do{var s=this.parseDecorator(e);if(!s)break;i.push(s)}while(e.skip(o.Token.AT));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 u=0,h=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,h=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,h=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,h=e.pos);var d=0,_=0,g=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,d=e.tokenPos,_=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,g=e.tokenPos,m=e.pos),t.flags&a.CommonFlags.GENERIC&&(l|=a.CommonFlags.GENERIC_CONTEXT));var y=0,E=0;e.skip(o.Token.READONLY)&&(l|=a.CommonFlags.READONLY,y=e.tokenPos,E=e.pos);var f,T=e.mark(),I=!1,v=!1,C=!1,A=0,N=0;if(n||(e.skip(o.Token.GET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(T):(l|=a.CommonFlags.GET,v=!0,A=e.tokenPos,N=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,E),"readonly")):e.skip(o.Token.SET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(T):(l|=a.CommonFlags.SET,C=!0,A=e.tokenPos,N=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,E),"readonly")):e.skip(o.Token.CONSTRUCTOR)&&(I=!0,(l|=a.CommonFlags.CONSTRUCTOR)&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(d,_),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(g,m),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,E),"readonly"))),I)f=p.Node.createConstructorExpression(e.range());else{if(!v&&!C&&e.skip(o.Token.OPENBRACKET)){l&a.CommonFlags.PUBLIC?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,h),"public"):l&a.CommonFlags.PROTECTED?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,h),"protected"):l&a.CommonFlags.PRIVATE&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,h),"protected"),l&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(d,_),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(g,m),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,E),"readonly");var S=this.parseIndexSignatureDeclaration(e,i);return S?(e.skip(o.Token.SEMICOLON),S):null}if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;f=p.Node.createIdentifierExpression(e.readIdentifier(),e.range())}var O=null;if(e.skip(o.Token.LESSTHAN)){var L=e.tokenPos;if(!(O=this.parseTypeParameters(e)))return null;I?this.error(c.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration,e.range(L,e.pos)):v||C?this.error(c.DiagnosticCode.An_accessor_cannot_have_type_parameters,e.range(L,e.pos)):l|=a.CommonFlags.GENERIC}if(e.skip(o.Token.OPENPAREN)){var b=e.tokenPos,k=this.parseParameters(e,I);if(!k)return null;var R=this.parseParametersThis;if(I)for(var x=0,F=k.length;x"),null):null;case o.Token.IDENTIFIER:return p.Node.createIdentifierExpression(e.readIdentifier(),e.range(r,e.pos));case o.Token.THIS:return p.Node.createThisExpression(e.range(r,e.pos));case o.Token.CONSTRUCTOR:return p.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()),p.Node.createSuperExpression(e.range(r,e.pos));case o.Token.STRINGLITERAL:return p.Node.createStringLiteralExpression(e.readString(),e.range(r,e.pos));case o.Token.INTEGERLITERAL:return p.Node.createIntegerLiteralExpression(e.readInteger(),e.range(r,e.pos));case o.Token.FLOATLITERAL:return p.Node.createFloatLiteralExpression(e.readFloat(),e.range(r,e.pos));case o.Token.SLASH:var f=e.readRegexpPattern();return e.skip(o.Token.SLASH)?p.Node.createRegexpLiteralExpression(f,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=new Array;do{if(e.peek()===o.Token.GREATERTHAN)break;var n=this.parseType(e,!0,!0);if(!n)return e.reset(t),null;r.push(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=h(n=e.peek()))>=t;){switch(e.next(),n){case o.Token.AS:var l=this.parseType(e);if(!l)return null;r=p.Node.createAssertionExpression(p.AssertionKind.AS,r,l,e.range(a,e.pos));break;case o.Token.EXCLAMATION:r=p.Node.createAssertionExpression(p.AssertionKind.NONNULL,r,null,e.range(a,e.pos));break;case o.Token.INSTANCEOF:var u=this.parseType(e);if(!u)return null;r=p.Node.createInstanceOfExpression(r,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;r=p.Node.createElementAccessExpression(r,s,e.range(a,e.pos));break;case o.Token.PLUS_PLUS:case o.Token.MINUS_MINUS:r.kind!=p.NodeKind.IDENTIFIER&&r.kind!=p.NodeKind.ELEMENTACCESS&&r.kind!=p.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=p.Node.createUnaryPostfixExpression(n,r,e.range(a,e.pos));break;case o.Token.QUESTION:var _=this.parseExpression(e);if(!_)return null;if(!e.skip(o.Token.COLON))return this.error(c.DiagnosticCode._0_expected,e.range(),":"),null;var g=this.parseExpression(e,t>1?2:1);if(!g)return null;r=p.Node.createTernaryExpression(r,_,g,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=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,d(n)?i:i+1)))return null;if(s.kind==p.NodeKind.IDENTIFIER)r=p.Node.createPropertyAccessExpression(r,s,e.range(a,e.pos));else{if(s.kind!=p.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,d(n)?i:i+1)))return null;r=p.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 p.NodeKind.IDENTIFIER:n.expression=p.Node.createPropertyAccessExpression(r,i,e.range(t,e.pos));break;case p.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(p.nodeIsCallable(t.kind))for(var r=null;e.skip(o.Token.OPENPAREN)||p.nodeIsGenericCallable(t.kind)&&null!==(r=this.tryParseTypeArgumentsBeforeArguments(e));){var n=this.parseArguments(e);if(!n)break;t=p.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()}}},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 h(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 d(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=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"}(t.Precedence||(t.Precedence={}))},function(e,t,r){r(16),e.exports=r(29)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(17),r(19),r(20),r(21);var n=r(5);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(18);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=0,t.ASC_NO_TREESHAKING=!1,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;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.isReference=function(e){return"object"==typeof e||"string"==typeof e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isArray=Array.isArray,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,t.JSMath.signbit=function(e){return r[0]=e,Boolean(n[1]>>>31&e==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)]}}).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(22);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?E:y;if(t){if(e<0)return E;if(e>=_)return C}else{if(e<=-g)return A;if(e+1>=g)return v}return e<0?c(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=o,n.fromNumber=c,n.fromBits=l;var p=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return y;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=c(p(r,8)),a=y,s=0;s>>0:this.low},N.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},N.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}},N.getHighBits=function(){return this.high},N.getHighBitsUnsigned=function(){return this.high>>>0},N.getLowBits=function(){return this.low},N.getLowBitsUnsigned=function(){return this.low>>>0},N.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},N.isOdd=function(){return 1==(1&this.low)},N.isEven=function(){return 0==(1&this.low)},N.equals=function(e){return i(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},N.eq=N.equals,N.notEquals=function(e){return!this.eq(e)},N.neq=N.notEquals,N.ne=N.notEquals,N.lessThan=function(e){return this.comp(e)<0},N.lt=N.lessThan,N.lessThanOrEqual=function(e){return this.comp(e)<=0},N.lte=N.lessThanOrEqual,N.le=N.lessThanOrEqual,N.greaterThan=function(e){return this.comp(e)>0},N.gt=N.greaterThan,N.greaterThanOrEqual=function(e){return this.comp(e)>=0},N.gte=N.greaterThanOrEqual,N.ge=N.greaterThanOrEqual,N.compare=function(e){if(i(e)||(e=h(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},N.comp=N.compare,N.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(f)},N.neg=N.negate,N.add=function(e){i(e)||(e=h(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,p=0,u=0,d=0,_=0;return d+=(_+=a+(65535&e.low))>>>16,u+=(d+=n+c)>>>16,p+=(u+=r+o)>>>16,p+=t+s,l((d&=65535)<<16|(_&=65535),(p&=65535)<<16|(u&=65535),this.unsigned)},N.subtract=function(e){return i(e)||(e=h(e)),this.add(e.neg())},N.sub=N.subtract,N.multiply=function(e){if(this.isZero())return y;if(i(e)||(e=h(e)),r)return l(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(A))return e.isOdd()?A:y;if(e.eq(A))return this.isOdd()?A:y;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,p=65535&e.high,u=e.low>>>16,d=65535&e.low,_=0,g=0,E=0,f=0;return E+=(f+=s*d)>>>16,g+=(E+=a*d)>>>16,E&=65535,g+=(E+=s*u)>>>16,_+=(g+=n*d)>>>16,g&=65535,_+=(g+=a*u)>>>16,g&=65535,_+=(g+=s*p)>>>16,_+=t*d+n*u+a*p+s*o,l((E&=65535)<<16|(f&=65535),(_&=65535)<<16|(g&=65535),this.unsigned)},N.mul=N.multiply,N.divide=function(e){if(i(e)||(e=h(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?E:y;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return E;if(e.gt(this.shru(1)))return T;a=E}else{if(this.eq(A))return e.eq(f)||e.eq(I)?A:e.eq(A)?f:(t=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?f:I:(n=this.sub(e.mul(t)),a=t.add(n.div(e)));if(e.eq(A))return this.unsigned?E:y;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=y}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:p(2,s-48),u=c(t),d=u.mul(e);d.isNegative()||d.gt(n);)d=(u=c(t-=o,this.unsigned)).mul(e);u.isZero()&&(u=f),a=a.add(u),n=n.sub(d)}return a},N.div=N.divide,N.modulo=function(e){return i(e)||(e=h(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))},N.mod=N.modulo,N.rem=N.modulo,N.not=function(){return l(~this.low,~this.high,this.unsigned)},N.and=function(e){return i(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},N.or=function(e){return i(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},N.xor=function(e){return i(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},N.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)},N.shr=N.shiftRight,N.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)},N.shru=N.shiftRightUnsigned,N.shr_u=N.shiftRightUnsigned,N.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},N.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},N.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},N.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]},N.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";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=r(1),a=r(3),s=r(7),o=r(5),c=r(4),l=r(11),p=r(0);function u(e,t,r,n,p,u){var m,y,E,f,T=e.module;switch(t.internalName){case"isInteger":var I=d(e,r,n,u);return e.currentType=s.Type.bool,I?I.is(4)&&!I.is(256)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isFloat":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?I.is(8)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isSigned":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?I.is(1)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isReference":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?I.is(256)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isString":I=d(e,r,n,u);if(e.currentType=s.Type.bool,!I)return T.createUnreachable();if(B=I.classReference){var v=e.program.stringInstance;if(v&&B.isAssignableTo(v))return T.createI32(1)}return T.createI32(0);case"isArray":I=d(e,r,n,u);return e.currentType=s.Type.bool,I?null!==(B=I.classReference)&&B.prototype.extends(e.program.arrayPrototype)?T.createI32(1):T.createI32(0):T.createUnreachable();case"isDefined":if(e.currentType=s.Type.bool,r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),1!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();var C=e.resolver.resolveExpression(n[0],e.currentFunction,s.Type.void,l.ReportMode.SWALLOW);return T.createI32(C?1:0);case"isConstant":if(e.currentType=s.Type.bool,r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),1!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();var A=e.compileExpressionRetainType(n[0],s.Type.i32,0);return e.currentType=s.Type.bool,T.createI32(o.getExpressionId(A)==o.ExpressionId.Const?1:0);case"isManaged":if(!e.program.hasGC)return e.currentType=s.Type.bool,T.createI32(0);I=d(e,r,n,u);return e.currentType=s.Type.bool,I?null===(B=I.classReference)||B.hasDecorator(c.DecoratorFlags.UNMANAGED)?T.createI32(0):T.createI32(1):T.createUnreachable();case"clz":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpression(n[0],s.Type.i32,0,1);switch(e.currentType.kind){case 0:case 1:case 5:case 6:f=T.createUnary(o.UnaryOp.ClzI32,m);break;case 10:case 2:case 7:f=T.createUnary(o.UnaryOp.ClzI32,m);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}case 4:f=T.createUnary(e.options.isWasm64?o.UnaryOp.ClzI64:o.UnaryOp.ClzI32,m);break;case 3:case 8:f=T.createUnary(o.UnaryOp.ClzI64,m);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"ctz":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],0,1)}else m=e.compileExpression(n[0],s.Type.i32,0,1);switch(e.currentType.kind){case 0:case 1:case 5:case 6:f=T.createUnary(o.UnaryOp.CtzI32,m);break;case 10:case 2:case 7:f=T.createUnary(o.UnaryOp.CtzI32,m);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}case 4:f=T.createUnary(e.options.isWasm64?o.UnaryOp.CtzI64:o.UnaryOp.CtzI32,m);break;case 3:case 8:f=T.createUnary(o.UnaryOp.CtzI64,m);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"popcnt":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpression(n[0],s.Type.i32,0,1);switch(e.currentType.kind){case 0:case 1:case 5:case 6:f=T.createUnary(o.UnaryOp.PopcntI32,m);break;case 10:case 2:case 7:f=T.createUnary(o.UnaryOp.PopcntI32,m);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}case 4:f=T.createUnary(e.options.isWasm64?o.UnaryOp.PopcntI64:o.UnaryOp.PopcntI32,m);break;case 3:case 8:f=T.createUnary(o.UnaryOp.PopcntI64,m);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"rotl":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpression(n[0],s.Type.i32,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,0),e.currentType.kind){case 0:case 1:case 5:case 6:case 10:f=e.ensureSmallIntegerWrap(T.createBinary(o.BinaryOp.RotlI32,m,y),e.currentType);case 2:case 7:f=T.createBinary(o.BinaryOp.RotlI32,m,y);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}case 4:f=T.createBinary(e.options.isWasm64?o.BinaryOp.RotlI64:o.BinaryOp.RotlI32,m,y);break;case 3:case 8:f=T.createBinary(o.BinaryOp.RotlI64,m,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"rotr":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpression(n[0],s.Type.i32,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,0),e.currentType.kind){case 0:case 1:case 5:case 6:case 10:f=e.ensureSmallIntegerWrap(T.createBinary(o.BinaryOp.RotrI32,m,y),e.currentType);break;case 2:case 7:f=T.createBinary(o.BinaryOp.RotrI32,m,y);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}case 4:f=T.createBinary(e.options.isWasm64?o.BinaryOp.RotrI64:o.BinaryOp.RotrI32,m,y);break;case 3:case 8:f=T.createBinary(o.BinaryOp.RotrI64,m,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"abs":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpression(n[0],s.Type.f64,0,1);switch(e.currentType.kind){case 0:case 1:case 2:var N=(b=e.currentFunction).getTempLocal(s.Type.i32,!1),S=b.getAndFreeTempLocal(s.Type.i32,!1).index,O=N.index;f=T.createBinary(o.BinaryOp.XorI32,T.createBinary(o.BinaryOp.AddI32,T.createTeeLocal(S,T.createBinary(o.BinaryOp.ShrI32,T.createTeeLocal(O,m),T.createI32(31))),T.createGetLocal(O,1)),T.createGetLocal(S,1)),b.freeTempLocal(N);break;case 4:var L=e.options,b=e.currentFunction,k=L.isWasm64;N=b.getTempLocal(L.usizeType,!1),S=b.getAndFreeTempLocal(L.usizeType,!1).index,O=N.index;f=T.createBinary(k?o.BinaryOp.XorI64:o.BinaryOp.XorI32,T.createBinary(k?o.BinaryOp.AddI64:o.BinaryOp.AddI32,T.createTeeLocal(S,T.createBinary(k?o.BinaryOp.ShrI64:o.BinaryOp.ShrI32,T.createTeeLocal(O,m),k?T.createI64(63):T.createI32(31))),T.createGetLocal(O,L.nativeSizeType)),T.createGetLocal(S,L.nativeSizeType)),b.freeTempLocal(N);break;case 3:N=(b=e.currentFunction).getTempLocal(s.Type.i64,!1),S=b.getAndFreeTempLocal(s.Type.i64,!1).index,O=N.index;f=T.createBinary(o.BinaryOp.XorI64,T.createBinary(o.BinaryOp.AddI64,T.createTeeLocal(S,T.createBinary(o.BinaryOp.ShrI64,T.createTeeLocal(O,m),T.createI64(63))),T.createGetLocal(O,2)),T.createGetLocal(S,2)),b.freeTempLocal(N);break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}case 5:case 6:case 7:case 8:case 10:f=m;break;case 11:f=T.createUnary(o.UnaryOp.AbsF32,m);break;case 12:f=T.createUnary(o.UnaryOp.AbsF64,m);break;case 13:f=T.createUnreachable();break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"max":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpression(n[0],s.Type.f64,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,1),e.currentType.kind){case 0:case 1:case 2:var R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(m,e.currentType));N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtI32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 5:case 6:case 7:case 10:R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(m,e.currentType)),N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtU32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 3:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtI64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 8:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.GtU64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 4:x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.GtI64:o.BinaryOp.GtI32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.GtU64:o.BinaryOp.GtU32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 11:f=T.createBinary(o.BinaryOp.MaxF32,m,y);break;case 12:f=T.createBinary(o.BinaryOp.MaxF64,m,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"min":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpression(n[0],s.Type.f64,0,1);switch(y=e.compileExpression(n[1],e.currentType,1,1),e.currentType.kind){case 0:case 1:case 2:R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(m,e.currentType)),N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtI32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 5:case 6:case 7:case 10:R=e.currentFunction.flow,x=e.currentFunction.getTempLocal(e.currentType,!R.canOverflow(m,e.currentType)),N=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(y,e.currentType));e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtU32,T.createGetLocal(x.index,1),T.createGetLocal(N.index,1)));break;case 3:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtI64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 8:x=e.currentFunction.getTempLocal(s.Type.i64,!1),N=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(o.BinaryOp.LtU64,T.createGetLocal(x.index,2),T.createGetLocal(N.index,2)));break;case 4:x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.LtI64:o.BinaryOp.LtI32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}x=e.currentFunction.getTempLocal(e.options.usizeType,!1),N=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);e.currentFunction.freeTempLocal(x),f=T.createSelect(T.createTeeLocal(x.index,m),T.createTeeLocal(N.index,y),T.createBinary(e.options.isWasm64?o.BinaryOp.LtU64:o.BinaryOp.LtU32,T.createGetLocal(x.index,e.options.nativeSizeType),T.createGetLocal(N.index,e.options.nativeSizeType)));break;case 11:f=T.createBinary(o.BinaryOp.MinF32,m,y);break;case 12:f=T.createBinary(o.BinaryOp.MinF64,m,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"ceil":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,0)}else m=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}default:f=m;break;case 11:f=T.createUnary(o.UnaryOp.CeilF32,m);break;case 12:f=T.createUnary(o.UnaryOp.CeilF64,m);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"floor":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,0)}else m=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}default:f=m;break;case 11:f=T.createUnary(o.UnaryOp.FloorF32,m);break;case 12:f=T.createUnary(o.UnaryOp.FloorF64,m);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"copysign":if(2!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,0)}else m=e.compileExpression(n[0],s.Type.f64,0,0);switch(y=e.compileExpression(n[1],e.currentType,1,0),e.currentType.kind){case 11:f=T.createBinary(o.BinaryOp.CopysignF32,m,y);break;case 12:f=T.createBinary(o.BinaryOp.CopysignF64,m,y);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"nearest":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,0)}else m=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}default:f=m;break;case 11:f=T.createUnary(o.UnaryOp.NearestF32,m);break;case 12:f=T.createUnary(o.UnaryOp.NearestF64,m);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"reinterpret":if(1!=n.length)return r&&1==r.length||(r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0")),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(!r||1!=r.length)return r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable();switch(r[0].kind){case 2:case 7:m=e.compileExpression(n[0],s.Type.f32,1,0),f=T.createUnary(o.UnaryOp.ReinterpretF32,m);break;case 3:case 8:m=e.compileExpression(n[0],s.Type.f64,1,0),f=T.createUnary(o.UnaryOp.ReinterpretF64,m);break;case 9:if(r[0].is(256))return e.error(i.DiagnosticCode.Operation_not_supported,u.range),e.currentType=r[0],T.createUnreachable();case 4:m=e.compileExpression(n[0],e.options.isWasm64?s.Type.f64:s.Type.f32,1,0),f=T.createUnary(e.options.isWasm64?o.UnaryOp.ReinterpretF64:o.UnaryOp.ReinterpretF32,m);break;case 11:m=e.compileExpression(n[0],s.Type.i32,1,0),f=T.createUnary(o.UnaryOp.ReinterpretI32,m);break;case 12:m=e.compileExpression(n[0],s.Type.i64,1,0),f=T.createUnary(o.UnaryOp.ReinterpretI64,m);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return e.currentType=r[0],f;case"sqrt":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,0)}else m=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 11:f=T.createUnary(o.UnaryOp.SqrtF32,m);break;case 12:f=T.createUnary(o.UnaryOp.SqrtF64,m);break;default:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"trunc":if(1!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(r&&r.length){if(e.currentType=r[0],1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,0)}else m=e.compileExpression(n[0],s.Type.f64,0,0);switch(e.currentType.kind){case 9:if(e.currentType.is(256)){e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable();break}default:f=m;break;case 11:f=T.createUnary(o.UnaryOp.TruncF32,m);break;case 12:f=T.createUnary(o.UnaryOp.TruncF64,m);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"load":return n.length<1||n.length>2?(r&&1==r.length||e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),n.length<1?e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"1",n.length.toString(10)):e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable()):r&&1==r.length?(m=e.compileExpression(n[0],e.options.usizeType,1,0),(U=2==n.length?_(e,n[1]):0)<0?T.createUnreachable():(e.currentType=r[0],T.createLoad(r[0].byteSize,r[0].is(5),m,r[0].is(4)&&p.is(4)&&p.size>r[0].size?(e.currentType=p).toNativeType():(e.currentType=r[0]).toNativeType(),U))):(r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable());case"store":if(e.currentType=s.Type.void,n.length<2||n.length>3)return r&&1==r.length||e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),n.length<2?e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"2",n.length.toString(10)):e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),T.createUnreachable();if(!r||1!=r.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable();m=e.compileExpression(n[0],e.options.usizeType,1,0),y=e.compileExpression(n[1],r[0],r[0].is(4)?0:1,0);I=void 0;return r[0].is(4)&&(!e.currentType.is(4)||e.currentType.size1)return r&&1==r.length||e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();if(!r||1!=r.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable();var B;if(!(B=r[0].classReference))return e.error(i.DiagnosticCode.Operation_not_supported,u.range),T.createUnreachable();var U=void 0;if(n.length){if(n[0].kind!=a.NodeKind.LITERAL||n[0].literalKind!=a.LiteralKind.STRING)return e.error(i.DiagnosticCode.String_literal_expected,n[0].range),T.createUnreachable();var P=n[0].value,w=B.members?B.members.get(P):null;if(!w||w.kind!=c.ElementKind.FIELD)return e.error(i.DiagnosticCode.Type_0_has_no_property_1,n[0].range,B.internalName,P),T.createUnreachable();U=w.memoryOffset}else U=B.currentMemoryOffset;return e.options.isWasm64?p.is(4)&&p.size<=32?(e.currentType=s.Type.u32,T.createI32(U)):T.createI64(U):p.is(4)&&64==p.size?(e.currentType=s.Type.u64,T.createI64(U)):T.createI32(U);case"select":if(3!=n.length)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),T.createUnreachable();if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,0)}else m=e.compileExpressionRetainType(n[0],s.Type.i32,0);I=e.currentType;switch(y=e.compileExpression(n[1],I,1,0),E=e.makeIsTrueish(e.compileExpressionRetainType(n[2],s.Type.bool,0),e.currentType),e.currentType=I,e.currentType.kind){case 0:case 1:case 5:case 6:case 10:default:f=T.createSelect(m,y,E);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=T.createUnreachable()}return f;case"unreachable":return 0!=n.length&&e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"0",n.length.toString(10)),r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),T.createUnreachable();case"memory.size":return e.currentType=s.Type.i32,0!=n.length&&e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"0",n.length.toString(10)),r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),T.createHost(o.HostOp.CurrentMemory);case"memory.grow":return e.currentType=s.Type.i32,1!=n.length?(e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"0",n.length.toString(10)),m=T.createUnreachable()):m=e.compileExpression(n[0],s.Type.i32,1,0),r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),T.createHost(o.HostOp.GrowMemory,null,[m]);case"memory.copy":if(r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),3!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),e.currentType=s.Type.void,T.createUnreachable();throw m=e.compileExpression(n[0],e.options.usizeType,1,0),y=e.compileExpression(n[1],e.options.usizeType,1,0),E=e.compileExpression(n[2],e.options.usizeType,1,0),e.currentType=s.Type.void,new Error("not implemented");case"memory.fill":if(r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),3!=n.length)return e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"3",n.length.toString(10)),e.currentType=s.Type.void,T.createUnreachable();throw m=e.compileExpression(n[0],e.options.usizeType,1,0),y=e.compileExpression(n[1],s.Type.u32,1,0),E=e.compileExpression(n[2],e.options.usizeType,1,0),e.currentType=s.Type.void,new Error("not implemented");case"changetype":return r&&1==r.length?1!=n.length?(e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),e.currentType=r[0],T.createUnreachable()):(m=e.compileExpressionRetainType(n[0],r[0],0),e.currentType=r[0],e.currentType.size!=r[0].size?(e.error(i.DiagnosticCode.Operation_not_supported,u.range),T.createUnreachable()):m):(r&&r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r?r.length.toString(10):"0"),T.createUnreachable());case"assert":if(n.length<1||n.length>2)return r&&(r.length&&(e.currentType=r[0].nonNullableType),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),n.length<1?e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"1",n.length.toString(10)):n.length>2&&e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"2",n.length.toString(10)),T.createUnreachable();if(r){if(r.length&&(e.currentType=r[0].nonNullableType),1!=r.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();m=e.compileExpression(n[0],r[0],1,1)}else m=e.compileExpressionRetainType(n[0],s.Type.bool,1);I=e.currentType;if(e.currentType=I.nonNullableType,e.options.noAssert)return p==s.Type.void?(e.currentType=s.Type.void,T.createNop()):m;var M=g(e,2==n.length?n[1]:null,u);if(e.currentType=I.nonNullableType,p==s.Type.void){switch(e.currentType.kind){default:f=T.createIf(T.createUnary(o.UnaryOp.EqzI32,m),M);break;case 3:case 8:f=T.createIf(T.createUnary(o.UnaryOp.EqzI64,m),M);break;case 4:case 9:f=T.createIf(T.createUnary(e.options.isWasm64?o.UnaryOp.EqzI64:o.UnaryOp.EqzI32,m),M);break;case 11:f=T.createIf(T.createBinary(o.BinaryOp.EqF32,m,T.createF32(0)),M);break;case 12:f=T.createIf(T.createBinary(o.BinaryOp.EqF64,m,T.createF64(0)),M);break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=M}e.currentType=s.Type.void}else switch(e.currentType.kind){case 0:case 1:case 5:case 6:case 10:R=e.currentFunction.flow;var G=e.currentFunction.getAndFreeTempLocal(e.currentType,!R.canOverflow(m,e.currentType));f=T.createIf(T.createTeeLocal(G.index,m),T.createGetLocal(G.index,1),M);break;case 2:case 7:default:G=e.currentFunction.getAndFreeTempLocal(s.Type.i32,!1);f=T.createIf(T.createTeeLocal(G.index,m),T.createGetLocal(G.index,1),M);break;case 3:case 8:G=e.currentFunction.getAndFreeTempLocal(s.Type.i64,!1);f=T.createIf(T.createUnary(o.UnaryOp.EqzI64,T.createTeeLocal(G.index,m)),M,T.createGetLocal(G.index,2));break;case 4:case 9:G=e.currentFunction.getAndFreeTempLocal(e.options.usizeType,!1);f=T.createIf(T.createUnary(e.options.isWasm64?o.UnaryOp.EqzI64:o.UnaryOp.EqzI32,T.createTeeLocal(G.index,m)),M,T.createGetLocal(G.index,e.options.nativeSizeType));break;case 11:G=e.currentFunction.getAndFreeTempLocal(s.Type.f32,!1);f=T.createIf(T.createBinary(o.BinaryOp.EqF32,T.createTeeLocal(G.index,m),T.createF32(0)),M,T.createGetLocal(G.index,3));break;case 12:G=e.currentFunction.getAndFreeTempLocal(s.Type.f64,!1);f=T.createIf(T.createBinary(o.BinaryOp.EqF64,T.createTeeLocal(G.index,m),T.createF64(0)),M,T.createGetLocal(G.index,4));break;case 13:e.error(i.DiagnosticCode.Operation_not_supported,u.range),f=M}return f;case"unchecked":return r&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),1!=n.length?(e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable()):((R=e.currentFunction.flow).set(8192),f=e.compileExpressionRetainType(n[0],p,0),R.unset(8192),f);case"call_indirect":if(n.length<1)return r&&(r.length&&(e.currentType=r[0]),1!=r.length&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10))),e.error(i.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,u.range,"1",n.length.toString(10)),T.createUnreachable();var K=void 0;if(r){if(1!=r.length)return r.length&&(e.currentType=r[0]),e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,u.range,"1",r.length.toString(10)),T.createUnreachable();K=r[0]}else K=p;if(m=e.compileExpressionRetainType(n[0],s.Type.u32,0),7!=e.currentType.kind)return e.error(i.DiagnosticCode.Operation_not_supported,n[0].range),T.createUnreachable();for(var z=n.length-1,V=new Array(z),H=new Array(z+1),X=K.toNativeType(),W=new Array(z),Y=0;Y void"),T.createUnreachable())}var ee=function(e,t,r,n,i){switch(t.internalName){case"i32.clz":return h("clz",e,s.Type.i32,r,s.Type.i32,i);case"i64.clz":return h("clz",e,s.Type.i64,r,s.Type.i64,i);case"i32.ctz":return h("ctz",e,s.Type.i32,r,s.Type.i32,i);case"i64.ctz":return h("ctz",e,s.Type.i64,r,s.Type.i64,i);case"i32.popcnt":return h("popcnt",e,s.Type.i32,r,s.Type.i32,i);case"i64.popcnt":return h("popcnt",e,s.Type.i64,r,s.Type.i64,i);case"i32.rotl":return h("rotl",e,s.Type.i32,r,s.Type.i32,i);case"i64.rotl":return h("rotl",e,s.Type.i64,r,s.Type.i64,i);case"i32.rotr":return h("rotr",e,s.Type.i32,r,s.Type.i32,i);case"i64.rotr":return h("rotr",e,s.Type.i64,r,s.Type.i64,i);case"f32.abs":return h("abs",e,s.Type.f32,r,s.Type.f32,i);case"f64.abs":return h("abs",e,s.Type.f64,r,s.Type.f64,i);case"f32.max":return h("max",e,s.Type.f32,r,s.Type.f32,i);case"f64.max":return h("max",e,s.Type.f64,r,s.Type.f64,i);case"f32.min":return h("min",e,s.Type.f32,r,s.Type.f32,i);case"f64.min":return h("min",e,s.Type.f64,r,s.Type.f64,i);case"f32.ceil":return h("ceil",e,s.Type.f32,r,s.Type.f32,i);case"f64.ceil":return h("ceil",e,s.Type.f64,r,s.Type.f64,i);case"f32.floor":return h("floor",e,s.Type.f32,r,s.Type.f32,i);case"f64.floor":return h("floor",e,s.Type.f64,r,s.Type.f64,i);case"f32.copysign":return h("copysign",e,s.Type.f32,r,s.Type.f32,i);case"f64.copysign":return h("copysign",e,s.Type.f64,r,s.Type.f64,i);case"f32.nearest":return h("nearest",e,s.Type.f32,r,s.Type.f32,i);case"f64.nearest":return h("nearest",e,s.Type.f64,r,s.Type.f64,i);case"i32.reinterpret_f32":return h("reinterpret",e,s.Type.i32,r,s.Type.f32,i);case"i64.reinterpret_f64":return h("reinterpret",e,s.Type.i64,r,s.Type.f64,i);case"f32.reinterpret_i32":return h("reinterpret",e,s.Type.f32,r,s.Type.i32,i);case"f64.reinterpret_i64":return h("reinterpret",e,s.Type.f64,r,s.Type.i64,i);case"f32.sqrt":return h("sqrt",e,s.Type.f32,r,s.Type.f32,i);case"f64.sqrt":return h("sqrt",e,s.Type.f64,r,s.Type.f64,i);case"f32.trunc":return h("trunc",e,s.Type.f32,r,s.Type.f32,i);case"f64.trunc":return h("trunc",e,s.Type.f64,r,s.Type.f64,i);case"i32.load8_s":return h("load",e,s.Type.i8,r,s.Type.i32,i);case"i32.load8_u":return h("load",e,s.Type.u8,r,s.Type.u32,i);case"i32.load16_s":return h("load",e,s.Type.i16,r,s.Type.i32,i);case"i32.load16_u":return h("load",e,s.Type.u16,r,s.Type.u32,i);case"i32.load":return h("load",e,s.Type.i32,r,s.Type.i32,i);case"i64.load8_s":return h("load",e,s.Type.i8,r,s.Type.i64,i);case"i64.load8_u":return h("load",e,s.Type.u8,r,s.Type.u64,i);case"i64.load16_s":return h("load",e,s.Type.i16,r,s.Type.i64,i);case"i64.load16_u":return h("load",e,s.Type.u16,r,s.Type.u64,i);case"i64.load32_s":return h("load",e,s.Type.i32,r,s.Type.i64,i);case"i64.load32_u":return h("load",e,s.Type.u32,r,s.Type.u64,i);case"i64.load":return h("load",e,s.Type.i64,r,s.Type.i64,i);case"f32.load":return h("load",e,s.Type.f32,r,s.Type.f32,i);case"f64.load":return h("load",e,s.Type.f64,r,s.Type.f64,i);case"i32.store8":return h("store",e,s.Type.i8,r,s.Type.i32,i);case"i32.store16":return h("store",e,s.Type.i16,r,s.Type.i32,i);case"i32.store":return h("store",e,s.Type.i32,r,s.Type.i32,i);case"i64.store8":return h("store",e,s.Type.i8,r,s.Type.i64,i);case"i64.store16":return h("store",e,s.Type.i16,r,s.Type.i64,i);case"i64.store32":return h("store",e,s.Type.i32,r,s.Type.i64,i);case"i64.store":return h("store",e,s.Type.i64,r,s.Type.i64,i);case"f32.store":return h("store",e,s.Type.f32,r,s.Type.f32,i);case"f64.store":return h("store",e,s.Type.f64,r,s.Type.f64,i)}return 0}(e,t,n,0,u);return ee?(r&&r.length&&e.error(i.DiagnosticCode.Type_0_is_not_generic,u.range,t.internalName),ee):(e.error(i.DiagnosticCode.Operation_not_supported,u.range),T.createUnreachable())}function h(e,t,r,n,i,a){var s=assert(t.program.elementsLookup.get(e));return assert(s.kind==c.ElementKind.FUNCTION_PROTOTYPE),u(t,s,[r],n,i,a)}function d(e,t,r,n){if(0==r.length)return t&&1==t.length?t[0]:(e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.range,"1",t?t.length.toString(10):"0"),null);if(1==r.length){if(t)if(1==t.length)e.compileExpression(r[0],t[0],1,0);else{if(t.length)return e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.range,"1",t.length.toString(10)),null;e.compileExpressionRetainType(r[0],s.Type.i32,0)}else e.compileExpressionRetainType(r[0],s.Type.i32,0);return e.currentType}return t&&t.length>1&&e.error(i.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.range,"1",t.length.toString(10)),e.error(i.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,"1",r.length.toString(10)),null}function _(e,t){var r,n;return e.options.isWasm64?(r=e.precomputeExpression(t,s.Type.usize64,1,0),(o.getExpressionId(r)!=o.ExpressionId.Const||2!=o.getExpressionType(r)||0!=o.getConstValueI64High(r)||(n=o.getConstValueI64Low(r))<0)&&(e.error(i.DiagnosticCode.Operation_not_supported,t.range),n=-1)):(r=e.precomputeExpression(t,s.Type.usize32,1,0),(o.getExpressionId(r)!=o.ExpressionId.Const||1!=o.getExpressionType(r)||(n=o.getConstValueI32(r))<0)&&(e.error(i.DiagnosticCode.Operation_not_supported,t.range),n=-1)),n}function g(e,t,r){var n=e.program,i=e.module,a=n.typesLookup.get("string");if(!a)return i.createUnreachable();var o=n.abortInstance;if(!o||!e.compileFunction(o))return i.createUnreachable();var c=null!=t?e.compileExpression(t,a,1,0):a.toNativeZero(i),l=e.ensureStaticString(r.range.source.normalizedPath);return e.currentType=s.Type.void,i.createBlock(null,[i.createCall(o.internalName,[c,l,i.createI32(r.range.line),i.createI32(r.range.column)],0),i.createUnreachable()])}t.compileCall=u,t.compileAbort=g,t.compileIterateRoots=function(e){var t,r,i=e.module,a=new Array;try{for(var o=n(e.program.elementsLookup.values()),l=o.next();!l.done;l=o.next()){var u=l.value;if(u.kind==c.ElementKind.GLOBAL){var h=u,d=h.type.classReference;if(h.is(p.CommonFlags.COMPILED)&&null!==d&&!d.hasDecorator(c.DecoratorFlags.UNMANAGED))if(h.is(p.CommonFlags.INLINED)){var _=h.constantIntegerValue;a.push(i.createCallIndirect(i.createGetLocal(0,1),[e.options.isWasm64?i.createI64(i64_low(_),i64_high(_)):i.createI32(i64_low(_))],"iv"))}else a.push(i.createCallIndirect(i.createGetLocal(0,1),[i.createGetGlobal(h.internalName,e.options.nativeSizeType)],"iv"))}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}var g=e.ensureFunctionType([s.Type.i32],s.Type.void);i.addFunction("~iterateRoots",g,[],a.length?i.createBlock(null,a):i.createNop())},t.ensureGCHook=function e(t,r){var i,a,l=t.program;assert(r.type.isManaged(l));var u=r.gcHookIndex;if(-1!=u)return u;var h=r.members;if(r.prototype.declaration.range.source.isLibrary&&null!==h&&h.has("__gc")){var d=assert(h.get("__gc"));assert(d.kind==c.ElementKind.FUNCTION_PROTOTYPE);var _=assert(l.resolver.resolveFunction(d,null));assert(_.is(p.CommonFlags.PRIVATE|p.CommonFlags.INSTANCE)),assert(!_.isAny(p.CommonFlags.AMBIENT|p.CommonFlags.VIRTUAL)),assert(0==_.signature.parameterTypes.length),assert(_.signature.returnType==s.Type.void),_.internalName=r.internalName+"~gc",assert(t.compileFunction(_));var g=t.ensureFunctionTableEntry(_);return r.gcHookIndex=g,g}var m=t.module,y=t.options,E=y.nativeSizeType,f=y.usizeType.byteSize,T=new Array;T.push(m.createIf(m.createUnary(y.isWasm64?o.UnaryOp.EqzI64:o.UnaryOp.EqzI32,m.createGetLocal(0,E)),m.createReturn()));var I=t.functionTable,v=I.length;I.push(""),r.gcHookIndex=v;var C=r.base;if(C?(assert(C.type.isManaged(l)),T.push(m.createCallIndirect(m.createI32(e(t,C.type.classReference)),[m.createGetLocal(0,E)],2==E?"Iv":"iv"))):T.push(m.createCall(assert(l.gcMarkInstance).internalName,[m.createGetLocal(0,E)],0)),h)try{for(var A=n(h.values()),N=A.next();!N.done;N=A.next()){var S=N.value;if(S.kind==c.ElementKind.FIELD&&S.parent===r&&S.type.isManaged(l)){var O=S.memoryOffset;assert(O>=0),T.push(m.createCall(assert(l.gcMarkInstance).internalName,[m.createLoad(f,!1,m.createGetLocal(0,E),E,O)],0))}}}catch(e){i={error:e}}finally{try{N&&!N.done&&(a=A.return)&&a.call(A)}finally{if(i)throw i.error}}var L=r.internalName+"~gc";return m.addFunction(L,t.ensureFunctionType(null,s.Type.void,y.usizeType),null,m.createBlock(null,T)),I[v]=L,v}},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>=65&&e<=90||e>=97&&e<=122||36==e||95==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>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36==e||95==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=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||i=0;)if(e.charCodeAt(a)==n){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),i-=r+3-a,r=a-1);break}if(a<0&&r>0&&(2!=r||46!=e.charCodeAt(0)||46!=e.charCodeAt(1))){i=(e=e.substring(r+4)).length;continue}}}r++}return i>0?e:"."}function a(e){for(var t=e.length;--t>0;)if(e.charCodeAt(t)==n)return e.substring(0,t);return"."}t.normalizePath=i,t.resolvePath=function(e,t){return e.startsWith("std/")?e:i(a(t)+String.fromCharCode(n)+e)},t.dirname=a},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)}},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),a=r(12),s=r(13),o=r(1);t.formatDiagnostic=o.formatDiagnosticMessage;var c=r(14);t.parseFile=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=null),n||(n=new c.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 && !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 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 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, 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, 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, arg0, arg1, arg2);\r\n }\r\n}\r\n","/**\r\n * Various compiler utilities.\r\n * @module util\r\n * @preferred\r\n *//***/\r\n\r\nexport * from \"./charcode\";\r\nexport * from \"./collections\";\r\nexport * from \"./path\";\r\nexport * from \"./text\";\r\nexport * from \"./binary\";\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 PATH_DELIMITER,\r\n STATIC_DELIMITER,\r\n INSTANCE_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 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.CALL:\r\n case NodeKind.ELEMENTACCESS:\r\n case NodeKind.PROPERTYACCESS:\r\n case NodeKind.PARENTHESIZED: 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 /** Parent node. */\r\n parent: Node | 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 // types\r\n\r\n static createType(\r\n name: IdentifierExpression,\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; name.parent = type;\r\n type.typeArguments = typeArguments; if (typeArguments) setParent(typeArguments, type);\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.createIdentifierExpression(\"\", 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; name.parent = elem;\r\n elem.extendsType = extendsType; if (extendsType) extendsType.parent = elem;\r\n elem.defaultType = defaultType; if (defaultType) defaultType.parent = elem;\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; name.parent = elem;\r\n elem.type = type; if (type) type.parent = elem;\r\n elem.initializer = initializer; if (initializer) initializer.parent = elem;\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; setParent(parameters, sig);\r\n sig.returnType = returnType; returnType.parent = sig;\r\n sig.explicitThisType = explicitThisType; if (explicitThisType) explicitThisType.parent = sig;\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; name.parent = stmt;\r\n stmt.arguments = args; if (args) setParent(args, stmt);\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 ): IdentifierExpression {\r\n var expr = new IdentifierExpression();\r\n expr.range = range;\r\n expr.text = name;\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; setParentIfNotNull(elements, expr);\r\n return expr;\r\n }\r\n\r\n static createAssertionExpression(\r\n assertionKind: AssertionKind,\r\n expression: Expression,\r\n toType: CommonTypeNode,\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; expression.parent = expr;\r\n expr.toType = toType; toType.parent = expr;\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; left.parent = expr;\r\n expr.right = right; right.parent = expr;\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; expression.parent = expr;\r\n expr.typeArguments = typeArgs; if (typeArgs) setParent(typeArgs, expr);\r\n expr.arguments = args; setParent(args, expr);\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; setParent(expressions, expr);\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; expression.parent = expr;\r\n expr.elementExpression = element; element.parent = expr;\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.flags = declaration.flags & CommonFlags.ARROW;\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; expression.parent = expr;\r\n expr.isType = isType; isType.parent = expr;\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; expression.parent = expr;\r\n expr.typeArguments = typeArgs; if (typeArgs) setParent(typeArgs, expr);\r\n expr.arguments = args; setParent(args, expr);\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; expression.parent = expr;\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; expression.parent = expr;\r\n expr.property = property; property.parent = expr;\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; condition.parent = expr;\r\n expr.ifThen = ifThen; ifThen.parent = expr;\r\n expr.ifElse = ifElse; ifElse.parent = expr;\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; operand.parent = expr;\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; operand.parent = expr;\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; setParent(statements, stmt);\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; if (label) label.parent = stmt;\r\n return stmt;\r\n }\r\n\r\n static createClassDeclaration(\r\n identifier: IdentifierExpression,\r\n typeParameters: TypeParameterNode[],\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; identifier.parent = stmt;\r\n stmt.typeParameters = typeParameters; setParent(typeParameters, stmt);\r\n stmt.extendsType = extendsType; if (extendsType) extendsType.parent = stmt;\r\n stmt.implementsTypes = implementsTypes; if (implementsTypes) setParent(implementsTypes, stmt);\r\n stmt.members = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; if (label) label.parent = stmt;\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; statement.parent = stmt;\r\n stmt.condition = condition; condition.parent = stmt;\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; name.parent = stmt;\r\n stmt.values = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = stmt;\r\n stmt.value = value; if (value) value.parent = stmt;\r\n return stmt;\r\n }\r\n\r\n static createExportStatement(\r\n members: ExportMember[] | null,\r\n path: StringLiteralExpression | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): ExportStatement {\r\n var stmt = new ExportStatement();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.members = members; if (members) setParent(members, stmt);\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 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; name.parent = stmt;\r\n stmt.externalName = externalName; externalName.parent = stmt;\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.name = name; name.parent = elem;\r\n if (!externalName) {\r\n externalName = name;\r\n } else {\r\n externalName.parent = elem;\r\n }\r\n elem.externalName = 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; expression.parent = stmt;\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; condition.parent = stmt;\r\n stmt.ifTrue = ifTrue; ifTrue.parent = stmt;\r\n stmt.ifFalse = ifFalse; if (ifFalse) ifFalse.parent = stmt;\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; if (decls) setParent(decls, stmt);\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 externalName: 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.externalName = externalName; externalName.parent = elem;\r\n if (!name) {\r\n name = externalName;\r\n } else {\r\n name.parent = elem;\r\n }\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[],\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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.extendsType = extendsType; if (extendsType) extendsType.parent = stmt;\r\n stmt.members = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = stmt;\r\n stmt.type = type; if (type) type.parent = stmt;\r\n stmt.initializer = initializer; if (initializer) initializer.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; if (initializer) initializer.parent = stmt;\r\n stmt.condition = condition; if (condition) condition.parent = stmt;\r\n stmt.incrementor = incrementor; if (incrementor) incrementor.parent = stmt;\r\n stmt.statement = statement; statement.parent = stmt;\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 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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.signature = signature; signature.parent = stmt;\r\n stmt.body = body; if (body) body.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; keyType.parent = elem;\r\n elem.valueType = valueType; valueType.parent = elem;\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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.signature = signature; signature.parent = stmt;\r\n stmt.body = body; if (body) body.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = stmt;\r\n stmt.members = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; if (value) value.parent = stmt;\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; condition.parent = stmt;\r\n stmt.cases = cases; setParent(cases, stmt);\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; if (label) label.parent = elem;\r\n elem.statements = statements; setParent(statements, elem);\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; value.parent = stmt;\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; setParent(statements, stmt);\r\n stmt.catchVariable = catchVariable;\r\n if (catchVariable) catchVariable.parent = stmt;\r\n stmt.catchStatements = catchStatements;\r\n if (catchStatements) setParent(catchStatements, stmt);\r\n stmt.finallyStatements = finallyStatements;\r\n if (finallyStatements) setParent(finallyStatements, stmt);\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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.type = alias; alias.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\r\n return stmt;\r\n }\r\n\r\n static createVariableStatement(\r\n declarations: VariableDeclaration[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): VariableStatement {\r\n var stmt = new VariableStatement();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.declarations = declarations; setParent(declarations, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = elem;\r\n elem.type = type; if (type) type.parent = elem;\r\n elem.initializer = initializer; if (initializer) initializer.parent = elem;\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; condition.parent = stmt;\r\n stmt.statement = statement; statement.parent = stmt;\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 annotation. */\r\nexport class TypeNode extends CommonTypeNode {\r\n kind = NodeKind.TYPE;\r\n\r\n /** Identifier reference. */\r\n name: IdentifierExpression;\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}\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}\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.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 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}\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}\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;\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\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}\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}\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}\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}\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}\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}\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\nexport function isLastStatement(statement: Statement): bool {\r\n var parent = assert(statement.parent);\r\n if (parent.kind == NodeKind.BLOCK) {\r\n let statements = (parent).statements;\r\n if (statements[statements.length - 1] === statement) {\r\n switch (assert(parent.parent).kind) {\r\n case NodeKind.FUNCTIONDECLARATION:\r\n case NodeKind.METHODDECLARATION: return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\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\r\n /** Simple name being declared. */\r\n name: IdentifierExpression;\r\n /** Array of decorators. */\r\n decorators: DecoratorNode[] | null = null;\r\n\r\n protected cachedProgramLevelInternalName: string | null = null;\r\n protected cachedFileLevelInternalName: string | null = null;\r\n\r\n /** Gets the mangled program-level internal name of this declaration. */\r\n get programLevelInternalName(): string {\r\n if (!this.cachedProgramLevelInternalName) {\r\n this.cachedProgramLevelInternalName = mangleInternalName(this, true);\r\n }\r\n return this.cachedProgramLevelInternalName;\r\n }\r\n\r\n /** Gets the mangled file-level internal name of this declaration. */\r\n get fileLevelInternalName(): string {\r\n if (!this.cachedFileLevelInternalName) {\r\n this.cachedFileLevelInternalName = mangleInternalName(this, false);\r\n }\r\n return this.cachedFileLevelInternalName;\r\n }\r\n\r\n /** Tests if this is a top-level declaration within its source file. */\r\n get isTopLevel(): bool {\r\n var parent = this.parent;\r\n if (!parent) {\r\n return false;\r\n }\r\n if (parent.kind == NodeKind.VARIABLE && !(parent = parent.parent)) {\r\n return false;\r\n }\r\n return parent.kind == NodeKind.SOURCE;\r\n }\r\n\r\n /** Tests if this declaration is a top-level export within its source file. */\r\n get isTopLevelExport(): bool {\r\n var parent = this.parent;\r\n if (!parent || (parent.kind == NodeKind.VARIABLE && !(parent = parent.parent))) {\r\n return false;\r\n }\r\n if (parent.kind == NodeKind.NAMESPACEDECLARATION) {\r\n return this.is(CommonFlags.EXPORT) && (parent).isTopLevelExport;\r\n }\r\n if (parent.kind == NodeKind.CLASSDECLARATION) {\r\n return this.is(CommonFlags.STATIC) && (parent).isTopLevelExport;\r\n }\r\n return parent.kind == NodeKind.SOURCE && this.is(CommonFlags.EXPORT);\r\n }\r\n\r\n /** Tests if this declaration needs an explicit export. */\r\n needsExplicitExport(member: ExportMember): bool {\r\n // This is necessary because module-level exports are automatically created\r\n // for top level declarations of all sorts. This function essentially tests\r\n // that there isn't a otherwise duplicate top-level export already.\r\n return (\r\n member.name.text != member.externalName.text || // if aliased\r\n this.range.source != member.range.source || // if a re-export\r\n !this.isTopLevelExport // if not top-level\r\n );\r\n }\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[];\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 DeclarationStatement {\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 /** Identifier being exported. */\r\n name: IdentifierExpression;\r\n /** Identifier seen when imported again. */\r\n externalName: 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 filespace 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}\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 within the constructor, if applicable. */\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/** 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\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 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 externalName: 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 a declaration's name to an internal name. */\r\nexport function mangleInternalName(declaration: DeclarationStatement, asGlobal: bool = false): string {\r\n var name = declaration.name.text;\r\n var parent = declaration.parent;\r\n if (!parent) return name;\r\n if (\r\n declaration.kind == NodeKind.VARIABLEDECLARATION &&\r\n parent.kind == NodeKind.VARIABLE\r\n ) { // skip over\r\n if (!(parent = parent.parent)) return name;\r\n }\r\n if (parent.kind == NodeKind.CLASSDECLARATION) {\r\n return mangleInternalName(parent, asGlobal) + (\r\n declaration.is(CommonFlags.STATIC)\r\n ? STATIC_DELIMITER\r\n : INSTANCE_DELIMITER\r\n ) + name;\r\n }\r\n if (\r\n parent.kind == NodeKind.NAMESPACEDECLARATION ||\r\n parent.kind == NodeKind.ENUMDECLARATION\r\n ) {\r\n return mangleInternalName(parent, asGlobal) +\r\n STATIC_DELIMITER + name;\r\n }\r\n return asGlobal\r\n ? name\r\n : declaration.range.source.internalPath + PATH_DELIMITER + name;\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// Helpers\r\n\r\n/** Sets the parent node on an array of nodes. */\r\nfunction setParent(nodes: Node[], parent: Node): void {\r\n for (let i = 0, k = nodes.length; i < k; ++i) {\r\n nodes[i].parent = parent;\r\n }\r\n}\r\n\r\n/** Sets the parent node on an array of nullable nodes. */\r\nfunction setParentIfNotNull(nodes: (Node | null)[], parent: Node): void {\r\n for (let i = 0, k = nodes.length; i < k; ++i) {\r\n let node = nodes[i];\r\n if (node) node.parent = parent;\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 LIBRARY_PREFIX,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX,\r\n FILESPACE_PREFIX\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 Range,\r\n CommonTypeNode,\r\n TypeParameterNode,\r\n DecoratorNode,\r\n DecoratorKind,\r\n\r\n Expression,\r\n IdentifierExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n StringLiteralExpression,\r\n\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 NativeType,\r\n FunctionRef,\r\n ExpressionRef,\r\n ExpressionId,\r\n BinaryOp,\r\n UnaryOp,\r\n\r\n getExpressionId,\r\n getGetLocalIndex,\r\n isTeeLocal,\r\n getSetLocalValue,\r\n getBinaryOp,\r\n getConstValueI32,\r\n getBinaryLeft,\r\n getBinaryRight,\r\n getUnaryOp,\r\n getExpressionType,\r\n getLoadBytes,\r\n isLoadSigned,\r\n getIfTrue,\r\n getIfFalse,\r\n getSelectThen,\r\n getSelectElse,\r\n getCallTarget,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getBlockName,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getConstValueI64Low,\r\n getGetGlobalName\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\n/** Represents a yet unresolved import. */\r\nclass QueuedImport {\r\n localName: string;\r\n externalName: string;\r\n externalNameAlt: string;\r\n declaration: ImportDeclaration | null; // not set if a filespace\r\n}\r\n\r\n/** Represents a yet unresolved export. */\r\nclass QueuedExport {\r\n externalName: string;\r\n isReExport: bool;\r\n member: ExportMember;\r\n}\r\n\r\n/** Represents a type alias. */\r\nclass TypeAlias {\r\n typeParameters: TypeParameterNode[] | null;\r\n type: CommonTypeNode;\r\n}\r\n\r\n/** Represents a module-level export. */\r\nclass ModuleExport {\r\n element: Element;\r\n identifier: IdentifierExpression;\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\nconst noTypesYet = new Map();\r\n\r\n/** Represents an AssemblyScript program. */\r\nexport class Program extends DiagnosticEmitter {\r\n\r\n /** Array of source files. */\r\n sources: Source[];\r\n /** Resolver instance. */\r\n resolver: Resolver;\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\r\n /** Elements by internal name. */\r\n elementsLookup: Map = new Map();\r\n /** Class and function instances by internal name. */\r\n instancesLookup: Map = new Map();\r\n /** Types by internal name. */\r\n typesLookup: Map = noTypesYet;\r\n /** Declared type aliases. */\r\n typeAliases: Map = new Map();\r\n /** File-level exports by exported name. */\r\n fileLevelExports: Map = new Map();\r\n /** Module-level exports by exported name. */\r\n moduleLevelExports: Map = new Map();\r\n /** Classes backing basic types like `i32`. */\r\n basicClasses: Map = new Map();\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 /** Start function reference. */\r\n startFunction: FunctionPrototype;\r\n /** Main function reference, if present. */\r\n mainFunction: FunctionPrototype | 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 /** 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 /** Currently processing filespace. */\r\n currentFilespace: Filespace;\r\n\r\n /** Constructs a new program, optionally inheriting parser diagnostics. */\r\n constructor(diagnostics: DiagnosticMessage[] | null = null) {\r\n super(diagnostics);\r\n this.resolver = new Resolver(this);\r\n this.sources = [];\r\n }\r\n\r\n /** Gets a source by its exact path. */\r\n getSource(normalizedPath: string): Source | null {\r\n var sources = this.sources;\r\n for (let i = 0, k = sources.length; i < k; ++i) {\r\n let source = sources[i];\r\n if (source.normalizedPath == normalizedPath) return source;\r\n }\r\n return null;\r\n }\r\n\r\n /** Looks up the source for the specified possibly ambiguous path. */\r\n lookupSourceByPath(normalizedPathWithoutExtension: string): Source | null {\r\n var tmp: string;\r\n return (\r\n this.getSource(normalizedPathWithoutExtension + \".ts\") ||\r\n this.getSource(normalizedPathWithoutExtension + \"/index.ts\") ||\r\n this.getSource((tmp = LIBRARY_PREFIX + normalizedPathWithoutExtension) + \".ts\") ||\r\n this.getSource( tmp + \"/index.ts\")\r\n );\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 // add built-in types\r\n this.typesLookup = new Map([\r\n [\"i8\", Type.i8],\r\n [\"i16\", Type.i16],\r\n [\"i32\", Type.i32],\r\n [\"i64\", Type.i64],\r\n [\"isize\", options.isizeType],\r\n [\"u8\", Type.u8],\r\n [\"u16\", Type.u16],\r\n [\"u32\", Type.u32],\r\n [\"u64\", Type.u64],\r\n [\"usize\", options.usizeType],\r\n [\"bool\", Type.bool],\r\n [\"f32\", Type.f32],\r\n [\"f64\", Type.f64],\r\n [\"void\", Type.void],\r\n [\"number\", Type.f64],\r\n [\"boolean\", Type.bool]\r\n ]);\r\n\r\n // add compiler hints\r\n this.setConstantInteger(\"ASC_TARGET\", Type.i32,\r\n i64_new(options.isWasm64 ? 2 : 1));\r\n this.setConstantInteger(\"ASC_NO_TREESHAKING\", Type.bool,\r\n i64_new(options.noTreeShaking ? 1 : 0, 0));\r\n this.setConstantInteger(\"ASC_NO_ASSERT\", Type.bool,\r\n i64_new(options.noAssert ? 1 : 0, 0));\r\n this.setConstantInteger(\"ASC_MEMORY_BASE\", Type.i32,\r\n i64_new(options.memoryBase, 0));\r\n this.setConstantInteger(\"ASC_OPTIMIZE_LEVEL\", Type.i32,\r\n i64_new(options.optimizeLevelHint, 0));\r\n this.setConstantInteger(\"ASC_SHRINK_LEVEL\", Type.i32,\r\n i64_new(options.shrinkLevelHint, 0));\r\n this.setConstantInteger(\"ASC_FEATURE_MUTABLE_GLOBAL\", Type.bool,\r\n i64_new(options.hasFeature(Feature.MUTABLE_GLOBAL) ? 1 : 0, 0));\r\n this.setConstantInteger(\"ASC_FEATURE_SIGN_EXTENSION\", Type.bool,\r\n i64_new(options.hasFeature(Feature.SIGN_EXTENSION) ? 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 queuedExtends = new Array();\r\n var queuedImplements = new Array();\r\n\r\n // build initial lookup maps of internal names to declarations\r\n for (let i = 0, k = this.sources.length; i < k; ++i) {\r\n let source = this.sources[i];\r\n\r\n // create one filespace per source\r\n let filespace = new Filespace(this, source);\r\n this.elementsLookup.set(filespace.internalName, filespace);\r\n this.currentFilespace = filespace;\r\n\r\n // process this source's statements\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.CLASSDECLARATION: {\r\n this.initializeClass(statement, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(statement);\r\n break;\r\n }\r\n case NodeKind.EXPORT: {\r\n this.initializeExports(statement, queuedExports);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(statement);\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.initializeImports(statement, queuedExports, queuedImports);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(statement);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(statement, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n this.initializeTypeAlias(statement);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(statement);\r\n break;\r\n }\r\n }\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; i < queuedImports.length;) {\r\n let queuedImport = queuedImports[i];\r\n let declaration = queuedImport.declaration;\r\n if (declaration) { // named\r\n let element = this.tryLocateImport(queuedImport.externalName, queuedExports);\r\n if (element) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n if (element = this.tryLocateImport(queuedImport.externalNameAlt, queuedExports)) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n declaration.range,\r\n (declaration.parent).path.value,\r\n declaration.externalName.text\r\n );\r\n ++i;\r\n }\r\n }\r\n } else { // filespace\r\n let element = this.elementsLookup.get(queuedImport.externalName);\r\n if (element) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n if (element = this.elementsLookup.get(queuedImport.externalNameAlt)) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n assert(false); // already reported by the parser not finding the file\r\n ++i;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // queued exports should be resolvable now that imports are finalized\r\n for (let [exportName, queuedExport] of queuedExports) {\r\n let currentExport: QueuedExport | null = queuedExport; // nullable below\r\n let element: Element | null;\r\n do {\r\n if (currentExport.isReExport) {\r\n if (element = this.fileLevelExports.get(currentExport.externalName)) {\r\n this.setExportAndCheckLibrary(\r\n exportName,\r\n element,\r\n queuedExport.member.externalName\r\n );\r\n break;\r\n }\r\n currentExport = queuedExports.get(currentExport.externalName);\r\n if (!currentExport) {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n queuedExport.member.externalName.range,\r\n ((queuedExport.member.parent).path).value,\r\n queuedExport.member.externalName.text\r\n );\r\n }\r\n } else {\r\n if (\r\n // normal export\r\n (element = this.elementsLookup.get(currentExport.externalName)) ||\r\n // library re-export\r\n (element = this.elementsLookup.get(currentExport.member.name.text))\r\n ) {\r\n this.setExportAndCheckLibrary(\r\n exportName,\r\n element,\r\n queuedExport.member.externalName\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n queuedExport.member.range, queuedExport.member.name.text\r\n );\r\n }\r\n break;\r\n }\r\n } while (currentExport);\r\n }\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 derivedPrototype = queuedExtends[i];\r\n let derivedDeclaration = derivedPrototype.declaration;\r\n let derivedType = assert(derivedDeclaration.extendsType);\r\n let baseElement = resolver.resolveIdentifier(derivedType.name, null); // reports\r\n if (!baseElement) continue;\r\n if (baseElement.kind == ElementKind.CLASS_PROTOTYPE) {\r\n let basePrototype = baseElement;\r\n derivedPrototype.basePrototype = basePrototype;\r\n } else {\r\n this.error(\r\n DiagnosticCode.A_class_may_only_extend_another_class,\r\n derivedType.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 element = this.elementsLookup.get(name);\r\n if (element) this.elementsLookup.set(alias, element);\r\n else throw new Error(\"element not found: \" + name);\r\n }\r\n }\r\n }\r\n\r\n // register 'ArrayBuffer'\r\n if (this.elementsLookup.has(\"ArrayBuffer\")) {\r\n let element = assert(this.elementsLookup.get(\"ArrayBuffer\"));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.arrayBufferInstance = resolver.resolveClass(element, null);\r\n }\r\n\r\n // register 'Array'\r\n if (this.elementsLookup.has(\"Array\")) {\r\n let element = assert(this.elementsLookup.get(\"Array\"));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.arrayPrototype = element;\r\n }\r\n\r\n // register 'String'\r\n if (this.elementsLookup.has(\"String\")) {\r\n let element = assert(this.elementsLookup.get(\"String\"));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n let instance = resolver.resolveClass(element, null);\r\n if (instance) {\r\n if (this.typesLookup.has(\"string\")) {\r\n let declaration = (element).declaration;\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, declaration.programLevelInternalName\r\n );\r\n } else {\r\n this.stringInstance = instance;\r\n this.typesLookup.set(\"string\", instance.type);\r\n }\r\n }\r\n }\r\n\r\n // register classes backing basic types\r\n this.registerBasicClass(TypeKind.I8, \"I8\");\r\n this.registerBasicClass(TypeKind.I16, \"I16\");\r\n this.registerBasicClass(TypeKind.I32, \"I32\");\r\n this.registerBasicClass(TypeKind.I64, \"I64\");\r\n this.registerBasicClass(TypeKind.ISIZE, \"Isize\");\r\n this.registerBasicClass(TypeKind.U8, \"U8\");\r\n this.registerBasicClass(TypeKind.U16, \"U16\");\r\n this.registerBasicClass(TypeKind.U32, \"U32\");\r\n this.registerBasicClass(TypeKind.U64, \"U64\");\r\n this.registerBasicClass(TypeKind.USIZE, \"Usize\");\r\n this.registerBasicClass(TypeKind.BOOL, \"Bool\");\r\n this.registerBasicClass(TypeKind.F32, \"F32\");\r\n this.registerBasicClass(TypeKind.F64, \"F64\");\r\n\r\n // register 'start'\r\n {\r\n let element = assert(this.elementsLookup.get(\"start\"));\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.startFunction = element;\r\n }\r\n\r\n // register 'main' if present\r\n if (this.moduleLevelExports.has(\"main\")) {\r\n let element = (this.moduleLevelExports.get(\"main\")).element;\r\n if (\r\n element.kind == ElementKind.FUNCTION_PROTOTYPE &&\r\n !(element).isAny(CommonFlags.GENERIC | CommonFlags.AMBIENT)\r\n ) {\r\n (element).set(CommonFlags.MAIN);\r\n this.mainFunction = element;\r\n }\r\n }\r\n\r\n // register 'abort' if present\r\n if (this.elementsLookup.has(\"abort\")) {\r\n let element = this.elementsLookup.get(\"abort\");\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let instance = this.resolver.resolveFunction(element, null);\r\n if (instance) this.abortInstance = instance;\r\n }\r\n\r\n // register 'memory.allocate' if present\r\n if (this.elementsLookup.has(\"memory\")) {\r\n let element = this.elementsLookup.get(\"memory\");\r\n let members = element.members;\r\n if (members) {\r\n if (members.has(\"allocate\")) {\r\n element = assert(members.get(\"allocate\"));\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let instance = this.resolver.resolveFunction(element, null);\r\n if (instance) this.memoryAllocateInstance = instance;\r\n }\r\n }\r\n }\r\n\r\n // register GC hooks if present\r\n if (\r\n this.elementsLookup.has(\"__gc_allocate\") &&\r\n this.elementsLookup.has(\"__gc_link\") &&\r\n this.elementsLookup.has(\"__gc_mark\")\r\n ) {\r\n // __gc_allocate(usize, (ref: usize) => void): usize\r\n let element = this.elementsLookup.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.elementsLookup.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.elementsLookup.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\r\n private registerBasicClass(typeKind: TypeKind, className: string): void {\r\n if (this.elementsLookup.has(className)) {\r\n let element = assert(this.elementsLookup.get(className));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n let classElement = this.resolver.resolveClass(element, null);\r\n if (classElement) this.basicClasses.set(typeKind, classElement);\r\n }\r\n }\r\n\r\n /** Sets a constant integer value. */\r\n setConstantInteger(globalName: string, type: Type, value: I64): void {\r\n assert(type.is(TypeFlags.INTEGER));\r\n var global = new Global(this, globalName, globalName, type, null, DecoratorFlags.NONE)\r\n .withConstantIntegerValue(value);\r\n global.set(CommonFlags.RESOLVED);\r\n this.elementsLookup.set(globalName, global);\r\n }\r\n\r\n /** Sets a constant float value. */\r\n setConstantFloat(globalName: string, type: Type, value: f64): void {\r\n assert(type.is(TypeFlags.FLOAT));\r\n var global = new Global(this, globalName, globalName, type, null, DecoratorFlags.NONE)\r\n .withConstantFloatValue(value);\r\n global.set(CommonFlags.RESOLVED);\r\n this.elementsLookup.set(globalName, global);\r\n }\r\n\r\n /** Tries to locate an import by traversing exports and queued exports. */\r\n private tryLocateImport(\r\n externalName: string,\r\n queuedNamedExports: Map\r\n ): Element | null {\r\n var element: Element | null;\r\n var fileLevelExports = this.fileLevelExports;\r\n do {\r\n if (element = fileLevelExports.get(externalName)) return element;\r\n let queuedExport = queuedNamedExports.get(externalName);\r\n if (!queuedExport) break;\r\n if (queuedExport.isReExport) {\r\n externalName = queuedExport.externalName;\r\n continue;\r\n }\r\n return this.elementsLookup.get(queuedExport.externalName);\r\n } while (true);\r\n return null;\r\n }\r\n\r\n /** Checks that only supported decorators are present. */\r\n private checkDecorators(\r\n decorators: DecoratorNode[],\r\n acceptedFlags: DecoratorFlags\r\n ): DecoratorFlags {\r\n var presentFlags = DecoratorFlags.NONE;\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 presentFlags |= 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 (presentFlags & 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 presentFlags |= flag;\r\n }\r\n }\r\n }\r\n return presentFlags;\r\n }\r\n\r\n /** Checks and sets up global options of an element. */\r\n private checkGlobal(\r\n element: Element,\r\n declaration: DeclarationStatement\r\n ): void {\r\n var parentNode = declaration.parent;\r\n // alias globally if explicitly annotated @global or exported from a top-level library file\r\n if (\r\n (element.hasDecorator(DecoratorFlags.GLOBAL)) ||\r\n (\r\n declaration.range.source.isLibrary &&\r\n element.is(CommonFlags.EXPORT) &&\r\n (\r\n assert(parentNode).kind == NodeKind.SOURCE ||\r\n (\r\n parentNode).kind == NodeKind.VARIABLE &&\r\n assert((parentNode).parent).kind == NodeKind.SOURCE\r\n )\r\n )\r\n ) {\r\n let globalName = declaration.programLevelInternalName;\r\n if (this.elementsLookup.has(globalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, element.internalName\r\n );\r\n } else {\r\n this.elementsLookup.set(globalName, element);\r\n }\r\n }\r\n // builtins use the global name directly\r\n if (element.hasDecorator(DecoratorFlags.BUILTIN)) {\r\n element.internalName = declaration.programLevelInternalName;\r\n }\r\n }\r\n\r\n /** Initializes a class declaration. */\r\n private initializeClass(\r\n declaration: ClassDeclaration,\r\n queuedExtends: ClassPrototype[],\r\n queuedImplements: ClassPrototype[],\r\n namespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n\r\n var decorators = declaration.decorators;\r\n var simpleName = declaration.name.text;\r\n var prototype = new ClassPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.SEALED |\r\n DecoratorFlags.UNMANAGED\r\n )\r\n : DecoratorFlags.NONE\r\n );\r\n prototype.parent = namespace;\r\n this.elementsLookup.set(internalName, prototype);\r\n\r\n var implementsTypes = declaration.implementsTypes;\r\n if (implementsTypes) {\r\n let numImplementsTypes = implementsTypes.length;\r\n if (prototype.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\r\n // remember classes that implement interfaces\r\n } else if (numImplementsTypes) {\r\n for (let i = 0; i < numImplementsTypes; ++i) {\r\n this.warning( // TODO\r\n DiagnosticCode.Operation_not_supported,\r\n implementsTypes[i].range\r\n );\r\n }\r\n queuedImplements.push(prototype);\r\n }\r\n }\r\n\r\n // remember classes that extend another one\r\n if (declaration.extendsType) queuedExtends.push(prototype);\r\n\r\n // add as namespace member if applicable\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, prototype);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && prototype.is(CommonFlags.EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n // otherwise add to file-level exports if exported\r\n } else if (prototype.is(CommonFlags.EXPORT)) {\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, prototype);\r\n this.currentFilespace.members.set(simpleName, prototype);\r\n if (prototype.is(CommonFlags.EXPORT) && declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: prototype,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\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, prototype);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeAccessor(memberDeclaration, prototype);\r\n } else {\r\n this.initializeMethod(memberDeclaration, prototype);\r\n }\r\n break;\r\n }\r\n case NodeKind.INDEXSIGNATUREDECLARATION: break; // ignored for now\r\n default: {\r\n assert(false); // should have been reported while parsing\r\n return;\r\n }\r\n }\r\n }\r\n\r\n this.checkGlobal(prototype, declaration);\r\n }\r\n\r\n /** Initializes a field of a class or interface. */\r\n private initializeField(\r\n declaration: FieldDeclaration,\r\n classPrototype: ClassPrototype\r\n ): void {\r\n var name = declaration.name.text;\r\n var internalName = declaration.fileLevelInternalName;\r\n var decorators = declaration.decorators;\r\n var isInterface = classPrototype.kind == ElementKind.INTERFACE_PROTOTYPE;\r\n\r\n // static fields become global variables\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n if (isInterface) {\r\n // should have been reported while parsing\r\n assert(false);\r\n }\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n if (classPrototype.members) {\r\n if (classPrototype.members.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.members = new Map();\r\n }\r\n let staticField = new Global(\r\n this,\r\n name,\r\n internalName,\r\n Type.void, // resolved later on\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators, DecoratorFlags.INLINE)\r\n : DecoratorFlags.NONE\r\n );\r\n staticField.parent = classPrototype;\r\n classPrototype.members.set(name, staticField);\r\n this.elementsLookup.set(internalName, staticField);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n staticField.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n if (staticField.hasDecorator(DecoratorFlags.INLINE) && !staticField.is(CommonFlags.READONLY)) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n assert(findDecorator(DecoratorKind.INLINE, decorators)).range, \"inline\"\r\n );\r\n }\r\n\r\n // instance fields are remembered until resolved\r\n } else {\r\n if (isInterface) {\r\n // should have been reported while parsing\r\n assert(!declaration.isAny(CommonFlags.ABSTRACT | CommonFlags.GET | CommonFlags.SET));\r\n }\r\n if (classPrototype.instanceMembers) {\r\n if (classPrototype.instanceMembers.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.instanceMembers = new Map();\r\n }\r\n let instanceField = new FieldPrototype(\r\n classPrototype,\r\n name,\r\n internalName,\r\n declaration\r\n );\r\n if (decorators) this.checkDecorators(decorators, DecoratorFlags.NONE);\r\n classPrototype.instanceMembers.set(name, instanceField);\r\n }\r\n }\r\n\r\n /** Initializes a method of a class or interface. */\r\n private initializeMethod(\r\n declaration: MethodDeclaration,\r\n classPrototype: ClassPrototype\r\n ): void {\r\n var simpleName = declaration.name.text;\r\n var internalName = declaration.fileLevelInternalName;\r\n var prototype: FunctionPrototype | null = null;\r\n\r\n var decorators = declaration.decorators;\r\n var decoratorFlags = DecoratorFlags.NONE;\r\n if (decorators) {\r\n decoratorFlags = this.checkDecorators(decorators,\r\n DecoratorFlags.OPERATOR_BINARY |\r\n DecoratorFlags.OPERATOR_PREFIX |\r\n DecoratorFlags.OPERATOR_POSTFIX |\r\n DecoratorFlags.INLINE\r\n );\r\n }\r\n\r\n // static methods become global functions\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n assert(declaration.name.kind != NodeKind.CONSTRUCTOR);\r\n\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0, declaration.name.range,\r\n internalName\r\n );\r\n return;\r\n }\r\n if (classPrototype.members) {\r\n if (classPrototype.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.members = new Map();\r\n }\r\n prototype = new FunctionPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n classPrototype,\r\n decoratorFlags\r\n );\r\n classPrototype.members.set(simpleName, prototype);\r\n this.elementsLookup.set(internalName, prototype);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n // instance methods are remembered until resolved\r\n } else {\r\n if (classPrototype.instanceMembers) {\r\n if (classPrototype.instanceMembers.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.instanceMembers = new Map();\r\n }\r\n prototype = new FunctionPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n classPrototype,\r\n decoratorFlags\r\n );\r\n // if (classPrototype.isUnmanaged && instancePrototype.isAbstract) {\r\n // this.error( Unmanaged classes cannot declare abstract methods. );\r\n // }\r\n if (declaration.name.kind == NodeKind.CONSTRUCTOR) {\r\n if (classPrototype.constructorPrototype) {\r\n this.error(\r\n DiagnosticCode.Multiple_constructor_implementations_are_not_allowed,\r\n declaration.name.range\r\n );\r\n } else {\r\n prototype.set(CommonFlags.CONSTRUCTOR);\r\n classPrototype.constructorPrototype = prototype;\r\n }\r\n } else {\r\n classPrototype.instanceMembers.set(simpleName, prototype);\r\n }\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n\r\n this.checkOperatorOverloads(declaration.decorators, prototype, classPrototype);\r\n }\r\n\r\n private checkOperatorOverloads(\r\n decorators: DecoratorNode[] | null,\r\n prototype: FunctionPrototype,\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(0)\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private initializeAccessor(\r\n declaration: MethodDeclaration,\r\n classPrototype: ClassPrototype\r\n ): void {\r\n var simpleName = declaration.name.text;\r\n var internalPropertyName = declaration.fileLevelInternalName;\r\n var propertyElement = this.elementsLookup.get(internalPropertyName);\r\n var isGetter = declaration.is(CommonFlags.GET);\r\n var isNew = false;\r\n if (propertyElement) {\r\n if (\r\n propertyElement.kind != ElementKind.PROPERTY ||\r\n (isGetter\r\n ? (propertyElement).getterPrototype\r\n : (propertyElement).setterPrototype\r\n ) != null\r\n ) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalPropertyName\r\n );\r\n return;\r\n }\r\n } else {\r\n propertyElement = new Property(\r\n this,\r\n simpleName,\r\n internalPropertyName,\r\n classPrototype\r\n );\r\n isNew = true;\r\n }\r\n\r\n var decorators = declaration.decorators;\r\n var decoratorFlags = DecoratorFlags.NONE;\r\n if (decorators) {\r\n decoratorFlags = this.checkDecorators(decorators,\r\n DecoratorFlags.INLINE\r\n );\r\n }\r\n\r\n var baseName = (isGetter ? GETTER_PREFIX : SETTER_PREFIX) + simpleName;\r\n\r\n // static accessors become global functions\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n let staticName = classPrototype.internalName + STATIC_DELIMITER + baseName;\r\n if (this.elementsLookup.has(staticName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, staticName\r\n );\r\n return;\r\n }\r\n let staticPrototype = new FunctionPrototype(\r\n this,\r\n baseName,\r\n staticName,\r\n declaration,\r\n null,\r\n decoratorFlags\r\n );\r\n if (isGetter) {\r\n (propertyElement).getterPrototype = staticPrototype;\r\n } else {\r\n (propertyElement).setterPrototype = staticPrototype;\r\n }\r\n if (isNew) {\r\n if (classPrototype.members) {\r\n if (classPrototype.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, staticName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.members = new Map();\r\n }\r\n classPrototype.members.set(simpleName, propertyElement); // check above\r\n } else {\r\n assert(classPrototype.members && classPrototype.members.has(simpleName));\r\n }\r\n this.elementsLookup.set(internalPropertyName, propertyElement);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n propertyElement.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n // instance accessors are remembered until resolved\r\n } else {\r\n let instanceName = classPrototype.internalName + INSTANCE_DELIMITER + baseName;\r\n if (classPrototype.instanceMembers) {\r\n if (classPrototype.instanceMembers.has(baseName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalPropertyName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.instanceMembers = new Map();\r\n }\r\n let instancePrototype = new FunctionPrototype(\r\n this,\r\n baseName,\r\n instanceName,\r\n declaration,\r\n classPrototype,\r\n decoratorFlags\r\n );\r\n if (isGetter) {\r\n (propertyElement).getterPrototype = instancePrototype;\r\n } else {\r\n (propertyElement).setterPrototype = instancePrototype;\r\n }\r\n classPrototype.instanceMembers.set(baseName, propertyElement);\r\n this.elementsLookup.set(internalPropertyName, propertyElement);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n propertyElement.set(CommonFlags.MODULE_EXPORT);\r\n instancePrototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n }\r\n\r\n private initializeEnum(\r\n declaration: EnumDeclaration,\r\n namespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n var simpleName = declaration.name.text;\r\n var element = new Enum(this, simpleName, internalName, declaration);\r\n element.parent = namespace;\r\n this.elementsLookup.set(internalName, element);\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, element);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && element.is(CommonFlags.EXPORT)) {\r\n element.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (element.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, element);\r\n this.currentFilespace.members.set(simpleName, element);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n element.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n\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 this.checkGlobal(element, declaration);\r\n }\r\n\r\n private initializeEnumValue(\r\n declaration: EnumValueDeclaration,\r\n enm: Enum\r\n ): void {\r\n var name = declaration.name.text;\r\n var internalName = declaration.fileLevelInternalName;\r\n if (enm.members) {\r\n if (enm.members.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n enm.members = new Map();\r\n }\r\n var value = new EnumValue(enm, this, name, internalName, declaration);\r\n enm.members.set(name, value);\r\n if (enm.is(CommonFlags.MODULE_EXPORT)) {\r\n value.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n\r\n private initializeExports(\r\n statement: ExportStatement,\r\n queuedExports: Map\r\n ): void {\r\n var members = statement.members;\r\n if (members) { // named\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n this.initializeExport(members[i], statement.internalPath, queuedExports);\r\n }\r\n } else { // TODO: filespace\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.range\r\n );\r\n }\r\n }\r\n\r\n private setExportAndCheckLibrary(\r\n internalName: string,\r\n element: Element,\r\n externalIdentifier: IdentifierExpression\r\n ): void {\r\n // add to file-level exports\r\n this.fileLevelExports.set(internalName, element);\r\n\r\n // add to filespace\r\n var internalPath = externalIdentifier.range.source.internalPath;\r\n var prefix = FILESPACE_PREFIX + internalPath;\r\n var filespace = this.elementsLookup.get(prefix);\r\n if (!filespace) filespace = assert(this.elementsLookup.get(prefix + PATH_DELIMITER + \"index\"));\r\n assert(filespace.kind == ElementKind.FILESPACE);\r\n var simpleName = externalIdentifier.text;\r\n (filespace).members.set(simpleName, element);\r\n\r\n // add global alias if a top-level export of a library file\r\n var source = externalIdentifier.range.source;\r\n if (source.isLibrary) {\r\n if (this.elementsLookup.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n externalIdentifier.range, simpleName\r\n );\r\n } else {\r\n element.internalName = simpleName;\r\n this.elementsLookup.set(simpleName, element);\r\n }\r\n\r\n // add module level export if a top-level export of an entry file\r\n } else if (source.isEntry) {\r\n this.moduleLevelExports.set(externalIdentifier.text, {\r\n element,\r\n identifier: externalIdentifier\r\n });\r\n }\r\n }\r\n\r\n private initializeExport(\r\n member: ExportMember,\r\n internalPath: string | null,\r\n queuedExports: Map\r\n ): void {\r\n var externalName = member.range.source.internalPath + PATH_DELIMITER + member.externalName.text;\r\n if (this.fileLevelExports.has(externalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.externalName.range, externalName\r\n );\r\n return;\r\n }\r\n var referencedName: string;\r\n var referencedElement: Element | null;\r\n var queuedExport: QueuedExport | null;\r\n\r\n // export local element\r\n if (internalPath == null) {\r\n referencedName = member.range.source.internalPath + PATH_DELIMITER + member.name.text;\r\n\r\n // resolve right away if the element exists\r\n if (this.elementsLookup.has(referencedName)) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n this.elementsLookup.get(referencedName),\r\n member.externalName\r\n );\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n if (queuedExports.has(externalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.externalName.range, externalName\r\n );\r\n return;\r\n }\r\n queuedExport = new QueuedExport();\r\n queuedExport.isReExport = false;\r\n queuedExport.externalName = referencedName; // -> here: local name\r\n queuedExport.member = member;\r\n queuedExports.set(externalName, queuedExport);\r\n\r\n // export external element\r\n } else {\r\n referencedName = internalPath + PATH_DELIMITER + member.name.text;\r\n\r\n // resolve right away if the export exists\r\n referencedElement = this.elementsLookup.get(referencedName);\r\n if (referencedElement) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n referencedElement,\r\n member.externalName\r\n );\r\n return;\r\n }\r\n\r\n // walk already known queued exports\r\n let seen = new Set();\r\n while (queuedExport = queuedExports.get(referencedName)) {\r\n if (queuedExport.isReExport) {\r\n referencedElement = this.fileLevelExports.get(queuedExport.externalName);\r\n if (referencedElement) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n referencedElement,\r\n member.externalName\r\n );\r\n return;\r\n }\r\n referencedName = queuedExport.externalName;\r\n if (seen.has(queuedExport)) break;\r\n seen.add(queuedExport);\r\n } else {\r\n referencedElement = this.elementsLookup.get(queuedExport.externalName);\r\n if (referencedElement) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n referencedElement,\r\n member.externalName\r\n );\r\n return;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // otherwise queue it\r\n if (queuedExports.has(externalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.externalName.range, externalName\r\n );\r\n return;\r\n }\r\n queuedExport = new QueuedExport();\r\n queuedExport.isReExport = true;\r\n queuedExport.externalName = referencedName; // -> here: external name\r\n queuedExport.member = member;\r\n queuedExports.set(externalName, queuedExport);\r\n }\r\n }\r\n\r\n private initializeFunction(\r\n declaration: FunctionDeclaration,\r\n namespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n var simpleName = declaration.name.text;\r\n var decorators = declaration.decorators;\r\n var prototype = new FunctionPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n null,\r\n decorators\r\n ? this.checkDecorators(decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.INLINE |\r\n DecoratorFlags.EXTERNAL\r\n )\r\n : DecoratorFlags.NONE\r\n );\r\n prototype.parent = namespace;\r\n this.elementsLookup.set(internalName, prototype);\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, prototype);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && prototype.is(CommonFlags.EXPORT)) {\r\n prototype.parent = namespace;\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (prototype.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, prototype);\r\n this.currentFilespace.members.set(simpleName, prototype);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: prototype,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n\r\n this.checkGlobal(prototype, declaration);\r\n }\r\n\r\n private initializeImports(\r\n statement: ImportStatement,\r\n queuedExports: Map,\r\n queuedImports: QueuedImport[]\r\n ): void {\r\n var declarations = statement.declarations;\r\n if (declarations) {\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n this.initializeImport(\r\n declarations[i],\r\n statement.internalPath,\r\n queuedExports, queuedImports\r\n );\r\n }\r\n } else if (statement.namespaceName) { // import * as simpleName from \"file\"\r\n let simpleName = statement.namespaceName.text;\r\n let internalName = (\r\n statement.range.source.internalPath +\r\n PATH_DELIMITER +\r\n simpleName\r\n );\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n statement.namespaceName.range,\r\n internalName\r\n );\r\n return;\r\n }\r\n\r\n // resolve right away if the exact filespace exists\r\n let filespace = this.elementsLookup.get(statement.internalPath);\r\n if (filespace) {\r\n this.elementsLookup.set(internalName, filespace);\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n let queuedImport = new QueuedImport();\r\n queuedImport.localName = internalName;\r\n let externalName = FILESPACE_PREFIX + statement.internalPath;\r\n queuedImport.externalName = externalName;\r\n queuedImport.externalNameAlt = externalName + PATH_DELIMITER + \"index\";\r\n queuedImport.declaration = null; // filespace\r\n queuedImports.push(queuedImport);\r\n }\r\n }\r\n\r\n private initializeImport(\r\n declaration: ImportDeclaration,\r\n internalPath: string,\r\n queuedNamedExports: Map,\r\n queuedImports: QueuedImport[]\r\n ): void {\r\n var localName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(localName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, localName\r\n );\r\n return;\r\n }\r\n\r\n var externalName = internalPath + PATH_DELIMITER + declaration.externalName.text;\r\n\r\n // resolve right away if the exact export exists\r\n var element: Element | null;\r\n if (element = this.fileLevelExports.get(externalName)) {\r\n this.elementsLookup.set(localName, element);\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n const indexPart = PATH_DELIMITER + \"index\";\r\n var queuedImport = new QueuedImport();\r\n queuedImport.localName = localName;\r\n if (internalPath.endsWith(indexPart)) {\r\n queuedImport.externalName = externalName; // try exact first\r\n queuedImport.externalNameAlt = (\r\n internalPath.substring(0, internalPath.length - indexPart.length + 1) +\r\n declaration.externalName.text\r\n );\r\n } else {\r\n queuedImport.externalName = externalName; // try exact first\r\n queuedImport.externalNameAlt = (\r\n internalPath +\r\n indexPart +\r\n PATH_DELIMITER +\r\n declaration.externalName.text\r\n );\r\n }\r\n queuedImport.declaration = declaration; // named\r\n queuedImports.push(queuedImport);\r\n }\r\n\r\n private initializeInterface(declaration: InterfaceDeclaration, namespace: Element | null = null): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n\r\n var decorators = declaration.decorators;\r\n var simpleName = declaration.name.text;\r\n var prototype = new InterfacePrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators, DecoratorFlags.GLOBAL)\r\n : DecoratorFlags.NONE\r\n );\r\n prototype.parent = namespace;\r\n this.elementsLookup.set(internalName, prototype);\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(prototype.internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(prototype.internalName, prototype);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && prototype.is(CommonFlags.EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (prototype.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, prototype);\r\n this.currentFilespace.members.set(simpleName, prototype);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: prototype,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n\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\r\n case NodeKind.FIELDDECLARATION: {\r\n this.initializeField(memberDeclaration, prototype);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeAccessor(memberDeclaration, prototype);\r\n } else {\r\n this.initializeMethod(memberDeclaration, prototype);\r\n }\r\n break;\r\n }\r\n default: {\r\n throw new Error(\"interface member expected\");\r\n }\r\n }\r\n }\r\n\r\n this.checkGlobal(prototype, declaration);\r\n }\r\n\r\n private initializeNamespace(\r\n declaration: NamespaceDeclaration,\r\n queuedExtends: ClassPrototype[],\r\n queuedImplements: ClassPrototype[],\r\n parentNamespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n var simpleName = declaration.name.text;\r\n var namespace = this.elementsLookup.get(internalName);\r\n if (!namespace) {\r\n namespace = new Namespace(this, simpleName, internalName, declaration);\r\n namespace.parent = parentNamespace;\r\n this.elementsLookup.set(internalName, namespace);\r\n this.checkGlobal(namespace, declaration);\r\n }\r\n\r\n if (parentNamespace) {\r\n if (parentNamespace.members) {\r\n if (parentNamespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n parentNamespace.members = new Map();\r\n }\r\n parentNamespace.members.set(simpleName, namespace);\r\n if (parentNamespace.is(CommonFlags.MODULE_EXPORT) && namespace.is(CommonFlags.EXPORT)) {\r\n namespace.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (namespace.is(CommonFlags.EXPORT)) { // no parent namespace\r\n let existingExport = this.fileLevelExports.get(internalName);\r\n if (existingExport) {\r\n if (!existingExport.is(CommonFlags.EXPORT)) {\r\n this.error(\r\n DiagnosticCode.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,\r\n declaration.name.range, namespace.internalName\r\n ); // recoverable\r\n }\r\n namespace = existingExport; // join\r\n } else {\r\n this.fileLevelExports.set(internalName, namespace);\r\n }\r\n this.currentFilespace.members.set(simpleName, namespace);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n if (existingExport.element !== namespace) { // not merged\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n this.moduleLevelExports.set(simpleName, {\r\n element: namespace,\r\n identifier: declaration.name\r\n });\r\n }\r\n namespace.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n\r\n var members = declaration.members;\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n switch (members[i].kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n this.initializeClass(members[i], queuedExtends, queuedImplements, namespace);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(members[i], namespace);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(members[i], namespace);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(members[i], namespace);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(members[i], queuedExtends, queuedImplements, namespace);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n // this.initializeTypeAlias(members[i], namespace);\r\n // TODO: what about namespaced types?\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n members[i].range\r\n );\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(members[i], namespace);\r\n break;\r\n }\r\n default: {\r\n throw new Error(\"namespace member expected\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n private initializeTypeAlias(declaration: TypeDeclaration, namespace: Element | null = null): void {\r\n // type aliases are program globals\r\n // TODO: what about namespaced types?\r\n var name = declaration.name.text;\r\n if (this.typesLookup.has(name) || this.typeAliases.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, name\r\n );\r\n return;\r\n }\r\n var alias = new TypeAlias();\r\n alias.typeParameters = declaration.typeParameters;\r\n alias.type = declaration.type;\r\n this.typeAliases.set(name, alias);\r\n }\r\n\r\n private initializeVariables(statement: VariableStatement, namespace: Element | null = null): 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 decorators = declaration.decorators;\r\n let internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n continue;\r\n }\r\n let simpleName = declaration.name.text;\r\n let global = new Global(\r\n this,\r\n simpleName,\r\n internalName,\r\n Type.void, // resolved later on\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.INLINE |\r\n DecoratorFlags.EXTERNAL\r\n )\r\n : DecoratorFlags.NONE\r\n );\r\n global.parent = namespace;\r\n this.elementsLookup.set(internalName, global);\r\n\r\n if (global.hasDecorator(DecoratorFlags.INLINE) && !global.is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n assert(findDecorator(DecoratorKind.INLINE, decorators)).range, \"inline\"\r\n );\r\n }\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n continue;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, global);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && global.is(CommonFlags.EXPORT)) {\r\n global.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (global.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n } else {\r\n this.fileLevelExports.set(internalName, global);\r\n }\r\n this.currentFilespace.members.set(simpleName, global);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n continue;\r\n }\r\n global.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: global,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n this.checkGlobal(global, declaration);\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 Property}. */\r\n PROPERTY,\r\n /** A {@link Namespace}. */\r\n NAMESPACE,\r\n /** A {@link Filespace}. */\r\n FILESPACE,\r\n}\r\n\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}\r\n\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 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 /** Specific element kind. */\r\n kind: ElementKind;\r\n /** Containing {@link Program}. */\r\n program: Program;\r\n /** Simple name. */\r\n simpleName: string;\r\n /** Internal name referring to this element. */\r\n internalName: string;\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 /** Namespaced member elements. */\r\n members: Map | null = null;\r\n /** Parent element, if applicable. */\r\n parent: Element | null = null;\r\n\r\n /** Constructs a new element, linking it to its containing {@link Program}. */\r\n protected constructor(program: Program, simpleName: string, internalName: string) {\r\n this.program = program;\r\n this.simpleName = simpleName;\r\n this.internalName = internalName;\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\r\n/** A filespace representing the implicit top-level namespace of a source. */\r\nexport class Filespace extends Element {\r\n\r\n kind = ElementKind.FILESPACE;\r\n\r\n /** File members (externally visible only). */\r\n members: Map; // more specific\r\n\r\n /** Constructs a new filespace. */\r\n constructor(\r\n program: Program,\r\n source: Source\r\n ) {\r\n super(program, source.internalPath, FILESPACE_PREFIX + source.internalPath);\r\n this.members = new Map();\r\n }\r\n}\r\n\r\n/** A namespace that differs from a filespace in being user-declared with a name. */\r\nexport class Namespace extends Element {\r\n\r\n // All elements have namespace semantics. This is an explicitly declared one.\r\n kind = ElementKind.NAMESPACE;\r\n\r\n /** Declaration reference. */\r\n declaration: NamespaceDeclaration; // more specific\r\n\r\n /** Constructs a new namespace. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: NamespaceDeclaration\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n }\r\n}\r\n\r\n/** An enum. */\r\nexport class Enum extends Element {\r\n\r\n kind = ElementKind.ENUM;\r\n\r\n /** Declaration reference. */\r\n declaration: EnumDeclaration;\r\n\r\n /** Constructs a new enum. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: EnumDeclaration\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n }\r\n}\r\n\r\n/** An enum value. */\r\nexport class EnumValue extends Element {\r\n\r\n kind = ElementKind.ENUMVALUE;\r\n\r\n /** Declaration reference. */\r\n declaration: EnumValueDeclaration;\r\n /** Constant value, if applicable. */\r\n constantValue: i32 = 0;\r\n\r\n constructor(\r\n enm: Enum,\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: EnumValueDeclaration\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.parent = enm;\r\n this.declaration = declaration;\r\n }\r\n}\r\n\r\nexport const enum ConstantValueKind {\r\n NONE,\r\n INTEGER,\r\n FLOAT\r\n}\r\n\r\nexport class VariableLikeElement extends Element {\r\n\r\n // kind varies\r\n\r\n /** Declaration reference. */\r\n declaration: VariableLikeDeclarationStatement | null;\r\n /** Variable type. Is {@link Type.void} for type-inferred {@link Global}s before compilation. */\r\n type: Type;\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 protected constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n type: Type,\r\n declaration: VariableLikeDeclarationStatement | null\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.type = type;\r\n this.declaration = declaration;\r\n }\r\n\r\n withConstantIntegerValue(value: I64): this {\r\n this.constantValueKind = ConstantValueKind.INTEGER;\r\n this.constantIntegerValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED);\r\n return this;\r\n }\r\n\r\n withConstantFloatValue(value: f64): this {\r\n this.constantValueKind = ConstantValueKind.FLOAT;\r\n this.constantFloatValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED);\r\n return this;\r\n }\r\n}\r\n\r\n/** A global variable. */\r\nexport class Global extends VariableLikeElement {\r\n\r\n kind = ElementKind.GLOBAL;\r\n\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n type: Type,\r\n declaration: VariableLikeDeclarationStatement | null,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(program, simpleName, internalName, type, declaration);\r\n this.flags = declaration ? declaration.flags : CommonFlags.NONE;\r\n this.decoratorFlags = decoratorFlags;\r\n this.type = type; // resolved later if `void`\r\n }\r\n}\r\n\r\n/** A function parameter. */\r\nexport class Parameter {\r\n\r\n // not an Element on its own\r\n\r\n /** Parameter name. */\r\n name: string;\r\n /** Parameter type. */\r\n type: Type;\r\n /** Parameter initializer. */\r\n initializer: Expression | null;\r\n\r\n /** Constructs a new function parameter. */\r\n constructor(name: string, type: Type, initializer: Expression | null = null) {\r\n this.name = name;\r\n this.type = type;\r\n this.initializer = initializer;\r\n }\r\n}\r\n\r\n/** A function local. */\r\nexport class Local extends VariableLikeElement {\r\n\r\n kind = ElementKind.LOCAL;\r\n\r\n /** Local index. */\r\n index: i32;\r\n /** Respective scoped global, if any. */\r\n scopedGlobal: Global | null = null;\r\n\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n index: i32,\r\n type: Type,\r\n declaration: VariableLikeDeclarationStatement | null = null\r\n ) {\r\n super(program, simpleName, simpleName, type, declaration);\r\n this.index = index;\r\n }\r\n}\r\n\r\n/** A yet unresolved function prototype. */\r\nexport class FunctionPrototype extends Element {\r\n\r\n kind = ElementKind.FUNCTION_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: FunctionDeclaration;\r\n /** If an instance method, the class prototype reference. */\r\n classPrototype: ClassPrototype | null;\r\n /** Resolved instances by class type arguments and function type arguments. */\r\n instances: Map> = new Map();\r\n /** Class type arguments, if a partially resolved method of a generic class. Not set otherwise. */\r\n classTypeArguments: Type[] | null = null;\r\n /** Operator kind, if an overload. */\r\n operatorKind: OperatorKind = OperatorKind.INVALID;\r\n\r\n /** Constructs a new function prototype. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: FunctionDeclaration,\r\n classPrototype: ClassPrototype | null = null,\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n this.classPrototype = classPrototype;\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Applies class type arguments to the context of a partially resolved instance method. */\r\n applyClassTypeArguments(contextualTypeArguments: Map): void {\r\n var classTypeArguments = assert(this.classTypeArguments); // set only if partial\r\n var classDeclaration = assert(this.classPrototype).declaration;\r\n var classTypeParameters = classDeclaration.typeParameters;\r\n var numClassTypeParameters = classTypeParameters.length;\r\n assert(numClassTypeParameters == classTypeArguments.length);\r\n for (let i = 0; i < numClassTypeParameters; ++i) {\r\n contextualTypeArguments.set(\r\n classTypeParameters[i].name.text,\r\n classTypeArguments[i]\r\n );\r\n }\r\n }\r\n\r\n toString(): string { return this.simpleName; }\r\n}\r\n\r\n/** A resolved function. */\r\nexport class Function extends Element {\r\n\r\n kind = ElementKind.FUNCTION;\r\n\r\n /** Prototype reference. */\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 /** Current break context label. */\r\n breakContext: string | null = null;\r\n /** Contextual type arguments. */\r\n contextualTypeArguments: Map | null;\r\n /** Current 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 /** The outer scope, if a function expression. */\r\n outerScope: Flow | null = null;\r\n\r\n private nextBreakId: i32 = 0;\r\n private breakStack: i32[] | null = null;\r\n nextInlineId: i32 = 0;\r\n\r\n /** Constructs a new concrete function. */\r\n constructor(\r\n prototype: FunctionPrototype,\r\n internalName: string,\r\n signature: Signature,\r\n parent: Element | null = null,\r\n contextualTypeArguments: Map | null = null\r\n ) {\r\n super(prototype.program, prototype.simpleName, internalName);\r\n this.prototype = prototype;\r\n this.signature = signature;\r\n this.parent = parent;\r\n this.flags = prototype.flags;\r\n this.decoratorFlags = prototype.decoratorFlags;\r\n this.contextualTypeArguments = contextualTypeArguments;\r\n if (!(prototype.is(CommonFlags.AMBIENT))) {\r\n let localIndex = 0;\r\n if (parent && parent.kind == ElementKind.CLASS) {\r\n assert(this.is(CommonFlags.INSTANCE));\r\n let local = new Local(\r\n prototype.program,\r\n \"this\",\r\n localIndex++,\r\n assert(signature.thisType)\r\n );\r\n this.localsByName.set(\"this\", local);\r\n this.localsByIndex[local.index] = local;\r\n let inheritedTypeArguments = (parent).contextualTypeArguments;\r\n if (inheritedTypeArguments) {\r\n if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (let [inheritedName, inheritedType] of inheritedTypeArguments) {\r\n if (!this.contextualTypeArguments.has(inheritedName)) {\r\n this.contextualTypeArguments.set(inheritedName, inheritedType);\r\n }\r\n }\r\n }\r\n } else {\r\n assert(!this.is(CommonFlags.INSTANCE)); // internal error\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 prototype.program,\r\n parameterName,\r\n localIndex++,\r\n parameterType\r\n // FIXME: declaration?\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 }\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 local = new Local(\r\n this.prototype.program,\r\n name\r\n ? name\r\n : \"var$\" + localIndex.toString(10),\r\n localIndex,\r\n type,\r\n declaration\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 private tempI32s: Local[] | null = null;\r\n private tempI64s: Local[] | null = null;\r\n private tempF32s: Local[] | null = null;\r\n private tempF64s: Local[] | null = null;\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 temps: Local[] | null;\r\n switch (type.toNativeType()) {\r\n case NativeType.I32: {\r\n temps = this.tempI32s;\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = this.tempI64s;\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = this.tempF32s;\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = this.tempF64s;\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 && temps.length) {\r\n local = temps.pop();\r\n local.type = type;\r\n local.flags = CommonFlags.NONE;\r\n } else {\r\n local = this.addLocal(type);\r\n }\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n this.flow.setLocalWrapped(local.index, wrapped);\r\n }\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 temps: Local[];\r\n assert(local.type != null); // internal error\r\n switch ((local.type).toNativeType()) {\r\n case NativeType.I32: {\r\n temps = this.tempI32s || (this.tempI32s = []);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = this.tempI64s || (this.tempI64s = []);\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = this.tempF32s || (this.tempF32s = []);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = this.tempF64s || (this.tempF64s = []);\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 temps: Local[];\r\n switch (type.toNativeType()) {\r\n case NativeType.I32: {\r\n temps = this.tempI32s || (this.tempI32s = []);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = this.tempI64s || (this.tempI64s = []);\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = this.tempF32s || (this.tempF32s = []);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = this.tempF64s || (this.tempF64s = []);\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 = this.addLocal(type);\r\n temps.push(local);\r\n }\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n this.flow.setLocalWrapped(local.index, wrapped);\r\n }\r\n return local;\r\n }\r\n\r\n /** Enters a(nother) break context. */\r\n enterBreakContext(): string {\r\n var id = this.nextBreakId++;\r\n if (!this.breakStack) this.breakStack = [ id ];\r\n else this.breakStack.push(id);\r\n return this.breakContext = id.toString(10);\r\n }\r\n\r\n /** Leaves the current break context. */\r\n leaveBreakContext(): void {\r\n assert(this.breakStack != null);\r\n var length = (this.breakStack).length;\r\n assert(length > 0);\r\n (this.breakStack).pop();\r\n if (length > 1) {\r\n this.breakContext = (this.breakStack)[length - 2].toString(10);\r\n } else {\r\n this.breakContext = null;\r\n this.breakStack = null;\r\n }\r\n }\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.breakContext = 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 /** Returns the TypeScript representation of this function. */\r\n toString(): string { return this.prototype.simpleName; }\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 kind = ElementKind.FUNCTION_TARGET;\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(program: Program, signature: Signature) {\r\n super(program, \"\", \"\");\r\n var simpleName = signature.toSignatureString();\r\n this.simpleName = simpleName;\r\n this.internalName = simpleName;\r\n this.signature = signature;\r\n this.type = Type.u32.asFunction(signature);\r\n }\r\n}\r\n\r\n/** A yet unresolved instance field prototype. */\r\nexport class FieldPrototype extends Element {\r\n\r\n kind = ElementKind.FIELD_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: FieldDeclaration;\r\n /** Parent class prototype. */\r\n classPrototype: ClassPrototype;\r\n\r\n /** Constructs a new field prototype. */\r\n constructor(\r\n classPrototype: ClassPrototype,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: FieldDeclaration\r\n ) {\r\n super(classPrototype.program, simpleName, internalName);\r\n this.classPrototype = classPrototype;\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n }\r\n}\r\n\r\n/** A resolved instance field. */\r\nexport class Field extends VariableLikeElement {\r\n\r\n kind = ElementKind.FIELD;\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 prototype: FieldPrototype,\r\n internalName: string,\r\n type: Type,\r\n declaration: FieldDeclaration,\r\n parent: Class\r\n ) {\r\n super(prototype.program, prototype.simpleName, internalName, type, declaration);\r\n this.prototype = prototype;\r\n this.flags = prototype.flags;\r\n this.type = type;\r\n this.parent = parent;\r\n }\r\n}\r\n\r\n/** A property comprised of a getter and a setter function. */\r\nexport class Property extends Element {\r\n\r\n kind = ElementKind.PROPERTY;\r\n\r\n /** Parent class prototype. */\r\n parent: ClassPrototype;\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 program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n parent: ClassPrototype\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.parent = parent;\r\n }\r\n}\r\n\r\n/** A yet unresolved class prototype. */\r\nexport class ClassPrototype extends Element {\r\n\r\n kind = ElementKind.CLASS_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: ClassDeclaration;\r\n /** Resolved instances. */\r\n instances: Map = new Map();\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\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: ClassDeclaration,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n toString(): string {\r\n return this.simpleName;\r\n }\r\n}\r\n\r\n/** A resolved class. */\r\nexport class Class extends Element {\r\n\r\n kind = ElementKind.CLASS;\r\n\r\n /** Prototype reference. */\r\n prototype: ClassPrototype;\r\n /** Resolved type arguments. */\r\n typeArguments: Type[] | null;\r\n /** Resolved class type. */\r\n type: Type;\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 prototype: ClassPrototype,\r\n simpleName: string,\r\n internalName: string,\r\n typeArguments: Type[] | null = null,\r\n base: Class | null = null\r\n ) {\r\n super(prototype.program, simpleName, internalName);\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.type = prototype.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 if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (let [baseName, baseType] of inheritedTypeArguments) {\r\n this.contextualTypeArguments.set(baseName, baseType);\r\n }\r\n }\r\n }\r\n\r\n // apply instance-specific contextual type arguments\r\n var declaration = this.prototype.declaration;\r\n var i: i32, k: i32;\r\n if (declaration) { // irrelevant for built-ins\r\n let typeParameters = declaration.typeParameters;\r\n if (typeArguments) {\r\n if ((k = typeArguments.length) != typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n if (k) {\r\n if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (i = 0; i < k; ++i) {\r\n this.contextualTypeArguments.set(typeParameters[i].name.text, typeArguments[i]);\r\n }\r\n }\r\n } else if (typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n }\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 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 toString(): string {\r\n return this.simpleName;\r\n }\r\n}\r\n\r\n/** A yet unresolved interface. */\r\nexport class InterfacePrototype extends ClassPrototype {\r\n\r\n kind = ElementKind.INTERFACE_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: InterfaceDeclaration; // more specific\r\n\r\n /** Constructs a new interface prototype. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: InterfaceDeclaration,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(program, simpleName, internalName, declaration, decoratorFlags);\r\n }\r\n}\r\n\r\n/** A resolved interface. */\r\nexport class Interface extends Class {\r\n\r\n kind = ElementKind.INTERFACE;\r\n\r\n /** Prototype reference. */\r\n prototype: InterfacePrototype; // more specific\r\n /** Base interface, if applcable. */\r\n base: Interface | null; // more specific\r\n\r\n /** Constructs a new interface. */\r\n constructor(\r\n prototype: InterfacePrototype,\r\n simpleName: string,\r\n internalName: string,\r\n typeArguments: Type[] = [],\r\n base: Interface | null = null\r\n ) {\r\n super(prototype, simpleName, internalName, typeArguments, base);\r\n }\r\n}\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 branch always returns. */\r\n RETURNS = 1 << 0,\r\n /** This branch always returns a wrapped value. */\r\n RETURNS_WRAPPED = 1 << 1,\r\n /** This branch always throws. */\r\n THROWS = 1 << 2,\r\n /** This branch always breaks. */\r\n BREAKS = 1 << 3,\r\n /** This branch always continues. */\r\n CONTINUES = 1 << 4,\r\n /** This branch always allocates. Constructors only. */\r\n ALLOCATES = 1 << 5,\r\n\r\n // conditional\r\n\r\n /** This branch conditionally returns in a child branch. */\r\n CONDITIONALLY_RETURNS = 1 << 6,\r\n /** This branch conditionally throws in a child branch. */\r\n CONDITIONALLY_THROWS = 1 << 7,\r\n /** This branch conditionally breaks in a child branch. */\r\n CONDITIONALLY_BREAKS = 1 << 8,\r\n /** This branch conditionally continues in a child branch. */\r\n CONDITIONALLY_CONTINUES = 1 << 9,\r\n /** This branch conditionally allocates in a child branch. Constructors only. */\r\n CONDITIONALLY_ALLOCATES = 1 << 10,\r\n\r\n // special\r\n\r\n /** This branch is part of inlining a function. */\r\n INLINE_CONTEXT = 1 << 11,\r\n /** This branch explicitly requests no bounds checking. */\r\n UNCHECKED_CONTEXT = 1 << 12,\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\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 currentFunction: 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 label we break to when encountering a return statement, when inlining. */\r\n returnLabel: 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\r\n /** Creates the parent flow of the specified function. */\r\n static create(currentFunction: Function): Flow {\r\n var parentFlow = new Flow();\r\n parentFlow.parent = null;\r\n parentFlow.flags = FlowFlags.NONE;\r\n parentFlow.currentFunction = currentFunction;\r\n parentFlow.continueLabel = null;\r\n parentFlow.breakLabel = null;\r\n parentFlow.returnLabel = null;\r\n parentFlow.returnType = currentFunction.signature.returnType;\r\n parentFlow.contextualTypeArguments = currentFunction.contextualTypeArguments;\r\n parentFlow.wrappedLocals = i64_new(0);\r\n parentFlow.wrappedLocalsExt = null;\r\n return parentFlow;\r\n }\r\n\r\n private constructor() { }\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.currentFunction = this.currentFunction;\r\n branch.continueLabel = this.continueLabel;\r\n branch.breakLabel = this.breakLabel;\r\n branch.returnLabel = this.returnLabel;\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 return branch;\r\n }\r\n\r\n /** Frees this flow's scoped variables. */\r\n free(): Flow {\r\n var parent = assert(this.parent);\r\n if (this.scopedLocals) { // free block-scoped locals\r\n for (let scopedLocal of this.scopedLocals.values()) {\r\n if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias\r\n this.currentFunction.freeTempLocal(scopedLocal);\r\n }\r\n }\r\n this.scopedLocals = null;\r\n }\r\n return parent;\r\n }\r\n\r\n /** Adds a new scoped local of the specified name. */\r\n addScopedLocal(type: Type, name: string, wrapped: bool, declaration?: VariableDeclaration): Local {\r\n var scopedLocal = this.currentFunction.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 (declaration) {\r\n this.currentFunction.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range\r\n );\r\n } else assert(false);\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. */\r\n addScopedLocalAlias(index: i32, type: Type, name: string): 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 let declaration = existingLocal.declaration;\r\n if (declaration) {\r\n this.currentFunction.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range\r\n );\r\n } else assert(false);\r\n return existingLocal;\r\n }\r\n }\r\n assert(index < this.currentFunction.localsByIndex.length);\r\n var scopedAlias = new Local( // not SCOPED as an indicator that it isn't automatically free'd\r\n this.currentFunction.program,\r\n name,\r\n index,\r\n type,\r\n null\r\n );\r\n this.scopedLocals.set(name, scopedAlias);\r\n return scopedAlias;\r\n }\r\n\r\n /** Gets the local of the specified name in the current scope. */\r\n getScopedLocal(name: string): Local | null {\r\n var local: Local | null;\r\n var current: Flow | null = this;\r\n do {\r\n if (current.scopedLocals && (local = current.scopedLocals.get(name))) {\r\n return local;\r\n }\r\n } while (current = current.parent);\r\n return this.currentFunction.localsByName.get(name);\r\n }\r\n\r\n /** Tests if the local with the specified index is considered wrapped. */\r\n isLocalWrapped(index: i32): bool {\r\n var map: I64;\r\n var ext: I64[] | null;\r\n if (index < 64) {\r\n if (index < 0) return true; // inlined constant\r\n map = this.wrappedLocals;\r\n } else if (ext = this.wrappedLocalsExt) {\r\n let i = ((index - 64) / 64) | 0;\r\n if (i >= ext.length) return false;\r\n map = ext[i];\r\n index -= (i + 1) * 64;\r\n } else {\r\n return false;\r\n }\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 if the local with the specified index is considered wrapped. */\r\n setLocalWrapped(index: i32, wrapped: bool): void {\r\n var map: I64;\r\n var off: i32 = -1;\r\n if (index < 64) {\r\n if (index < 0) return; // inlined constant\r\n map = this.wrappedLocals;\r\n } else {\r\n let ext = this.wrappedLocalsExt;\r\n off = ((index - 64) / 64) | 0;\r\n if (!ext) {\r\n this.wrappedLocalsExt = ext = new Array(off + 1);\r\n ext.length = 0;\r\n }\r\n while (ext.length <= off) ext.push(i64_new(0));\r\n map = ext[off];\r\n index -= (off + 1) * 64;\r\n }\r\n map = wrapped\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 if (off >= 0) (this.wrappedLocalsExt)[off] = map;\r\n else this.wrappedLocals = map;\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 currentFunction = this.currentFunction;\r\n let local = currentFunction.localsByIndex[getGetLocalIndex(expr)];\r\n return !currentFunction.flow.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.currentFunction.program.elementsLookup.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 // actually, brs with a value that'd be handled here is not emitted atm\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.currentFunction.program;\r\n let instance = assert(program.instancesLookup.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 /** Finalizes this flow. Must be the topmost parent flow of the function. */\r\n finalize(): void {\r\n assert(this.parent == null); // must be the topmost parent flow\r\n this.continueLabel = null;\r\n this.breakLabel = null;\r\n this.returnLabel = null;\r\n this.contextualTypeArguments = null;\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 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 const enum NativeType {\r\n None = 0, // _BinaryenTypeNone(),\r\n I32 = 1, // _BinaryenTypeInt32(),\r\n I64 = 2, // _BinaryenTypeInt64(),\r\n F32 = 3, // _BinaryenTypeFloat32(),\r\n F64 = 4, // _BinaryenTypeFloat64(),\r\n Unreachable = 5, // _BinaryenTypeUnreachable(),\r\n Auto = -1 // _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 AtomicWake = _BinaryenAtomicWakeId()\r\n // SIMDExtract = _BinaryenSIMDExtractId(),\r\n // SIMDReplace = _BinaryenSIMDReplaceId(),\r\n // SIMDShuffle = _BinaryenSIMDShuffleId(),\r\n // SIMDBitselect = _BinaryenSIMDBitselectId(),\r\n // SIMDShift = _BinaryenSIMDShiftId()\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\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\r\nexport enum HostOp {\r\n CurrentMemory = _BinaryenCurrentMemory(),\r\n GrowMemory = _BinaryenGrowMemory(),\r\n\r\n // see: https://github.com/WebAssembly/bulk-memory-operations\r\n // MoveMemory\r\n // SetMemory\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\n// export enum SIMDOp {\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// 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 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 cachedByValue: usize;\r\n\r\n static create(): Module {\r\n var module = new Module();\r\n module.ref = _BinaryenModuleCreate();\r\n module.cachedByValue = memory.allocate(16);\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.cachedByValue = memory.allocate(3 * 8); // LLVM C-ABI, max used is 3 * usize\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 = allocString(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 memory.free(cStr);\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 = allocString(name);\r\n try {\r\n _BinaryenRemoveFunctionType(this.ref, cStr);\r\n } finally {\r\n memory.free(cStr);\r\n }\r\n }\r\n\r\n // constants\r\n\r\n createI32(value: i32): ExpressionRef {\r\n var out = this.cachedByValue;\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.cachedByValue;\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.cachedByValue;\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.cachedByValue;\r\n _BinaryenLiteralFloat64(out, value);\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 = allocString(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 memory.free(cStr);\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 = allocString(name);\r\n try {\r\n return _BinaryenGetGlobal(this.ref, cStr, type);\r\n } finally {\r\n memory.free(cStr);\r\n }\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 ): ExpressionRef {\r\n return _BinaryenLoad(this.ref, bytes, signed ? 1 : 0, offset, /* always aligned */ bytes, 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 ): ExpressionRef {\r\n return _BinaryenStore(this.ref, bytes, offset, /* always aligned */ bytes, 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 createAtomicWake(\r\n ptr: ExpressionRef,\r\n wakeCount: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenAtomicWake(this.ref, ptr, wakeCount);\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 = allocString(name);\r\n try {\r\n return _BinaryenSetGlobal(this.ref, cStr, value);\r\n } finally {\r\n memory.free(cStr);\r\n }\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 = allocString(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 memory.free(cStr);\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 = allocString(label);\r\n try {\r\n return _BinaryenBreak(this.ref, cStr, condition, value);\r\n } finally {\r\n memory.free(cStr);\r\n }\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 = allocString(label);\r\n try {\r\n return _BinaryenLoop(this.ref, cStr, body);\r\n } finally {\r\n memory.free(cStr);\r\n }\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] = allocString(names[i]);\r\n }\r\n var cArr = allocI32Array(strs);\r\n var cStr = allocString(defaultName);\r\n try {\r\n return _BinaryenSwitch(this.ref, cArr, numNames, cStr, condition, value);\r\n } finally {\r\n memory.free(cStr);\r\n memory.free(cArr);\r\n for (let i = numNames - 1; i >= 0; --i) memory.free(strs[i]);\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 = allocString(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 memory.free(cStr);\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 cArr = allocPtrArray(operands);\r\n var cStr = allocString(typeName);\r\n try {\r\n return _BinaryenCallIndirect(this.ref, index, cArr, operands && operands.length || 0, cStr);\r\n } finally {\r\n memory.free(cStr);\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 // 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 = allocString(name);\r\n try {\r\n return _BinaryenAddGlobal(this.ref, cStr, type, mutable ? 1 : 0, initializer);\r\n } finally {\r\n memory.free(cStr);\r\n }\r\n }\r\n\r\n removeGlobal(\r\n name: string\r\n ): void {\r\n var cStr = allocString(name);\r\n try {\r\n _BinaryenRemoveGlobal(this.ref, cStr);\r\n } finally {\r\n memory.free(cStr);\r\n }\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 = allocString(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 memory.free(cStr);\r\n }\r\n }\r\n\r\n removeFunction(name: string): void {\r\n var cStr = allocString(name);\r\n try {\r\n _BinaryenRemoveFunction(this.ref, cStr);\r\n } finally {\r\n memory.free(cStr);\r\n }\r\n }\r\n\r\n private cachedTemporaryName: usize = 0;\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.cachedTemporaryName;\r\n if (!tempName) this.cachedTemporaryName = tempName = allocString(\"\"); // works because strings are interned\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 = assert(this.cachedTemporaryName);\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 = allocString(internalName);\r\n var cStr2 = allocString(externalName);\r\n try {\r\n return _BinaryenAddFunctionExport(this.ref, cStr1, cStr2);\r\n } finally {\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\r\n }\r\n\r\n addTableExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = allocString(internalName);\r\n var cStr2 = allocString(externalName);\r\n try {\r\n return _BinaryenAddTableExport(this.ref, cStr1, cStr2);\r\n } finally {\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\r\n }\r\n\r\n addMemoryExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = allocString(internalName);\r\n var cStr2 = allocString(externalName);\r\n try {\r\n return _BinaryenAddMemoryExport(this.ref, cStr1, cStr2);\r\n } finally {\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\r\n }\r\n\r\n addGlobalExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = allocString(internalName);\r\n var cStr2 = allocString(externalName);\r\n try {\r\n return _BinaryenAddGlobalExport(this.ref, cStr1, cStr2);\r\n } finally {\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\r\n }\r\n\r\n removeExport(externalName: string): void {\r\n var cStr = allocString(externalName);\r\n try {\r\n _BinaryenRemoveExport(this.ref, cStr);\r\n } finally {\r\n memory.free(cStr);\r\n }\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 = allocString(internalName);\r\n var cStr2 = allocString(externalModuleName);\r\n var cStr3 = allocString(externalBaseName);\r\n try {\r\n return _BinaryenAddFunctionImport(this.ref, cStr1, cStr2, cStr3, functionType);\r\n } finally {\r\n memory.free(cStr3);\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\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 = allocString(internalName);\r\n var cStr2 = allocString(externalModuleName);\r\n var cStr3 = allocString(externalBaseName);\r\n try {\r\n return _BinaryenAddTableImport(this.ref, cStr1, cStr2, cStr3);\r\n } finally {\r\n memory.free(cStr3);\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\r\n }\r\n\r\n addMemoryImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string\r\n ): ImportRef {\r\n var cStr1 = allocString(internalName);\r\n var cStr2 = allocString(externalModuleName);\r\n var cStr3 = allocString(externalBaseName);\r\n try {\r\n return _BinaryenAddMemoryImport(this.ref, cStr1, cStr2, cStr3);\r\n } finally {\r\n memory.free(cStr3);\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\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 = allocString(internalName);\r\n var cStr2 = allocString(externalModuleName);\r\n var cStr3 = allocString(externalBaseName);\r\n try {\r\n return _BinaryenAddGlobalImport(this.ref, cStr1, cStr2, cStr3, globalType);\r\n } finally {\r\n memory.free(cStr3);\r\n memory.free(cStr2);\r\n memory.free(cStr1);\r\n }\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 ): void {\r\n var cStr = allocString(exportName);\r\n var k = segments.length;\r\n var segs = 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 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 = allocI32Array(offs);\r\n var cArr3 = allocI32Array(sizs);\r\n try {\r\n _BinaryenSetMemory(this.ref, initial, maximum, cStr, cArr1, cArr2, cArr3, k);\r\n } finally {\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 memory.free(cStr);\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] = allocString(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 for (let i = numNames; i >= 0; --i) memory.free(names[i]);\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 cachedPrecomputeName: usize = 0; // for free'ing\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 let name = allocString(\"precompute\");\r\n this.cachedPrecomputeName = name;\r\n this.cachedPrecomputeNames = names = allocI32Array([ name ]);\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.cachedByValue;\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 dispose(): void {\r\n assert(this.ref);\r\n memory.free(this.cachedByValue);\r\n memory.free(this.cachedTemporaryName);\r\n memory.free(this.cachedPrecomputeName);\r\n memory.free(this.cachedPrecomputeNames);\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 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 switch (_BinaryenExpressionGetType(expr)) {\r\n case NativeType.I32:\r\n case NativeType.I64:\r\n case NativeType.F32:\r\n case NativeType.F64: 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 * 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 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 if (text.charCodeAt(this.pos) == CharCode.AMPERSAND) {\r\n ++this.pos;\r\n return Token.AMPERSAND_AMPERSAND;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.ASTERISK_EQUALS;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.PLUS) {\r\n ++this.pos;\r\n return Token.PLUS_PLUS;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.MINUS) {\r\n ++this.pos;\r\n return Token.MINUS_MINUS;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (isDecimalDigit(text.charCodeAt(this.pos))) {\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 text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n if (maxTokenLength > 2 && this.pos < this.end) {\r\n if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.BAR) {\r\n ++this.pos;\r\n return Token.BAR_BAR;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 (c == CharCode.SLASH && !escaped) 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 (text.charCodeAt(this.pos) == CharCode._0 && this.pos + 1 < this.end) {\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 (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.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, 0);\r\n var i64_16 = i64_new(16, 0);\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 * 16 + c - CharCode._0;\r\n value = i64_add(\r\n i64_mul(value, i64_16),\r\n i64_new(c - CharCode._0, 0)\r\n );\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n // value = value * 16 + 10 + c - CharCode.A;\r\n value = i64_add(\r\n i64_mul(value, i64_16),\r\n i64_new(10 + c - CharCode.A, 0)\r\n );\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n // value = value * 16 + 10 + c - CharCode.a;\r\n value = i64_add(\r\n i64_mul(value, i64_16),\r\n i64_new(10 + c - CharCode.a, 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.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, 0);\r\n var i64_10 = i64_new(10, 0);\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, 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, 0);\r\n var i64_8 = i64_new(8, 0);\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 * 8 + c - CharCode._0;\r\n value = i64_add(\r\n i64_mul(value, i64_8),\r\n i64_new(c - CharCode._0, 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, 0);\r\n var i64_2 = i64_new(2, 0);\r\n var i64_1 = i64_new(1, 0);\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 * 2;\r\n value = i64_mul(\r\n value,\r\n i64_2\r\n );\r\n } else if (c == CharCode._1) {\r\n // value = value * 2 + 1;\r\n value = i64_add(\r\n i64_mul(value, i64_2),\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 text.charCodeAt(this.pos) == CharCode.MINUS ||\r\n text.charCodeAt(this.pos) == CharCode.PLUS\r\n ) &&\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 * 16 + c - CharCode._0;\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n value = value * 16 + 10 + c - CharCode.A;\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n value = value * 16 + 10 + c - 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) / 1024 | 0) + 0xD800) as i32,\r\n ( (value32 - 65536) % 1024 + 0xDC00) as i32\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","/**\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 // 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}\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 a target of the specified type. */\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 }\r\n }\r\n return false;\r\n }\r\n\r\n /** Determines the common compatible type of two types, if any. */\r\n static commonCompatible(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 its TypeScript representation. */\r\n toString(kindOnly: bool = false): string {\r\n if (!kindOnly && this.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.classReference;\r\n if (classReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? classReference.toString() + \" | null\"\r\n : classReference.toString();\r\n }\r\n let signatureReference = this.signatureReference;\r\n if (signatureReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? \"(\" + signatureReference.toString(true) + \") | null\"\r\n : signatureReference.toString(true);\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 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.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 }\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.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.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 default: return \"i\";\r\n case TypeKind.I64:\r\n case TypeKind.U64: return \"I\";\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: return this.size == 64 ? \"I\" : \"i\";\r\n case TypeKind.F32: return \"f\";\r\n case TypeKind.F64: return \"F\";\r\n case TypeKind.VOID: return \"v\";\r\n }\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 /** 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 /** 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 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 sb.push(returnType.toSignatureString());\r\n return 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(includeThis: bool = false): 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 if (includeThis) {\r\n sb.push(\"this: \");\r\n sb.push(thisType.toString());\r\n index = 1;\r\n }\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","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 * The AssemblyScript compiler.\r\n * @module compiler\r\n *//***/\r\n\r\nimport {\r\n compileCall as compileBuiltinCall,\r\n compileAllocate,\r\n compileAbort,\r\n compileIterateRoots,\r\n ensureGCHook\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 getGetLocalIndex,\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 PATH_DELIMITER,\r\n INNER_DELIMITER,\r\n INSTANCE_DELIMITER,\r\n STATIC_DELIMITER,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX\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 Namespace,\r\n EnumValue,\r\n Property,\r\n VariableLikeElement,\r\n FlowFlags,\r\n ConstantValueKind,\r\n Flow,\r\n OperatorKind,\r\n DecoratorFlags\r\n} from \"./program\";\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 Source,\r\n Range,\r\n DecoratorKind,\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 FunctionDeclaration,\r\n ForStatement,\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 VariableDeclaration,\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 FieldDeclaration,\r\n\r\n nodeIsConstantValue,\r\n isLastStatement,\r\n findDecorator\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, compiles everything instead of just reachable code. */\r\n noTreeShaking: bool = false;\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 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}\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 function in compilation. */\r\n currentFunction: Function;\r\n /** Current outer function in compilation, if compiling a function expression. */\r\n currentOuterFunction: Function | null = null;\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 being compiled. */\r\n startFunctionInstance: Function;\r\n /** Start function statements. */\r\n startFunctionBody: 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 start function\r\n var startFunctionInstance = new Function(program.startFunction, \"start\", new Signature([], Type.void));\r\n this.startFunctionInstance = startFunctionInstance;\r\n var startFunctionBody = new Array();\r\n this.startFunctionBody = startFunctionBody;\r\n this.currentFunction = startFunctionInstance;\r\n\r\n // add a mutable heap base dummy\r\n if (options.isWasm64) {\r\n module.addGlobal(\r\n \"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 \"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 sources = program.sources;\r\n for (let i = 0, k = sources.length; i < k; ++i) {\r\n if (sources[i].isEntry) this.compileSource(sources[i]);\r\n }\r\n\r\n // compile the start function if not empty or called by main\r\n if (startFunctionBody.length || program.mainFunction !== null) {\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 (!program.mainFunction) 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(\"HEAP_BASE\");\r\n if (options.isWasm64) {\r\n module.addGlobal(\r\n \"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 \"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 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 Module.UNLIMITED_MEMORY,\r\n this.memorySegments,\r\n options.target,\r\n \"memory\"\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\");\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 [name, moduleExport] of program.moduleLevelExports) {\r\n this.makeModuleExport(name, moduleExport.element);\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 export(s) for the specified element. */\r\n private makeModuleExport(name: string, element: Element, prefix: string = \"\"): void {\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 (element.kind == ElementKind.NAMESPACE) {\r\n for (let member of members.values()) {\r\n if (!member.is(CommonFlags.EXPORT)) continue;\r\n this.makeModuleExport(member.simpleName, 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.simpleName, member, subPrefix);\r\n }\r\n }\r\n }\r\n\r\n switch (element.kind) {\r\n\r\n // export global\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 let declaration = (element).declaration;\r\n if (declaration) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n declaration.name.range\r\n );\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 (!assert(element.parent).is(CommonFlags.CONST) && !this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n let declaration = (element).declaration;\r\n if (declaration) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n declaration.name.range\r\n );\r\n }\r\n } else {\r\n this.module.addGlobalExport(element.internalName, prefix + name);\r\n }\r\n break;\r\n }\r\n\r\n // export function\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\r\n // export getter and setter\r\n case ElementKind.PROPERTY: {\r\n let getter = assert((element).getterPrototype);\r\n this.makeModuleExport(GETTER_PREFIX + name, getter, prefix);\r\n let setter = (element).setterPrototype;\r\n if (setter) this.makeModuleExport(SETTER_PREFIX + name, setter, prefix);\r\n break;\r\n }\r\n\r\n // export a getter and a setter\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 // skip prototype and export instances\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n for (let instances of (element).instances.values()) {\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 for (let instance of (element).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 let ctor = instance.constructorInstance;\r\n if (ctor) this.makeModuleExport(instanceName + INSTANCE_DELIMITER + ctor.simpleName, ctor, prefix);\r\n this.makeModuleExport(instanceName, instance, prefix);\r\n }\r\n break;\r\n }\r\n\r\n // all possible members already handled above\r\n case ElementKind.ENUM:\r\n case ElementKind.CLASS:\r\n case ElementKind.NAMESPACE: break;\r\n\r\n default: assert(false);\r\n }\r\n }\r\n\r\n // sources\r\n\r\n /** Compiles a source by looking it up by path first. */\r\n compileSourceByPath(normalizedPathWithoutExtension: string, reportNode: Node): void {\r\n var source = this.program.lookupSourceByPath(normalizedPathWithoutExtension);\r\n if (source) this.compileSource(source);\r\n else {\r\n this.error(\r\n DiagnosticCode.File_0_not_found,\r\n reportNode.range, normalizedPathWithoutExtension\r\n );\r\n }\r\n }\r\n\r\n /** Compiles a source. */\r\n compileSource(source: Source): void {\r\n if (source.is(CommonFlags.COMPILED)) return;\r\n source.set(CommonFlags.COMPILED);\r\n\r\n // compile top-level statements\r\n var noTreeShaking = this.options.noTreeShaking;\r\n var isEntry = source.isEntry;\r\n var startFunctionInstance = this.startFunctionInstance;\r\n var startFunctionBody = this.startFunctionBody;\r\n var statements = source.statements;\r\n for (let i = 0, k = statements.length; i < k; ++i) {\r\n let statement = statements[i];\r\n switch (statement.kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n if (\r\n (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) &&\r\n !(statement).isGeneric\r\n ) {\r\n this.compileClassDeclaration(statement, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: break;\r\n case NodeKind.ENUMDECLARATION: {\r\n if (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) {\r\n this.compileEnumDeclaration(statement);\r\n }\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n if (\r\n (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) &&\r\n !(statement).isGeneric\r\n ) {\r\n this.compileFunctionDeclaration(statement, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.compileSourceByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n if (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) {\r\n this.compileNamespaceDeclaration(statement);\r\n }\r\n break;\r\n }\r\n case NodeKind.VARIABLE: { // global, always compiled as initializers might have side effects\r\n let variableInit = this.compileVariableStatement(statement);\r\n if (variableInit) startFunctionBody.push(variableInit);\r\n break;\r\n }\r\n case NodeKind.EXPORT: {\r\n if ((statement).normalizedPath != null) {\r\n this.compileSourceByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n }\r\n if (noTreeShaking || isEntry) {\r\n this.compileExportStatement(statement);\r\n }\r\n break;\r\n }\r\n default: { // otherwise a top-level statement that is part of the start function's body\r\n let previousFunction = this.currentFunction;\r\n this.currentFunction = startFunctionInstance;\r\n startFunctionBody.push(this.compileStatement(statement));\r\n this.currentFunction = previousFunction;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // globals\r\n\r\n compileGlobalDeclaration(declaration: VariableDeclaration): Global | null {\r\n // look up the initialized program element\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.GLOBAL);\r\n if (!this.compileGlobal(element)) return null; // reports\r\n return element;\r\n }\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 declaration = global.declaration;\r\n var initExpr: ExpressionRef = 0;\r\n\r\n if (!global.is(CommonFlags.RESOLVED)) {\r\n if (declaration) {\r\n\r\n // resolve now if annotated\r\n if (declaration.type) {\r\n let resolvedType = this.resolver.resolveType(declaration.type); // reports\r\n if (!resolvedType) return false;\r\n if (resolvedType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n declaration.type.range\r\n );\r\n return false;\r\n }\r\n global.type = resolvedType;\r\n global.set(CommonFlags.RESOLVED);\r\n\r\n // infer from initializer if not annotated\r\n } else if (declaration.initializer) { // infer type using void/NONE for literal inference\r\n initExpr = this.compileExpressionRetainType( // reports\r\n declaration.initializer,\r\n Type.void,\r\n WrapMode.WRAP\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.initializer.range, this.currentType.toString(), \"\"\r\n );\r\n return false;\r\n }\r\n global.type = this.currentType;\r\n global.set(CommonFlags.RESOLVED);\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 declaration.name.range.atEnd\r\n );\r\n return false;\r\n }\r\n } else {\r\n assert(false); // must have a declaration if resolved lazily\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 if (declaration) {\r\n mangleImportName(global, declaration);\r\n } else {\r\n mangleImportName_moduleName = \"env\";\r\n mangleImportName_elementName = global.simpleName;\r\n }\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 assert(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 (declaration !== null && declaration.initializer !== null) {\r\n if (!initExpr) {\r\n initExpr = this.compileExpression(\r\n declaration.initializer,\r\n global.type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP\r\n );\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 declaration.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 module.addGlobal(internalName, nativeType, true, global.type.toNativeZero(module));\r\n this.startFunctionBody.push(module.createSetGlobal(internalName, initExpr));\r\n\r\n } else { // 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 compileEnumDeclaration(declaration: EnumDeclaration): Enum | null {\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.ENUM);\r\n if (!this.compileEnum(element)) return null;\r\n return element;\r\n }\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\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 valueDeclaration = val.declaration;\r\n val.set(CommonFlags.COMPILED);\r\n let initExpr: ExpressionRef;\r\n if (valueDeclaration.value) {\r\n initExpr = this.compileExpression(\r\n valueDeclaration.value,\r\n Type.i32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (element.is(CommonFlags.CONST)) {\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n this.error(\r\n DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,\r\n valueDeclaration.value.range\r\n );\r\n initInStart = true;\r\n }\r\n } else {\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 valueDeclaration.range\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 valueDeclaration.range\r\n );\r\n }\r\n initInStart = true;\r\n }\r\n }\r\n if (initInStart) {\r\n module.addGlobal(val.internalName, NativeType.I32, true, module.createI32(0));\r\n this.startFunctionBody.push(module.createSetGlobal(val.internalName, initExpr));\r\n previousValueIsMut = true;\r\n } else {\r\n module.addGlobal(val.internalName, NativeType.I32, !element.is(CommonFlags.CONST), initExpr);\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 /** Compiles a top-level function given its declaration. */\r\n compileFunctionDeclaration(\r\n declaration: FunctionDeclaration,\r\n typeArguments: TypeNode[]\r\n ): Function | null {\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n return this.compileFunctionUsingTypeArguments( // reports\r\n element,\r\n typeArguments,\r\n makeMap(),\r\n null,\r\n (element).declaration.name\r\n );\r\n }\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,\r\n outerScope: Flow | null,\r\n reportNode: Node\r\n ): Function | null {\r\n var instance = this.resolver.resolveFunctionInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n contextualTypeArguments,\r\n reportNode\r\n );\r\n if (!instance) return null;\r\n instance.outerScope = outerScope;\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 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 // check that modifiers are matching\r\n var declaration = instance.prototype.declaration;\r\n var body = declaration.body;\r\n if (body) {\r\n if (instance.is(CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,\r\n declaration.name.range\r\n );\r\n }\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 declaration.name.range\r\n );\r\n }\r\n }\r\n\r\n var ref: FunctionRef;\r\n var signature = instance.signature;\r\n var typeRef = this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType);\r\n var module = this.module;\r\n if (body) {\r\n let isConstructor = instance.is(CommonFlags.CONSTRUCTOR);\r\n let returnType = instance.signature.returnType;\r\n\r\n // compile body\r\n let previousFunction = this.currentFunction;\r\n this.currentFunction = instance;\r\n let flow = instance.flow;\r\n let stmt: ExpressionRef;\r\n if (body.kind == NodeKind.EXPRESSION) { // () => expression\r\n assert(!instance.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.GET | CommonFlags.SET | CommonFlags.MAIN));\r\n assert(instance.is(CommonFlags.ARROW));\r\n stmt = this.compileExpression(\r\n (body).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 flow.finalize();\r\n } else {\r\n assert(body.kind == NodeKind.BLOCK);\r\n let stmts = this.compileStatements((body).statements);\r\n if (instance.is(CommonFlags.MAIN)) {\r\n module.addGlobal(\"~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(\"~started\", NativeType.I32)\r\n ),\r\n module.createBlock(null, [\r\n module.createCall(\"start\", null, NativeType.None),\r\n module.createSetGlobal(\"~started\", module.createI32(1))\r\n ])\r\n )\r\n );\r\n }\r\n flow.finalize();\r\n if (isConstructor) {\r\n let nativeSizeType = this.options.nativeSizeType;\r\n assert(instance.is(CommonFlags.INSTANCE));\r\n\r\n // implicitly return `this` if the constructor doesn't always return on its own\r\n if (!flow.is(FlowFlags.RETURNS)) {\r\n\r\n // if all branches are guaranteed to allocate, skip the final conditional allocation\r\n if (flow.is(FlowFlags.ALLOCATES)) {\r\n stmts.push(module.createGetLocal(0, nativeSizeType));\r\n\r\n // if not all branches are guaranteed to allocate, also append a conditional allocation\r\n } else {\r\n let parent = assert(instance.parent);\r\n assert(parent.kind == ElementKind.CLASS);\r\n stmts.push(module.createTeeLocal(0,\r\n this.makeConditionalAllocate(parent, declaration.name)\r\n ));\r\n }\r\n }\r\n\r\n // make sure 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 declaration.signature.returnType.range\r\n );\r\n }\r\n stmt = !stmts.length\r\n ? module.createNop()\r\n : stmts.length == 1\r\n ? stmts[0]\r\n : module.createBlock(null, stmts, returnType.toNativeType());\r\n }\r\n this.currentFunction = previousFunction;\r\n\r\n // create the function\r\n ref = module.addFunction(\r\n instance.internalName,\r\n typeRef,\r\n typesToNativeTypes(instance.additionalLocals),\r\n stmt\r\n );\r\n\r\n // concrete functions cannot have an annotated external name\r\n if (instance.hasDecorator(DecoratorFlags.EXTERNAL)) {\r\n let decorator = assert(findDecorator(DecoratorKind.EXTERNAL, declaration.decorators));\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n decorator.range\r\n );\r\n }\r\n\r\n } else {\r\n instance.set(CommonFlags.MODULE_IMPORT);\r\n mangleImportName(instance, declaration); // TODO: check for duplicates\r\n\r\n // create the function import\r\n ref = 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, ref);\r\n return true;\r\n }\r\n\r\n // namespaces\r\n\r\n compileNamespaceDeclaration(declaration: NamespaceDeclaration): void {\r\n var members = declaration.members;\r\n var noTreeShaking = this.options.noTreeShaking;\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 if (\r\n (noTreeShaking || member.is(CommonFlags.EXPORT)) &&\r\n !(member).isGeneric\r\n ) {\r\n this.compileClassDeclaration(member, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n if (\r\n (noTreeShaking || member.is(CommonFlags.EXPORT)) &&\r\n !(member).isGeneric\r\n ) {\r\n this.compileInterfaceDeclaration(member, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n if (noTreeShaking || member.is(CommonFlags.EXPORT)) {\r\n this.compileEnumDeclaration(member);\r\n }\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n if (\r\n (noTreeShaking || member.is(CommonFlags.EXPORT)) &&\r\n !(member).isGeneric\r\n ) {\r\n this.compileFunctionDeclaration(member, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n if (noTreeShaking || member.is(CommonFlags.EXPORT)) {\r\n this.compileNamespaceDeclaration(member);\r\n }\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n if (noTreeShaking || member.is(CommonFlags.EXPORT)) {\r\n let variableInit = this.compileVariableStatement(member, true);\r\n if (variableInit) this.startFunctionBody.push(variableInit);\r\n }\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n }\r\n\r\n compileNamespace(ns: Namespace): void {\r\n if (!ns.members) return;\r\n\r\n var noTreeShaking = this.options.noTreeShaking;\r\n for (let element of ns.members.values()) {\r\n switch (element.kind) {\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n if (\r\n (\r\n noTreeShaking ||\r\n (element).is(CommonFlags.EXPORT)\r\n ) && !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n this.compileClassUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap()\r\n );\r\n }\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 (\r\n (\r\n noTreeShaking || (element).is(CommonFlags.EXPORT)\r\n ) && !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n if (element.hasDecorator(DecoratorFlags.BUILTIN)) break;\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(),\r\n null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n this.compileNamespace(element);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // exports\r\n\r\n compileExportStatement(statement: ExportStatement): void {\r\n var fileLevelExports = this.program.fileLevelExports;\r\n var members = statement.members;\r\n if (!members) return; // filespace\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n let member = members[i];\r\n let element = fileLevelExports.get(\r\n statement.range.source.internalPath + PATH_DELIMITER + member.externalName.text\r\n );\r\n if (!element) continue; // reported in Program#initialize\r\n switch (element.kind) {\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n if (!(element).is(CommonFlags.GENERIC)) {\r\n this.compileClassUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap()\r\n );\r\n }\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 (\r\n !(element).is(CommonFlags.GENERIC) &&\r\n statement.range.source.isEntry\r\n ) {\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(),\r\n null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n this.compileNamespace(element);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // classes\r\n\r\n compileClassDeclaration(\r\n declaration: ClassDeclaration,\r\n typeArguments: TypeNode[]\r\n ): void {\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.compileClassUsingTypeArguments(\r\n element,\r\n typeArguments,\r\n makeMap(),\r\n declaration\r\n );\r\n }\r\n\r\n compileClassUsingTypeArguments(\r\n prototype: ClassPrototype,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map,\r\n alternativeReportNode: Node | null = null\r\n ): void {\r\n var instance = this.resolver.resolveClassInclTypeArguments(\r\n prototype,\r\n typeArguments,\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\r\n var staticMembers = instance.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 null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterPrototype;\r\n if (getter) {\r\n this.compileFunctionUsingTypeArguments(\r\n getter,\r\n [],\r\n makeMap(),\r\n null,\r\n getter.declaration.name\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 null,\r\n setter.declaration.name\r\n );\r\n }\r\n break;\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 null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.FIELD: {\r\n element.set(CommonFlags.COMPILED);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterPrototype;\r\n if (getter) {\r\n this.compileFunctionUsingTypeArguments(\r\n getter,\r\n [],\r\n makeMap(instance.contextualTypeArguments),\r\n null,\r\n getter.declaration.name\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(instance.contextualTypeArguments),\r\n null,\r\n setter.declaration.name\r\n );\r\n }\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 compileStatement(statement: Statement): 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);\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 // type declarations must be top-level because function bodies are evaluated when\r\n // reachaable only.\r\n if (this.currentFunction == this.startFunctionInstance) {\r\n return module.createNop();\r\n }\r\n // otherwise fall-through\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[]): ExpressionRef[] {\r\n var numStatements = statements.length;\r\n var stmts = new Array(numStatements);\r\n stmts.length = 0;\r\n var flow = this.currentFunction.flow;\r\n for (let i = 0; i < numStatements; ++i) {\r\n let stmt = this.compileStatement(statements[i]);\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 parentFlow = this.currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n this.currentFunction.flow = flow;\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 this.currentFunction.flow = flow.free();\r\n parentFlow.inherit(flow);\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.currentFunction.flow;\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.currentFunction.flow;\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 currentFunction = this.currentFunction;\r\n var module = this.module;\r\n\r\n var label = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n var breakLabel = \"break|\" + label;\r\n flow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n flow.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 currentFunction.flow = flow.free();\r\n currentFunction.leaveBreakContext();\r\n var terminated = flow.isAny(FlowFlags.ANY_TERMINATING);\r\n flow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n parentFlow.inherit(flow);\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 currentFunction = this.currentFunction;\r\n var label = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n var breakLabel = flow.breakLabel = \"break|\" + label;\r\n flow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n flow.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 currentFunction.flow = flow.free();\r\n currentFunction.leaveBreakContext();\r\n var usesContinue = flow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES);\r\n flow.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) parentFlow.inherit(flow);\r\n else parentFlow.inheritConditional(flow);\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 currentFunction = this.currentFunction;\r\n var ifTrue = statement.ifTrue;\r\n var ifFalse = statement.ifFalse;\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 if (\r\n !this.options.noTreeShaking ||\r\n this.currentFunction.isAny(CommonFlags.GENERIC | CommonFlags.GENERIC_CONTEXT)\r\n ) {\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n let 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\r\n // Each arm initiates a branch\r\n var parentFlow = currentFunction.flow;\r\n var ifTrueFlow = parentFlow.fork();\r\n currentFunction.flow = ifTrueFlow;\r\n var ifTrueExpr = this.compileStatement(ifTrue);\r\n currentFunction.flow = ifTrueFlow.free();\r\n\r\n var ifFalseExpr: ExpressionRef = 0;\r\n if (ifFalse) {\r\n let ifFalseFlow = parentFlow.fork();\r\n currentFunction.flow = ifFalseFlow;\r\n ifFalseExpr = this.compileStatement(ifFalse);\r\n currentFunction.flow = ifFalseFlow.free();\r\n parentFlow.inheritMutual(ifTrueFlow, ifFalseFlow);\r\n } else {\r\n parentFlow.inheritConditional(ifTrueFlow);\r\n }\r\n return module.createIf(condExpr, ifTrueExpr, ifFalseExpr);\r\n }\r\n\r\n compileReturnStatement(statement: ReturnStatement): ExpressionRef {\r\n var module = this.module;\r\n var currentFunction = this.currentFunction;\r\n var expr: ExpressionRef = 0;\r\n var flow = currentFunction.flow;\r\n\r\n // Remember that this flow returns\r\n flow.set(FlowFlags.RETURNS);\r\n\r\n if (statement.value) {\r\n let returnType = flow.returnType;\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 currentFunction.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\r\n // If the last statement anyway, make it the block's return value\r\n if (isLastStatement(statement)) 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 return flow.is(FlowFlags.INLINE_CONTEXT)\r\n ? module.createBreak(assert(flow.returnLabel), 0, expr)\r\n : module.createReturn(expr);\r\n }\r\n\r\n compileSwitchStatement(statement: SwitchStatement): ExpressionRef {\r\n var module = this.module;\r\n var currentFunction = this.currentFunction;\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 context = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n\r\n // introduce a local for evaluating the condition (exactly once)\r\n var tempLocal = currentFunction.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 currentFunction.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 flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n let breakLabel = \"break|\" + context;\r\n flow.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 (flow.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 (!flow.is(FlowFlags.RETURNS)) alwaysReturns = false;\r\n if (!flow.is(FlowFlags.RETURNS_WRAPPED)) alwaysReturnsWrapped = false;\r\n if (!flow.is(FlowFlags.THROWS)) alwaysThrows = false;\r\n if (!flow.is(FlowFlags.ALLOCATES)) alwaysAllocates = false;\r\n }\r\n\r\n // Switch back to the parent flow\r\n flow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS\r\n );\r\n currentFunction.flow = flow.free();\r\n currentBlock = module.createBlock(nextLabel, stmts, NativeType.None); // must be a labeled block\r\n }\r\n currentFunction.leaveBreakContext();\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) parentFlow.set(FlowFlags.RETURNS);\r\n if (alwaysReturnsWrapped) parentFlow.set(FlowFlags.RETURNS_WRAPPED);\r\n if (alwaysThrows) parentFlow.set(FlowFlags.THROWS);\r\n if (alwaysAllocates) parentFlow.set(FlowFlags.ALLOCATES);\r\n }\r\n return currentBlock;\r\n }\r\n\r\n compileThrowStatement(statement: ThrowStatement): ExpressionRef {\r\n var flow = this.currentFunction.flow;\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\r\n // 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 /**\r\n * Compiles a variable statement. Returns `0` if an initializer is not\r\n * necessary.\r\n */\r\n compileVariableStatement(statement: VariableStatement, isKnownGlobal: bool = false): ExpressionRef {\r\n var program = this.program;\r\n var currentFunction = this.currentFunction;\r\n var declarations = statement.declarations;\r\n var numDeclarations = declarations.length;\r\n\r\n // top-level variables and constants become globals\r\n if (isKnownGlobal || (\r\n currentFunction == this.startFunctionInstance &&\r\n statement.parent && statement.parent.kind == NodeKind.SOURCE\r\n )) {\r\n // NOTE that the above condition also covers top-level variables declared with 'let', even\r\n // though such variables could also become start function locals if, and only if, not used\r\n // within any function declared in the same source, which is unknown at this point. the only\r\n // efficient way to deal with this would be to keep track of all occasions it is used and\r\n // replace these instructions afterwards, dynamically. (TOOD: what about a Binaryen pass?)\r\n for (let i = 0; i < numDeclarations; ++i) {\r\n this.compileGlobalDeclaration(declarations[i]);\r\n }\r\n return 0;\r\n }\r\n\r\n // other variables become locals\r\n var initializers = new Array();\r\n var flow = this.currentFunction.flow;\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.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(program, name, -1, type);\r\n switch (getExpressionType(initExpr)) {\r\n case NativeType.I32: {\r\n local = local.withConstantIntegerValue(\r\n i64_new(\r\n getConstValueI32(initExpr),\r\n 0\r\n )\r\n );\r\n break;\r\n }\r\n case NativeType.I64: {\r\n local = local.withConstantIntegerValue(\r\n i64_new(\r\n getConstValueI64Low(initExpr),\r\n getConstValueI64High(initExpr)\r\n )\r\n );\r\n break;\r\n }\r\n case NativeType.F32: {\r\n local = local.withConstantFloatValue(getConstValueF32(initExpr));\r\n break;\r\n }\r\n case NativeType.F64: {\r\n local = local.withConstantFloatValue(getConstValueF64(initExpr));\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 = currentFunction.flow.scopedLocals;\r\n if (!scopedLocals) currentFunction.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(type, name, false, declaration); // reports\r\n } else {\r\n local = currentFunction.addLocal(type, name, declaration); // reports\r\n }\r\n if (initExpr) {\r\n initializers.push(this.compileAssignmentWithValue(declaration.name, initExpr));\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\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 if (\r\n !this.options.noTreeShaking ||\r\n this.currentFunction.isAny(CommonFlags.GENERIC | CommonFlags.GENERIC_CONTEXT)\r\n ) {\r\n // Try to eliminate unnecesssary loops if the condition is constant\r\n let 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\r\n // Statements initiate a new branch with its own break context\r\n var currentFunction = this.currentFunction;\r\n var label = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n var breakLabel = \"break|\" + label;\r\n flow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n flow.continueLabel = continueLabel;\r\n\r\n var body = this.compileStatement(statement.statement);\r\n var alwaysTrue = false; // TODO\r\n var terminated = flow.isAny(FlowFlags.ANY_TERMINATING);\r\n\r\n // Switch back to the parent flow\r\n currentFunction.flow = flow.free();\r\n currentFunction.leaveBreakContext();\r\n flow.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) parentFlow.inherit(flow);\r\n else parentFlow.inheritConditional(flow);\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\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);\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\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 var toType = this.resolver.resolveType( // reports\r\n expression.toType,\r\n this.currentFunction.flow.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\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.commonCompatible(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.commonCompatible(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.commonCompatible(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.commonCompatible(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.commonCompatible(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 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.commonCompatible(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 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.commonCompatible(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.commonCompatible(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.commonCompatible(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.elementsLookup.get(\"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(\"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.elementsLookup.get(\"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(\"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.commonCompatible(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.commonCompatible(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.elementsLookup.get(\"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(\"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.elementsLookup.get(\"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(\"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.commonCompatible(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.commonCompatible(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.commonCompatible(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 this.makeIsTrueish(leftExpr, this.currentType);\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.currentFunction.flow;\r\n let tempLocal = this.currentFunction.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.currentFunction.flow;\r\n let tempLocal = this.currentFunction.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 operatorInstance.hasDecorator(DecoratorFlags.INLINE)\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 parent = assert(operatorInstance.parent);\r\n assert(parent.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 operatorInstance.hasDecorator(DecoratorFlags.INLINE)\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 currentFunction = this.currentFunction;\r\n var target = resolver.resolveExpression(expression, currentFunction); // 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: {\r\n let setterPrototype = (target).setterPrototype;\r\n if (setterPrototype) {\r\n let instance = this.resolver.resolveFunction(setterPrototype, null);\r\n if (!instance) return this.module.createUnreachable();\r\n assert(instance.signature.parameterTypes.length == 1); // parser must guarantee this\r\n targetType = instance.signature.parameterTypes[0];\r\n break;\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 this.module.createUnreachable();\r\n }\r\n case ElementKind.CLASS: {\r\n if (resolver.currentElementExpression) { // indexed access\r\n let isUnchecked = currentFunction.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 target = this.resolver.resolveExpression(expression, this.currentFunction); // 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 let flow = this.currentFunction.flow;\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 const declaration = (target).declaration;\r\n if (\r\n (target).is(CommonFlags.READONLY) &&\r\n !(\r\n this.currentFunction.is(CommonFlags.CONSTRUCTOR) ||\r\n declaration == null ||\r\n declaration.initializer != null\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 currentFunction = this.currentFunction;\r\n let flow = currentFunction.flow;\r\n let tempLocal = currentFunction.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: {\r\n let setterPrototype = (target).setterPrototype;\r\n if (setterPrototype) {\r\n let setterInstance = this.resolver.resolveFunction(setterPrototype, null);\r\n if (!setterInstance) 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 if (setterInstance.is(CommonFlags.INSTANCE)) {\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 return this.makeCallDirect(setterInstance, [ thisExpr, valueWithCorrectType ]);\r\n } else {\r\n return this.makeCallDirect(setterInstance, [ valueWithCorrectType ]);\r\n }\r\n }\r\n\r\n // otherwise call the setter first, then the getter\r\n let getterPrototype = (target).getterPrototype;\r\n assert(getterPrototype != null); // must have one if there is a setter\r\n let getterInstance = this.resolver.resolveFunction(getterPrototype, null);\r\n if (!getterInstance) return module.createUnreachable();\r\n let returnType = getterInstance.signature.returnType;\r\n let nativeReturnType = returnType.toNativeType();\r\n if (setterInstance.is(CommonFlags.INSTANCE)) {\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 tempLocal = this.currentFunction.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 } else {\r\n // note that this must be performed here because `resolved` is shared\r\n return module.createBlock(null, [\r\n this.makeCallDirect(setterInstance, [ valueWithCorrectType ]),\r\n this.makeCallDirect(getterInstance)\r\n ], nativeReturnType);\r\n }\r\n } else {\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 }\r\n return module.createUnreachable();\r\n }\r\n case ElementKind.CLASS: {\r\n let elementExpression = this.resolver.currentElementExpression;\r\n if (elementExpression) {\r\n let isUnchecked = this.currentFunction.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 currentFunction = this.currentFunction;\r\n let tempLocalTarget = currentFunction.getTempLocal(targetType, false);\r\n let tempLocalElement = currentFunction.getAndFreeTempLocal(this.currentType, false);\r\n let returnType = indexedGet.signature.returnType;\r\n this.currentFunction.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 currentFunction = this.currentFunction;\r\n var target = this.resolver.resolveExpression(expression.expression, currentFunction); // 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 makeMap(this.currentFunction.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 typeParameters = assert(prototype.declaration.typeParameters);\r\n let numTypeParameters = typeParameters.length;\r\n for (let i = 0; i < numTypeParameters; ++i) {\r\n inferredTypes.set(typeParameters[i].name.text, null);\r\n }\r\n // let numInferred = 0;\r\n let parameterTypes = prototype.declaration.signature.parameters;\r\n let numParameterTypes = parameterTypes.length;\r\n let argumentExpressions = expression.arguments;\r\n let numArguments = argumentExpressions.length;\r\n let argumentExprs = new Array(numArguments);\r\n for (let i = 0; i < numParameterTypes; ++i) {\r\n let typeNode = parameterTypes[i].type;\r\n let name = typeNode.kind == NodeKind.TYPE ? (typeNode).name.text : null;\r\n let argumentExpression = i < numArguments\r\n ? argumentExpressions[i]\r\n : prototype.declaration.signature.parameters[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, numParameterTypes.toString(10), numArguments.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (name !== null && inferredTypes.has(name)) {\r\n let inferredType = inferredTypes.get(name);\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.commonCompatible(inferredType, this.currentType, true))) {\r\n if (!(commonType = Type.commonCompatible(inferredType, this.currentType, false))) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n parameterTypes[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(name, inferredType);\r\n } else {\r\n let concreteType = this.resolver.resolveType(\r\n parameterTypes[i].type,\r\n this.currentFunction.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(typeParameters[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(this.currentFunction.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 instance.hasDecorator(DecoratorFlags.INLINE)\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: {\r\n indexArg = this.compileGetter(target, expression.expression);\r\n let type = this.currentType;\r\n signature = type.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, type.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 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(prototype.declaration.typeParameters),\r\n typeArgumentNodes,\r\n makeMap(this.currentFunction.flow.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 inline: bool = false\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 (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.compileCallInlineUnchecked(instance, argumentExpressions, reportNode, 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 compileCallInlineUnchecked(\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 var currentFunction = this.currentFunction;\r\n var module = this.module;\r\n var declaration = instance.prototype.declaration;\r\n\r\n // Create an empty child flow with its own scope and mark it for inlining\r\n var previousFlow = currentFunction.flow;\r\n var returnLabel = instance.internalName + \"|inlined.\" + (instance.nextInlineId++).toString(10);\r\n var returnType = instance.signature.returnType;\r\n var flow = Flow.create(currentFunction);\r\n flow.set(FlowFlags.INLINE_CONTEXT);\r\n flow.returnLabel = returnLabel;\r\n flow.returnType = returnType;\r\n flow.contextualTypeArguments = instance.contextualTypeArguments;\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 if (thisArg) {\r\n let parent = assert(instance.parent);\r\n assert(parent.kind == ElementKind.CLASS);\r\n let thisType = assert(instance.signature.thisType);\r\n let classType = thisType.classReference;\r\n let superType = classType\r\n ? classType.base\r\n ? classType.base.type\r\n : null\r\n : null;\r\n if (getExpressionId(thisArg) == ExpressionId.GetLocal) { // reuse this var\r\n flow.addScopedLocalAlias(getGetLocalIndex(thisArg), thisType, \"this\");\r\n if (superType) flow.addScopedLocalAlias(getGetLocalIndex(thisArg), superType, \"super\");\r\n } else { // use a temp var\r\n let thisLocal = flow.addScopedLocal(thisType, \"this\", false);\r\n body.push(\r\n module.createSetLocal(thisLocal.index, thisArg)\r\n );\r\n if (superType) flow.addScopedLocalAlias(thisLocal.index, superType, \"super\");\r\n }\r\n }\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 if (getExpressionId(paramExpr) == ExpressionId.GetLocal) {\r\n flow.addScopedLocalAlias(\r\n getGetLocalIndex(paramExpr),\r\n parameterTypes[i],\r\n signature.getParameterName(i)\r\n );\r\n // inherits wrap status\r\n } else {\r\n let argumentLocal = flow.addScopedLocal(\r\n parameterTypes[i],\r\n signature.getParameterName(i),\r\n !flow.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\r\n // Compile optional parameter initializers in the scope of the inlined flow\r\n currentFunction.flow = 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(declaration.signature.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 parameterTypes[i],\r\n signature.getParameterName(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 var bodyStatement = assert(declaration.body);\r\n if (bodyStatement.kind == NodeKind.BLOCK) {\r\n let statements = (bodyStatement).statements;\r\n for (let i = 0, k = statements.length; i < k; ++i) {\r\n let stmt = this.compileStatement(statements[i]);\r\n if (getExpressionId(stmt) != ExpressionId.Nop) {\r\n body.push(stmt);\r\n if (flow.isAny(FlowFlags.ANY_TERMINATING)) break;\r\n }\r\n }\r\n } else {\r\n body.push(this.compileStatement(bodyStatement));\r\n }\r\n\r\n // Free any new scoped locals and reset to the original flow\r\n var scopedLocals = flow.scopedLocals;\r\n if (scopedLocals) {\r\n for (let scopedLocal of scopedLocals.values()) {\r\n if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias\r\n currentFunction.freeTempLocal(scopedLocal);\r\n }\r\n }\r\n flow.scopedLocals = null;\r\n }\r\n flow.finalize();\r\n this.currentFunction.flow = previousFlow;\r\n this.currentType = returnType;\r\n\r\n // Check that all branches are terminated\r\n if (returnType != Type.void && !flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n this.error(\r\n DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,\r\n declaration.signature.returnType.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n return flow.is(FlowFlags.RETURNS)\r\n ? module.createBlock(returnLabel, body, returnType.toNativeType())\r\n : body.length > 1\r\n ? module.createBlock(null, body, returnType.toNativeType())\r\n : body.length\r\n ? body[0]\r\n : module.createNop();\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.declaration.signature.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 var trampolineName = originalName + \"|trampoline\";\r\n trampolineSignature.requiredParameters = maxArguments;\r\n trampoline = new Function(\r\n original.prototype,\r\n trampolineName,\r\n trampolineSignature,\r\n original.parent,\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 previousFunction = this.currentFunction;\r\n this.currentFunction = trampoline;\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(\"~argc\", NativeType.I32),\r\n module.createI32(minArguments)\r\n )\r\n : module.createGetGlobal(\"~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.currentFunction = previousFunction;\r\n assert(operandIndex == maxOperands);\r\n\r\n var funcRef = module.addFunction(\r\n trampolineName,\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 var internalName = \"~argc\";\r\n if (!this.argcVar) {\r\n let module = this.module;\r\n this.argcVar = module.addGlobal(\r\n internalName,\r\n NativeType.I32,\r\n true,\r\n module.createI32(0)\r\n );\r\n }\r\n return internalName;\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 = \"~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.declaration.signature.parameters;\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 !== null && 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 this.program.instancesLookup.set(instance.internalName, instance); // so canOverflow can find it\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.resolveElementAccess(expression, this.currentFunction, contextualType); // reports\r\n if (!target) return this.module.createUnreachable();\r\n switch (target.kind) {\r\n case ElementKind.CLASS: {\r\n let isUnchecked = this.currentFunction.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.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(expression: FunctionExpression, contextualType: Type): ExpressionRef {\r\n var declaration = expression.declaration;\r\n var name = declaration.name;\r\n var simpleName = (name.text.length\r\n ? name.text\r\n : \"anonymous\") + \"|\" + this.functionTable.length.toString(10);\r\n var currentFunction = this.currentFunction;\r\n var prototype = new FunctionPrototype(\r\n this.program,\r\n simpleName,\r\n currentFunction.internalName + INNER_DELIMITER + simpleName,\r\n declaration,\r\n null,\r\n DecoratorFlags.NONE\r\n );\r\n var flow = currentFunction.flow;\r\n var instance = this.compileFunctionUsingTypeArguments(\r\n prototype,\r\n [],\r\n makeMap(flow.contextualTypeArguments),\r\n flow,\r\n declaration\r\n );\r\n if (!instance) return this.module.createUnreachable();\r\n this.currentType = instance.signature.type; // TODO: get cached type?\r\n // NOTE that, in order to make this work in every case, the function must be represented by a\r\n // value, so we add it and rely on the optimizer to figure out where it can be called directly.\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 /**\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 currentFunction = this.currentFunction;\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 let flow = currentFunction.flow;\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let scopedThis = flow.getScopedLocal(\"this\");\r\n if (scopedThis) {\r\n this.currentType = scopedThis.type;\r\n return module.createGetLocal(scopedThis.index, scopedThis.type.toNativeType());\r\n }\r\n }\r\n if (currentFunction.is(CommonFlags.INSTANCE)) {\r\n let parent = assert(currentFunction.parent);\r\n assert(parent.kind == ElementKind.CLASS);\r\n let thisType = assert(currentFunction.signature.thisType);\r\n if (currentFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n if (!flow.is(FlowFlags.ALLOCATES)) {\r\n flow.set(FlowFlags.ALLOCATES);\r\n // must be conditional because `this` could have been provided by a derived class\r\n this.currentType = thisType;\r\n return module.createTeeLocal(0,\r\n this.makeConditionalAllocate(parent, expression)\r\n );\r\n }\r\n }\r\n this.currentType = thisType;\r\n return module.createGetLocal(0, 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 = currentFunction.flow;\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let scopedThis = flow.getScopedLocal(\"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 (currentFunction.is(CommonFlags.INSTANCE)) {\r\n let parent = assert(currentFunction.parent);\r\n assert(parent.kind == ElementKind.CLASS);\r\n let base = (parent).base;\r\n if (base) {\r\n let superType = base.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 // otherwise resolve\r\n var target = this.resolver.resolveIdentifier( // reports\r\n expression,\r\n this.currentEnum || currentFunction\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 return this.module.createI32((target).constantValue);\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(currentFunction.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 type = this.currentType;\r\n var isType = this.resolver.resolveType(expression.isType);\r\n this.currentType = Type.bool;\r\n if (!isType) return module.createUnreachable();\r\n return type.is(TypeFlags.NULLABLE) && !isType.is(TypeFlags.NULLABLE)\r\n ? type.nonNullableType.isAssignableTo(isType)\r\n ? module.createBinary( // not precomputeable\r\n type.is(TypeFlags.LONG)\r\n ? BinaryOp.NeI64\r\n : BinaryOp.NeI32,\r\n expr,\r\n type.toNativeZero(module)\r\n )\r\n : module.createI32(0)\r\n : module.createI32(type.isAssignableTo(isType, true) ? 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\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(\"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(\"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 if (usizeTypeSize == 8) {\r\n writeI64(bufferOffset, buf, pos + arrayInstance.offsetof(\"buffer_\"));\r\n writeI32(length, buf, pos + arrayInstance.offsetof(\"length_\"));\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, pos + arrayInstance.offsetof(\"buffer_\"));\r\n writeI32(length, buf, pos + arrayInstance.offsetof(\"length_\"));\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 expr = expressions[i]\r\n ? this.compileExpression(expressions[i], elementType, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : elementType.toNativeZero(module);\r\n compiledValues[i] = expr;\r\n if (isStatic) {\r\n expr = module.precomputeExpression(compiledValues[i]);\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 currentFunction = this.currentFunction;\r\n var tempLocal = currentFunction.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 currentFunction.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 tempLocal = this.currentFunction.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 compileAllocate(this, classReference, expression)\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 options = this.options;\r\n var currentFunction = this.currentFunction;\r\n\r\n // obtain the class being instantiated\r\n var target = this.resolver.resolveExpression( // reports\r\n expression.expression,\r\n currentFunction\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(currentFunction.flow.contextualTypeArguments)\r\n );\r\n } else {\r\n classInstance = this.resolver.resolveClassInclTypeArguments(\r\n classPrototype,\r\n typeArguments,\r\n makeMap(currentFunction.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 compileInstantiate(classInstance: Class, argumentExpressions: Expression[], reportNode: Node): ExpressionRef {\r\n // traverse to the top-most visible constructor\r\n var currentClassInstance: Class | null = classInstance;\r\n var constructorInstance: Function | null = null;\r\n do {\r\n constructorInstance = currentClassInstance.constructorInstance;\r\n if (constructorInstance) break; // TODO: check visibility\r\n } while (currentClassInstance = currentClassInstance.base);\r\n\r\n // if a constructor is present, call it with a zero `this`\r\n var expr: ExpressionRef;\r\n if (constructorInstance) {\r\n expr = this.compileCallDirect(constructorInstance, argumentExpressions, reportNode,\r\n this.options.usizeType.toNativeZero(this.module)\r\n );\r\n\r\n // otherwise simply allocate a new instance and initialize its fields\r\n } else {\r\n if (argumentExpressions.length) {\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", argumentExpressions.length.toString(10)\r\n );\r\n }\r\n expr = this.makeAllocate(classInstance, reportNode);\r\n }\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\r\n var target = this.resolver.resolvePropertyAccess(propertyAccess, this.currentFunction, contextualType); // reports\r\n if (!target) return module.createUnreachable();\r\n\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: { // static property\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 parent = (target).parent;\r\n assert(parent !== null && parent.kind == ElementKind.ENUM);\r\n if (!this.compileEnum(parent)) {\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 return module.createI32((target).constantValue);\r\n }\r\n return module.createGetGlobal((target).internalName, NativeType.I32);\r\n }\r\n case ElementKind.FIELD: { // instance field\r\n let thisExpression = assert(this.resolver.currentThisExpression);\r\n assert((target).memoryOffset >= 0);\r\n let thisExpr = this.compileExpressionRetainType(\r\n thisExpression,\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: {// instance property (here: getter)\r\n return this.compileGetter(target, propertyAccess);\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).simpleName\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: Property, 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 let inline = (instance.decoratorFlags & DecoratorFlags.INLINE) != 0;\r\n if (instance.is(CommonFlags.INSTANCE)) {\r\n let parent = assert(instance.parent);\r\n assert(parent.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, inline);\r\n } else {\r\n this.currentType = signature.returnType;\r\n return this.compileCallDirect(instance, [], reportNode, 0, inline);\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).simpleName, (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 currentFunction = this.currentFunction;\r\n var parentFlow = currentFunction.flow;\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 if (\r\n !this.options.noTreeShaking ||\r\n this.currentFunction.isAny(CommonFlags.GENERIC | CommonFlags.GENERIC_CONTEXT)\r\n ) {\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n let 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\r\n var ifThenFlow = parentFlow.fork();\r\n currentFunction.flow = ifThenFlow;\r\n var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE);\r\n var ifThenType = this.currentType;\r\n ifThenFlow.free();\r\n\r\n var ifElseFlow = parentFlow.fork();\r\n currentFunction.flow = ifElseFlow;\r\n var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE);\r\n var ifElseType = this.currentType;\r\n currentFunction.flow = ifElseFlow.free();\r\n\r\n parentFlow.inheritMutual(ifThenFlow, ifElseFlow);\r\n\r\n var commonType = Type.commonCompatible(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 currentFunction = this.currentFunction;\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 = currentFunction.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 currentFunction.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.currentFunction.flow;\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 expression for an instance of the specified class. */\r\n makeAllocate(classInstance: Class, reportNode: Node): ExpressionRef {\r\n var module = this.module;\r\n var currentFunction = this.currentFunction;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n\r\n // allocate the necessary memory and tee the pointer to a temp. local for reuse\r\n var tempLocal = currentFunction.getTempLocal(classInstance.type, false);\r\n var initializers = new Array();\r\n initializers.push(\r\n module.createSetLocal(tempLocal.index,\r\n compileAllocate(this, classInstance, reportNode)\r\n )\r\n );\r\n\r\n // apply field initializers\r\n if (classInstance.members) {\r\n for (let member of classInstance.members.values()) {\r\n if (member.kind == ElementKind.FIELD) {\r\n let field = member;\r\n let fieldType = field.type;\r\n let nativeFieldType = fieldType.toNativeType();\r\n let fieldDeclaration = field.prototype.declaration;\r\n assert(!field.isAny(CommonFlags.CONST));\r\n if (fieldDeclaration.initializer) { // use initializer\r\n initializers.push(module.createStore(fieldType.byteSize,\r\n module.createGetLocal(tempLocal.index, nativeSizeType),\r\n this.compileExpression( // reports\r\n fieldDeclaration.initializer,\r\n fieldType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n ),\r\n nativeFieldType,\r\n field.memoryOffset\r\n ));\r\n } else { // initialize with zero\r\n // TODO: might be unnecessary if the ctor initializes the field\r\n let parameterIndex = (field.prototype.declaration).parameterIndex;\r\n initializers.push(module.createStore(fieldType.byteSize,\r\n module.createGetLocal(tempLocal.index, nativeSizeType),\r\n parameterIndex >= 0 // initialized via parameter\r\n ? module.createGetLocal(1 + parameterIndex, nativeFieldType)\r\n : fieldType.toNativeZero(module),\r\n nativeFieldType,\r\n field.memoryOffset\r\n ));\r\n }\r\n }\r\n }\r\n }\r\n\r\n // return `this`\r\n initializers.push(\r\n module.createGetLocal(tempLocal.index, nativeSizeType)\r\n );\r\n\r\n currentFunction.freeTempLocal(tempLocal);\r\n this.currentType = classInstance.type;\r\n return module.createBlock(null, initializers, nativeSizeType);\r\n }\r\n\r\n /** Makes a conditional allocation expression inside of the constructor of the specified class. */\r\n makeConditionalAllocate(classInstance: Class, reportNode: Node): ExpressionRef {\r\n // requires that `this` is the first local\r\n var module = this.module;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n this.currentType = classInstance.type;\r\n return module.createIf(\r\n nativeSizeType == NativeType.I64\r\n ? module.createBinary(\r\n BinaryOp.NeI64,\r\n module.createGetLocal(0, NativeType.I64),\r\n module.createI64(0)\r\n )\r\n : module.createGetLocal(0, NativeType.I32),\r\n module.createGetLocal(0, nativeSizeType),\r\n module.createTeeLocal(0,\r\n this.makeAllocate(classInstance, reportNode)\r\n )\r\n );\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 currentFunction = this.currentFunction;\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 currentFunction.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 = declaration.programLevelInternalName;\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 * 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 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 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 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 _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 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 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}\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 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 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 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 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 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 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 default: return \"\";\r\n }\r\n}\r\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 FlowFlags,\r\n\r\n Element,\r\n Class,\r\n ClassPrototype,\r\n Function,\r\n FunctionTarget,\r\n FunctionPrototype,\r\n VariableLikeElement,\r\n Property,\r\n DecoratorFlags,\r\n FieldPrototype,\r\n Field,\r\n Global\r\n} from \"./program\";\r\n\r\nimport {\r\n SignatureNode,\r\n ParameterKind,\r\n CommonTypeNode,\r\n NodeKind,\r\n TypeNode,\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} 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 PATH_DELIMITER,\r\n INSTANCE_DELIMITER,\r\n CommonFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n makeMap\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(program: Program) {\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 node: CommonTypeNode,\r\n contextualTypeArguments: Map | null = null,\r\n reportMode = ReportMode.REPORT\r\n ): Type | null {\r\n\r\n // handle signatures specifically\r\n if (node.kind == NodeKind.SIGNATURE) {\r\n let signature = this.resolveSignature(node, contextualTypeArguments, reportMode);\r\n if (!signature) return null;\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 simpleName = typeNode.name.text;\r\n var globalName = simpleName;\r\n var localName = typeNode.range.source.internalPath + PATH_DELIMITER + simpleName; // TODO cache\r\n\r\n // check file-global / program-global enum or class\r\n {\r\n let elementsLookup = this.program.elementsLookup;\r\n let element: Element | null;\r\n if (\r\n (element = elementsLookup.get(localName)) || // file-global\r\n (element = elementsLookup.get(globalName)) // program-global\r\n ) {\r\n switch (element.kind) {\r\n case ElementKind.ENUM: {\r\n if (typeNode.typeArguments !== null && typeNode.typeArguments.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 return null;\r\n }\r\n return Type.i32;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instance = this.resolveClassInclTypeArguments(\r\n element,\r\n typeNode.typeArguments,\r\n makeMap(contextualTypeArguments),\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 }\r\n\r\n // check (global) type alias\r\n {\r\n let alias = this.program.typeAliases.get(simpleName);\r\n if (alias) return this.resolveType(alias.type, contextualTypeArguments, reportMode);\r\n }\r\n\r\n // resolve parameters\r\n var typeArgumentNodes = typeNode.typeArguments;\r\n var typeArguments: Type[] | null = null;\r\n if (typeArgumentNodes) {\r\n let numTypeArguments = typeArgumentNodes.length;\r\n typeArguments = new Array(numTypeArguments);\r\n for (let i = 0; i < numTypeArguments; ++i) {\r\n let paramType = this.resolveType( // reports\r\n typeArgumentNodes[i],\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!paramType) return null;\r\n typeArguments[i] = paramType;\r\n }\r\n if (numTypeArguments) { // can't be a placeholder if it has parameters\r\n let instanceKey = typesToString(typeArguments);\r\n if (instanceKey.length) {\r\n localName += \"<\" + instanceKey + \">\";\r\n globalName += \"<\" + instanceKey + \">\";\r\n }\r\n } else if (contextualTypeArguments) {\r\n let placeholderType = contextualTypeArguments.get(globalName);\r\n if (placeholderType) return placeholderType;\r\n }\r\n }\r\n\r\n // check file-global / program-global type\r\n {\r\n let typesLookup = this.program.typesLookup;\r\n let type: Type | null;\r\n if (\r\n (type = typesLookup.get(localName)) ||\r\n (type = typesLookup.get(globalName))\r\n ) {\r\n return type;\r\n }\r\n }\r\n\r\n // check built-in macro types\r\n if (simpleName == \"NATIVE\") {\r\n if (!(typeArguments && typeArguments.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 switch (typeArguments[0].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.VOID: return Type.void;\r\n default: assert(false);\r\n }\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, globalName\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a {@link SignatureNode} to a concrete {@link Signature}. */\r\n resolveSignature(\r\n node: SignatureNode,\r\n contextualTypeArguments: Map | null = null,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Signature | null {\r\n var explicitThisType = node.explicitThisType;\r\n var thisType: Type | null = null;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(explicitThisType, contextualTypeArguments, reportMode);\r\n if (!thisType) return null;\r\n }\r\n var parameterTypeNodes = node.parameters;\r\n var numParameters = parameterTypeNodes.length;\r\n var parameterTypes = new Array(numParameters);\r\n var parameterNames = new Array(numParameters);\r\n var requiredParameters = 0;\r\n var hasRest = false;\r\n for (let i = 0; i < numParameters; ++i) {\r\n let parameterTypeNode = parameterTypeNodes[i];\r\n switch (parameterTypeNode.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 parameterType = this.resolveType(\r\n assert(parameterTypeNode.type),\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterTypeNode.name.text;\r\n }\r\n var returnTypeNode = node.returnType;\r\n var returnType: Type | null;\r\n if (returnTypeNode) {\r\n returnType = this.resolveType(returnTypeNode, contextualTypeArguments, reportMode);\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Type.void;\r\n }\r\n var signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.parameterNames = parameterNames;\r\n signature.requiredParameters = requiredParameters;\r\n signature.hasRest = hasRest;\r\n return signature;\r\n }\r\n\r\n /** Resolves an array of type arguments to concrete types. */\r\n resolveTypeArguments(\r\n typeParameters: TypeParameterNode[],\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n contextualTypeArguments: Map,\r\n alternativeReportNode: Node | null = null,\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.atEnd,\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 contextualTypeArguments,\r\n reportMode\r\n )\r\n : this.resolveType( // reports\r\n assert(typeParameters[i].defaultType),\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 element it refers to. */\r\n resolveIdentifier(\r\n identifier: IdentifierExpression,\r\n context: Element | null,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var name = identifier.text;\r\n var element: Element | null;\r\n\r\n if (context) {\r\n\r\n switch (context.kind) {\r\n case ElementKind.FUNCTION: { // search locals, use prototype\r\n element = (context).flow.getScopedLocal(name);\r\n if (element) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n context = (context).prototype.parent;\r\n break;\r\n }\r\n case ElementKind.CLASS: { // use prototype\r\n context = (context).prototype.parent;\r\n break;\r\n }\r\n }\r\n\r\n // search context\r\n while (context) {\r\n let members = context.members;\r\n if (members) {\r\n if (element = members.get(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n }\r\n context = context.parent;\r\n }\r\n }\r\n\r\n // search current file\r\n var elementsLookup = this.program.elementsLookup;\r\n if (element = elementsLookup.get(identifier.range.source.internalPath + PATH_DELIMITER + name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element; // GLOBAL, FUNCTION_PROTOTYPE, CLASS_PROTOTYPE\r\n }\r\n\r\n // search global scope\r\n if (element = elementsLookup.get(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element; // GLOBAL, FUNCTION_PROTOTYPE, CLASS_PROTOTYPE\r\n }\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 resolveType = assert(global.declaration).type;\r\n if (!resolveType) return false;\r\n var resolvedType = this.resolveType(resolveType, null, reportMode);\r\n if (!resolvedType) return false;\r\n global.type = resolvedType;\r\n global.set(CommonFlags.RESOLVED);\r\n return true;\r\n }\r\n\r\n /** Resolves a property access to the element it refers to. */\r\n resolvePropertyAccess(\r\n propertyAccess: PropertyAccessExpression,\r\n contextualFunction: Function,\r\n contextualType: Type,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n // start by resolving the lhs target (expression before the last dot)\r\n var targetExpression = propertyAccess.expression;\r\n var target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode); // reports\r\n if (!target) return null;\r\n\r\n // at this point we know exactly what the target is, so look up the element within\r\n var propertyName = propertyAccess.property.text;\r\n\r\n // Resolve variable-likes to the class type they reference 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;\r\n assert(type != Type.void);\r\n let classReference = type.classReference;\r\n if (!classReference) {\r\n let basicClasses = this.program.basicClasses;\r\n if (!type.is(TypeFlags.REFERENCE) && basicClasses.has(type.kind)) {\r\n classReference = assert(basicClasses.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: {\r\n let getter = this.resolveFunction(\r\n assert((target).getterPrototype),\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n if (!getter) return null;\r\n let classReference = getter.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, getter.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: {\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 let member: Element | null;\r\n if (members && (member = members.get(propertyName))) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return member; // 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) {\r\n let member = members.get(propertyName);\r\n if (member) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return member; // static ENUMVALUE, static GLOBAL, static FUNCTION_PROTOTYPE...\r\n }\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 resolveElementAccess(\r\n elementAccess: ElementAccessExpression,\r\n contextualFunction: Function,\r\n contextualType: Type,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = elementAccess.expression;\r\n var target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode);\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 determineIntegerLiteralType(\r\n intValue: I64,\r\n contextualType: Type\r\n ): Type {\r\n\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\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 resolveExpression(\r\n expression: Expression,\r\n contextualFunction: Function,\r\n contextualType: Type = Type.void,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n while (expression.kind == NodeKind.PARENTHESIZED) {\r\n expression = (expression).expression;\r\n }\r\n switch (expression.kind) {\r\n case NodeKind.ASSERTION: {\r\n let type = this.resolveType(\r\n (expression).toType,\r\n contextualFunction.flow.contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n let classType = type.classReference;\r\n if (!classType) return null;\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return classType;\r\n }\r\n case NodeKind.UNARYPREFIX: {\r\n // TODO: overloads\r\n switch ((expression).operator) {\r\n case Token.MINUS: {\r\n let operand = (expression).operand;\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 return assert(this.program.basicClasses.get(type.kind));\r\n }\r\n return this.resolveExpression(\r\n operand,\r\n contextualFunction,\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 contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case Token.EXCLAMATION: {\r\n return assert(this.program.basicClasses.get(TypeKind.BOOL));\r\n }\r\n case Token.TILDE: {\r\n let resolvedOperand = this.resolveExpression(\r\n (expression).operand,\r\n contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n if (!resolvedOperand) return null;\r\n throw new Error(\"not implemented\"); // TODO: should all elements have a corresponding type right away?\r\n }\r\n default: assert(false);\r\n }\r\n return null;\r\n }\r\n case NodeKind.UNARYPOSTFIX: {\r\n // TODO: 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 contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n default: assert(false);\r\n }\r\n return null;\r\n }\r\n case NodeKind.BINARY: {\r\n // TODO: all sorts of unary and binary expressions, which means looking up overloads and\r\n // evaluating their return types, knowing the semantics of different operators etc.\r\n // should probably share that code with the compiler somehow, as it also does exactly this.\r\n throw new Error(\"not implemented\");\r\n }\r\n case NodeKind.THIS: { // -> Class / ClassPrototype\r\n if (contextualFunction.flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let explicitLocal = contextualFunction.flow.getScopedLocal(\"this\");\r\n if (explicitLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return explicitLocal;\r\n }\r\n }\r\n let parent = contextualFunction.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 case NodeKind.SUPER: { // -> Class\r\n if (contextualFunction.flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let explicitLocal = contextualFunction.flow.getScopedLocal(\"super\");\r\n if (explicitLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return explicitLocal;\r\n }\r\n }\r\n let parent = contextualFunction.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 case NodeKind.IDENTIFIER: {\r\n return this.resolveIdentifier(expression, contextualFunction, reportMode);\r\n }\r\n case NodeKind.LITERAL: {\r\n switch ((expression).literalKind) {\r\n case LiteralKind.INTEGER: {\r\n return assert(\r\n this.program.basicClasses.get(\r\n this.determineIntegerLiteralType(\r\n (expression).value,\r\n contextualType\r\n ).kind\r\n )\r\n );\r\n }\r\n case LiteralKind.FLOAT: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n return assert(\r\n this.program.basicClasses.get(\r\n contextualType == Type.f32\r\n ? TypeKind.F32\r\n : TypeKind.F64\r\n )\r\n );\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 // case LiteralKind.ARRAY: // TODO\r\n }\r\n break;\r\n }\r\n case NodeKind.PROPERTYACCESS: {\r\n return this.resolvePropertyAccess(\r\n expression,\r\n contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case NodeKind.ELEMENTACCESS: {\r\n return this.resolveElementAccess(\r\n expression,\r\n contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case NodeKind.CALL: {\r\n let targetExpression = (expression).expression;\r\n let target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode);\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 makeMap(contextualFunction.flow.contextualTypeArguments),\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.cachedFunctionTarget;\r\n if (!functionTarget) {\r\n functionTarget = new FunctionTarget(this.program, signature);\r\n signature.cachedFunctionTarget = functionTarget;\r\n }\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 break;\r\n }\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 to an instance using the specified concrete type arguments. */\r\n resolveFunction(\r\n prototype: FunctionPrototype,\r\n typeArguments: Type[] | null,\r\n contextualTypeArguments: Map = makeMap(),\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | null {\r\n var classTypeArguments = prototype.classTypeArguments; // set only if partially resolved\r\n var classInstanceKey = classTypeArguments ? typesToString(classTypeArguments) : \"\";\r\n var instanceKey = typeArguments ? typesToString(typeArguments) : \"\";\r\n var classInstances = prototype.instances.get(classInstanceKey);\r\n if (classInstances) {\r\n let instance = classInstances.get(instanceKey);\r\n if (instance) return instance;\r\n }\r\n\r\n var declaration = prototype.declaration;\r\n var isInstance = prototype.is(CommonFlags.INSTANCE);\r\n var classPrototype = prototype.classPrototype;\r\n\r\n // apply class type arguments if a partially resolved instance method\r\n if (classTypeArguments) prototype.applyClassTypeArguments(contextualTypeArguments);\r\n\r\n // override with function specific type arguments\r\n var signatureNode = declaration.signature;\r\n var functionTypeParameters = declaration.typeParameters;\r\n var numFunctionTypeArguments: i32;\r\n if (typeArguments && (numFunctionTypeArguments = typeArguments.length)) {\r\n assert(functionTypeParameters && numFunctionTypeArguments == functionTypeParameters.length);\r\n for (let i = 0; i < numFunctionTypeArguments; ++i) {\r\n contextualTypeArguments.set(\r\n (functionTypeParameters)[i].name.text,\r\n typeArguments[i]\r\n );\r\n }\r\n } else {\r\n assert(!functionTypeParameters || functionTypeParameters.length == 0);\r\n }\r\n\r\n // resolve class if an instance method\r\n var classInstance: Class | null = null;\r\n var thisType: Type | null = null;\r\n if (isInstance) {\r\n classInstance = this.resolveClass(\r\n assert(classPrototype),\r\n classTypeArguments,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!classInstance) return null;\r\n let explicitThisType = signatureNode.explicitThisType;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(explicitThisType, contextualTypeArguments, reportMode);\r\n if (!thisType) return null;\r\n } else {\r\n thisType = classInstance.type;\r\n }\r\n contextualTypeArguments.set(\"this\", thisType);\r\n } else {\r\n if (signatureNode.explicitThisType) {\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n signatureNode.explicitThisType.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n // resolve signature node\r\n var signatureParameters = signatureNode.parameters;\r\n var signatureParameterCount = signatureParameters.length;\r\n var parameterTypes = new Array(signatureParameterCount);\r\n var parameterNames = new Array(signatureParameterCount);\r\n var requiredParameters = 0;\r\n for (let i = 0; i < signatureParameterCount; ++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 = assert(parameterDeclaration.type);\r\n let parameterType = this.resolveType(typeNode, contextualTypeArguments, reportMode);\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterDeclaration.name.text;\r\n }\r\n\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 = assert(signatureNode.returnType);\r\n let type = this.resolveType(typeNode, contextualTypeArguments, reportMode);\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 internalName = prototype.internalName;\r\n if (instanceKey.length) internalName += \"<\" + instanceKey + \">\";\r\n var instance = new Function(\r\n prototype,\r\n internalName,\r\n signature,\r\n classInstance\r\n ? classInstance\r\n : classPrototype,\r\n contextualTypeArguments\r\n );\r\n if (!classInstances) prototype.instances.set(classInstanceKey, classInstances = new Map());\r\n classInstances.set(instanceKey, instance);\r\n this.program.instancesLookup.set(internalName, instance);\r\n return instance;\r\n }\r\n\r\n /** Resolves a function prototype partially by applying the specified type arguments. */\r\n resolveFunctionPartially(\r\n prototype: FunctionPrototype,\r\n typeArguments: Type[] | null,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): FunctionPrototype | null {\r\n assert(prototype.is(CommonFlags.INSTANCE));\r\n var classPrototype = assert(prototype.classPrototype);\r\n\r\n if (!(typeArguments && typeArguments.length)) return prototype; // no need to clone\r\n\r\n var simpleName = prototype.simpleName;\r\n var partialKey = typesToString(typeArguments);\r\n var partialPrototype = new FunctionPrototype(\r\n this.program,\r\n simpleName,\r\n classPrototype.internalName + \"<\" + partialKey + \">\" + INSTANCE_DELIMITER + simpleName,\r\n prototype.declaration,\r\n classPrototype,\r\n prototype.decoratorFlags\r\n );\r\n partialPrototype.flags = prototype.flags;\r\n partialPrototype.operatorKind = prototype.operatorKind;\r\n partialPrototype.classTypeArguments = typeArguments;\r\n partialPrototype.instances = prototype.instances;\r\n return partialPrototype;\r\n }\r\n\r\n /** Resolves a function prototype to an instance by first resolving the specified type arguments. */\r\n resolveFunctionInclTypeArguments(\r\n prototype: FunctionPrototype,\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n contextualTypeArguments: Map,\r\n reportNode: Node,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | 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\r\n // apply class type arguments if a partially resolved instance method\r\n // FIXME: this is done once more in resolveFunction. required here for resolveTypeArguments,\r\n // required there for just resolving a function no matter if a partial or not.\r\n let classTypeArguments = prototype.classTypeArguments;\r\n if (classTypeArguments) prototype.applyClassTypeArguments(contextualTypeArguments);\r\n\r\n resolvedTypeArguments = this.resolveTypeArguments( // reports\r\n assert(prototype.declaration.typeParameters),\r\n typeArgumentNodes,\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 prototype: ClassPrototype,\r\n typeArguments: Type[] | null,\r\n contextualTypeArguments: Map = makeMap(),\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.instances.get(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 var declaration = prototype.declaration;\r\n if (typeArguments) {\r\n let typeParameters = declaration.typeParameters;\r\n let expectedTypeArguments = typeParameters.length;\r\n let actualTypeArguments = typeArguments.length;\r\n assert(actualTypeArguments == expectedTypeArguments);\r\n for (let i = 0; i < actualTypeArguments; ++i) {\r\n contextualTypeArguments.set(typeParameters[i].name.text, typeArguments[i]);\r\n }\r\n } else {\r\n assert(declaration.typeParameters.length == 0);\r\n }\r\n\r\n // Resolve base class if applicable\r\n var baseClass: Class | null = null;\r\n if (declaration.extendsType) {\r\n let baseClassType = this.resolveType(\r\n declaration.extendsType,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!baseClassType) return null;\r\n if (!(baseClass = baseClassType.classReference)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.program.error(\r\n DiagnosticCode.A_class_may_only_extend_another_class,\r\n declaration.extendsType.range\r\n );\r\n }\r\n return null;\r\n }\r\n if (baseClass.hasDecorator(DecoratorFlags.SEALED)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.program.error(\r\n DiagnosticCode.Class_0_is_sealed_and_cannot_be_extended,\r\n declaration.extendsType.range, baseClass.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n if (baseClass.hasDecorator(DecoratorFlags.UNMANAGED) != prototype.hasDecorator(DecoratorFlags.UNMANAGED)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.program.error(\r\n DiagnosticCode.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa,\r\n Range.join(declaration.name.range, declaration.extendsType.range)\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n // Construct the instance and remember that it has been resolved already\r\n var simpleName = prototype.simpleName;\r\n var internalName = prototype.internalName;\r\n if (instanceKey.length) {\r\n simpleName += \"<\" + instanceKey + \">\";\r\n internalName += \"<\" + instanceKey + \">\";\r\n }\r\n instance = new Class(prototype, simpleName, internalName, typeArguments, baseClass);\r\n instance.contextualTypeArguments = contextualTypeArguments;\r\n prototype.instances.set(instanceKey, instance);\r\n this.program.instancesLookup.set(internalName, 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 if (baseClass.members) {\r\n if (!instance.members) instance.members = new Map();\r\n for (let inheritedMember of baseClass.members.values()) {\r\n instance.members.set(inheritedMember.simpleName, inheritedMember);\r\n }\r\n }\r\n memoryOffset = baseClass.currentMemoryOffset;\r\n }\r\n\r\n // Resolve constructor by first applying the class type arguments\r\n var constructorPrototype = prototype.constructorPrototype;\r\n if (constructorPrototype) {\r\n let constructorPartial = this.resolveFunctionPartially(\r\n constructorPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!constructorPartial) return null;\r\n instance.constructorInstance = this.resolveFunction(\r\n constructorPartial,\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n }\r\n\r\n // Resolve instance members\r\n if (prototype.instanceMembers) {\r\n for (let member of prototype.instanceMembers.values()) {\r\n switch (member.kind) {\r\n\r\n // Lay out fields in advance\r\n case ElementKind.FIELD_PROTOTYPE: {\r\n if (!instance.members) instance.members = new Map();\r\n let fieldDeclaration = (member).declaration;\r\n let fieldType: Type | null = null;\r\n // TODO: handle duplicate non-private fields\r\n if (!fieldDeclaration.type) {\r\n if (baseClass !== null && baseClass.members !== null) {\r\n let baseField = baseClass.members.get((member).simpleName);\r\n if (baseField && !baseField.is(CommonFlags.PRIVATE)) {\r\n assert(baseField.kind == ElementKind.FIELD);\r\n fieldType = (baseField).type;\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 fieldDeclaration.name.range.atEnd\r\n );\r\n }\r\n }\r\n } else {\r\n fieldType = this.resolveType(\r\n fieldDeclaration.type,\r\n instance.contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n if (!fieldType) break;\r\n let fieldInstance = new Field(\r\n member,\r\n internalName + INSTANCE_DELIMITER + (member).simpleName,\r\n fieldType,\r\n fieldDeclaration,\r\n instance\r\n );\r\n switch (fieldType.byteSize) { // align\r\n case 1: break;\r\n case 2: { if (memoryOffset & 1) ++memoryOffset; break; }\r\n case 4: { if (memoryOffset & 3) memoryOffset = (memoryOffset | 3) + 1; break; }\r\n case 8: { if (memoryOffset & 7) memoryOffset = (memoryOffset | 7) + 1; break; }\r\n default: assert(false);\r\n }\r\n fieldInstance.memoryOffset = memoryOffset;\r\n memoryOffset += fieldType.byteSize;\r\n instance.members.set(member.simpleName, fieldInstance);\r\n break;\r\n }\r\n\r\n // Partially resolve methods as these might have type arguments on their own\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (!instance.members) instance.members = new Map();\r\n let partialPrototype = this.resolveFunctionPartially(\r\n member,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!partialPrototype) return null;\r\n partialPrototype.internalName = internalName + INSTANCE_DELIMITER + partialPrototype.simpleName;\r\n instance.members.set(member.simpleName, partialPrototype);\r\n break;\r\n }\r\n\r\n // Clone properties and partially resolve the wrapped accessors for consistence with other methods\r\n case ElementKind.PROPERTY: {\r\n if (!instance.members) instance.members = new Map();\r\n let getterPrototype = assert((member).getterPrototype); // must be present\r\n let setterPrototype = (member).setterPrototype; // might be present\r\n let instanceProperty = new Property(\r\n this.program,\r\n member.simpleName,\r\n internalName + INSTANCE_DELIMITER + member.simpleName,\r\n prototype\r\n );\r\n let partialGetterPrototype = this.resolveFunctionPartially(\r\n getterPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!partialGetterPrototype) return null;\r\n partialGetterPrototype\r\n .internalName = internalName + INSTANCE_DELIMITER + partialGetterPrototype.simpleName;\r\n instanceProperty.getterPrototype = partialGetterPrototype;\r\n if (setterPrototype) {\r\n let partialSetterPrototype = this.resolveFunctionPartially(\r\n setterPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!partialSetterPrototype) return null;\r\n partialSetterPrototype\r\n .internalName = internalName + INSTANCE_DELIMITER + partialSetterPrototype.simpleName;\r\n instanceProperty.setterPrototype = partialSetterPrototype;\r\n }\r\n instance.members.set(member.simpleName, instanceProperty);\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 // 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 operatorPartial = this.resolveFunctionPartially(\r\n overloadPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!operatorPartial) continue;\r\n operatorInstance = this.resolveFunction(\r\n operatorPartial,\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 prototype: ClassPrototype,\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n contextualTypeArguments: Map,\r\n reportNode: Node,\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(\r\n assert(prototype.declaration.typeParameters),\r\n typeArgumentNodes,\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 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.AtomicWake:\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.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} 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 exports and calls the respective handlers. */\r\n walk(): void {\r\n for (let moduleExport of this.program.moduleLevelExports.values()) {\r\n // FIXME: doesn't honor the actual externally visible name\r\n this.visitElement(moduleExport.element);\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: {\r\n let prop = element;\r\n let getter = prop.getterPrototype;\r\n if (getter) this.visitFunctionInstances(getter);\r\n let setter = prop.setterPrototype;\r\n if (setter) this.visitFunctionInstances(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 default: assert(false);\r\n }\r\n }\r\n\r\n private visitFunctionInstances(element: FunctionPrototype): void {\r\n for (let instances of element.instances.values()) {\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 for (let instance of element.instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) this.visitClass(instance);\r\n }\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.simpleName);\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.simpleName);\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 sb.push((member).constantValue.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.simpleName);\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.simpleName);\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.simpleName);\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.simpleName);\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.simpleName);\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.simpleName);\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 sb.push((member).constantValue.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.prototype.declaration.name.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.simpleName);\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.simpleName);\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.simpleName); // TODO: fqn\r\n }\r\n sb.push(\" {\\n\");\r\n var members = element.prototype.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.simpleName);\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.simpleName);\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.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 for (let instances of (member).instances.values()) {\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 for (let instance of (member).instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\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\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 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 IndexSignatureDeclaration\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);\r\n if (statement) {\r\n statement.parent = source;\r\n statements.push(statement);\r\n }\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: Node | 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 = [];\r\n 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 break;\r\n } else {\r\n statement = this.parseVariable(tn, flags, decorators, startPos);\r\n decorators = null;\r\n }\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, flags, startPos);\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.createIdentifierExpression(\"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.createThisExpression(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.createIdentifierExpression(\"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.createIdentifierExpression(\"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 identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let parameters = new Array();\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 // TODO: this works for now, but the representation isn't great\r\n identifier = Node.createIdentifierExpression(\r\n identifier.text + \".\" + tn.readIdentifier(),\r\n tn.range(identifier.range.start, tn.pos)\r\n );\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 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 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(tn.pos), \"null\"\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n type = Node.createType(identifier, parameters, nullable, tn.range(startPos, tn.pos));\r\n\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.createIdentifierExpression(\"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, flags, 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 = new Array();\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 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.length === 0) {\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 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 isArrow = false;\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 isArrow = true;\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, isArrow, startPos, signatureStart);\r\n }\r\n\r\n private parseFunctionExpressionCommon(\r\n tn: Tokenizer,\r\n name: IdentifierExpression,\r\n parameters: ParameterNode[],\r\n isArrow: bool,\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 (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 this.error(\r\n DiagnosticCode.Type_expected,\r\n returnType.range\r\n ); // recoverable\r\n }\r\n\r\n if (isArrow) {\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;\r\n if (isArrow) {\r\n body = this.parseStatement(tn, false);\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 isArrow ? CommonFlags.ARROW : CommonFlags.NONE,\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;\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 } else {\r\n typeParameters = [];\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 = [];\r\n 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) return null;\r\n member.parent = declaration;\r\n members.push(member);\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) return null;\r\n member.parent = declaration;\r\n members.push(member);\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 = new Array();\r\n if (tn.skip(Token.AT)) {\r\n do {\r\n let decorator = this.parseDecorator(tn);\r\n if (!decorator) break;\r\n decorators.push(decorator);\r\n } while (tn.skip(Token.AT));\r\n if (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 implicitFieldDeclaration.parent = parent;\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[]): IndexSignatureDeclaration | null {\r\n\r\n // at: '[': 'key' ':' Type ']' ':' Type\r\n\r\n if (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) return null;\r\n member.parent = ns;\r\n members.push(member);\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 flags: CommonFlags,\r\n startPos: i32\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, flags, 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, flags, 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 true\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.set(CommonFlags.QUOTED);\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.is(CommonFlags.QUOTED)) {\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 return Node.createIdentifierExpression(tn.readIdentifier(), tn.range(startPos, tn.pos));\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 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 = new Array();\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 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 // 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 }\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: 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__18__;","/** @module std/portable *//***/\r\n\r\nvar globalScope = typeof window !== \"undefined\" && window || typeof global !== \"undefined\" && global || self;\r\n\r\nglobalScope.ASC_TARGET = 0;\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[\"isReference\"] = function isClass(arg) {\r\n return typeof arg === \"object\" || typeof arg === \"string\";\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\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\nglobalScope[\"JSMath\"].signbit = function signbit(x) {\r\n F64[0] = x; return Boolean((U64[1] >>> 31) & (x == x));\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} 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} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags\r\n} from \"./types\";\r\n\r\nimport {\r\n BinaryOp,\r\n UnaryOp,\r\n HostOp,\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} from \"./module\";\r\n\r\nimport {\r\n ElementKind,\r\n FunctionPrototype,\r\n Class,\r\n Field,\r\n OperatorKind,\r\n FlowFlags,\r\n Global,\r\n DecoratorFlags\r\n} from \"./program\";\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\n/** Compiles a call to a built-in function. */\r\nexport function compileCall(\r\n compiler: Compiler,\r\n prototype: FunctionPrototype,\r\n typeArguments: Type[] | null,\r\n operands: Expression[],\r\n contextualType: Type,\r\n reportNode: Node\r\n): ExpressionRef {\r\n var module = compiler.module;\r\n\r\n var arg0: ExpressionRef,\r\n arg1: ExpressionRef,\r\n arg2: ExpressionRef,\r\n ret: ExpressionRef;\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 switch (prototype.internalName) {\r\n\r\n // types\r\n\r\n case \"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 \"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 \"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 \"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 compiler.currentType = Type.bool;\r\n return type.is(TypeFlags.REFERENCE)\r\n ? module.createI32(1)\r\n : module.createI32(0);\r\n }\r\n case \"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 \"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 classType = type.classReference;\r\n return classType !== null && classType.lookupOverload(OperatorKind.INDEXED_GET) !== null\r\n ? module.createI32(1)\r\n : module.createI32(0);\r\n }\r\n case \"isDefined\": { // isDefined(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n let element = compiler.resolver.resolveExpression(\r\n operands[0],\r\n compiler.currentFunction,\r\n Type.void,\r\n ReportMode.SWALLOW\r\n );\r\n return module.createI32(element ? 1 : 0);\r\n }\r\n case \"isConstant\": { // isConstant(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\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 \"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\r\n // math\r\n\r\n case \"clz\": { // clz(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16: {\r\n ret = module.createUnary(UnaryOp.ClzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.BOOL: // usually overflows\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createUnary(UnaryOp.ClzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.ClzI64\r\n : UnaryOp.ClzI32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createUnary(UnaryOp.ClzI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"ctz\": { // ctz(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.NONE, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16: {\r\n ret = module.createUnary(UnaryOp.CtzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.BOOL: // usually overflows\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createUnary(UnaryOp.CtzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.CtzI64\r\n : UnaryOp.CtzI32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createUnary(UnaryOp.CtzI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"popcnt\": { // popcnt(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16: {\r\n ret = module.createUnary(UnaryOp.PopcntI32, arg0);\r\n break;\r\n }\r\n case TypeKind.BOOL: // usually overflows\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createUnary(UnaryOp.PopcntI32, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.PopcntI64\r\n : UnaryOp.PopcntI32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createUnary(UnaryOp.PopcntI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"rotl\": { // rotl(value: T, shift: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n switch (compiler.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 ret = compiler.ensureSmallIntegerWrap(\r\n module.createBinary(BinaryOp.RotlI32, arg0, arg1),\r\n compiler.currentType\r\n );\r\n // fall-through\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createBinary(BinaryOp.RotlI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotlI64\r\n : BinaryOp.RotlI32,\r\n arg0,\r\n arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = 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.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret; // possibly overflows\r\n }\r\n case \"rotr\": { // rotr(value: T, shift: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n switch (compiler.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 ret = compiler.ensureSmallIntegerWrap(\r\n module.createBinary(BinaryOp.RotrI32, arg0, arg1),\r\n compiler.currentType\r\n );\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createBinary(BinaryOp.RotrI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotrI64\r\n : BinaryOp.RotrI32,\r\n arg0,\r\n arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = 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.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret; // possibly overflowws\r\n }\r\n case \"abs\": { // abs(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let currentFunction = compiler.currentFunction;\r\n\r\n // possibly overflows, e.g. abs(-128) == 128\r\n let tempLocal1 = currentFunction.getTempLocal(Type.i32, false);\r\n let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(Type.i32, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 31)) ^ (x >> 31)\r\n ret = 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 currentFunction.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = compiler.options;\r\n let currentFunction = compiler.currentFunction;\r\n let wasm64 = options.isWasm64;\r\n\r\n let tempLocal1 = currentFunction.getTempLocal(options.usizeType, false);\r\n let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(options.usizeType, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n ret = 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 currentFunction.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let currentFunction = compiler.currentFunction;\r\n\r\n let tempLocal1 = currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(Type.i64, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 63)) ^ (x >> 63)\r\n ret = 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 currentFunction.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\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 ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.AbsF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.AbsF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n default: { // void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"max\": { // max(left: T, right: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtI32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\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 let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtU32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtI64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtU64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.GtI64\r\n : BinaryOp.GtI32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.GtU64\r\n : BinaryOp.GtU32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createBinary(BinaryOp.MaxF32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createBinary(BinaryOp.MaxF64, arg0, arg1);\r\n break;\r\n }\r\n default: { // void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"min\": { // min(left: T, right: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtI32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\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 let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtU32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtI64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtU64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.LtI64\r\n : BinaryOp.LtI32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.LtU64\r\n : BinaryOp.LtU32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createBinary(BinaryOp.MinF32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createBinary(BinaryOp.MinF64, arg0, arg1);\r\n break;\r\n }\r\n default: { // void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"ceil\": { // ceil(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.CeilF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.CeilF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"floor\": { // floor(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.FloorF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.FloorF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"copysign\": { // copysign(left: T, right: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n switch (compiler.currentType.kind) { // TODO: does an integer version make sense?\r\n case TypeKind.F32: {\r\n ret = module.createBinary(BinaryOp.CopysignF32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createBinary(BinaryOp.CopysignF64, arg0, arg1);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"nearest\": { // nearest(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.NearestF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.NearestF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"reinterpret\": { // reinterpret(value: *) -> T\r\n if (operands.length != 1) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n switch (typeArguments[0].kind) {\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n arg0 = compiler.compileExpression(operands[0], Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretF32, arg0);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretF64, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (typeArguments[0].is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n compiler.currentType = typeArguments[0];\r\n return module.createUnreachable();\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n 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 ret = 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 arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretI32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n arg0 = compiler.compileExpression(operands[0], Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretI64, arg0);\r\n break;\r\n }\r\n default: { // small integers and void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n compiler.currentType = typeArguments[0];\r\n return ret;\r\n }\r\n case \"sqrt\": { // sqrt(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) { // TODO: integer versions (that return f64 or convert)?\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.SqrtF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.SqrtF64, arg0);\r\n break;\r\n }\r\n // case TypeKind.VOID:\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"trunc\": { // trunc(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments && typeArguments.length) {\r\n compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = 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 ret = module.createUnary(UnaryOp.TruncF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.TruncF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n // memory access\r\n\r\n case \"load\": { // load(offset: usize, constantOffset?: usize) -> *\r\n if (operands.length < 1 || operands.length > 2) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n if (operands.length < 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n } else {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n }\r\n return module.createUnreachable();\r\n }\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n 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 offset = operands.length == 2 ? evaluateConstantOffset(compiler, operands[1]) : 0; // reports\r\n if (offset < 0) { // reported in evaluateConstantOffset\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = typeArguments[0];\r\n return module.createLoad(\r\n typeArguments[0].byteSize,\r\n typeArguments[0].is(TypeFlags.SIGNED | TypeFlags.INTEGER),\r\n arg0,\r\n typeArguments[0].is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n contextualType.size > typeArguments[0].size\r\n ? (compiler.currentType = contextualType).toNativeType()\r\n : (compiler.currentType = typeArguments[0]).toNativeType(),\r\n offset\r\n );\r\n }\r\n case \"store\": { // store(offset: usize, value: *, constantOffset?: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (operands.length < 2 || operands.length > 3) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n if (operands.length < 2) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n } else {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n }\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg1 = compiler.compileExpression(\r\n operands[1],\r\n typeArguments[0],\r\n typeArguments[0].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 type: Type;\r\n if (\r\n typeArguments[0].is(TypeFlags.INTEGER) &&\r\n (\r\n !compiler.currentType.is(TypeFlags.INTEGER) || // float to int\r\n compiler.currentType.size < typeArguments[0].size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(\r\n arg1,\r\n compiler.currentType, typeArguments[0],\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE, // still clears garbage bits\r\n operands[1]\r\n );\r\n type = typeArguments[0];\r\n } else {\r\n type = compiler.currentType;\r\n }\r\n let offset = operands.length == 3 ? evaluateConstantOffset(compiler, operands[2]) : 0; // reports\r\n if (offset < 0) { // reported in evaluateConstantOffset\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = Type.void;\r\n return module.createStore(typeArguments[0].byteSize, arg0, arg1, type.toNativeType(), offset);\r\n }\r\n case \"sizeof\": { // sizeof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (operands.length != 0) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n let byteSize = (typeArguments)[0].byteSize;\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 ret = module.createI32(byteSize);\r\n } else {\r\n ret = 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 ret = module.createI64(byteSize, 0);\r\n } else {\r\n ret = module.createI32(byteSize);\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"alignof\": { // alignof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (operands.length != 0) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n let byteSize = (typeArguments)[0].byteSize;\r\n let alignLog2: i32;\r\n switch (byteSize) {\r\n case 1: { alignLog2 = 0; break; }\r\n case 2: { alignLog2 = 1; break; }\r\n case 4: { alignLog2 = 2; break; }\r\n case 8: { alignLog2 = 3; break; }\r\n default: { assert(false); return module.createUnreachable(); }\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 ret = module.createI32(alignLog2);\r\n } else {\r\n ret = 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 ret = module.createI64(alignLog2, 0);\r\n } else {\r\n ret = module.createI32(alignLog2);\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"offsetof\": { // offsetof(fieldName?: string) -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (operands.length > 1) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n let classType = typeArguments[0].classReference;\r\n if (!classType) {\r\n compiler.error( // TODO: better error\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\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 // control flow\r\n\r\n case \"select\": { // select(ifTrue: T, ifFalse: T, condition: bool) -> T\r\n if (operands.length != 3) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE);\r\n }\r\n let type = compiler.currentType;\r\n arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n 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 switch (compiler.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 ret = module.createSelect(arg0, arg1, arg2);\r\n break;\r\n }\r\n default: { // any other value type\r\n ret = module.createSelect(arg0, arg1, arg2);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"unreachable\": { // unreachable() -> *\r\n if (operands.length != 0) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n }\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return module.createUnreachable();\r\n }\r\n\r\n // host operations\r\n\r\n case \"memory.size\": { // memory.size() -> i32\r\n compiler.currentType = Type.i32;\r\n if (operands.length != 0) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n }\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return module.createHost(HostOp.CurrentMemory);\r\n }\r\n case \"memory.grow\": { // memory.grow(pages: i32) -> i32\r\n compiler.currentType = Type.i32;\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n arg0 = module.createUnreachable();\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n }\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return module.createHost(HostOp.GrowMemory, null, [ arg0 ]);\r\n }\r\n // see: https://github.com/WebAssembly/bulk-memory-operations\r\n case \"memory.copy\": { // memory.copy(dest: usize, src: usize: n: usize) -> void\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 3) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg1 = compiler.compileExpression(\r\n operands[1],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg2 = compiler.compileExpression(\r\n operands[2],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.void;\r\n throw new Error(\"not implemented\");\r\n // return module.createHost(HostOp.MoveMemory, null, [ arg0, arg1, arg2 ]);\r\n }\r\n case \"memory.fill\": { // memory.fill(dest: usize, value: u8, n: usize) -> void\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 3) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg1 = compiler.compileExpression(\r\n operands[1],\r\n Type.u32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg2 = compiler.compileExpression(\r\n operands[2],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.void;\r\n throw new Error(\"not implemented\");\r\n // return module.createHost(HostOp.SetMemory, null, [ arg0, arg1, arg2 ]);\r\n }\r\n\r\n // other\r\n\r\n case \"changetype\": { // changetype(value: *) -> T\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = typeArguments[0];\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpressionRetainType(\r\n operands[0],\r\n typeArguments[0],\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = typeArguments[0];\r\n if (compiler.currentType.size != typeArguments[0].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 // if (reportNode.range.source.sourceKind != SourceKind.STDLIB)\r\n // compiler.warning(DiagnosticCode.Operation_is_unsafe, reportNode.range);\r\n return arg0; // any usize to any usize\r\n }\r\n case \"assert\": { // assert(isTrueish: T, message?: string) -> T with T != null\r\n if (operands.length < 1 || operands.length > 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0].nonNullableType;\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n if (operands.length < 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n } else if (operands.length > 2) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n }\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0].nonNullableType;\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpressionRetainType(operands[0], Type.bool, WrapMode.WRAP);\r\n }\r\n\r\n let type = compiler.currentType;\r\n compiler.currentType = type.nonNullableType;\r\n\r\n // just return ifTrueish if assertions are disabled, or simplify if dropped anyway\r\n if (compiler.options.noAssert) {\r\n if (contextualType == Type.void) {\r\n compiler.currentType = Type.void;\r\n return module.createNop();\r\n }\r\n return arg0;\r\n }\r\n\r\n let abort = compileAbort(compiler, operands.length == 2 ? operands[1] : null, reportNode);\r\n\r\n compiler.currentType = type.nonNullableType;\r\n\r\n if (contextualType == Type.void) { // simplify if dropped anyway\r\n switch (compiler.currentType.kind) {\r\n default: { // any integer up to 32-bits incl. bool\r\n ret = module.createIf(\r\n module.createUnary(UnaryOp.EqzI32,\r\n arg0\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createIf(\r\n module.createUnary(UnaryOp.EqzI64,\r\n arg0\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n ret = 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 ret = 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 ret = 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 case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = abort;\r\n break;\r\n }\r\n }\r\n compiler.currentType = Type.void;\r\n } else {\r\n switch (compiler.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 let flow = compiler.currentFunction.flow;\r\n let tempLocal = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n ret = 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.I32:\r\n case TypeKind.U32:\r\n default: {\r\n let tempLocal = compiler.currentFunction.getAndFreeTempLocal(Type.i32, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(Type.f32, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(Type.f64, false);\r\n ret = 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 case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = abort;\r\n break;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"unchecked\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n let flow = compiler.currentFunction.flow;\r\n flow.set(FlowFlags.UNCHECKED_CONTEXT);\r\n ret = compiler.compileExpressionRetainType(operands[0], contextualType, WrapMode.NONE);\r\n flow.unset(FlowFlags.UNCHECKED_CONTEXT);\r\n return ret;\r\n }\r\n case \"call_indirect\": { // call_indirect(target: Function | u32, ...args: *[]) -> T\r\n if (operands.length < 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n let returnType: Type;\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n returnType = typeArguments[0];\r\n } else {\r\n returnType = contextualType;\r\n }\r\n arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32, WrapMode.NONE);\r\n if (compiler.currentType.kind != TypeKind.U32) {\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 signatureParts = new Array(numOperands + 1);\r\n let nativeReturnType = returnType.toNativeType();\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 signatureParts[i] = operandType.toSignatureString();\r\n nativeParamTypes[i] = operandType.toNativeType();\r\n }\r\n signatureParts[numOperands] = returnType.toSignatureString();\r\n let typeName = signatureParts.join(\"\");\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 \"instantiate\": {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n let classInstance = typeArguments[0].classReference;\r\n if (!classInstance) {\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 compiler.compileInstantiate(classInstance, operands, reportNode);\r\n }\r\n\r\n // user-defined diagnostic macros\r\n\r\n case \"ERROR\": {\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 \"WARNING\": {\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 \"INFO\": {\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 // conversions\r\n\r\n case \"i8\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i8;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i8,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"i16\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i16;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i16,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"i32\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"i64\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i64,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"isize\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = compiler.options.isWasm64\r\n ? Type.isize64\r\n : Type.isize32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n compiler.options.isWasm64\r\n ? Type.isize64\r\n : Type.isize32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u8\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u8;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u8,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u16\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u16;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u16,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u32\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u64\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u64,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"usize\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = compiler.options.usizeType;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"bool\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.bool;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.bool,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"f32\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.f32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.f32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"f64\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.f64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.f64,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n\r\n // gc\r\n\r\n case \"iterateRoots\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\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 compiler.currentType = Type.void;\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 return module.createUnreachable();\r\n }\r\n compiler.currentType = Type.void;\r\n // just emit a call even if the function doesn't yet exist\r\n compiler.needsIterateRoots = true;\r\n return module.createCall(\"~iterateRoots\", [ expr ], NativeType.None);\r\n }\r\n }\r\n var expr = deferASMCall(compiler, prototype, operands, contextualType, reportNode);\r\n if (expr) {\r\n if (typeArguments && typeArguments.length) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return expr;\r\n }\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\r\n/** Defers an inline-assembler-like call to a built-in function. */\r\nfunction deferASMCall(\r\n compiler: Compiler,\r\n prototype: FunctionPrototype,\r\n operands: Expression[],\r\n contextualType: Type,\r\n reportNode: Node\r\n): ExpressionRef {\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 \"i32.clz\": return deferASM(\"clz\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.clz\": return deferASM(\"clz\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.ctz\": return deferASM(\"ctz\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.ctz\": return deferASM(\"ctz\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.popcnt\": return deferASM(\"popcnt\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.popcnt\": return deferASM(\"popcnt\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.rotl\": return deferASM(\"rotl\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.rotl\": return deferASM(\"rotl\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.rotr\": return deferASM(\"rotr\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.rotr\": return deferASM(\"rotr\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"f32.abs\": return deferASM(\"abs\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.abs\": return deferASM(\"abs\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.max\": return deferASM(\"max\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.max\": return deferASM(\"max\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.min\": return deferASM(\"min\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.min\": return deferASM(\"min\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.ceil\": return deferASM(\"ceil\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.ceil\": return deferASM(\"ceil\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.floor\": return deferASM(\"floor\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.floor\": return deferASM(\"floor\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.copysign\": return deferASM(\"copysign\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.copysign\": return deferASM(\"copysign\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.nearest\": return deferASM(\"nearest\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.nearest\": return deferASM(\"nearest\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"i32.reinterpret_f32\": return deferASM(\"reinterpret\", compiler, Type.i32, operands, Type.f32, reportNode);\r\n case \"i64.reinterpret_f64\": return deferASM(\"reinterpret\", compiler, Type.i64, operands, Type.f64, reportNode);\r\n case \"f32.reinterpret_i32\": return deferASM(\"reinterpret\", compiler, Type.f32, operands, Type.i32, reportNode);\r\n case \"f64.reinterpret_i64\": return deferASM(\"reinterpret\", compiler, Type.f64, operands, Type.i64, reportNode);\r\n\r\n case \"f32.sqrt\": return deferASM(\"sqrt\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.sqrt\": return deferASM(\"sqrt\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.trunc\": return deferASM(\"trunc\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.trunc\": return deferASM(\"trunc\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"i32.load8_s\": return deferASM(\"load\", compiler, Type.i8, operands, Type.i32, reportNode);\r\n case \"i32.load8_u\": return deferASM(\"load\", compiler, Type.u8, operands, Type.u32, reportNode);\r\n case \"i32.load16_s\": return deferASM(\"load\", compiler, Type.i16, operands, Type.i32, reportNode);\r\n case \"i32.load16_u\": return deferASM(\"load\", compiler, Type.u16, operands, Type.u32, reportNode);\r\n case \"i32.load\": return deferASM(\"load\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.load8_s\": return deferASM(\"load\", compiler, Type.i8, operands, Type.i64, reportNode);\r\n case \"i64.load8_u\": return deferASM(\"load\", compiler, Type.u8, operands, Type.u64, reportNode);\r\n case \"i64.load16_s\": return deferASM(\"load\", compiler, Type.i16, operands, Type.i64, reportNode);\r\n case \"i64.load16_u\": return deferASM(\"load\", compiler, Type.u16, operands, Type.u64, reportNode);\r\n case \"i64.load32_s\": return deferASM(\"load\", compiler, Type.i32, operands, Type.i64, reportNode);\r\n case \"i64.load32_u\": return deferASM(\"load\", compiler, Type.u32, operands, Type.u64, reportNode);\r\n case \"i64.load\": return deferASM(\"load\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n case \"f32.load\": return deferASM(\"load\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.load\": return deferASM(\"load\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"i32.store8\": return deferASM(\"store\", compiler, Type.i8, operands, Type.i32, reportNode);\r\n case \"i32.store16\": return deferASM(\"store\", compiler, Type.i16, operands, Type.i32, reportNode);\r\n case \"i32.store\": return deferASM(\"store\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.store8\": return deferASM(\"store\", compiler, Type.i8, operands, Type.i64, reportNode);\r\n case \"i64.store16\": return deferASM(\"store\", compiler, Type.i16, operands, Type.i64, reportNode);\r\n case \"i64.store32\": return deferASM(\"store\", compiler, Type.i32, operands, Type.i64, reportNode);\r\n case \"i64.store\": return deferASM(\"store\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n case \"f32.store\": return deferASM(\"store\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.store\": return deferASM(\"store\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n }\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 valueType: Type,\r\n reportNode: Node\r\n): ExpressionRef {\r\n var prototype = assert(compiler.program.elementsLookup.get(name));\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n return compileCall(compiler, prototype, [ typeArgument ], operands, valueType, reportNode);\r\n}\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: Node\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.range, \"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.range, \"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.range, \"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.range, \"1\", operands.length.toString(10)\r\n );\r\n return null;\r\n}\r\n\r\n/** Evaluates a `constantOffset` argument.*/\r\nfunction evaluateConstantOffset(compiler: Compiler, expression: Expression): 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.Operation_not_supported,\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.Operation_not_supported,\r\n expression.range\r\n );\r\n value = -1;\r\n }\r\n }\r\n return value;\r\n}\r\n\r\n/** Compiles a memory allocation for an instance of the specified class. */\r\nexport function compileAllocate(\r\n compiler: Compiler,\r\n classInstance: Class,\r\n reportNode: Node\r\n): ExpressionRef {\r\n var program = compiler.program;\r\n assert(classInstance.program == program);\r\n var module = compiler.module;\r\n var options = compiler.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 (!compiler.compileFunction(allocateInstance)) return module.createUnreachable();\r\n compiler.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(compiler, 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) {\r\n program.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n reportNode.range, \"memory.allocate\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (!compiler.compileFunction(allocateInstance)) return module.createUnreachable();\r\n\r\n compiler.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/** 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 stringType = program.typesLookup.get(\"string\");\r\n if (!stringType) 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, stringType, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : stringType.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 requires. */\r\nexport function compileIterateRoots(compiler: Compiler): void {\r\n var module = compiler.module;\r\n var exprs = new Array();\r\n\r\n for (let element of compiler.program.elementsLookup.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 \"iv\"\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 \"iv\"\r\n )\r\n );\r\n }\r\n }\r\n }\r\n var typeRef = compiler.ensureFunctionType([ Type.i32 ], Type.void);\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 internals)\r\n var members = classInstance.members;\r\n if (classInstance.prototype.declaration.range.source.isLibrary) {\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 nativeSizeType == NativeType.I64 ? \"Iv\" : \"iv\"\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","/** @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.DOLLAR\r\n || c == CharCode._\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.DOLLAR\r\n || c == CharCode._\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\r\n while (lo + 1 < hi) {\r\n mid = lo + (hi - lo) / 2;\r\n mid -= mid % 2;\r\n if (map[mid] <= code && code <= map[mid + 1]) {\r\n return true;\r\n }\r\n if (code < map[mid]) {\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): Map {\r\n if (original) {\r\n let cloned = new Map();\r\n for (let [k, v] of original) cloned.set(k, v);\r\n return cloned;\r\n }\r\n return new Map();\r\n}\r\n","/** @module util *//***/\r\n\r\nimport {\r\n CharCode\r\n} from \"./charcode\";\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) + String.fromCharCode(separator) + 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 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 `noTreeShaking` option. */\r\nexport function setNoTreeShaking(options: Options, noTreeShaking: bool): void {\r\n options.noTreeShaking = noTreeShaking;\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 `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\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 \"./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/diagnostics.ts","webpack://assemblyscript/./src/util/index.ts","webpack://assemblyscript/./src/ast.ts","webpack://assemblyscript/./src/program.ts","webpack://assemblyscript/./src/module.ts","webpack://assemblyscript/./src/tokenizer.ts","webpack://assemblyscript/./src/types.ts","webpack://assemblyscript/(webpack)/buildin/global.js","webpack://assemblyscript/./src/compiler.ts","webpack://assemblyscript/./src/diagnosticMessages.generated.ts","webpack://assemblyscript/./src/resolver.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/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__18__","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","FILESPACE_PREFIX","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","arg0","arg1","arg2","replace","createInfo","createWarning","createError","withRange","toString","source","normalizedPath","line","column","formatDiagnosticContext","useColors","text","len","length","start","end","isLineBreak","charCodeAt","sb","substring","push","join","formatDiagnosticMessage","showContext","DiagnosticEmitter","diagnostics","Array","emitDiagnostic","info","warning","error","__export","common_1","tokenizer_1","Token","Range","NodeKind","nodeIsConstantValue","kind","LITERAL","NULL","TRUE","FALSE","nodeIsCallable","IDENTIFIER","ASSERTION","CALL","ELEMENTACCESS","PARENTHESIZED","PROPERTYACCESS","SUPER","nodeIsGenericCallable","Node","parent","flags","NONE","is","flag","isAny","set","createType","typeArguments","isNullable","type","TypeNode","setParent","createOmittedType","createIdentifierExpression","createTypeParameter","extendsType","defaultType","elem","TypeParameterNode","createParameter","initializer","ParameterNode","parameterKind","createSignature","parameters","returnType","explicitThisType","sig","SignatureNode","createDecorator","args","stmt","DecoratorNode","arguments","decoratorKind","decoratorNameToKind","createComment","node","CommentNode","commentKind","expr","IdentifierExpression","createEmptyIdentifierExpression","createArrayLiteralExpression","elements","ArrayLiteralExpression","elementExpressions","nodes","k","setParentIfNotNull","createAssertionExpression","assertionKind","expression","toType","AssertionExpression","createBinaryExpression","operator","left","right","BinaryExpression","createCallExpression","typeArgs","CallExpression","createClassExpression","declaration","ClassExpression","createCommaExpression","expressions","CommaExpression","createConstructorExpression","ConstructorExpression","createElementAccessExpression","element","ElementAccessExpression","elementExpression","createFalseExpression","FalseExpression","createFloatLiteralExpression","FloatLiteralExpression","createFunctionExpression","FunctionExpression","ARROW","createInstanceOfExpression","isType","InstanceOfExpression","createIntegerLiteralExpression","IntegerLiteralExpression","createNewExpression","NewExpression","createNullExpression","NullExpression","createObjectLiteralExpression","names","values","ObjectLiteralExpression","createParenthesizedExpression","ParenthesizedExpression","createPropertyAccessExpression","PropertyAccessExpression","createRegexpLiteralExpression","pattern","RegexpLiteralExpression","patternFlags","createTernaryExpression","condition","ifThen","ifElse","TernaryExpression","createStringLiteralExpression","StringLiteralExpression","createSuperExpression","SuperExpression","createThisExpression","ThisExpression","createTrueExpression","TrueExpression","createUnaryPostfixExpression","operand","UnaryPostfixExpression","createUnaryPrefixExpression","UnaryPrefixExpression","createBlockStatement","statements","BlockStatement","createBreakStatement","label","BreakStatement","createClassDeclaration","identifier","typeParameters","implementsTypes","members","decorators","ClassDeclaration","createContinueStatement","ContinueStatement","createDoStatement","statement","DoStatement","createEmptyStatement","EmptyStatement","createEnumDeclaration","EnumDeclaration","createEnumValueDeclaration","EnumValueDeclaration","createExportStatement","path","ExportStatement","normalizePath","startsWith","resolvePath","internalPath","mangleInternalPath","createExportImportStatement","externalName","ExportImportStatement","createExportMember","ExportMember","createExpressionStatement","ExpressionStatement","createIfStatement","ifTrue","ifFalse","IfStatement","createImportStatement","decls","ImportStatement","declarations","namespaceName","createImportStatementWithWildcard","createImportDeclaration","ImportDeclaration","createInterfaceDeclaration","InterfaceDeclaration","createFieldDeclaration","FieldDeclaration","createForStatement","incrementor","ForStatement","createFunctionDeclaration","signature","body","FunctionDeclaration","createIndexSignatureDeclaration","keyType","valueType","IndexSignatureDeclaration","createMethodDeclaration","MethodDeclaration","createNamespaceDeclaration","NamespaceDeclaration","createReturnStatement","ReturnStatement","createSwitchStatement","cases","SwitchStatement","createSwitchCase","SwitchCase","createThrowStatement","ThrowStatement","createTryStatement","catchVariable","catchStatements","finallyStatements","TryStatement","createTypeDeclaration","alias","TypeDeclaration","createVariableStatement","VariableStatement","createVariableDeclaration","VariableDeclaration","createVoidStatement","VoidStatement","createWhileStatement","WhileStatement","CommonTypeNode","_super","__extends","_this","apply","TYPE","TYPEPARAMETER","ParameterKind","PARAMETER","implicitFieldDeclaration","DecoratorKind","SIGNATURE","nameStr","BUILTIN","EXTERNAL","GLOBAL","INLINE","OPERATOR","SEALED","UNMANAGED","propStr","OPERATOR_BINARY","OPERATOR_PREFIX","OPERATOR_POSTFIX","CUSTOM","DECORATOR","CommentKind","COMMENT","Expression","LiteralKind","LiteralExpression","literalKind","ARRAY","AssertionKind","BINARY","CLASS","COMMA","CONSTRUCTOR","FLOAT","FUNCTION","INSTANCEOF","INTEGER","NEW","OBJECT","REGEXP","TERNARY","STRING","THIS","UnaryExpression","UNARYPOSTFIX","UNARYPREFIX","isLastStatement","BLOCK","FUNCTIONDECLARATION","METHODDECLARATION","SourceKind","Statement","Source","SOURCE","tokenizer","debugInfoIndex","exportPaths","sourceKind","pos","lastIndexOf","simplePath","ENTRY","LIBRARY","DeclarationStatement","cachedProgramLevelInternalName","cachedFileLevelInternalName","mangleInternalName","VARIABLE","NAMESPACEDECLARATION","EXPORT","isTopLevelExport","CLASSDECLARATION","STATIC","needsExplicitExport","member","INDEXSIGNATUREDECLARATION","VariableLikeDeclarationStatement","BREAK","CONTINUE","DO","EMPTY","ENUMDECLARATION","ENUMVALUEDECLARATION","EXPORTIMPORT","EXPORTMEMBER","EXPRESSION","FIELDDECLARATION","parameterIndex","FOR","IF","IMPORTDECLARATION","IMPORT","INTERFACEDECLARATION","RETURN","SWITCHCASE","SWITCH","THROW","TRY","TYPEDECLARATION","VARIABLEDECLARATION","VOID","WHILE","asGlobal","endsWith","findDecorator","decorator","OperatorKind","diagnostics_1","types_1","ast_1","module_1","resolver_1","QueuedImport","QueuedExport","TypeAlias","operatorKindFromDecorator","arg","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","PLUS","PREFIX_INC","MINUS","PREFIX_DEC","NOT","BITWISE_NOT","POSTFIX_INC","POSTFIX_DEC","INVALID","ElementKind","DecoratorFlags","noTypesYet","Map","Program","diagnosticsOffset","elementsLookup","instancesLookup","typesLookup","typeAliases","fileLevelExports","moduleLevelExports","basicClasses","arrayBufferInstance","arrayPrototype","stringInstance","mainFunction","abortInstance","memoryAllocateInstance","hasGC","gcAllocateInstance","gcLinkInstance","gcMarkInstance","gcHeaderSize","gcHookOffset","resolver","Resolver","sources","getSource","lookupSourceByPath","normalizedPathWithoutExtension","tmp","initialize","options","Type","i8","i16","i32","i64","isizeType","u8","u16","u32","u64","usizeType","bool","f32","f64","void","setConstantInteger","i64_new","isWasm64","noTreeShaking","noAssert","memoryBase","optimizeLevelHint","shrinkLevelHint","hasFeature","queuedImports","queuedExports","queuedExtends","queuedImplements","filespace","Filespace","internalName","currentFilespace","j","initializeClass","initializeEnum","initializeExports","initializeFunction","initializeImports","initializeInterface","initializeNamespace","initializeTypeAlias","initializeVariables","queuedImport","tryLocateImport","localName","splice","externalNameAlt","Module_0_has_no_exported_member_1","queuedExports_1","__values","queuedExports_1_1","next","done","_c","__read","exportName","queuedExport","currentExport","isReExport","setExportAndCheckLibrary","Cannot_find_name_0","derivedPrototype","derivedDeclaration","derivedType","baseElement","resolveIdentifier","CLASS_PROTOTYPE","basePrototype","A_class_may_only_extend_another_class","globalAliases","globalAliases_1","globalAliases_1_1","_d","Error","has","resolveClass","instance","Duplicate_identifier_0","programLevelInternalName","registerBasicClass","FUNCTION_PROTOTYPE","startFunction","GENERIC","AMBIENT","MAIN","resolveFunction","parameterTypes","signatureReference","byteSize","typeKind","className","classElement","globalName","global","Global","withConstantIntegerValue","RESOLVED","setConstantFloat","withConstantFloatValue","queuedNamedExports","checkDecorators","acceptedFlags","presentFlags","decoratorKindToFlag","isLibrary","Decorator_0_is_not_valid_here","Duplicate_decorator","checkGlobal","parentNode","hasDecorator","namespace","fileLevelInternalName","simpleName","ClassPrototype","numImplementsTypes","Unmanaged_classes_cannot_implement_interfaces","Operation_not_supported","MODULE_EXPORT","Export_declaration_conflicts_with_exported_declaration_of_0","isEntry","existingExport","memberDeclarations","memberDeclaration","initializeField","GET","SET","initializeAccessor","initializeMethod","classPrototype","isInterface","INTERFACE_PROTOTYPE","staticField","READONLY","ABSTRACT","instanceMembers","instanceField","FieldPrototype","decoratorFlags","FunctionPrototype","constructorPrototype","Multiple_constructor_implementations_are_not_allowed","checkOperatorOverloads","numArgs","firstArg","overloads","overloadPrototypes","Duplicate_function_implementation","operatorKind","String_literal_expected","Expected_0_arguments_but_got_1","internalPropertyName","propertyElement","isGetter","isNew","PROPERTY","getterPrototype","setterPrototype","Property","baseName","staticName","staticPrototype","instanceName","instancePrototype","Enum","initializeEnumValue","enm","EnumValue","initializeExport","externalIdentifier","prefix","FILESPACE","referencedName","referencedElement","seen","Set","add","initializeImport","indexPart","InterfacePrototype","parentNamespace","Namespace","Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local","existingExport_1","global_1","CONST","Element","program","NAMESPACE","ENUM","ENUMVALUE","constantValue","ConstantValueKind","VariableLikeElement","constantValueKind","constantIntegerValue","INLINED","constantFloatValue","Parameter","Local","index","LOCAL","scopedGlobal","instances","classTypeArguments","applyClassTypeArguments","contextualTypeArguments","classTypeParameters","numClassTypeParameters","Function","localsByName","localsByIndex","additionalLocals","breakContext","debugLocations","ref","functionTableIndex","trampoline","outerScope","nextBreakId","breakStack","nextInlineId","tempI32s","tempI64s","tempF32s","tempF64s","localIndex","INSTANCE","local","thisType","inheritedTypeArguments","inheritedTypeArguments_1","inheritedTypeArguments_1_1","_b","inheritedName","inheritedType","parameterType","parameterName","getParameterName","flow","Flow","addLocal","getTempLocal","wrapped","temps","toNativeType","pop","setLocalWrapped","freeTempLocal","getAndFreeTempLocal","enterBreakContext","id","leaveBreakContext","finalize","sourceMap","debugLocation","setDebugLocation","debugInfoRef","FunctionTarget","FUNCTION_TARGET","toSignatureString","asFunction","FIELD_PROTOTYPE","Field","FIELD","memoryOffset","extends","basePtototype","current","Class","base","currentMemoryOffset","constructorInstance","gcHookIndex","asClass","inheritedTypeArguments_2","inheritedTypeArguments_2_1","baseType","isAssignableTo","target","lookupOverload","unchecked","uncheckedOverload","overload","lookupField","shouldReadonly","offsetof","fieldName","field","Interface","INTERFACE","FlowFlags","scopedLocals","currentFunction","parentFlow","continueLabel","breakLabel","returnLabel","wrappedLocals","wrappedLocalsExt","unset","fork","branch","slice","free","scopedLocal","SCOPED","addScopedLocal","existingLocal","addScopedLocalAlias","scopedAlias","getScopedLocal","isLocalWrapped","map","ext","i64_ne","i64_and","i64_shl","i64_one","i64_zero","off","i64_or","i64_not","inherit","other","inheritConditional","inheritMutual","leftExt","rightExt","thisExt","minLength","min","canOverflow","getExpressionId","ExpressionId","GetLocal","getGetLocalIndex","canConversionOverflow","SetLocal","isTeeLocal","getSetLocalValue","GetGlobal","global_2","getGetGlobalName","Binary","getBinaryOp","BinaryOp","EqI32","EqI64","EqF32","EqF64","NeI32","NeI64","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","getBinaryLeft","Const","getConstValueI32","getBinaryRight","AndI32","computeSmallIntegerMask","ShlI32","shift","size","ShrI32","ShrU32","DivU32","RemI32","RemU32","Unary","getUnaryOp","UnaryOp","EqzI32","EqzI64","ClzI32","CtzI32","PopcntI32","getExpressionType","getConstValueI64Low","getConstValueF32","getConstValueF64","MIN_VALUE","MAX_VALUE","Load","fromType","getLoadBytes","isLoadSigned","Block","getBlockName","getBlockChildCount","last","getBlockChild","If","getIfTrue","getIfFalse","Select","getSelectThen","getSelectElse","Call","getCallTarget","Unreachable","compiler_1","NativeType","_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","_BinaryenAtomicWakeId","_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","_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","HostOp","_BinaryenCurrentMemory","_BinaryenGrowMemory","AtomicRMWOp","_BinaryenAtomicRMWAdd","_BinaryenAtomicRMWSub","_BinaryenAtomicRMWAnd","_BinaryenAtomicRMWOr","_BinaryenAtomicRMWXor","_BinaryenAtomicRMWXchg","MemorySegment","buffer","offset","segment","Module","hasTemporaryFunction","cachedPrecomputeNames","cachedStrings","_BinaryenModuleCreate","cachedByValue","memory","allocate","createFrom","cArr","allocU8Array","_BinaryenModuleRead","changetype","addFunctionType","result","paramTypes","cStr","allocStringCached","allocI32Array","_BinaryenAddFunctionType","getFunctionTypeBySignature","_BinaryenGetFunctionTypeBySignature","removeFunctionType","_BinaryenRemoveFunctionType","createI32","out","_BinaryenLiteralInt32","_BinaryenConst","createI64","valueLow","valueHigh","_BinaryenLiteralInt64","createF32","_BinaryenLiteralFloat32","createF64","_BinaryenLiteralFloat64","createUnary","op","_BinaryenUnary","createBinary","_BinaryenBinary","createHost","operands","allocPtrArray","_BinaryenHost","createGetLocal","_BinaryenGetLocal","createTeeLocal","_BinaryenTeeLocal","createGetGlobal","_BinaryenGetGlobal","createLoad","bytes","signed","ptr","_BinaryenLoad","createStore","_BinaryenStore","createAtomicLoad","_BinaryenAtomicLoad","createAtomicStore","_BinaryenAtomicStore","createAtomicRMW","_BinaryenAtomicRMW","createAtomicCmpxchg","expected","replacement","_BinaryenAtomicCmpxchg","createAtomicWait","timeout","expectedType","_BinaryenAtomicWait","createAtomicWake","wakeCount","_BinaryenAtomicWake","createSetLocal","_BinaryenSetLocal","createSetGlobal","_BinaryenSetGlobal","createBlock","children","_BinaryenBlock","createBreak","_BinaryenBreak","createDrop","_BinaryenDrop","createLoop","_BinaryenLoop","createIf","_BinaryenIf","createNop","_BinaryenNop","createReturn","_BinaryenReturn","createSelect","_BinaryenSelect","createSwitch","defaultName","numNames","strs","_BinaryenSwitch","createCall","_BinaryenCall","createCallIndirect","typeName","_BinaryenCallIndirect","createUnreachable","_BinaryenUnreachable","addGlobal","mutable","_BinaryenAddGlobal","removeGlobal","_BinaryenRemoveGlobal","addFunction","varTypes","_BinaryenAddFunction","removeFunction","_BinaryenRemoveFunction","addTemporaryFunction","tempName","typeRef","removeTemporaryFunction","addFunctionExport","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","offs","sizs","Target","WASM64","i64_low","i64_high","cArr1","cArr2","cArr3","_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","nested1","nested2","_BinaryenExpressionGetId","_BinaryenConstGetValueI32","_BinaryenConstGetValueI64Low","_BinaryenConstGetValueI64High","_BinaryenConstGetValueF32","_BinaryenConstGetValueF64","_BinaryenGetLocalGetIndex","_BinaryenGetGlobalGetName","_BinaryenLoadGetPtr","_BinaryenLoadIsAtomic","_BinaryenLoadGetBytes","_BinaryenLoadGetOffset","_BinaryenLoadIsSigned","_BinaryenLoadGetAlign","_BinaryenUnaryGetValue","_BinaryenUnaryGetOp","_BinaryenBinaryGetLeft","_BinaryenBinaryGetRight","_BinaryenBinaryGetOp","addDebugInfoFile","_BinaryenModuleAddDebugInfoFileName","getDebugInfoFile","_BinaryenModuleGetDebugInfoFileName","fileIndex","lineNumber","columnNumber","_BinaryenFunctionSetDebugLocation","UNLIMITED_MEMORY","getConstValueI64High","getSetLocalIndex","_BinaryenSetLocalGetIndex","_BinaryenSetLocalGetValue","_BinaryenSetLocalIsTee","getUnaryValue","getLoadOffset","getLoadPtr","getStoreBytes","_BinaryenStoreGetBytes","getStoreOffset","_BinaryenStoreGetOffset","getStorePtr","_BinaryenStoreGetPtr","getStoreValue","_BinaryenStoreGetValue","_BinaryenBlockGetName","_BinaryenBlockGetNumChildren","_BinaryenBlockGetChild","getIfCondition","_BinaryenIfGetCondition","_BinaryenIfGetIfTrue","_BinaryenIfGetIfFalse","getLoopName","_BinaryenLoopGetName","getLoopBody","_BinaryenLoopGetBody","getBreakName","_BinaryenBreakGetName","getBreakCondition","_BinaryenBreakGetCondition","_BinaryenSelectGetIfTrue","_BinaryenSelectGetIfFalse","getSelectCondition","_BinaryenSelectGetCondition","getDropValue","_BinaryenDropGetValue","getReturnValue","_BinaryenReturnGetValue","_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","idx","store","i32s","val","ptrs","u","stringLengthUTF8","cp","u1","u2","u3","u4","arr","String","fromCodePoints","needsExplicitUnreachable","Return","Break","numChildren","IdentifierHandling","tokenFromKeyword","AS","ASYNC","AWAIT","CASE","CATCH","DEBUGGER","DECLARE","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","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_16","sepEnd","i64_add","i64_mul","Numeric_separators_are_not_allowed_here","Multiple_consecutive_numeric_separators_are_not_permitted","Hexadecimal_digit_expected","i64_10","Digit_expected","i64_8","Octal_digit_expected","i64_2","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","program_1","TypeKind","TypeFlags","cachedNullableType","ceil","classReference","nonNullableType","isize64","isize32","usize64","usize32","isManaged","computeSmallIntegerShift","targetType","classType","asNullable","signednessIsRelevant","currentClass","targetClass","targetFunction","commonCompatible","signednessIsImportant","kindOnly","toNativeZero","toNativeOne","toNativeNegOne","typesToNativeTypes","types","numTypes","typesToString","Signature","cachedFunctionTarget","parameterNames","requiredParameters","hasRest","asFunctionTarget","getDefaultParameterName","thisThisType","targetThisType","thisParameterTypes","targetParameterTypes","numParameters","thisParameterType","targetParameterType","thisReturnType","targetReturnType","makeSignatureString","includeThis","optionalStart","restIndex","cachedDefaultParameterNames","g","e","window","builtins_1","Options","WASM32","importMemory","importTable","features","feature","Feature","ConversionKind","WrapMode","mangleImportName_moduleName","mangleImportName_elementName","Compiler","currentOuterFunction","currentInlineFunctions","currentEnum","currentType","memorySegments","stringSegments","functionTable","argcVar","argcSet","needsIterateRoots","f32ModInstance","f64ModInstance","f32PowInstance","f64PowInstance","max","compile","startFunctionInstance","startFunctionBody","compileSource","funcRef","ensureFunctionType","i64_align","i64_shr_u","moduleExport","makeModuleExport","compileIterateRoots","subPrefix","_f","_g","_h","_j","Cannot_export_a_mutable_global","ensureTrampoline","ensureArgcSet","COMPILED","setter","nativeType","nativeSizeType","getterName","setterName","_k","_l","_m","_o","fullName","_p","_q","ctor","compileSourceByPath","reportNode","File_0_not_found","isGeneric","compileClassDeclaration","compileEnumDeclaration","compileFunctionDeclaration","compileNamespaceDeclaration","variableInit","compileVariableStatement","compileExportStatement","previousFunction","compileStatement","compileGlobalDeclaration","compileGlobal","initExpr","resolvedType","resolveType","Type_expected","atEnd","compileExpressionRetainType","Type_0_is_not_assignable_to_type_1","isDeclaredConstant","MODULE_IMPORT","mangleImportName","initializeInStart","compileExpression","Compiling_constant_with_non_constant_initializer_as_mutable","compileEnum","previousValue","previousValueIsMut","initInStart","valueDeclaration","In_const_enum_declarations_member_initializer_must_be_constant_expression","Enum_member_must_have_initializer","AddI32","compileFunctionUsingTypeArguments","makeMap","resolveFunctionInclTypeArguments","compileFunction","resultType","compileFunctionBody","compileStatements","An_implementation_cannot_be_declared_in_ambient_contexts","stmts","unshift","classInstance","makeAllocation","makeFieldInitialization","Constructors_for_derived_classes_must_contain_a_super_call","A_function_whose_declared_type_is_not_void_must_return_a_value","Function_implementation_is_missing_or_not_immediately_following_the_declaration","compileInterfaceDeclaration","compileNamespace","compileClassUsingTypeArguments","alternativeReportNode","resolveClassInclTypeArguments","compileClass","staticMembers","ctorInstance","_e","addMemorySegment","alignment","ensureFunctionTableEntry","TRAMPOLINE","compileBlockStatement","compileBreakStatement","compileContinueStatement","compileDoStatement","compileEmptyStatement","compileExpressionStatement","compileForStatement","compileIfStatement","compileReturnStatement","compileSwitchStatement","compileThrowStatement","compileTryStatement","compileVoidStatement","compileWhileStatement","addDebugLocation","numStatements","Nop","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","block","repeatLabel","alwaysTrue","condPre","incrExpr","bodyStatement","bodyExpr","usesContinue","breakBlock","repeatBlock","GENERIC_CONTEXT","condExprPrecomp","ifTrueFlow","ifTrueExpr","ifFalseExpr","ifFalseFlow","numCases","context","tempLocal","tempLocalIndex","breaks","breakIndex","defaultIndex","currentBlock","alwaysReturns","alwaysReturnsWrapped","alwaysThrows","alwaysAllocates","isLast","nextLabel","count","compileAbort","isKnownGlobal","numDeclarations","initializers","isInlined","_const_declarations_must_be_initialized","compileAssignmentWithValue","compileInlineConstant","contextualType","retainType","mask","conversionKind","wrapMode","compileAssertionExpression","compileBinaryExpression","compileCallExpression","compileCommaExpression","compileElementAccessExpression","compileFunctionExpression","compileIdentifierExpression","compileInstanceOfExpression","compileLiteralExpression","compileNewExpression","compileParenthesizedExpression","compilePropertyAccessExpression","compileTernaryExpression","compileUnaryPostfixExpression","compileUnaryPrefixExpression","convertExpression","ensureSmallIntegerWrap","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","NONNULL","leftExpr","leftType","rightExpr","rightType","commonType","compound","compileBinaryOverload","Operator_0_cannot_be_applied_to_types_1_and_2","compileAssignment","AddI64","AddF32","AddF64","SubI32","SubI64","SubF32","SubF64","MulI64","MulF32","MulF64","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","compileUnaryOverload","operatorInstance","valueExpr","argumentExpressions","thisArg","compileCallDirect","valueExpression","resolveExpression","Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property","currentElementExpression","isUnchecked","indexedSet","Index_signature_in_type_0_only_permits_reading","Index_signature_is_missing_in_type_0","valueWithCorrectType","tee","thisExpression","currentThisExpression","thisExpr","setterInstance","getterInstance","nativeReturnType","indexedGet","elementExpr","tempLocalTarget","tempLocalElement","indexArg","compileCallExpressionBuiltin","Type_0_is_not_generic","inferredTypes","numTypeParameters","numParameterTypes","numArguments","argumentExprs","typeNode","argumentExpression","inferredType","concreteType","resolvedTypeArguments","Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures","compileGetter","Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors","baseClassInstance","thisLocal","ensureConstructor","_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class","compileCallIndirect","typeArgumentNodes","resolveTypeArguments","compileCall","checkCallSignature","hasThis","minimum","Expected_at_least_0_arguments_but_got_1","inline","includes","compileCallInlineUnchecked","Function_0_cannot_be_inlined_into_itself","numArgumentsInclThis","previousFlow","superType","paramExpr","argumentLocal","original","originalSignature","originalName","originalParameterTypes","originalParameterDeclarations","commonReturnType","commonThisType","isInstance","minArguments","minOperands","maxArguments","maxOperands","numOptional","forwardedOperands","operandIndex","trampolineSignature","trampolineName","ofN","Optional_parameter_must_have_an_initializer","ensureArgcVar","numOperands","isCallImport","parameterNodes","allOptionalsAreConstant","makeCallIndirect","numExpressions","exprs","resolveElementAccess","retainConstantType","_this_cannot_be_referenced_in_current_location","_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class","scopedThis","_super_can_only_be_referenced_in_a_derived_class","localType","A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums","implicitNegate","compileArrayLiteral","floatValue","intValue","i64_sub","determineIntegerLiteralType","i64_to_f32","i64_to_f64","compileStringLiteral","compileObjectLiteral","ensureStaticString","stringValue","stringSegment","headerSize","totalSize","buf","writeI32","ensureGCHook","writeI16","stringOffset","i64_is_u32","ensureStaticArray","elementType","byteLength","usizeTypeSize","bufferInstance","bufferHeaderSize","bufferTotalSize","clz","writeI8","writeI64","writeF32","writeF64","bufferOffset","arrayInstance","arrayHeaderSize","arrayOffset","isConst","compiledValues","constantValues","nativeElementType","isStatic","arrayType","nativeArrayType","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","Property_0_does_not_exist_on_type_1","Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature","compileInstantiate","baseClass","nativeDummy","propertyAccess","resolvePropertyAccess","theEnum","Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set","ifThenFlow","ifThenExpr","ifThenType","ifElseFlow","ifElseExpr","ifElseType","getValue","calcValue","setValue","NegF32","NegF64","makeIsFalseish","ExtendI8ToI32","ExtendI16ToI32","allocateInstance","fieldType","nativeFieldType","fieldDeclaration","ReportMode","reportMode","REPORT","resolveSignature","numTypeArguments","paramType","instanceKey","placeholderType","Basic_type_0_cannot_be_nullable","Expected_0_type_arguments_but_got_1","parameterTypeNodes","parameterTypeNode","REST","returnTypeNode","minParameterCount","maxParameterCount","argumentCount","ensureResolvedLazyGlobal","contextualFunction","targetExpression","propertyName","elementAccess","i64_is_i8","i64_is_u8","i64_is_i16","i64_is_u16","i64_is_i32","i64_is_bool","explicitLocal","classInstanceKey","classInstances","instance_1","numFunctionTypeArguments","signatureNode","functionTypeParameters","signatureParameters","signatureParameterCount","parameterDeclaration","resolveFunctionPartially","partialKey","partialPrototype","expectedTypeArguments","actualTypeArguments","baseClassType","Class_0_is_sealed_and_cannot_be_extended","Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa","inheritedMember","constructorPartial","baseField","fieldInstance","instanceProperty","partialGetterPrototype","partialSetterPrototype","overloadPrototype","operatorPartial","Decompiler","functionId","decompile","decompiler","decompileFunction","nativeTypeToType","decompileExpression","nested","string","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","AtomicWake","ExportsWalker","includePrivate","todo","walk","visitElement","visitGlobal","visitEnum","visitFunctionInstances","visitClassInstances","visitField","prop","hasCompiledMember","visitNamespace","visitFunction","visitClass","IDLBuilder","indentLevel","build","indent","typeToString","members_1","members_1_1","visitInterface","TSDBuilder","numMembers","members_2","members_2_1","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","isArrow","parseFunctionExpressionCommon","Interface_declaration_cannot_have_implements_clause","parseClassMember","parseClassExpression","VIRTUAL","accessStart","accessEnd","staticStart","staticEnd","abstractStart","abstractEnd","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","QUOTED","_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","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","F64","Float64Array","U64","Uint32Array","UnreachableError","captureStackTrace","stack","AssertionError","defineProperties","writable","Math","fround","EPSILON","MIN_NORMAL_VALUE","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","clz32","abs","floor","trunc","round","sqrt","x","y","sign","isTrueish","radix","parseInt","undefined","fromCodePoint","Number","isInteger","isArray","signbit","Boolean","HEAP","HEAP_OFFSET","oldHeap","fill","dest","copy","src","copyWithin","F32","Float32Array","I32","Int32Array","f32_as_i32","i32_as_f32","f64_as_i64","i64_as_f64","Long","ZERO","ONE","lo","hi","fromBits","low","high","sub","mul","i64_div","div","i64_div_u","toUnsigned","toSigned","i64_rem","mod","i64_rem_u","and","or","i64_xor","xor","shl","i64_shr","shr","shru","not","i64_eq","eq","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","pow","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","evaluateConstantType","SWALLOW","expr_1","tempLocal1","tempLocalIndex2","tempLocalIndex1","wasm64","tempLocal0","evaluateConstantOffset","alignLog2","Type_0_has_no_property_1","abort","operandExprs","signatureParts","nativeParamTypes","operandType","User_defined_0","expr_2","deferASM","deferASMCall","typeArgument","stringType","messageArg","filenameArg","existingIndex","gcPrototype","gcInstance","nativeSizeSize","baseInstance","funcName","CharCode","lookupInUnicodeMap","unicodeIdentifierStart","unicodeIdentifierPart","mid","makeArray","cloned","makeSet","original_1","original_1_1","v","original_2","original_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","setNoTreeShaking","setNoAssert","setImportMemory","setImportTable","setSourceMap","setMemoryBase","setGlobalAlias","FEATURE_SIGN_EXTENSION","FEATURE_MUTABLE_GLOBAL","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,EAAAD,EAAA,UARA,CASC,oBAAAO,UAAAC,KAAA,SAAAC,GACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAV,QAGA,IAAAC,EAAAO,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAZ,QAAA,IAUA,OANAa,EAAAH,GAAAI,KAAAb,EAAAD,QAAAC,IAAAD,QAAAS,GAGAR,EAAAW,GAAA,EAGAX,EAAAD,QA0DA,OArDAS,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAjB,EAAAkB,EAAAC,GACAV,EAAAW,EA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AArG,EAAA,IACAqG,EAAArG,EAAA,IACAqG,EAAArG,EAAA,KACAqG,EAAArG,EAAA,IACAqG,EAAArG,EAAA,KACAqG,EAAArG,EAAA,IACAqG,EAAArG,EAAA,IACAqG,EAAArG,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__18__) {\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 = 15);\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 an arrow function. */\r\n ARROW = 1 << 19,\r\n /** Is a module export. */\r\n MODULE_EXPORT = 1 << 20,\r\n /** Is a module import. */\r\n MODULE_IMPORT = 1 << 21,\r\n\r\n // Compilation states\r\n\r\n /** Is resolved. */\r\n RESOLVED = 1 << 22,\r\n /** Is compiled. */\r\n COMPILED = 1 << 23,\r\n /** Has a constant value and is therefore inlined. */\r\n INLINED = 1 << 24,\r\n /** Is scoped. */\r\n SCOPED = 1 << 25,\r\n /** Is a trampoline. */\r\n TRAMPOLINE = 1 << 26,\r\n /** Is a virtual method. */\r\n VIRTUAL = 1 << 27,\r\n /** Is the main function. */\r\n MAIN = 1 << 28,\r\n\r\n // Other\r\n\r\n QUOTED = 1 << 29\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/** Prefix used to indicate a filespace element. */\r\nexport const FILESPACE_PREFIX = \"file:\";\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\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 /** 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(message.range, useColors));\r\n }\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 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 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 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, 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, 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, arg0, arg1, arg2);\r\n }\r\n}\r\n","/**\r\n * Various compiler utilities.\r\n * @module util\r\n * @preferred\r\n *//***/\r\n\r\nexport * from \"./charcode\";\r\nexport * from \"./collections\";\r\nexport * from \"./path\";\r\nexport * from \"./text\";\r\nexport * from \"./binary\";\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 PATH_DELIMITER,\r\n STATIC_DELIMITER,\r\n INSTANCE_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 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 /** Parent node. */\r\n parent: Node | 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 // types\r\n\r\n static createType(\r\n name: IdentifierExpression,\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; name.parent = type;\r\n type.typeArguments = typeArguments; if (typeArguments) setParent(typeArguments, type);\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.createIdentifierExpression(\"\", 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; name.parent = elem;\r\n elem.extendsType = extendsType; if (extendsType) extendsType.parent = elem;\r\n elem.defaultType = defaultType; if (defaultType) defaultType.parent = elem;\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; name.parent = elem;\r\n elem.type = type; if (type) type.parent = elem;\r\n elem.initializer = initializer; if (initializer) initializer.parent = elem;\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; setParent(parameters, sig);\r\n sig.returnType = returnType; returnType.parent = sig;\r\n sig.explicitThisType = explicitThisType; if (explicitThisType) explicitThisType.parent = sig;\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; name.parent = stmt;\r\n stmt.arguments = args; if (args) setParent(args, stmt);\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 ): IdentifierExpression {\r\n var expr = new IdentifierExpression();\r\n expr.range = range;\r\n expr.text = name;\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; setParentIfNotNull(elements, expr);\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; expression.parent = expr;\r\n expr.toType = toType; if (toType) toType.parent = expr;\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; left.parent = expr;\r\n expr.right = right; right.parent = expr;\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; expression.parent = expr;\r\n expr.typeArguments = typeArgs; if (typeArgs) setParent(typeArgs, expr);\r\n expr.arguments = args; setParent(args, expr);\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; setParent(expressions, expr);\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; expression.parent = expr;\r\n expr.elementExpression = element; element.parent = expr;\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.flags = declaration.flags & CommonFlags.ARROW;\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; expression.parent = expr;\r\n expr.isType = isType; isType.parent = expr;\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; expression.parent = expr;\r\n expr.typeArguments = typeArgs; if (typeArgs) setParent(typeArgs, expr);\r\n expr.arguments = args; setParent(args, expr);\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; expression.parent = expr;\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; expression.parent = expr;\r\n expr.property = property; property.parent = expr;\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; condition.parent = expr;\r\n expr.ifThen = ifThen; ifThen.parent = expr;\r\n expr.ifElse = ifElse; ifElse.parent = expr;\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; operand.parent = expr;\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; operand.parent = expr;\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; setParent(statements, stmt);\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; if (label) label.parent = stmt;\r\n return stmt;\r\n }\r\n\r\n static createClassDeclaration(\r\n identifier: IdentifierExpression,\r\n typeParameters: TypeParameterNode[],\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; identifier.parent = stmt;\r\n stmt.typeParameters = typeParameters; setParent(typeParameters, stmt);\r\n stmt.extendsType = extendsType; if (extendsType) extendsType.parent = stmt;\r\n stmt.implementsTypes = implementsTypes; if (implementsTypes) setParent(implementsTypes, stmt);\r\n stmt.members = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; if (label) label.parent = stmt;\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; statement.parent = stmt;\r\n stmt.condition = condition; condition.parent = stmt;\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; name.parent = stmt;\r\n stmt.values = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = stmt;\r\n stmt.value = value; if (value) value.parent = stmt;\r\n return stmt;\r\n }\r\n\r\n static createExportStatement(\r\n members: ExportMember[] | null,\r\n path: StringLiteralExpression | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): ExportStatement {\r\n var stmt = new ExportStatement();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.members = members; if (members) setParent(members, stmt);\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 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; name.parent = stmt;\r\n stmt.externalName = externalName; externalName.parent = stmt;\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.name = name; name.parent = elem;\r\n if (!externalName) {\r\n externalName = name;\r\n } else {\r\n externalName.parent = elem;\r\n }\r\n elem.externalName = 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; expression.parent = stmt;\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; condition.parent = stmt;\r\n stmt.ifTrue = ifTrue; ifTrue.parent = stmt;\r\n stmt.ifFalse = ifFalse; if (ifFalse) ifFalse.parent = stmt;\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; if (decls) setParent(decls, stmt);\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 externalName: 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.externalName = externalName; externalName.parent = elem;\r\n if (!name) {\r\n name = externalName;\r\n } else {\r\n name.parent = elem;\r\n }\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[],\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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.extendsType = extendsType; if (extendsType) extendsType.parent = stmt;\r\n stmt.members = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = stmt;\r\n stmt.type = type; if (type) type.parent = stmt;\r\n stmt.initializer = initializer; if (initializer) initializer.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; if (initializer) initializer.parent = stmt;\r\n stmt.condition = condition; if (condition) condition.parent = stmt;\r\n stmt.incrementor = incrementor; if (incrementor) incrementor.parent = stmt;\r\n stmt.statement = statement; statement.parent = stmt;\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 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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.signature = signature; signature.parent = stmt;\r\n stmt.body = body; if (body) body.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; keyType.parent = elem;\r\n elem.valueType = valueType; valueType.parent = elem;\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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.signature = signature; signature.parent = stmt;\r\n stmt.body = body; if (body) body.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = stmt;\r\n stmt.members = members; setParent(members, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; if (value) value.parent = stmt;\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; condition.parent = stmt;\r\n stmt.cases = cases; setParent(cases, stmt);\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; if (label) label.parent = elem;\r\n elem.statements = statements; setParent(statements, elem);\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; value.parent = stmt;\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; setParent(statements, stmt);\r\n stmt.catchVariable = catchVariable;\r\n if (catchVariable) catchVariable.parent = stmt;\r\n stmt.catchStatements = catchStatements;\r\n if (catchStatements) setParent(catchStatements, stmt);\r\n stmt.finallyStatements = finallyStatements;\r\n if (finallyStatements) setParent(finallyStatements, stmt);\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; name.parent = stmt;\r\n stmt.typeParameters = typeParameters; if (typeParameters) setParent(typeParameters, stmt);\r\n stmt.type = alias; alias.parent = stmt;\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\r\n return stmt;\r\n }\r\n\r\n static createVariableStatement(\r\n declarations: VariableDeclaration[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): VariableStatement {\r\n var stmt = new VariableStatement();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.declarations = declarations; setParent(declarations, stmt);\r\n stmt.decorators = decorators; if (decorators) setParent(decorators, stmt);\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; name.parent = elem;\r\n elem.type = type; if (type) type.parent = elem;\r\n elem.initializer = initializer; if (initializer) initializer.parent = elem;\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; condition.parent = stmt;\r\n stmt.statement = statement; statement.parent = stmt;\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 annotation. */\r\nexport class TypeNode extends CommonTypeNode {\r\n kind = NodeKind.TYPE;\r\n\r\n /** Identifier reference. */\r\n name: IdentifierExpression;\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}\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}\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.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 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}\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\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}\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}\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}\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}\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}\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}\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\nexport function isLastStatement(statement: Statement): bool {\r\n var parent = assert(statement.parent);\r\n if (parent.kind == NodeKind.BLOCK) {\r\n let statements = (parent).statements;\r\n if (statements[statements.length - 1] === statement) {\r\n switch (assert(parent.parent).kind) {\r\n case NodeKind.FUNCTIONDECLARATION:\r\n case NodeKind.METHODDECLARATION: return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\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\r\n /** Simple name being declared. */\r\n name: IdentifierExpression;\r\n /** Array of decorators. */\r\n decorators: DecoratorNode[] | null = null;\r\n\r\n protected cachedProgramLevelInternalName: string | null = null;\r\n protected cachedFileLevelInternalName: string | null = null;\r\n\r\n /** Gets the mangled program-level internal name of this declaration. */\r\n get programLevelInternalName(): string {\r\n if (!this.cachedProgramLevelInternalName) {\r\n this.cachedProgramLevelInternalName = mangleInternalName(this, true);\r\n }\r\n return this.cachedProgramLevelInternalName;\r\n }\r\n\r\n /** Gets the mangled file-level internal name of this declaration. */\r\n get fileLevelInternalName(): string {\r\n if (!this.cachedFileLevelInternalName) {\r\n this.cachedFileLevelInternalName = mangleInternalName(this, false);\r\n }\r\n return this.cachedFileLevelInternalName;\r\n }\r\n\r\n /** Tests if this is a top-level declaration within its source file. */\r\n get isTopLevel(): bool {\r\n var parent = this.parent;\r\n if (!parent) {\r\n return false;\r\n }\r\n if (parent.kind == NodeKind.VARIABLE && !(parent = parent.parent)) {\r\n return false;\r\n }\r\n return parent.kind == NodeKind.SOURCE;\r\n }\r\n\r\n /** Tests if this declaration is a top-level export within its source file. */\r\n get isTopLevelExport(): bool {\r\n var parent = this.parent;\r\n if (!parent || (parent.kind == NodeKind.VARIABLE && !(parent = parent.parent))) {\r\n return false;\r\n }\r\n if (parent.kind == NodeKind.NAMESPACEDECLARATION) {\r\n return this.is(CommonFlags.EXPORT) && (parent).isTopLevelExport;\r\n }\r\n if (parent.kind == NodeKind.CLASSDECLARATION) {\r\n return this.is(CommonFlags.STATIC) && (parent).isTopLevelExport;\r\n }\r\n return parent.kind == NodeKind.SOURCE && this.is(CommonFlags.EXPORT);\r\n }\r\n\r\n /** Tests if this declaration needs an explicit export. */\r\n needsExplicitExport(member: ExportMember): bool {\r\n // This is necessary because module-level exports are automatically created\r\n // for top level declarations of all sorts. This function essentially tests\r\n // that there isn't a otherwise duplicate top-level export already.\r\n return (\r\n member.name.text != member.externalName.text || // if aliased\r\n this.range.source != member.range.source || // if a re-export\r\n !this.isTopLevelExport // if not top-level\r\n );\r\n }\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[];\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 DeclarationStatement {\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 /** Identifier being exported. */\r\n name: IdentifierExpression;\r\n /** Identifier seen when imported again. */\r\n externalName: 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 filespace 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}\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 within the constructor, if applicable. */\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/** 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\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 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 externalName: 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 a declaration's name to an internal name. */\r\nexport function mangleInternalName(declaration: DeclarationStatement, asGlobal: bool = false): string {\r\n var name = declaration.name.text;\r\n var parent = declaration.parent;\r\n if (!parent) return name;\r\n if (\r\n declaration.kind == NodeKind.VARIABLEDECLARATION &&\r\n parent.kind == NodeKind.VARIABLE\r\n ) { // skip over\r\n if (!(parent = parent.parent)) return name;\r\n }\r\n if (parent.kind == NodeKind.CLASSDECLARATION) {\r\n return mangleInternalName(parent, asGlobal) + (\r\n declaration.is(CommonFlags.STATIC)\r\n ? STATIC_DELIMITER\r\n : INSTANCE_DELIMITER\r\n ) + name;\r\n }\r\n if (\r\n parent.kind == NodeKind.NAMESPACEDECLARATION ||\r\n parent.kind == NodeKind.ENUMDECLARATION\r\n ) {\r\n return mangleInternalName(parent, asGlobal) +\r\n STATIC_DELIMITER + name;\r\n }\r\n return asGlobal\r\n ? name\r\n : declaration.range.source.internalPath + PATH_DELIMITER + name;\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// Helpers\r\n\r\n/** Sets the parent node on an array of nodes. */\r\nfunction setParent(nodes: Node[], parent: Node): void {\r\n for (let i = 0, k = nodes.length; i < k; ++i) {\r\n nodes[i].parent = parent;\r\n }\r\n}\r\n\r\n/** Sets the parent node on an array of nullable nodes. */\r\nfunction setParentIfNotNull(nodes: (Node | null)[], parent: Node): void {\r\n for (let i = 0, k = nodes.length; i < k; ++i) {\r\n let node = nodes[i];\r\n if (node) node.parent = parent;\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 LIBRARY_PREFIX,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX,\r\n FILESPACE_PREFIX\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 Range,\r\n CommonTypeNode,\r\n TypeParameterNode,\r\n DecoratorNode,\r\n DecoratorKind,\r\n\r\n Expression,\r\n IdentifierExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n StringLiteralExpression,\r\n\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 NativeType,\r\n FunctionRef,\r\n ExpressionRef,\r\n ExpressionId,\r\n BinaryOp,\r\n UnaryOp,\r\n\r\n getExpressionId,\r\n getGetLocalIndex,\r\n isTeeLocal,\r\n getSetLocalValue,\r\n getBinaryOp,\r\n getConstValueI32,\r\n getBinaryLeft,\r\n getBinaryRight,\r\n getUnaryOp,\r\n getExpressionType,\r\n getLoadBytes,\r\n isLoadSigned,\r\n getIfTrue,\r\n getIfFalse,\r\n getSelectThen,\r\n getSelectElse,\r\n getCallTarget,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getBlockName,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getConstValueI64Low,\r\n getGetGlobalName\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\n/** Represents a yet unresolved import. */\r\nclass QueuedImport {\r\n localName: string;\r\n externalName: string;\r\n externalNameAlt: string;\r\n declaration: ImportDeclaration | null; // not set if a filespace\r\n}\r\n\r\n/** Represents a yet unresolved export. */\r\nclass QueuedExport {\r\n externalName: string;\r\n isReExport: bool;\r\n member: ExportMember;\r\n}\r\n\r\n/** Represents a type alias. */\r\nclass TypeAlias {\r\n typeParameters: TypeParameterNode[] | null;\r\n type: CommonTypeNode;\r\n}\r\n\r\n/** Represents a module-level export. */\r\nclass ModuleExport {\r\n element: Element;\r\n identifier: IdentifierExpression;\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\nconst noTypesYet = new Map();\r\n\r\n/** Represents an AssemblyScript program. */\r\nexport class Program extends DiagnosticEmitter {\r\n\r\n /** Array of source files. */\r\n sources: Source[];\r\n /** Resolver instance. */\r\n resolver: Resolver;\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\r\n /** Elements by internal name. */\r\n elementsLookup: Map = new Map();\r\n /** Class and function instances by internal name. */\r\n instancesLookup: Map = new Map();\r\n /** Types by internal name. */\r\n typesLookup: Map = noTypesYet;\r\n /** Declared type aliases. */\r\n typeAliases: Map = new Map();\r\n /** File-level exports by exported name. */\r\n fileLevelExports: Map = new Map();\r\n /** Module-level exports by exported name. */\r\n moduleLevelExports: Map = new Map();\r\n /** Classes backing basic types like `i32`. */\r\n basicClasses: Map = new Map();\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 /** Start function reference. */\r\n startFunction: FunctionPrototype;\r\n /** Main function reference, if present. */\r\n mainFunction: FunctionPrototype | 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 /** 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 /** Currently processing filespace. */\r\n currentFilespace: Filespace;\r\n\r\n /** Constructs a new program, optionally inheriting parser diagnostics. */\r\n constructor(diagnostics: DiagnosticMessage[] | null = null) {\r\n super(diagnostics);\r\n this.resolver = new Resolver(this);\r\n this.sources = [];\r\n }\r\n\r\n /** Gets a source by its exact path. */\r\n getSource(normalizedPath: string): Source | null {\r\n var sources = this.sources;\r\n for (let i = 0, k = sources.length; i < k; ++i) {\r\n let source = sources[i];\r\n if (source.normalizedPath == normalizedPath) return source;\r\n }\r\n return null;\r\n }\r\n\r\n /** Looks up the source for the specified possibly ambiguous path. */\r\n lookupSourceByPath(normalizedPathWithoutExtension: string): Source | null {\r\n var tmp: string;\r\n return (\r\n this.getSource(normalizedPathWithoutExtension + \".ts\") ||\r\n this.getSource(normalizedPathWithoutExtension + \"/index.ts\") ||\r\n this.getSource((tmp = LIBRARY_PREFIX + normalizedPathWithoutExtension) + \".ts\") ||\r\n this.getSource( tmp + \"/index.ts\")\r\n );\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 // add built-in types\r\n this.typesLookup = new Map([\r\n [\"i8\", Type.i8],\r\n [\"i16\", Type.i16],\r\n [\"i32\", Type.i32],\r\n [\"i64\", Type.i64],\r\n [\"isize\", options.isizeType],\r\n [\"u8\", Type.u8],\r\n [\"u16\", Type.u16],\r\n [\"u32\", Type.u32],\r\n [\"u64\", Type.u64],\r\n [\"usize\", options.usizeType],\r\n [\"bool\", Type.bool],\r\n [\"f32\", Type.f32],\r\n [\"f64\", Type.f64],\r\n [\"void\", Type.void],\r\n [\"number\", Type.f64],\r\n [\"boolean\", Type.bool]\r\n ]);\r\n\r\n // add compiler hints\r\n this.setConstantInteger(\"ASC_TARGET\", Type.i32,\r\n i64_new(options.isWasm64 ? 2 : 1));\r\n this.setConstantInteger(\"ASC_NO_TREESHAKING\", Type.bool,\r\n i64_new(options.noTreeShaking ? 1 : 0, 0));\r\n this.setConstantInteger(\"ASC_NO_ASSERT\", Type.bool,\r\n i64_new(options.noAssert ? 1 : 0, 0));\r\n this.setConstantInteger(\"ASC_MEMORY_BASE\", Type.i32,\r\n i64_new(options.memoryBase, 0));\r\n this.setConstantInteger(\"ASC_OPTIMIZE_LEVEL\", Type.i32,\r\n i64_new(options.optimizeLevelHint, 0));\r\n this.setConstantInteger(\"ASC_SHRINK_LEVEL\", Type.i32,\r\n i64_new(options.shrinkLevelHint, 0));\r\n this.setConstantInteger(\"ASC_FEATURE_MUTABLE_GLOBAL\", Type.bool,\r\n i64_new(options.hasFeature(Feature.MUTABLE_GLOBAL) ? 1 : 0, 0));\r\n this.setConstantInteger(\"ASC_FEATURE_SIGN_EXTENSION\", Type.bool,\r\n i64_new(options.hasFeature(Feature.SIGN_EXTENSION) ? 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 queuedExtends = new Array();\r\n var queuedImplements = new Array();\r\n\r\n // build initial lookup maps of internal names to declarations\r\n for (let i = 0, k = this.sources.length; i < k; ++i) {\r\n let source = this.sources[i];\r\n\r\n // create one filespace per source\r\n let filespace = new Filespace(this, source);\r\n this.elementsLookup.set(filespace.internalName, filespace);\r\n this.currentFilespace = filespace;\r\n\r\n // process this source's statements\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.CLASSDECLARATION: {\r\n this.initializeClass(statement, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(statement);\r\n break;\r\n }\r\n case NodeKind.EXPORT: {\r\n this.initializeExports(statement, queuedExports);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(statement);\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.initializeImports(statement, queuedExports, queuedImports);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(statement);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(statement, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n this.initializeTypeAlias(statement);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(statement);\r\n break;\r\n }\r\n }\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; i < queuedImports.length;) {\r\n let queuedImport = queuedImports[i];\r\n let declaration = queuedImport.declaration;\r\n if (declaration) { // named\r\n let element = this.tryLocateImport(queuedImport.externalName, queuedExports);\r\n if (element) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n if (element = this.tryLocateImport(queuedImport.externalNameAlt, queuedExports)) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n declaration.range,\r\n (declaration.parent).path.value,\r\n declaration.externalName.text\r\n );\r\n ++i;\r\n }\r\n }\r\n } else { // filespace\r\n let element = this.elementsLookup.get(queuedImport.externalName);\r\n if (element) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n if (element = this.elementsLookup.get(queuedImport.externalNameAlt)) {\r\n this.elementsLookup.set(queuedImport.localName, element);\r\n queuedImports.splice(i, 1);\r\n } else {\r\n assert(false); // already reported by the parser not finding the file\r\n ++i;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // queued exports should be resolvable now that imports are finalized\r\n for (let [exportName, queuedExport] of queuedExports) {\r\n let currentExport: QueuedExport | null = queuedExport; // nullable below\r\n let element: Element | null;\r\n do {\r\n if (currentExport.isReExport) {\r\n if (element = this.fileLevelExports.get(currentExport.externalName)) {\r\n this.setExportAndCheckLibrary(\r\n exportName,\r\n element,\r\n queuedExport.member.externalName\r\n );\r\n break;\r\n }\r\n currentExport = queuedExports.get(currentExport.externalName);\r\n if (!currentExport) {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n queuedExport.member.externalName.range,\r\n ((queuedExport.member.parent).path).value,\r\n queuedExport.member.externalName.text\r\n );\r\n }\r\n } else {\r\n if (\r\n // normal export\r\n (element = this.elementsLookup.get(currentExport.externalName)) ||\r\n // library re-export\r\n (element = this.elementsLookup.get(currentExport.member.name.text))\r\n ) {\r\n this.setExportAndCheckLibrary(\r\n exportName,\r\n element,\r\n queuedExport.member.externalName\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n queuedExport.member.range, queuedExport.member.name.text\r\n );\r\n }\r\n break;\r\n }\r\n } while (currentExport);\r\n }\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 derivedPrototype = queuedExtends[i];\r\n let derivedDeclaration = derivedPrototype.declaration;\r\n let derivedType = assert(derivedDeclaration.extendsType);\r\n let baseElement = resolver.resolveIdentifier(derivedType.name, null); // reports\r\n if (!baseElement) continue;\r\n if (baseElement.kind == ElementKind.CLASS_PROTOTYPE) {\r\n let basePrototype = baseElement;\r\n derivedPrototype.basePrototype = basePrototype;\r\n } else {\r\n this.error(\r\n DiagnosticCode.A_class_may_only_extend_another_class,\r\n derivedType.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 element = this.elementsLookup.get(name);\r\n if (element) this.elementsLookup.set(alias, element);\r\n else throw new Error(\"element not found: \" + name);\r\n }\r\n }\r\n }\r\n\r\n // register 'ArrayBuffer'\r\n if (this.elementsLookup.has(\"ArrayBuffer\")) {\r\n let element = assert(this.elementsLookup.get(\"ArrayBuffer\"));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.arrayBufferInstance = resolver.resolveClass(element, null);\r\n }\r\n\r\n // register 'Array'\r\n if (this.elementsLookup.has(\"Array\")) {\r\n let element = assert(this.elementsLookup.get(\"Array\"));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.arrayPrototype = element;\r\n }\r\n\r\n // register 'String'\r\n if (this.elementsLookup.has(\"String\")) {\r\n let element = assert(this.elementsLookup.get(\"String\"));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n let instance = resolver.resolveClass(element, null);\r\n if (instance) {\r\n if (this.typesLookup.has(\"string\")) {\r\n let declaration = (element).declaration;\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, declaration.programLevelInternalName\r\n );\r\n } else {\r\n this.stringInstance = instance;\r\n this.typesLookup.set(\"string\", instance.type);\r\n }\r\n }\r\n }\r\n\r\n // register classes backing basic types\r\n this.registerBasicClass(TypeKind.I8, \"I8\");\r\n this.registerBasicClass(TypeKind.I16, \"I16\");\r\n this.registerBasicClass(TypeKind.I32, \"I32\");\r\n this.registerBasicClass(TypeKind.I64, \"I64\");\r\n this.registerBasicClass(TypeKind.ISIZE, \"Isize\");\r\n this.registerBasicClass(TypeKind.U8, \"U8\");\r\n this.registerBasicClass(TypeKind.U16, \"U16\");\r\n this.registerBasicClass(TypeKind.U32, \"U32\");\r\n this.registerBasicClass(TypeKind.U64, \"U64\");\r\n this.registerBasicClass(TypeKind.USIZE, \"Usize\");\r\n this.registerBasicClass(TypeKind.BOOL, \"Bool\");\r\n this.registerBasicClass(TypeKind.F32, \"F32\");\r\n this.registerBasicClass(TypeKind.F64, \"F64\");\r\n\r\n // register 'start'\r\n {\r\n let element = assert(this.elementsLookup.get(\"start\"));\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.startFunction = element;\r\n }\r\n\r\n // register 'main' if present\r\n if (this.moduleLevelExports.has(\"main\")) {\r\n let element = (this.moduleLevelExports.get(\"main\")).element;\r\n if (\r\n element.kind == ElementKind.FUNCTION_PROTOTYPE &&\r\n !(element).isAny(CommonFlags.GENERIC | CommonFlags.AMBIENT)\r\n ) {\r\n (element).set(CommonFlags.MAIN);\r\n this.mainFunction = element;\r\n }\r\n }\r\n\r\n // register 'abort' if present\r\n if (this.elementsLookup.has(\"abort\")) {\r\n let element = this.elementsLookup.get(\"abort\");\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let instance = this.resolver.resolveFunction(element, null);\r\n if (instance) this.abortInstance = instance;\r\n }\r\n\r\n // register 'memory.allocate' if present\r\n if (this.elementsLookup.has(\"memory\")) {\r\n let element = this.elementsLookup.get(\"memory\");\r\n let members = element.members;\r\n if (members) {\r\n if (members.has(\"allocate\")) {\r\n element = assert(members.get(\"allocate\"));\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let instance = this.resolver.resolveFunction(element, null);\r\n if (instance) this.memoryAllocateInstance = instance;\r\n }\r\n }\r\n }\r\n\r\n // register GC hooks if present\r\n if (\r\n this.elementsLookup.has(\"__gc_allocate\") &&\r\n this.elementsLookup.has(\"__gc_link\") &&\r\n this.elementsLookup.has(\"__gc_mark\")\r\n ) {\r\n // __gc_allocate(usize, (ref: usize) => void): usize\r\n let element = this.elementsLookup.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.elementsLookup.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.elementsLookup.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\r\n private registerBasicClass(typeKind: TypeKind, className: string): void {\r\n if (this.elementsLookup.has(className)) {\r\n let element = assert(this.elementsLookup.get(className));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n let classElement = this.resolver.resolveClass(element, null);\r\n if (classElement) this.basicClasses.set(typeKind, classElement);\r\n }\r\n }\r\n\r\n /** Sets a constant integer value. */\r\n setConstantInteger(globalName: string, type: Type, value: I64): void {\r\n assert(type.is(TypeFlags.INTEGER));\r\n var global = new Global(this, globalName, globalName, type, null, DecoratorFlags.NONE)\r\n .withConstantIntegerValue(value);\r\n global.set(CommonFlags.RESOLVED);\r\n this.elementsLookup.set(globalName, global);\r\n }\r\n\r\n /** Sets a constant float value. */\r\n setConstantFloat(globalName: string, type: Type, value: f64): void {\r\n assert(type.is(TypeFlags.FLOAT));\r\n var global = new Global(this, globalName, globalName, type, null, DecoratorFlags.NONE)\r\n .withConstantFloatValue(value);\r\n global.set(CommonFlags.RESOLVED);\r\n this.elementsLookup.set(globalName, global);\r\n }\r\n\r\n /** Tries to locate an import by traversing exports and queued exports. */\r\n private tryLocateImport(\r\n externalName: string,\r\n queuedNamedExports: Map\r\n ): Element | null {\r\n var element: Element | null;\r\n var fileLevelExports = this.fileLevelExports;\r\n do {\r\n if (element = fileLevelExports.get(externalName)) return element;\r\n let queuedExport = queuedNamedExports.get(externalName);\r\n if (!queuedExport) break;\r\n if (queuedExport.isReExport) {\r\n externalName = queuedExport.externalName;\r\n continue;\r\n }\r\n return this.elementsLookup.get(queuedExport.externalName);\r\n } while (true);\r\n return null;\r\n }\r\n\r\n /** Checks that only supported decorators are present. */\r\n private checkDecorators(\r\n decorators: DecoratorNode[],\r\n acceptedFlags: DecoratorFlags\r\n ): DecoratorFlags {\r\n var presentFlags = DecoratorFlags.NONE;\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 presentFlags |= 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 (presentFlags & 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 presentFlags |= flag;\r\n }\r\n }\r\n }\r\n return presentFlags;\r\n }\r\n\r\n /** Checks and sets up global options of an element. */\r\n private checkGlobal(\r\n element: Element,\r\n declaration: DeclarationStatement\r\n ): void {\r\n var parentNode = declaration.parent;\r\n // alias globally if explicitly annotated @global or exported from a top-level library file\r\n if (\r\n (element.hasDecorator(DecoratorFlags.GLOBAL)) ||\r\n (\r\n declaration.range.source.isLibrary &&\r\n element.is(CommonFlags.EXPORT) &&\r\n (\r\n assert(parentNode).kind == NodeKind.SOURCE ||\r\n (\r\n parentNode).kind == NodeKind.VARIABLE &&\r\n assert((parentNode).parent).kind == NodeKind.SOURCE\r\n )\r\n )\r\n ) {\r\n let globalName = declaration.programLevelInternalName;\r\n if (this.elementsLookup.has(globalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, element.internalName\r\n );\r\n } else {\r\n this.elementsLookup.set(globalName, element);\r\n }\r\n }\r\n // builtins use the global name directly\r\n if (element.hasDecorator(DecoratorFlags.BUILTIN)) {\r\n element.internalName = declaration.programLevelInternalName;\r\n }\r\n }\r\n\r\n /** Initializes a class declaration. */\r\n private initializeClass(\r\n declaration: ClassDeclaration,\r\n queuedExtends: ClassPrototype[],\r\n queuedImplements: ClassPrototype[],\r\n namespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n\r\n var decorators = declaration.decorators;\r\n var simpleName = declaration.name.text;\r\n var prototype = new ClassPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.SEALED |\r\n DecoratorFlags.UNMANAGED\r\n )\r\n : DecoratorFlags.NONE\r\n );\r\n prototype.parent = namespace;\r\n this.elementsLookup.set(internalName, prototype);\r\n\r\n var implementsTypes = declaration.implementsTypes;\r\n if (implementsTypes) {\r\n let numImplementsTypes = implementsTypes.length;\r\n if (prototype.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\r\n // remember classes that implement interfaces\r\n } else if (numImplementsTypes) {\r\n for (let i = 0; i < numImplementsTypes; ++i) {\r\n this.warning( // TODO\r\n DiagnosticCode.Operation_not_supported,\r\n implementsTypes[i].range\r\n );\r\n }\r\n queuedImplements.push(prototype);\r\n }\r\n }\r\n\r\n // remember classes that extend another one\r\n if (declaration.extendsType) queuedExtends.push(prototype);\r\n\r\n // add as namespace member if applicable\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, prototype);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && prototype.is(CommonFlags.EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n // otherwise add to file-level exports if exported\r\n } else if (prototype.is(CommonFlags.EXPORT)) {\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, prototype);\r\n this.currentFilespace.members.set(simpleName, prototype);\r\n if (prototype.is(CommonFlags.EXPORT) && declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: prototype,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\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, prototype);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeAccessor(memberDeclaration, prototype);\r\n } else {\r\n this.initializeMethod(memberDeclaration, prototype);\r\n }\r\n break;\r\n }\r\n case NodeKind.INDEXSIGNATUREDECLARATION: break; // ignored for now\r\n default: {\r\n assert(false); // should have been reported while parsing\r\n return;\r\n }\r\n }\r\n }\r\n\r\n this.checkGlobal(prototype, declaration);\r\n }\r\n\r\n /** Initializes a field of a class or interface. */\r\n private initializeField(\r\n declaration: FieldDeclaration,\r\n classPrototype: ClassPrototype\r\n ): void {\r\n var name = declaration.name.text;\r\n var internalName = declaration.fileLevelInternalName;\r\n var decorators = declaration.decorators;\r\n var isInterface = classPrototype.kind == ElementKind.INTERFACE_PROTOTYPE;\r\n\r\n // static fields become global variables\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n if (isInterface) {\r\n // should have been reported while parsing\r\n assert(false);\r\n }\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n if (classPrototype.members) {\r\n if (classPrototype.members.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.members = new Map();\r\n }\r\n let staticField = new Global(\r\n this,\r\n name,\r\n internalName,\r\n Type.void, // resolved later on\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators, DecoratorFlags.INLINE)\r\n : DecoratorFlags.NONE\r\n );\r\n staticField.parent = classPrototype;\r\n classPrototype.members.set(name, staticField);\r\n this.elementsLookup.set(internalName, staticField);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n staticField.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n if (staticField.hasDecorator(DecoratorFlags.INLINE) && !staticField.is(CommonFlags.READONLY)) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n assert(findDecorator(DecoratorKind.INLINE, decorators)).range, \"inline\"\r\n );\r\n }\r\n\r\n // instance fields are remembered until resolved\r\n } else {\r\n if (isInterface) {\r\n // should have been reported while parsing\r\n assert(!declaration.isAny(CommonFlags.ABSTRACT | CommonFlags.GET | CommonFlags.SET));\r\n }\r\n if (classPrototype.instanceMembers) {\r\n if (classPrototype.instanceMembers.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.instanceMembers = new Map();\r\n }\r\n let instanceField = new FieldPrototype(\r\n classPrototype,\r\n name,\r\n internalName,\r\n declaration\r\n );\r\n if (decorators) this.checkDecorators(decorators, DecoratorFlags.NONE);\r\n classPrototype.instanceMembers.set(name, instanceField);\r\n }\r\n }\r\n\r\n /** Initializes a method of a class or interface. */\r\n private initializeMethod(\r\n declaration: MethodDeclaration,\r\n classPrototype: ClassPrototype\r\n ): void {\r\n var simpleName = declaration.name.text;\r\n var internalName = declaration.fileLevelInternalName;\r\n var prototype: FunctionPrototype | null = null;\r\n\r\n var decorators = declaration.decorators;\r\n var decoratorFlags = DecoratorFlags.NONE;\r\n if (decorators) {\r\n decoratorFlags = this.checkDecorators(decorators,\r\n DecoratorFlags.OPERATOR_BINARY |\r\n DecoratorFlags.OPERATOR_PREFIX |\r\n DecoratorFlags.OPERATOR_POSTFIX |\r\n DecoratorFlags.INLINE\r\n );\r\n }\r\n\r\n // static methods become global functions\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n assert(declaration.name.kind != NodeKind.CONSTRUCTOR);\r\n\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0, declaration.name.range,\r\n internalName\r\n );\r\n return;\r\n }\r\n if (classPrototype.members) {\r\n if (classPrototype.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.members = new Map();\r\n }\r\n prototype = new FunctionPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n classPrototype,\r\n decoratorFlags\r\n );\r\n classPrototype.members.set(simpleName, prototype);\r\n this.elementsLookup.set(internalName, prototype);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n // instance methods are remembered until resolved\r\n } else {\r\n if (classPrototype.instanceMembers) {\r\n if (classPrototype.instanceMembers.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.instanceMembers = new Map();\r\n }\r\n prototype = new FunctionPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n classPrototype,\r\n decoratorFlags\r\n );\r\n // if (classPrototype.isUnmanaged && instancePrototype.isAbstract) {\r\n // this.error( Unmanaged classes cannot declare abstract methods. );\r\n // }\r\n if (declaration.name.kind == NodeKind.CONSTRUCTOR) {\r\n if (classPrototype.constructorPrototype) {\r\n this.error(\r\n DiagnosticCode.Multiple_constructor_implementations_are_not_allowed,\r\n declaration.name.range\r\n );\r\n } else {\r\n prototype.set(CommonFlags.CONSTRUCTOR);\r\n classPrototype.constructorPrototype = prototype;\r\n }\r\n } else {\r\n classPrototype.instanceMembers.set(simpleName, prototype);\r\n }\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n\r\n this.checkOperatorOverloads(declaration.decorators, prototype, classPrototype);\r\n }\r\n\r\n private checkOperatorOverloads(\r\n decorators: DecoratorNode[] | null,\r\n prototype: FunctionPrototype,\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(0)\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private initializeAccessor(\r\n declaration: MethodDeclaration,\r\n classPrototype: ClassPrototype\r\n ): void {\r\n var simpleName = declaration.name.text;\r\n var internalPropertyName = declaration.fileLevelInternalName;\r\n var propertyElement = this.elementsLookup.get(internalPropertyName);\r\n var isGetter = declaration.is(CommonFlags.GET);\r\n var isNew = false;\r\n if (propertyElement) {\r\n if (\r\n propertyElement.kind != ElementKind.PROPERTY ||\r\n (isGetter\r\n ? (propertyElement).getterPrototype\r\n : (propertyElement).setterPrototype\r\n ) != null\r\n ) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalPropertyName\r\n );\r\n return;\r\n }\r\n } else {\r\n propertyElement = new Property(\r\n this,\r\n simpleName,\r\n internalPropertyName,\r\n classPrototype\r\n );\r\n isNew = true;\r\n }\r\n\r\n var decorators = declaration.decorators;\r\n var decoratorFlags = DecoratorFlags.NONE;\r\n if (decorators) {\r\n decoratorFlags = this.checkDecorators(decorators,\r\n DecoratorFlags.INLINE\r\n );\r\n }\r\n\r\n var baseName = (isGetter ? GETTER_PREFIX : SETTER_PREFIX) + simpleName;\r\n\r\n // static accessors become global functions\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n let staticName = classPrototype.internalName + STATIC_DELIMITER + baseName;\r\n if (this.elementsLookup.has(staticName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, staticName\r\n );\r\n return;\r\n }\r\n let staticPrototype = new FunctionPrototype(\r\n this,\r\n baseName,\r\n staticName,\r\n declaration,\r\n null,\r\n decoratorFlags\r\n );\r\n if (isGetter) {\r\n (propertyElement).getterPrototype = staticPrototype;\r\n } else {\r\n (propertyElement).setterPrototype = staticPrototype;\r\n }\r\n if (isNew) {\r\n if (classPrototype.members) {\r\n if (classPrototype.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, staticName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.members = new Map();\r\n }\r\n classPrototype.members.set(simpleName, propertyElement); // check above\r\n } else {\r\n assert(classPrototype.members && classPrototype.members.has(simpleName));\r\n }\r\n this.elementsLookup.set(internalPropertyName, propertyElement);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n propertyElement.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n\r\n // instance accessors are remembered until resolved\r\n } else {\r\n let instanceName = classPrototype.internalName + INSTANCE_DELIMITER + baseName;\r\n if (classPrototype.instanceMembers) {\r\n if (classPrototype.instanceMembers.has(baseName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalPropertyName\r\n );\r\n return;\r\n }\r\n } else {\r\n classPrototype.instanceMembers = new Map();\r\n }\r\n let instancePrototype = new FunctionPrototype(\r\n this,\r\n baseName,\r\n instanceName,\r\n declaration,\r\n classPrototype,\r\n decoratorFlags\r\n );\r\n if (isGetter) {\r\n (propertyElement).getterPrototype = instancePrototype;\r\n } else {\r\n (propertyElement).setterPrototype = instancePrototype;\r\n }\r\n classPrototype.instanceMembers.set(baseName, propertyElement);\r\n this.elementsLookup.set(internalPropertyName, propertyElement);\r\n if (classPrototype.is(CommonFlags.MODULE_EXPORT)) {\r\n propertyElement.set(CommonFlags.MODULE_EXPORT);\r\n instancePrototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n }\r\n\r\n private initializeEnum(\r\n declaration: EnumDeclaration,\r\n namespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n var simpleName = declaration.name.text;\r\n var element = new Enum(this, simpleName, internalName, declaration);\r\n element.parent = namespace;\r\n this.elementsLookup.set(internalName, element);\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, element);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && element.is(CommonFlags.EXPORT)) {\r\n element.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (element.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, element);\r\n this.currentFilespace.members.set(simpleName, element);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n element.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n\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 this.checkGlobal(element, declaration);\r\n }\r\n\r\n private initializeEnumValue(\r\n declaration: EnumValueDeclaration,\r\n enm: Enum\r\n ): void {\r\n var name = declaration.name.text;\r\n var internalName = declaration.fileLevelInternalName;\r\n if (enm.members) {\r\n if (enm.members.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n enm.members = new Map();\r\n }\r\n var value = new EnumValue(enm, this, name, internalName, declaration);\r\n enm.members.set(name, value);\r\n if (enm.is(CommonFlags.MODULE_EXPORT)) {\r\n value.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n\r\n private initializeExports(\r\n statement: ExportStatement,\r\n queuedExports: Map\r\n ): void {\r\n var members = statement.members;\r\n if (members) { // named\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n this.initializeExport(members[i], statement.internalPath, queuedExports);\r\n }\r\n } else { // TODO: filespace\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.range\r\n );\r\n }\r\n }\r\n\r\n private setExportAndCheckLibrary(\r\n internalName: string,\r\n element: Element,\r\n externalIdentifier: IdentifierExpression\r\n ): void {\r\n // add to file-level exports\r\n this.fileLevelExports.set(internalName, element);\r\n\r\n // add to filespace\r\n var internalPath = externalIdentifier.range.source.internalPath;\r\n var prefix = FILESPACE_PREFIX + internalPath;\r\n var filespace = this.elementsLookup.get(prefix);\r\n if (!filespace) filespace = assert(this.elementsLookup.get(prefix + PATH_DELIMITER + \"index\"));\r\n assert(filespace.kind == ElementKind.FILESPACE);\r\n var simpleName = externalIdentifier.text;\r\n (filespace).members.set(simpleName, element);\r\n\r\n // add global alias if a top-level export of a library file\r\n var source = externalIdentifier.range.source;\r\n if (source.isLibrary) {\r\n if (this.elementsLookup.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n externalIdentifier.range, simpleName\r\n );\r\n } else {\r\n element.internalName = simpleName;\r\n this.elementsLookup.set(simpleName, element);\r\n }\r\n\r\n // add module level export if a top-level export of an entry file\r\n } else if (source.isEntry) {\r\n this.moduleLevelExports.set(externalIdentifier.text, {\r\n element,\r\n identifier: externalIdentifier\r\n });\r\n }\r\n }\r\n\r\n private initializeExport(\r\n member: ExportMember,\r\n internalPath: string | null,\r\n queuedExports: Map\r\n ): void {\r\n var externalName = member.range.source.internalPath + PATH_DELIMITER + member.externalName.text;\r\n if (this.fileLevelExports.has(externalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.externalName.range, externalName\r\n );\r\n return;\r\n }\r\n var referencedName: string;\r\n var referencedElement: Element | null;\r\n var queuedExport: QueuedExport | null;\r\n\r\n // export local element\r\n if (internalPath == null) {\r\n referencedName = member.range.source.internalPath + PATH_DELIMITER + member.name.text;\r\n\r\n // resolve right away if the element exists\r\n if (this.elementsLookup.has(referencedName)) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n this.elementsLookup.get(referencedName),\r\n member.externalName\r\n );\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n if (queuedExports.has(externalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.externalName.range, externalName\r\n );\r\n return;\r\n }\r\n queuedExport = new QueuedExport();\r\n queuedExport.isReExport = false;\r\n queuedExport.externalName = referencedName; // -> here: local name\r\n queuedExport.member = member;\r\n queuedExports.set(externalName, queuedExport);\r\n\r\n // export external element\r\n } else {\r\n referencedName = internalPath + PATH_DELIMITER + member.name.text;\r\n\r\n // resolve right away if the export exists\r\n referencedElement = this.elementsLookup.get(referencedName);\r\n if (referencedElement) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n referencedElement,\r\n member.externalName\r\n );\r\n return;\r\n }\r\n\r\n // walk already known queued exports\r\n let seen = new Set();\r\n while (queuedExport = queuedExports.get(referencedName)) {\r\n if (queuedExport.isReExport) {\r\n referencedElement = this.fileLevelExports.get(queuedExport.externalName);\r\n if (referencedElement) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n referencedElement,\r\n member.externalName\r\n );\r\n return;\r\n }\r\n referencedName = queuedExport.externalName;\r\n if (seen.has(queuedExport)) break;\r\n seen.add(queuedExport);\r\n } else {\r\n referencedElement = this.elementsLookup.get(queuedExport.externalName);\r\n if (referencedElement) {\r\n this.setExportAndCheckLibrary(\r\n externalName,\r\n referencedElement,\r\n member.externalName\r\n );\r\n return;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // otherwise queue it\r\n if (queuedExports.has(externalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.externalName.range, externalName\r\n );\r\n return;\r\n }\r\n queuedExport = new QueuedExport();\r\n queuedExport.isReExport = true;\r\n queuedExport.externalName = referencedName; // -> here: external name\r\n queuedExport.member = member;\r\n queuedExports.set(externalName, queuedExport);\r\n }\r\n }\r\n\r\n private initializeFunction(\r\n declaration: FunctionDeclaration,\r\n namespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n var simpleName = declaration.name.text;\r\n var decorators = declaration.decorators;\r\n var prototype = new FunctionPrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n null,\r\n decorators\r\n ? this.checkDecorators(decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.INLINE |\r\n DecoratorFlags.EXTERNAL\r\n )\r\n : DecoratorFlags.NONE\r\n );\r\n prototype.parent = namespace;\r\n this.elementsLookup.set(internalName, prototype);\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, prototype);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && prototype.is(CommonFlags.EXPORT)) {\r\n prototype.parent = namespace;\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (prototype.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, prototype);\r\n this.currentFilespace.members.set(simpleName, prototype);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: prototype,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n\r\n this.checkGlobal(prototype, declaration);\r\n }\r\n\r\n private initializeImports(\r\n statement: ImportStatement,\r\n queuedExports: Map,\r\n queuedImports: QueuedImport[]\r\n ): void {\r\n var declarations = statement.declarations;\r\n if (declarations) {\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n this.initializeImport(\r\n declarations[i],\r\n statement.internalPath,\r\n queuedExports, queuedImports\r\n );\r\n }\r\n } else if (statement.namespaceName) { // import * as simpleName from \"file\"\r\n let simpleName = statement.namespaceName.text;\r\n let internalName = (\r\n statement.range.source.internalPath +\r\n PATH_DELIMITER +\r\n simpleName\r\n );\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n statement.namespaceName.range,\r\n internalName\r\n );\r\n return;\r\n }\r\n\r\n // resolve right away if the exact filespace exists\r\n let filespace = this.elementsLookup.get(statement.internalPath);\r\n if (filespace) {\r\n this.elementsLookup.set(internalName, filespace);\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n let queuedImport = new QueuedImport();\r\n queuedImport.localName = internalName;\r\n let externalName = FILESPACE_PREFIX + statement.internalPath;\r\n queuedImport.externalName = externalName;\r\n queuedImport.externalNameAlt = externalName + PATH_DELIMITER + \"index\";\r\n queuedImport.declaration = null; // filespace\r\n queuedImports.push(queuedImport);\r\n }\r\n }\r\n\r\n private initializeImport(\r\n declaration: ImportDeclaration,\r\n internalPath: string,\r\n queuedNamedExports: Map,\r\n queuedImports: QueuedImport[]\r\n ): void {\r\n var localName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(localName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, localName\r\n );\r\n return;\r\n }\r\n\r\n var externalName = internalPath + PATH_DELIMITER + declaration.externalName.text;\r\n\r\n // resolve right away if the exact export exists\r\n var element: Element | null;\r\n if (element = this.fileLevelExports.get(externalName)) {\r\n this.elementsLookup.set(localName, element);\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n const indexPart = PATH_DELIMITER + \"index\";\r\n var queuedImport = new QueuedImport();\r\n queuedImport.localName = localName;\r\n if (internalPath.endsWith(indexPart)) {\r\n queuedImport.externalName = externalName; // try exact first\r\n queuedImport.externalNameAlt = (\r\n internalPath.substring(0, internalPath.length - indexPart.length + 1) +\r\n declaration.externalName.text\r\n );\r\n } else {\r\n queuedImport.externalName = externalName; // try exact first\r\n queuedImport.externalNameAlt = (\r\n internalPath +\r\n indexPart +\r\n PATH_DELIMITER +\r\n declaration.externalName.text\r\n );\r\n }\r\n queuedImport.declaration = declaration; // named\r\n queuedImports.push(queuedImport);\r\n }\r\n\r\n private initializeInterface(declaration: InterfaceDeclaration, namespace: Element | null = null): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n\r\n var decorators = declaration.decorators;\r\n var simpleName = declaration.name.text;\r\n var prototype = new InterfacePrototype(\r\n this,\r\n simpleName,\r\n internalName,\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators, DecoratorFlags.GLOBAL)\r\n : DecoratorFlags.NONE\r\n );\r\n prototype.parent = namespace;\r\n this.elementsLookup.set(internalName, prototype);\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(prototype.internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(prototype.internalName, prototype);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && prototype.is(CommonFlags.EXPORT)) {\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (prototype.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n this.fileLevelExports.set(internalName, prototype);\r\n this.currentFilespace.members.set(simpleName, prototype);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n prototype.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: prototype,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n\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\r\n case NodeKind.FIELDDECLARATION: {\r\n this.initializeField(memberDeclaration, prototype);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeAccessor(memberDeclaration, prototype);\r\n } else {\r\n this.initializeMethod(memberDeclaration, prototype);\r\n }\r\n break;\r\n }\r\n default: {\r\n throw new Error(\"interface member expected\");\r\n }\r\n }\r\n }\r\n\r\n this.checkGlobal(prototype, declaration);\r\n }\r\n\r\n private initializeNamespace(\r\n declaration: NamespaceDeclaration,\r\n queuedExtends: ClassPrototype[],\r\n queuedImplements: ClassPrototype[],\r\n parentNamespace: Element | null = null\r\n ): void {\r\n var internalName = declaration.fileLevelInternalName;\r\n var simpleName = declaration.name.text;\r\n var namespace = this.elementsLookup.get(internalName);\r\n if (!namespace) {\r\n namespace = new Namespace(this, simpleName, internalName, declaration);\r\n namespace.parent = parentNamespace;\r\n this.elementsLookup.set(internalName, namespace);\r\n this.checkGlobal(namespace, declaration);\r\n }\r\n\r\n if (parentNamespace) {\r\n if (parentNamespace.members) {\r\n if (parentNamespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n parentNamespace.members = new Map();\r\n }\r\n parentNamespace.members.set(simpleName, namespace);\r\n if (parentNamespace.is(CommonFlags.MODULE_EXPORT) && namespace.is(CommonFlags.EXPORT)) {\r\n namespace.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (namespace.is(CommonFlags.EXPORT)) { // no parent namespace\r\n let existingExport = this.fileLevelExports.get(internalName);\r\n if (existingExport) {\r\n if (!existingExport.is(CommonFlags.EXPORT)) {\r\n this.error(\r\n DiagnosticCode.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,\r\n declaration.name.range, namespace.internalName\r\n ); // recoverable\r\n }\r\n namespace = existingExport; // join\r\n } else {\r\n this.fileLevelExports.set(internalName, namespace);\r\n }\r\n this.currentFilespace.members.set(simpleName, namespace);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n if (existingExport.element !== namespace) { // not merged\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n return;\r\n }\r\n } else {\r\n this.moduleLevelExports.set(simpleName, {\r\n element: namespace,\r\n identifier: declaration.name\r\n });\r\n }\r\n namespace.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n }\r\n\r\n var members = declaration.members;\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n switch (members[i].kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n this.initializeClass(members[i], queuedExtends, queuedImplements, namespace);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(members[i], namespace);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(members[i], namespace);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(members[i], namespace);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(members[i], queuedExtends, queuedImplements, namespace);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n // this.initializeTypeAlias(members[i], namespace);\r\n // TODO: what about namespaced types?\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n members[i].range\r\n );\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(members[i], namespace);\r\n break;\r\n }\r\n default: {\r\n throw new Error(\"namespace member expected\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n private initializeTypeAlias(declaration: TypeDeclaration, namespace: Element | null = null): void {\r\n // type aliases are program globals\r\n // TODO: what about namespaced types?\r\n var name = declaration.name.text;\r\n if (this.typesLookup.has(name) || this.typeAliases.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, name\r\n );\r\n return;\r\n }\r\n var alias = new TypeAlias();\r\n alias.typeParameters = declaration.typeParameters;\r\n alias.type = declaration.type;\r\n this.typeAliases.set(name, alias);\r\n }\r\n\r\n private initializeVariables(statement: VariableStatement, namespace: Element | null = null): 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 decorators = declaration.decorators;\r\n let internalName = declaration.fileLevelInternalName;\r\n if (this.elementsLookup.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n continue;\r\n }\r\n let simpleName = declaration.name.text;\r\n let global = new Global(\r\n this,\r\n simpleName,\r\n internalName,\r\n Type.void, // resolved later on\r\n declaration,\r\n decorators\r\n ? this.checkDecorators(decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.INLINE |\r\n DecoratorFlags.EXTERNAL\r\n )\r\n : DecoratorFlags.NONE\r\n );\r\n global.parent = namespace;\r\n this.elementsLookup.set(internalName, global);\r\n\r\n if (global.hasDecorator(DecoratorFlags.INLINE) && !global.is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n assert(findDecorator(DecoratorKind.INLINE, decorators)).range, \"inline\"\r\n );\r\n }\r\n\r\n if (namespace) {\r\n if (namespace.members) {\r\n if (namespace.members.has(simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n continue;\r\n }\r\n } else {\r\n namespace.members = new Map();\r\n }\r\n namespace.members.set(simpleName, global);\r\n if (namespace.is(CommonFlags.MODULE_EXPORT) && global.is(CommonFlags.EXPORT)) {\r\n global.set(CommonFlags.MODULE_EXPORT);\r\n }\r\n } else if (global.is(CommonFlags.EXPORT)) { // no namespace\r\n if (this.fileLevelExports.has(internalName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, internalName\r\n );\r\n } else {\r\n this.fileLevelExports.set(internalName, global);\r\n }\r\n this.currentFilespace.members.set(simpleName, global);\r\n if (declaration.range.source.isEntry) {\r\n if (this.moduleLevelExports.has(simpleName)) {\r\n let existingExport = this.moduleLevelExports.get(simpleName);\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, existingExport.element.internalName\r\n );\r\n continue;\r\n }\r\n global.set(CommonFlags.MODULE_EXPORT);\r\n this.moduleLevelExports.set(simpleName, {\r\n element: global,\r\n identifier: declaration.name\r\n });\r\n }\r\n }\r\n this.checkGlobal(global, declaration);\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 Property}. */\r\n PROPERTY,\r\n /** A {@link Namespace}. */\r\n NAMESPACE,\r\n /** A {@link Filespace}. */\r\n FILESPACE,\r\n}\r\n\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}\r\n\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 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 /** Specific element kind. */\r\n kind: ElementKind;\r\n /** Containing {@link Program}. */\r\n program: Program;\r\n /** Simple name. */\r\n simpleName: string;\r\n /** Internal name referring to this element. */\r\n internalName: string;\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 /** Namespaced member elements. */\r\n members: Map | null = null;\r\n /** Parent element, if applicable. */\r\n parent: Element | null = null;\r\n\r\n /** Constructs a new element, linking it to its containing {@link Program}. */\r\n protected constructor(program: Program, simpleName: string, internalName: string) {\r\n this.program = program;\r\n this.simpleName = simpleName;\r\n this.internalName = internalName;\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\r\n/** A filespace representing the implicit top-level namespace of a source. */\r\nexport class Filespace extends Element {\r\n\r\n kind = ElementKind.FILESPACE;\r\n\r\n /** File members (externally visible only). */\r\n members: Map; // more specific\r\n\r\n /** Constructs a new filespace. */\r\n constructor(\r\n program: Program,\r\n source: Source\r\n ) {\r\n super(program, source.internalPath, FILESPACE_PREFIX + source.internalPath);\r\n this.members = new Map();\r\n }\r\n}\r\n\r\n/** A namespace that differs from a filespace in being user-declared with a name. */\r\nexport class Namespace extends Element {\r\n\r\n // All elements have namespace semantics. This is an explicitly declared one.\r\n kind = ElementKind.NAMESPACE;\r\n\r\n /** Declaration reference. */\r\n declaration: NamespaceDeclaration; // more specific\r\n\r\n /** Constructs a new namespace. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: NamespaceDeclaration\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n }\r\n}\r\n\r\n/** An enum. */\r\nexport class Enum extends Element {\r\n\r\n kind = ElementKind.ENUM;\r\n\r\n /** Declaration reference. */\r\n declaration: EnumDeclaration;\r\n\r\n /** Constructs a new enum. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: EnumDeclaration\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n }\r\n}\r\n\r\n/** An enum value. */\r\nexport class EnumValue extends Element {\r\n\r\n kind = ElementKind.ENUMVALUE;\r\n\r\n /** Declaration reference. */\r\n declaration: EnumValueDeclaration;\r\n /** Constant value, if applicable. */\r\n constantValue: i32 = 0;\r\n\r\n constructor(\r\n enm: Enum,\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: EnumValueDeclaration\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.parent = enm;\r\n this.declaration = declaration;\r\n }\r\n}\r\n\r\nexport const enum ConstantValueKind {\r\n NONE,\r\n INTEGER,\r\n FLOAT\r\n}\r\n\r\nexport class VariableLikeElement extends Element {\r\n\r\n // kind varies\r\n\r\n /** Declaration reference. */\r\n declaration: VariableLikeDeclarationStatement | null;\r\n /** Variable type. Is {@link Type.void} for type-inferred {@link Global}s before compilation. */\r\n type: Type;\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 protected constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n type: Type,\r\n declaration: VariableLikeDeclarationStatement | null\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.type = type;\r\n this.declaration = declaration;\r\n }\r\n\r\n withConstantIntegerValue(value: I64): this {\r\n this.constantValueKind = ConstantValueKind.INTEGER;\r\n this.constantIntegerValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED);\r\n return this;\r\n }\r\n\r\n withConstantFloatValue(value: f64): this {\r\n this.constantValueKind = ConstantValueKind.FLOAT;\r\n this.constantFloatValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED);\r\n return this;\r\n }\r\n}\r\n\r\n/** A global variable. */\r\nexport class Global extends VariableLikeElement {\r\n\r\n kind = ElementKind.GLOBAL;\r\n\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n type: Type,\r\n declaration: VariableLikeDeclarationStatement | null,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(program, simpleName, internalName, type, declaration);\r\n this.flags = declaration ? declaration.flags : CommonFlags.NONE;\r\n this.decoratorFlags = decoratorFlags;\r\n this.type = type; // resolved later if `void`\r\n }\r\n}\r\n\r\n/** A function parameter. */\r\nexport class Parameter {\r\n\r\n // not an Element on its own\r\n\r\n /** Parameter name. */\r\n name: string;\r\n /** Parameter type. */\r\n type: Type;\r\n /** Parameter initializer. */\r\n initializer: Expression | null;\r\n\r\n /** Constructs a new function parameter. */\r\n constructor(name: string, type: Type, initializer: Expression | null = null) {\r\n this.name = name;\r\n this.type = type;\r\n this.initializer = initializer;\r\n }\r\n}\r\n\r\n/** A function local. */\r\nexport class Local extends VariableLikeElement {\r\n\r\n kind = ElementKind.LOCAL;\r\n\r\n /** Local index. */\r\n index: i32;\r\n /** Respective scoped global, if any. */\r\n scopedGlobal: Global | null = null;\r\n\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n index: i32,\r\n type: Type,\r\n declaration: VariableLikeDeclarationStatement | null = null\r\n ) {\r\n super(program, simpleName, simpleName, type, declaration);\r\n this.index = index;\r\n }\r\n}\r\n\r\n/** A yet unresolved function prototype. */\r\nexport class FunctionPrototype extends Element {\r\n\r\n kind = ElementKind.FUNCTION_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: FunctionDeclaration;\r\n /** If an instance method, the class prototype reference. */\r\n classPrototype: ClassPrototype | null;\r\n /** Resolved instances by class type arguments and function type arguments. */\r\n instances: Map> = new Map();\r\n /** Class type arguments, if a partially resolved method of a generic class. Not set otherwise. */\r\n classTypeArguments: Type[] | null = null;\r\n /** Operator kind, if an overload. */\r\n operatorKind: OperatorKind = OperatorKind.INVALID;\r\n\r\n /** Constructs a new function prototype. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: FunctionDeclaration,\r\n classPrototype: ClassPrototype | null = null,\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n this.classPrototype = classPrototype;\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Applies class type arguments to the context of a partially resolved instance method. */\r\n applyClassTypeArguments(contextualTypeArguments: Map): void {\r\n var classTypeArguments = assert(this.classTypeArguments); // set only if partial\r\n var classDeclaration = assert(this.classPrototype).declaration;\r\n var classTypeParameters = classDeclaration.typeParameters;\r\n var numClassTypeParameters = classTypeParameters.length;\r\n assert(numClassTypeParameters == classTypeArguments.length);\r\n for (let i = 0; i < numClassTypeParameters; ++i) {\r\n contextualTypeArguments.set(\r\n classTypeParameters[i].name.text,\r\n classTypeArguments[i]\r\n );\r\n }\r\n }\r\n\r\n toString(): string { return this.simpleName; }\r\n}\r\n\r\n/** A resolved function. */\r\nexport class Function extends Element {\r\n\r\n kind = ElementKind.FUNCTION;\r\n\r\n /** Prototype reference. */\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 /** Current break context label. */\r\n breakContext: string | null = null;\r\n /** Contextual type arguments. */\r\n contextualTypeArguments: Map | null;\r\n /** Current 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 /** The outer scope, if a function expression. */\r\n outerScope: Flow | null = null;\r\n\r\n private nextBreakId: i32 = 0;\r\n private breakStack: i32[] | null = null;\r\n nextInlineId: i32 = 0;\r\n\r\n /** Constructs a new concrete function. */\r\n constructor(\r\n prototype: FunctionPrototype,\r\n internalName: string,\r\n signature: Signature,\r\n parent: Element | null = null,\r\n contextualTypeArguments: Map | null = null\r\n ) {\r\n super(prototype.program, prototype.simpleName, internalName);\r\n this.prototype = prototype;\r\n this.signature = signature;\r\n this.parent = parent;\r\n this.flags = prototype.flags;\r\n this.decoratorFlags = prototype.decoratorFlags;\r\n this.contextualTypeArguments = contextualTypeArguments;\r\n if (prototype.internalName != \"NATIVE_CODE\") { // e.g. generated constructor without a real prototype\r\n if (!(prototype.is(CommonFlags.AMBIENT))) {\r\n let localIndex = 0;\r\n if (parent && parent.kind == ElementKind.CLASS) {\r\n assert(this.is(CommonFlags.INSTANCE));\r\n let local = new Local(\r\n prototype.program,\r\n \"this\",\r\n localIndex++,\r\n assert(signature.thisType)\r\n );\r\n this.localsByName.set(\"this\", local);\r\n this.localsByIndex[local.index] = local;\r\n let inheritedTypeArguments = (parent).contextualTypeArguments;\r\n if (inheritedTypeArguments) {\r\n if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (let [inheritedName, inheritedType] of inheritedTypeArguments) {\r\n if (!this.contextualTypeArguments.has(inheritedName)) {\r\n this.contextualTypeArguments.set(inheritedName, inheritedType);\r\n }\r\n }\r\n }\r\n } else {\r\n assert(!this.is(CommonFlags.INSTANCE)); // internal error\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 prototype.program,\r\n parameterName,\r\n localIndex++,\r\n parameterType\r\n // FIXME: declaration?\r\n );\r\n this.localsByName.set(parameterName, local);\r\n this.localsByIndex[local.index] = local;\r\n }\r\n }\r\n }\r\n this.flow = Flow.create(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 local = new Local(\r\n this.prototype.program,\r\n name\r\n ? name\r\n : \"var$\" + localIndex.toString(10),\r\n localIndex,\r\n type,\r\n declaration\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 private tempI32s: Local[] | null = null;\r\n private tempI64s: Local[] | null = null;\r\n private tempF32s: Local[] | null = null;\r\n private tempF64s: Local[] | null = null;\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 temps: Local[] | null;\r\n switch (type.toNativeType()) {\r\n case NativeType.I32: {\r\n temps = this.tempI32s;\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = this.tempI64s;\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = this.tempF32s;\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = this.tempF64s;\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 && temps.length) {\r\n local = temps.pop();\r\n local.type = type;\r\n local.flags = CommonFlags.NONE;\r\n } else {\r\n local = this.addLocal(type);\r\n }\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n this.flow.setLocalWrapped(local.index, wrapped);\r\n }\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 temps: Local[];\r\n assert(local.type != null); // internal error\r\n switch ((local.type).toNativeType()) {\r\n case NativeType.I32: {\r\n temps = this.tempI32s || (this.tempI32s = []);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = this.tempI64s || (this.tempI64s = []);\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = this.tempF32s || (this.tempF32s = []);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = this.tempF64s || (this.tempF64s = []);\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 temps: Local[];\r\n switch (type.toNativeType()) {\r\n case NativeType.I32: {\r\n temps = this.tempI32s || (this.tempI32s = []);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = this.tempI64s || (this.tempI64s = []);\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = this.tempF32s || (this.tempF32s = []);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = this.tempF64s || (this.tempF64s = []);\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 = this.addLocal(type);\r\n temps.push(local);\r\n }\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n this.flow.setLocalWrapped(local.index, wrapped);\r\n }\r\n return local;\r\n }\r\n\r\n /** Enters a(nother) break context. */\r\n enterBreakContext(): string {\r\n var id = this.nextBreakId++;\r\n if (!this.breakStack) this.breakStack = [ id ];\r\n else this.breakStack.push(id);\r\n return this.breakContext = id.toString(10);\r\n }\r\n\r\n /** Leaves the current break context. */\r\n leaveBreakContext(): void {\r\n assert(this.breakStack != null);\r\n var length = (this.breakStack).length;\r\n assert(length > 0);\r\n (this.breakStack).pop();\r\n if (length > 1) {\r\n this.breakContext = (this.breakStack)[length - 2].toString(10);\r\n } else {\r\n this.breakContext = null;\r\n this.breakStack = null;\r\n }\r\n }\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.breakContext = 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 /** Returns the TypeScript representation of this function. */\r\n toString(): string { return this.prototype.simpleName; }\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 kind = ElementKind.FUNCTION_TARGET;\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(program: Program, signature: Signature) {\r\n super(program, \"\", \"\");\r\n var simpleName = signature.toSignatureString();\r\n this.simpleName = simpleName;\r\n this.internalName = simpleName;\r\n this.signature = signature;\r\n this.type = Type.u32.asFunction(signature);\r\n }\r\n}\r\n\r\n/** A yet unresolved instance field prototype. */\r\nexport class FieldPrototype extends Element {\r\n\r\n kind = ElementKind.FIELD_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: FieldDeclaration;\r\n /** Parent class prototype. */\r\n classPrototype: ClassPrototype;\r\n\r\n /** Constructs a new field prototype. */\r\n constructor(\r\n classPrototype: ClassPrototype,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: FieldDeclaration\r\n ) {\r\n super(classPrototype.program, simpleName, internalName);\r\n this.classPrototype = classPrototype;\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n }\r\n}\r\n\r\n/** A resolved instance field. */\r\nexport class Field extends VariableLikeElement {\r\n\r\n kind = ElementKind.FIELD;\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 prototype: FieldPrototype,\r\n internalName: string,\r\n type: Type,\r\n declaration: FieldDeclaration,\r\n parent: Class\r\n ) {\r\n super(prototype.program, prototype.simpleName, internalName, type, declaration);\r\n this.prototype = prototype;\r\n this.flags = prototype.flags;\r\n this.type = type;\r\n this.parent = parent;\r\n }\r\n}\r\n\r\n/** A property comprised of a getter and a setter function. */\r\nexport class Property extends Element {\r\n\r\n kind = ElementKind.PROPERTY;\r\n\r\n /** Parent class prototype. */\r\n parent: ClassPrototype;\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 program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n parent: ClassPrototype\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.parent = parent;\r\n }\r\n}\r\n\r\n/** A yet unresolved class prototype. */\r\nexport class ClassPrototype extends Element {\r\n\r\n kind = ElementKind.CLASS_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: ClassDeclaration;\r\n /** Resolved instances. */\r\n instances: Map = new Map();\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\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: ClassDeclaration,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(program, simpleName, internalName);\r\n this.declaration = declaration;\r\n this.flags = declaration.flags;\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\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 toString(): string {\r\n return this.simpleName;\r\n }\r\n}\r\n\r\n/** A resolved class. */\r\nexport class Class extends Element {\r\n\r\n kind = ElementKind.CLASS;\r\n\r\n /** Prototype reference. */\r\n prototype: ClassPrototype;\r\n /** Resolved type arguments. */\r\n typeArguments: Type[] | null;\r\n /** Resolved class type. */\r\n type: Type;\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 prototype: ClassPrototype,\r\n simpleName: string,\r\n internalName: string,\r\n typeArguments: Type[] | null = null,\r\n base: Class | null = null\r\n ) {\r\n super(prototype.program, simpleName, internalName);\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.type = prototype.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 if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (let [baseName, baseType] of inheritedTypeArguments) {\r\n this.contextualTypeArguments.set(baseName, baseType);\r\n }\r\n }\r\n }\r\n\r\n // apply instance-specific contextual type arguments\r\n var declaration = this.prototype.declaration;\r\n var i: i32, k: i32;\r\n if (declaration) { // irrelevant for built-ins\r\n let typeParameters = declaration.typeParameters;\r\n if (typeArguments) {\r\n if ((k = typeArguments.length) != typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n if (k) {\r\n if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (i = 0; i < k; ++i) {\r\n this.contextualTypeArguments.set(typeParameters[i].name.text, typeArguments[i]);\r\n }\r\n }\r\n } else if (typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n }\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 lookupField(name: string, shouldReadonly: boolean = false): Element | null {\r\n if (this.members == null) return null;\r\n var member = this.members.get(name);\r\n if (\r\n member == null || member.kind != ElementKind.FIELD ||\r\n (shouldReadonly && !member.is(CommonFlags.READONLY))\r\n ) return null;\r\n return member;\r\n }\r\n\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 toString(): string {\r\n return this.simpleName;\r\n }\r\n}\r\n\r\n/** A yet unresolved interface. */\r\nexport class InterfacePrototype extends ClassPrototype {\r\n\r\n kind = ElementKind.INTERFACE_PROTOTYPE;\r\n\r\n /** Declaration reference. */\r\n declaration: InterfaceDeclaration; // more specific\r\n\r\n /** Constructs a new interface prototype. */\r\n constructor(\r\n program: Program,\r\n simpleName: string,\r\n internalName: string,\r\n declaration: InterfaceDeclaration,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(program, simpleName, internalName, declaration, decoratorFlags);\r\n }\r\n}\r\n\r\n/** A resolved interface. */\r\nexport class Interface extends Class {\r\n\r\n kind = ElementKind.INTERFACE;\r\n\r\n /** Prototype reference. */\r\n prototype: InterfacePrototype; // more specific\r\n /** Base interface, if applcable. */\r\n base: Interface | null; // more specific\r\n\r\n /** Constructs a new interface. */\r\n constructor(\r\n prototype: InterfacePrototype,\r\n simpleName: string,\r\n internalName: string,\r\n typeArguments: Type[] = [],\r\n base: Interface | null = null\r\n ) {\r\n super(prototype, simpleName, internalName, typeArguments, base);\r\n }\r\n}\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 branch always returns. */\r\n RETURNS = 1 << 0,\r\n /** This branch always returns a wrapped value. */\r\n RETURNS_WRAPPED = 1 << 1,\r\n /** This branch always throws. */\r\n THROWS = 1 << 2,\r\n /** This branch always breaks. */\r\n BREAKS = 1 << 3,\r\n /** This branch always continues. */\r\n CONTINUES = 1 << 4,\r\n /** This branch always allocates. Constructors only. */\r\n ALLOCATES = 1 << 5,\r\n /** This branch always calls super. Constructors only. */\r\n CALLS_SUPER = 1 << 6,\r\n\r\n // conditional\r\n\r\n /** This branch conditionally returns in a child branch. */\r\n CONDITIONALLY_RETURNS = 1 << 7,\r\n /** This branch conditionally throws in a child branch. */\r\n CONDITIONALLY_THROWS = 1 << 8,\r\n /** This branch conditionally breaks in a child branch. */\r\n CONDITIONALLY_BREAKS = 1 << 9,\r\n /** This branch conditionally continues in a child branch. */\r\n CONDITIONALLY_CONTINUES = 1 << 10,\r\n /** This branch conditionally allocates in a child branch. Constructors only. */\r\n CONDITIONALLY_ALLOCATES = 1 << 11,\r\n\r\n // special\r\n\r\n /** This branch is part of inlining a function. */\r\n INLINE_CONTEXT = 1 << 12,\r\n /** This branch explicitly requests no 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 currentFunction: 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 label we break to when encountering a return statement, when inlining. */\r\n returnLabel: 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\r\n /** Creates the parent flow of the specified function. */\r\n static create(currentFunction: Function): Flow {\r\n var parentFlow = new Flow();\r\n parentFlow.parent = null;\r\n parentFlow.flags = FlowFlags.NONE;\r\n parentFlow.currentFunction = currentFunction;\r\n parentFlow.continueLabel = null;\r\n parentFlow.breakLabel = null;\r\n parentFlow.returnLabel = null;\r\n parentFlow.returnType = currentFunction.signature.returnType;\r\n parentFlow.contextualTypeArguments = currentFunction.contextualTypeArguments;\r\n parentFlow.wrappedLocals = i64_new(0);\r\n parentFlow.wrappedLocalsExt = null;\r\n return parentFlow;\r\n }\r\n\r\n private constructor() { }\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.currentFunction = this.currentFunction;\r\n branch.continueLabel = this.continueLabel;\r\n branch.breakLabel = this.breakLabel;\r\n branch.returnLabel = this.returnLabel;\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 return branch;\r\n }\r\n\r\n /** Frees this flow's scoped variables. */\r\n free(): Flow {\r\n var parent = assert(this.parent);\r\n if (this.scopedLocals) { // free block-scoped locals\r\n for (let scopedLocal of this.scopedLocals.values()) {\r\n if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias\r\n this.currentFunction.freeTempLocal(scopedLocal);\r\n }\r\n }\r\n this.scopedLocals = null;\r\n }\r\n return parent;\r\n }\r\n\r\n /** Adds a new scoped local of the specified name. */\r\n addScopedLocal(type: Type, name: string, wrapped: bool, declaration?: VariableDeclaration): Local {\r\n var scopedLocal = this.currentFunction.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 (declaration) {\r\n this.currentFunction.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range\r\n );\r\n } else assert(false);\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. */\r\n addScopedLocalAlias(index: i32, type: Type, name: string): 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 let declaration = existingLocal.declaration;\r\n if (declaration) {\r\n this.currentFunction.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range\r\n );\r\n } else assert(false);\r\n return existingLocal;\r\n }\r\n }\r\n assert(index < this.currentFunction.localsByIndex.length);\r\n var scopedAlias = new Local( // not SCOPED as an indicator that it isn't automatically free'd\r\n this.currentFunction.program,\r\n name,\r\n index,\r\n type,\r\n null\r\n );\r\n this.scopedLocals.set(name, scopedAlias);\r\n return scopedAlias;\r\n }\r\n\r\n /** Gets the local of the specified name in the current scope. */\r\n getScopedLocal(name: string): Local | null {\r\n var local: Local | null;\r\n var current: Flow | null = this;\r\n do {\r\n if (current.scopedLocals && (local = current.scopedLocals.get(name))) {\r\n return local;\r\n }\r\n } while (current = current.parent);\r\n return this.currentFunction.localsByName.get(name);\r\n }\r\n\r\n /** Tests if the local with the specified index is considered wrapped. */\r\n isLocalWrapped(index: i32): bool {\r\n var map: I64;\r\n var ext: I64[] | null;\r\n if (index < 64) {\r\n if (index < 0) return true; // inlined constant\r\n map = this.wrappedLocals;\r\n } else if (ext = this.wrappedLocalsExt) {\r\n let i = ((index - 64) / 64) | 0;\r\n if (i >= ext.length) return false;\r\n map = ext[i];\r\n index -= (i + 1) * 64;\r\n } else {\r\n return false;\r\n }\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 if the local with the specified index is considered wrapped. */\r\n setLocalWrapped(index: i32, wrapped: bool): void {\r\n var map: I64;\r\n var off: i32 = -1;\r\n if (index < 64) {\r\n if (index < 0) return; // inlined constant\r\n map = this.wrappedLocals;\r\n } else {\r\n let ext = this.wrappedLocalsExt;\r\n off = ((index - 64) / 64) | 0;\r\n if (!ext) {\r\n this.wrappedLocalsExt = ext = new Array(off + 1);\r\n ext.length = 0;\r\n }\r\n while (ext.length <= off) ext.push(i64_new(0));\r\n map = ext[off];\r\n index -= (off + 1) * 64;\r\n }\r\n map = wrapped\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 if (off >= 0) (this.wrappedLocalsExt)[off] = map;\r\n else this.wrappedLocals = map;\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 currentFunction = this.currentFunction;\r\n let local = currentFunction.localsByIndex[getGetLocalIndex(expr)];\r\n return !currentFunction.flow.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.currentFunction.program.elementsLookup.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 // actually, brs with a value that'd be handled here is not emitted atm\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.currentFunction.program;\r\n let instance = assert(program.instancesLookup.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 /** Finalizes this flow. Must be the topmost parent flow of the function. */\r\n finalize(): void {\r\n assert(this.parent == null); // must be the topmost parent flow\r\n this.continueLabel = null;\r\n this.breakLabel = null;\r\n this.returnLabel = null;\r\n this.contextualTypeArguments = null;\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 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 const enum NativeType {\r\n None = 0, // _BinaryenTypeNone(),\r\n I32 = 1, // _BinaryenTypeInt32(),\r\n I64 = 2, // _BinaryenTypeInt64(),\r\n F32 = 3, // _BinaryenTypeFloat32(),\r\n F64 = 4, // _BinaryenTypeFloat64(),\r\n Unreachable = 5, // _BinaryenTypeUnreachable(),\r\n Auto = -1 // _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 AtomicWake = _BinaryenAtomicWakeId()\r\n // SIMDExtract = _BinaryenSIMDExtractId(),\r\n // SIMDReplace = _BinaryenSIMDReplaceId(),\r\n // SIMDShuffle = _BinaryenSIMDShuffleId(),\r\n // SIMDBitselect = _BinaryenSIMDBitselectId(),\r\n // SIMDShift = _BinaryenSIMDShiftId()\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\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\r\nexport enum HostOp {\r\n CurrentMemory = _BinaryenCurrentMemory(),\r\n GrowMemory = _BinaryenGrowMemory(),\r\n\r\n // see: https://github.com/WebAssembly/bulk-memory-operations\r\n // MoveMemory\r\n // SetMemory\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\n// export enum SIMDOp {\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// 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 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 cachedByValue: usize;\r\n\r\n static create(): Module {\r\n var module = new Module();\r\n module.ref = _BinaryenModuleCreate();\r\n module.cachedByValue = memory.allocate(16);\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.cachedByValue = memory.allocate(3 * 8); // LLVM C-ABI, max used is 3 * usize\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.cachedByValue;\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.cachedByValue;\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.cachedByValue;\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.cachedByValue;\r\n _BinaryenLiteralFloat64(out, value);\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 ): ExpressionRef {\r\n return _BinaryenLoad(this.ref, bytes, signed ? 1 : 0, offset, /* always aligned */ bytes, 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 ): ExpressionRef {\r\n return _BinaryenStore(this.ref, bytes, offset, /* always aligned */ bytes, 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 createAtomicWake(\r\n ptr: ExpressionRef,\r\n wakeCount: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenAtomicWake(this.ref, ptr, wakeCount);\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 // 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 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 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 = allocI32Array(offs);\r\n var cArr3 = allocI32Array(sizs);\r\n try {\r\n _BinaryenSetMemory(this.ref, initial, maximum, cStr, cArr1, cArr2, cArr3, k, shared);\r\n } finally {\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.cachedByValue;\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 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.cachedByValue);\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 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\nvar cachedStrings = new Map();\r\n\r\nfunction allocString(str: string | null): usize {\r\n if (str == null) return 0;\r\n if (cachedStrings.has(str)) return cachedStrings.get(str);\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 cachedStrings.set(str, ptr);\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 switch (_BinaryenExpressionGetType(expr)) {\r\n case NativeType.I32:\r\n case NativeType.I64:\r\n case NativeType.F32:\r\n case NativeType.F64: 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 * 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 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 if (text.charCodeAt(this.pos) == CharCode.AMPERSAND) {\r\n ++this.pos;\r\n return Token.AMPERSAND_AMPERSAND;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.ASTERISK_EQUALS;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.PLUS) {\r\n ++this.pos;\r\n return Token.PLUS_PLUS;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.MINUS) {\r\n ++this.pos;\r\n return Token.MINUS_MINUS;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 if (isDecimalDigit(text.charCodeAt(this.pos))) {\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 text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n if (maxTokenLength > 2 && this.pos < this.end) {\r\n if (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 (text.charCodeAt(this.pos) == 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 if (text.charCodeAt(this.pos) == CharCode.BAR) {\r\n ++this.pos;\r\n return Token.BAR_BAR;\r\n }\r\n if (text.charCodeAt(this.pos) == 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 (c == CharCode.SLASH && !escaped) 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 (text.charCodeAt(this.pos) == CharCode._0 && this.pos + 1 < this.end) {\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 (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.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, 0);\r\n var i64_16 = i64_new(16, 0);\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 * 16 + c - CharCode._0;\r\n value = i64_add(\r\n i64_mul(value, i64_16),\r\n i64_new(c - CharCode._0, 0)\r\n );\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n // value = value * 16 + 10 + c - CharCode.A;\r\n value = i64_add(\r\n i64_mul(value, i64_16),\r\n i64_new(10 + c - CharCode.A, 0)\r\n );\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n // value = value * 16 + 10 + c - CharCode.a;\r\n value = i64_add(\r\n i64_mul(value, i64_16),\r\n i64_new(10 + c - CharCode.a, 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.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, 0);\r\n var i64_10 = i64_new(10, 0);\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, 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, 0);\r\n var i64_8 = i64_new(8, 0);\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 * 8 + c - CharCode._0;\r\n value = i64_add(\r\n i64_mul(value, i64_8),\r\n i64_new(c - CharCode._0, 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, 0);\r\n var i64_2 = i64_new(2, 0);\r\n var i64_1 = i64_new(1, 0);\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 * 2;\r\n value = i64_mul(\r\n value,\r\n i64_2\r\n );\r\n } else if (c == CharCode._1) {\r\n // value = value * 2 + 1;\r\n value = i64_add(\r\n i64_mul(value, i64_2),\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 text.charCodeAt(this.pos) == CharCode.MINUS ||\r\n text.charCodeAt(this.pos) == CharCode.PLUS\r\n ) &&\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 * 16 + c - CharCode._0;\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n value = value * 16 + 10 + c - CharCode.A;\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n value = value * 16 + 10 + c - 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) / 1024 | 0) + 0xD800) as i32,\r\n ( (value32 - 65536) % 1024 + 0xDC00) as i32\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","/**\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 // 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}\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 a target of the specified type. */\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 }\r\n }\r\n return false;\r\n }\r\n\r\n /** Determines the common compatible type of two types, if any. */\r\n static commonCompatible(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 its TypeScript representation. */\r\n toString(kindOnly: bool = false): string {\r\n if (!kindOnly && this.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.classReference;\r\n if (classReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? classReference.toString() + \" | null\"\r\n : classReference.toString();\r\n }\r\n let signatureReference = this.signatureReference;\r\n if (signatureReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? \"(\" + signatureReference.toString(true) + \") | null\"\r\n : signatureReference.toString(true);\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 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.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 }\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.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.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 default: return \"i\";\r\n case TypeKind.I64:\r\n case TypeKind.U64: return \"I\";\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: return this.size == 64 ? \"I\" : \"i\";\r\n case TypeKind.F32: return \"f\";\r\n case TypeKind.F64: return \"F\";\r\n case TypeKind.VOID: return \"v\";\r\n }\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 /** 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(program, this);\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 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 sb.push(returnType.toSignatureString());\r\n return 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(includeThis: bool = false): 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 if (includeThis) {\r\n sb.push(\"this: \");\r\n sb.push(thisType.toString());\r\n index = 1;\r\n }\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","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 * 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} 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 getGetLocalIndex,\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 PATH_DELIMITER,\r\n INNER_DELIMITER,\r\n INSTANCE_DELIMITER,\r\n STATIC_DELIMITER,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX\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 Namespace,\r\n EnumValue,\r\n Property,\r\n VariableLikeElement,\r\n FlowFlags,\r\n ConstantValueKind,\r\n Flow,\r\n OperatorKind,\r\n DecoratorFlags\r\n} from \"./program\";\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 Source,\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 FunctionDeclaration,\r\n ForStatement,\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 VariableDeclaration,\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 FieldDeclaration,\r\n\r\n nodeIsConstantValue,\r\n isLastStatement,\r\n findDecorator\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, compiles everything instead of just reachable code. */\r\n noTreeShaking: bool = false;\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 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}\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 function in compilation. */\r\n currentFunction: Function;\r\n /** Current outer function in compilation, if compiling a function expression. */\r\n currentOuterFunction: Function | null = null;\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 being compiled. */\r\n startFunctionInstance: Function;\r\n /** Start function statements. */\r\n startFunctionBody: 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 start function\r\n var startFunctionInstance = new Function(program.startFunction, \"start\", new Signature([], Type.void));\r\n this.startFunctionInstance = startFunctionInstance;\r\n var startFunctionBody = new Array();\r\n this.startFunctionBody = startFunctionBody;\r\n this.currentFunction = startFunctionInstance;\r\n\r\n // add a mutable heap base dummy\r\n if (options.isWasm64) {\r\n module.addGlobal(\r\n \"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 \"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 sources = program.sources;\r\n for (let i = 0, k = sources.length; i < k; ++i) {\r\n if (sources[i].isEntry) this.compileSource(sources[i]);\r\n }\r\n\r\n // compile the start function if not empty or called by main\r\n if (startFunctionBody.length || program.mainFunction !== null) {\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 (!program.mainFunction) 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(\"HEAP_BASE\");\r\n if (options.isWasm64) {\r\n module.addGlobal(\r\n \"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 \"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 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 Module.UNLIMITED_MEMORY,\r\n this.memorySegments,\r\n options.target,\r\n \"memory\"\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\");\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 [name, moduleExport] of program.moduleLevelExports) {\r\n this.makeModuleExport(name, moduleExport.element);\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 export(s) for the specified element. */\r\n private makeModuleExport(name: string, element: Element, prefix: string = \"\"): void {\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 (element.kind == ElementKind.NAMESPACE) {\r\n for (let member of members.values()) {\r\n if (!member.is(CommonFlags.EXPORT)) continue;\r\n this.makeModuleExport(member.simpleName, 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.simpleName, member, subPrefix);\r\n }\r\n }\r\n }\r\n\r\n switch (element.kind) {\r\n\r\n // export global\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 let declaration = (element).declaration;\r\n if (declaration) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n declaration.name.range\r\n );\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 (!assert(element.parent).is(CommonFlags.CONST) && !this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n let declaration = (element).declaration;\r\n if (declaration) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n declaration.name.range\r\n );\r\n }\r\n } else {\r\n this.module.addGlobalExport(element.internalName, prefix + name);\r\n }\r\n break;\r\n }\r\n\r\n // export function\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\r\n // export getter and setter\r\n case ElementKind.PROPERTY: {\r\n let getter = assert((element).getterPrototype);\r\n this.makeModuleExport(GETTER_PREFIX + name, getter, prefix);\r\n let setter = (element).setterPrototype;\r\n if (setter) this.makeModuleExport(SETTER_PREFIX + name, setter, prefix);\r\n break;\r\n }\r\n\r\n // export a getter and a setter\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 // skip prototype and export instances\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n for (let instances of (element).instances.values()) {\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 for (let instance of (element).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 let ctor = instance.constructorInstance;\r\n if (ctor) this.makeModuleExport(instanceName + INSTANCE_DELIMITER + ctor.simpleName, ctor, prefix);\r\n this.makeModuleExport(instanceName, instance, prefix);\r\n }\r\n break;\r\n }\r\n\r\n // all possible members already handled above\r\n case ElementKind.ENUM:\r\n case ElementKind.CLASS:\r\n case ElementKind.NAMESPACE: break;\r\n\r\n default: assert(false);\r\n }\r\n }\r\n\r\n // sources\r\n\r\n /** Compiles a source by looking it up by path first. */\r\n compileSourceByPath(normalizedPathWithoutExtension: string, reportNode: Node): void {\r\n var source = this.program.lookupSourceByPath(normalizedPathWithoutExtension);\r\n if (source) this.compileSource(source);\r\n else {\r\n this.error(\r\n DiagnosticCode.File_0_not_found,\r\n reportNode.range, normalizedPathWithoutExtension\r\n );\r\n }\r\n }\r\n\r\n /** Compiles a source. */\r\n compileSource(source: Source): void {\r\n if (source.is(CommonFlags.COMPILED)) return;\r\n source.set(CommonFlags.COMPILED);\r\n\r\n // compile top-level statements\r\n var noTreeShaking = this.options.noTreeShaking;\r\n var isEntry = source.isEntry;\r\n var startFunctionInstance = this.startFunctionInstance;\r\n var startFunctionBody = this.startFunctionBody;\r\n var statements = source.statements;\r\n for (let i = 0, k = statements.length; i < k; ++i) {\r\n let statement = statements[i];\r\n switch (statement.kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n if (\r\n (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) &&\r\n !(statement).isGeneric\r\n ) {\r\n this.compileClassDeclaration(statement, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: break;\r\n case NodeKind.ENUMDECLARATION: {\r\n if (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) {\r\n this.compileEnumDeclaration(statement);\r\n }\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n if (\r\n (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) &&\r\n !(statement).isGeneric\r\n ) {\r\n this.compileFunctionDeclaration(statement, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.compileSourceByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n if (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) {\r\n this.compileNamespaceDeclaration(statement);\r\n }\r\n break;\r\n }\r\n case NodeKind.VARIABLE: { // global, always compiled as initializers might have side effects\r\n let variableInit = this.compileVariableStatement(statement);\r\n if (variableInit) startFunctionBody.push(variableInit);\r\n break;\r\n }\r\n case NodeKind.EXPORT: {\r\n if ((statement).normalizedPath != null) {\r\n this.compileSourceByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n }\r\n if (noTreeShaking || isEntry) {\r\n this.compileExportStatement(statement);\r\n }\r\n break;\r\n }\r\n default: { // otherwise a top-level statement that is part of the start function's body\r\n let previousFunction = this.currentFunction;\r\n this.currentFunction = startFunctionInstance;\r\n startFunctionBody.push(this.compileStatement(statement));\r\n this.currentFunction = previousFunction;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // globals\r\n\r\n compileGlobalDeclaration(declaration: VariableDeclaration): Global | null {\r\n // look up the initialized program element\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.GLOBAL);\r\n if (!this.compileGlobal(element)) return null; // reports\r\n return element;\r\n }\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 declaration = global.declaration;\r\n var initExpr: ExpressionRef = 0;\r\n\r\n if (!global.is(CommonFlags.RESOLVED)) {\r\n if (declaration) {\r\n\r\n // resolve now if annotated\r\n if (declaration.type) {\r\n let resolvedType = this.resolver.resolveType(declaration.type); // reports\r\n if (!resolvedType) return false;\r\n if (resolvedType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n declaration.type.range\r\n );\r\n return false;\r\n }\r\n global.type = resolvedType;\r\n global.set(CommonFlags.RESOLVED);\r\n\r\n // infer from initializer if not annotated\r\n } else if (declaration.initializer) { // infer type using void/NONE for literal inference\r\n initExpr = this.compileExpressionRetainType( // reports\r\n declaration.initializer,\r\n Type.void,\r\n WrapMode.WRAP\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.initializer.range, this.currentType.toString(), \"\"\r\n );\r\n return false;\r\n }\r\n global.type = this.currentType;\r\n global.set(CommonFlags.RESOLVED);\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 declaration.name.range.atEnd\r\n );\r\n return false;\r\n }\r\n } else {\r\n assert(false); // must have a declaration if resolved lazily\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 if (declaration) {\r\n mangleImportName(global, declaration);\r\n } else {\r\n mangleImportName_moduleName = \"env\";\r\n mangleImportName_elementName = global.simpleName;\r\n }\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 assert(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 (declaration !== null && declaration.initializer !== null) {\r\n if (!initExpr) {\r\n initExpr = this.compileExpression(\r\n declaration.initializer,\r\n global.type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP\r\n );\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 declaration.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 module.addGlobal(internalName, nativeType, true, global.type.toNativeZero(module));\r\n this.startFunctionBody.push(module.createSetGlobal(internalName, initExpr));\r\n\r\n } else { // 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 compileEnumDeclaration(declaration: EnumDeclaration): Enum | null {\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.ENUM);\r\n if (!this.compileEnum(element)) return null;\r\n return element;\r\n }\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\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 valueDeclaration = val.declaration;\r\n val.set(CommonFlags.COMPILED);\r\n let initExpr: ExpressionRef;\r\n if (valueDeclaration.value) {\r\n initExpr = this.compileExpression(\r\n valueDeclaration.value,\r\n Type.i32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (element.is(CommonFlags.CONST)) {\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n this.error(\r\n DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,\r\n valueDeclaration.value.range\r\n );\r\n initInStart = true;\r\n }\r\n } else {\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 valueDeclaration.range\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 valueDeclaration.range\r\n );\r\n }\r\n initInStart = true;\r\n }\r\n }\r\n if (initInStart) {\r\n module.addGlobal(val.internalName, NativeType.I32, true, module.createI32(0));\r\n this.startFunctionBody.push(module.createSetGlobal(val.internalName, initExpr));\r\n previousValueIsMut = true;\r\n } else {\r\n module.addGlobal(val.internalName, NativeType.I32, !element.is(CommonFlags.CONST), initExpr);\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 /** Compiles a top-level function given its declaration. */\r\n compileFunctionDeclaration(\r\n declaration: FunctionDeclaration,\r\n typeArguments: TypeNode[]\r\n ): Function | null {\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n return this.compileFunctionUsingTypeArguments( // reports\r\n element,\r\n typeArguments,\r\n makeMap(),\r\n null,\r\n (element).declaration.name\r\n );\r\n }\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,\r\n outerScope: Flow | null,\r\n reportNode: Node\r\n ): Function | null {\r\n var instance = this.resolver.resolveFunctionInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n contextualTypeArguments,\r\n reportNode\r\n );\r\n if (!instance) return null;\r\n instance.outerScope = outerScope;\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 just the body of a function in whatever is the current context. */\r\n private compileFunctionBody(instance: Function): ExpressionRef[] {\r\n var declaration = instance.prototype.declaration;\r\n var body = assert(declaration.body);\r\n if (body.kind == NodeKind.BLOCK) {\r\n return this.compileStatements((body).statements);\r\n } else {\r\n assert(body.kind == NodeKind.EXPRESSION);\r\n assert(instance.is(CommonFlags.ARROW));\r\n assert(!instance.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.GET | CommonFlags.SET | CommonFlags.MAIN));\r\n let returnType = instance.signature.returnType;\r\n let flow = instance.flow;\r\n let stmt = this.compileExpression(\r\n (body).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 return [ stmt ];\r\n }\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 declaration = instance.prototype.declaration;\r\n var body = declaration.body;\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 (body) {\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 declaration.name.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 decorator = assert(findDecorator(DecoratorKind.EXTERNAL, declaration.decorators));\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 previousFunction = this.currentFunction;\r\n this.currentFunction = instance;\r\n let flow = instance.flow;\r\n let returnType = instance.signature.returnType;\r\n let stmts = this.compileFunctionBody(instance);\r\n flow.finalize();\r\n\r\n // make the main function call `start` implicitly once\r\n if (instance.is(CommonFlags.MAIN)) {\r\n module.addGlobal(\"~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(\"~started\", NativeType.I32)\r\n ),\r\n module.createBlock(null, [\r\n module.createCall(\"start\", null, NativeType.None),\r\n module.createSetGlobal(\"~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\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(0, nativeSizeType)\r\n ),\r\n module.createSetLocal(0,\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(0, 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 declaration.signature.returnType.range\r\n );\r\n }\r\n\r\n this.currentFunction = previousFunction;\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, 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 declaration.name.range\r\n );\r\n }\r\n\r\n instance.set(CommonFlags.MODULE_IMPORT);\r\n mangleImportName(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 // namespaces\r\n\r\n compileNamespaceDeclaration(declaration: NamespaceDeclaration): void {\r\n var members = declaration.members;\r\n var noTreeShaking = this.options.noTreeShaking;\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 if (\r\n (noTreeShaking || member.is(CommonFlags.EXPORT)) &&\r\n !(member).isGeneric\r\n ) {\r\n this.compileClassDeclaration(member, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n if (\r\n (noTreeShaking || member.is(CommonFlags.EXPORT)) &&\r\n !(member).isGeneric\r\n ) {\r\n this.compileInterfaceDeclaration(member, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n if (noTreeShaking || member.is(CommonFlags.EXPORT)) {\r\n this.compileEnumDeclaration(member);\r\n }\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n if (\r\n (noTreeShaking || member.is(CommonFlags.EXPORT)) &&\r\n !(member).isGeneric\r\n ) {\r\n this.compileFunctionDeclaration(member, []);\r\n }\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n if (noTreeShaking || member.is(CommonFlags.EXPORT)) {\r\n this.compileNamespaceDeclaration(member);\r\n }\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n if (noTreeShaking || member.is(CommonFlags.EXPORT)) {\r\n let variableInit = this.compileVariableStatement(member, true);\r\n if (variableInit) this.startFunctionBody.push(variableInit);\r\n }\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n }\r\n\r\n compileNamespace(ns: Namespace): void {\r\n if (!ns.members) return;\r\n\r\n var noTreeShaking = this.options.noTreeShaking;\r\n for (let element of ns.members.values()) {\r\n switch (element.kind) {\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n if (\r\n (\r\n noTreeShaking ||\r\n (element).is(CommonFlags.EXPORT)\r\n ) && !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n this.compileClassUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap()\r\n );\r\n }\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 (\r\n (\r\n noTreeShaking || (element).is(CommonFlags.EXPORT)\r\n ) && !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n if (element.hasDecorator(DecoratorFlags.BUILTIN)) break;\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(),\r\n null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n this.compileNamespace(element);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // exports\r\n\r\n compileExportStatement(statement: ExportStatement): void {\r\n var fileLevelExports = this.program.fileLevelExports;\r\n var members = statement.members;\r\n if (!members) return; // filespace\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n let member = members[i];\r\n let element = fileLevelExports.get(\r\n statement.range.source.internalPath + PATH_DELIMITER + member.externalName.text\r\n );\r\n if (!element) continue; // reported in Program#initialize\r\n switch (element.kind) {\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n if (!(element).is(CommonFlags.GENERIC)) {\r\n this.compileClassUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap()\r\n );\r\n }\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 (\r\n !(element).is(CommonFlags.GENERIC) &&\r\n statement.range.source.isEntry\r\n ) {\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(),\r\n null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n this.compileNamespace(element);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // classes\r\n\r\n compileClassDeclaration(\r\n declaration: ClassDeclaration,\r\n typeArguments: TypeNode[]\r\n ): void {\r\n var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName));\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.compileClassUsingTypeArguments(\r\n element,\r\n typeArguments,\r\n makeMap(),\r\n declaration\r\n );\r\n }\r\n\r\n compileClassUsingTypeArguments(\r\n prototype: ClassPrototype,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map,\r\n alternativeReportNode: Node | null = null\r\n ): void {\r\n var instance = this.resolver.resolveClassInclTypeArguments(\r\n prototype,\r\n typeArguments,\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\r\n var staticMembers = instance.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 null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterPrototype;\r\n if (getter) {\r\n this.compileFunctionUsingTypeArguments(\r\n getter,\r\n [],\r\n makeMap(),\r\n null,\r\n getter.declaration.name\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 null,\r\n setter.declaration.name\r\n );\r\n }\r\n break;\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 null,\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.FIELD: {\r\n element.set(CommonFlags.COMPILED);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterPrototype;\r\n if (getter) {\r\n this.compileFunctionUsingTypeArguments(\r\n getter,\r\n [],\r\n makeMap(instance.contextualTypeArguments),\r\n null,\r\n getter.declaration.name\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(instance.contextualTypeArguments),\r\n null,\r\n setter.declaration.name\r\n );\r\n }\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 compileStatement(statement: Statement): 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);\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 // type declarations must be top-level because function bodies are evaluated when\r\n // reachaable only.\r\n if (this.currentFunction == this.startFunctionInstance) {\r\n return module.createNop();\r\n }\r\n // otherwise fall-through\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[]): ExpressionRef[] {\r\n var numStatements = statements.length;\r\n var stmts = new Array(numStatements);\r\n stmts.length = 0;\r\n var flow = this.currentFunction.flow;\r\n for (let i = 0; i < numStatements; ++i) {\r\n let stmt = this.compileStatement(statements[i]);\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 parentFlow = this.currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n this.currentFunction.flow = flow;\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 this.currentFunction.flow = flow.free();\r\n parentFlow.inherit(flow);\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.currentFunction.flow;\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.currentFunction.flow;\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 currentFunction = this.currentFunction;\r\n var module = this.module;\r\n\r\n var label = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n var breakLabel = \"break|\" + label;\r\n flow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n flow.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 currentFunction.flow = flow.free();\r\n currentFunction.leaveBreakContext();\r\n var terminated = flow.isAny(FlowFlags.ANY_TERMINATING);\r\n flow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n parentFlow.inherit(flow);\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 currentFunction = this.currentFunction;\r\n var label = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n var breakLabel = flow.breakLabel = \"break|\" + label;\r\n flow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n flow.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 currentFunction.flow = flow.free();\r\n currentFunction.leaveBreakContext();\r\n var usesContinue = flow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES);\r\n flow.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) parentFlow.inherit(flow);\r\n else parentFlow.inheritConditional(flow);\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 currentFunction = this.currentFunction;\r\n var ifTrue = statement.ifTrue;\r\n var ifFalse = statement.ifFalse;\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 if (\r\n !this.options.noTreeShaking ||\r\n this.currentFunction.isAny(CommonFlags.GENERIC | CommonFlags.GENERIC_CONTEXT)\r\n ) {\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n let 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\r\n // Each arm initiates a branch\r\n var parentFlow = currentFunction.flow;\r\n var ifTrueFlow = parentFlow.fork();\r\n currentFunction.flow = ifTrueFlow;\r\n var ifTrueExpr = this.compileStatement(ifTrue);\r\n currentFunction.flow = ifTrueFlow.free();\r\n\r\n var ifFalseExpr: ExpressionRef = 0;\r\n if (ifFalse) {\r\n let ifFalseFlow = parentFlow.fork();\r\n currentFunction.flow = ifFalseFlow;\r\n ifFalseExpr = this.compileStatement(ifFalse);\r\n currentFunction.flow = ifFalseFlow.free();\r\n parentFlow.inheritMutual(ifTrueFlow, ifFalseFlow);\r\n } else {\r\n parentFlow.inheritConditional(ifTrueFlow);\r\n }\r\n return module.createIf(condExpr, ifTrueExpr, ifFalseExpr);\r\n }\r\n\r\n compileReturnStatement(statement: ReturnStatement): ExpressionRef {\r\n var module = this.module;\r\n var currentFunction = this.currentFunction;\r\n var expr: ExpressionRef = 0;\r\n var flow = currentFunction.flow;\r\n\r\n // Remember that this flow returns\r\n flow.set(FlowFlags.RETURNS);\r\n\r\n if (statement.value) {\r\n let returnType = flow.returnType;\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 currentFunction.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\r\n // If the last statement anyway, make it the block's return value\r\n if (isLastStatement(statement)) 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 return flow.is(FlowFlags.INLINE_CONTEXT)\r\n ? module.createBreak(assert(flow.returnLabel), 0, expr)\r\n : module.createReturn(expr);\r\n }\r\n\r\n compileSwitchStatement(statement: SwitchStatement): ExpressionRef {\r\n var module = this.module;\r\n var currentFunction = this.currentFunction;\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 context = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n\r\n // introduce a local for evaluating the condition (exactly once)\r\n var tempLocal = currentFunction.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 currentFunction.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 flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n let breakLabel = \"break|\" + context;\r\n flow.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 (flow.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 (!flow.is(FlowFlags.RETURNS)) alwaysReturns = false;\r\n if (!flow.is(FlowFlags.RETURNS_WRAPPED)) alwaysReturnsWrapped = false;\r\n if (!flow.is(FlowFlags.THROWS)) alwaysThrows = false;\r\n if (!flow.is(FlowFlags.ALLOCATES)) alwaysAllocates = false;\r\n }\r\n\r\n // Switch back to the parent flow\r\n flow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS\r\n );\r\n currentFunction.flow = flow.free();\r\n currentBlock = module.createBlock(nextLabel, stmts, NativeType.None); // must be a labeled block\r\n }\r\n currentFunction.leaveBreakContext();\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) parentFlow.set(FlowFlags.RETURNS);\r\n if (alwaysReturnsWrapped) parentFlow.set(FlowFlags.RETURNS_WRAPPED);\r\n if (alwaysThrows) parentFlow.set(FlowFlags.THROWS);\r\n if (alwaysAllocates) parentFlow.set(FlowFlags.ALLOCATES);\r\n }\r\n return currentBlock;\r\n }\r\n\r\n compileThrowStatement(statement: ThrowStatement): ExpressionRef {\r\n var flow = this.currentFunction.flow;\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\r\n // 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 /**\r\n * Compiles a variable statement. Returns `0` if an initializer is not\r\n * necessary.\r\n */\r\n compileVariableStatement(statement: VariableStatement, isKnownGlobal: bool = false): ExpressionRef {\r\n var program = this.program;\r\n var currentFunction = this.currentFunction;\r\n var declarations = statement.declarations;\r\n var numDeclarations = declarations.length;\r\n\r\n // top-level variables and constants become globals\r\n if (isKnownGlobal || (\r\n currentFunction == this.startFunctionInstance &&\r\n statement.parent && statement.parent.kind == NodeKind.SOURCE\r\n )) {\r\n // NOTE that the above condition also covers top-level variables declared with 'let', even\r\n // though such variables could also become start function locals if, and only if, not used\r\n // within any function declared in the same source, which is unknown at this point. the only\r\n // efficient way to deal with this would be to keep track of all occasions it is used and\r\n // replace these instructions afterwards, dynamically. (TOOD: what about a Binaryen pass?)\r\n for (let i = 0; i < numDeclarations; ++i) {\r\n this.compileGlobalDeclaration(declarations[i]);\r\n }\r\n return 0;\r\n }\r\n\r\n // other variables become locals\r\n var initializers = new Array();\r\n var flow = this.currentFunction.flow;\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.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(program, name, -1, type);\r\n switch (getExpressionType(initExpr)) {\r\n case NativeType.I32: {\r\n local = local.withConstantIntegerValue(\r\n i64_new(\r\n getConstValueI32(initExpr),\r\n 0\r\n )\r\n );\r\n break;\r\n }\r\n case NativeType.I64: {\r\n local = local.withConstantIntegerValue(\r\n i64_new(\r\n getConstValueI64Low(initExpr),\r\n getConstValueI64High(initExpr)\r\n )\r\n );\r\n break;\r\n }\r\n case NativeType.F32: {\r\n local = local.withConstantFloatValue(getConstValueF32(initExpr));\r\n break;\r\n }\r\n case NativeType.F64: {\r\n local = local.withConstantFloatValue(getConstValueF64(initExpr));\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 = currentFunction.flow.scopedLocals;\r\n if (!scopedLocals) currentFunction.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(type, name, false, declaration); // reports\r\n } else {\r\n if (currentFunction.flow.getScopedLocal(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 = currentFunction.addLocal(type, name, declaration);\r\n }\r\n if (initExpr) {\r\n initializers.push(this.compileAssignmentWithValue(declaration.name, initExpr));\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\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 if (\r\n !this.options.noTreeShaking ||\r\n this.currentFunction.isAny(CommonFlags.GENERIC | CommonFlags.GENERIC_CONTEXT)\r\n ) {\r\n // Try to eliminate unnecesssary loops if the condition is constant\r\n let 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\r\n // Statements initiate a new branch with its own break context\r\n var currentFunction = this.currentFunction;\r\n var label = currentFunction.enterBreakContext();\r\n var parentFlow = currentFunction.flow;\r\n var flow = parentFlow.fork();\r\n currentFunction.flow = flow;\r\n var breakLabel = \"break|\" + label;\r\n flow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n flow.continueLabel = continueLabel;\r\n\r\n var body = this.compileStatement(statement.statement);\r\n var alwaysTrue = false; // TODO\r\n var terminated = flow.isAny(FlowFlags.ANY_TERMINATING);\r\n\r\n // Switch back to the parent flow\r\n currentFunction.flow = flow.free();\r\n currentFunction.leaveBreakContext();\r\n flow.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) parentFlow.inherit(flow);\r\n else parentFlow.inheritConditional(flow);\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\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);\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\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.currentFunction.flow.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.commonCompatible(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.commonCompatible(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.commonCompatible(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.commonCompatible(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.commonCompatible(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 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.commonCompatible(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 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.commonCompatible(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.commonCompatible(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.commonCompatible(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.elementsLookup.get(\"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(\"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.elementsLookup.get(\"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(\"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.commonCompatible(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.commonCompatible(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.elementsLookup.get(\"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(\"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.elementsLookup.get(\"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(\"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.commonCompatible(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.commonCompatible(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.commonCompatible(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 this.makeIsTrueish(leftExpr, this.currentType);\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.currentFunction.flow;\r\n let tempLocal = this.currentFunction.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.currentFunction.flow;\r\n let tempLocal = this.currentFunction.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 operatorInstance.hasDecorator(DecoratorFlags.INLINE)\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 operatorInstance.hasDecorator(DecoratorFlags.INLINE)\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 currentFunction = this.currentFunction;\r\n var target = resolver.resolveExpression(expression, currentFunction); // 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: {\r\n let setterPrototype = (target).setterPrototype;\r\n if (setterPrototype) {\r\n let instance = this.resolver.resolveFunction(setterPrototype, null);\r\n if (!instance) return this.module.createUnreachable();\r\n assert(instance.signature.parameterTypes.length == 1); // parser must guarantee this\r\n targetType = instance.signature.parameterTypes[0];\r\n break;\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 this.module.createUnreachable();\r\n }\r\n case ElementKind.CLASS: {\r\n if (resolver.currentElementExpression) { // indexed access\r\n let isUnchecked = currentFunction.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 target = this.resolver.resolveExpression(expression, this.currentFunction); // 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 let flow = this.currentFunction.flow;\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 const declaration = (target).declaration;\r\n if (\r\n (target).is(CommonFlags.READONLY) &&\r\n !(\r\n this.currentFunction.is(CommonFlags.CONSTRUCTOR) ||\r\n declaration == null ||\r\n declaration.initializer != null\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 currentFunction = this.currentFunction;\r\n let flow = currentFunction.flow;\r\n let tempLocal = currentFunction.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: {\r\n let setterPrototype = (target).setterPrototype;\r\n if (setterPrototype) {\r\n let setterInstance = this.resolver.resolveFunction(setterPrototype, null);\r\n if (!setterInstance) 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 if (setterInstance.is(CommonFlags.INSTANCE)) {\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 return this.makeCallDirect(setterInstance, [ thisExpr, valueWithCorrectType ]);\r\n } else {\r\n return this.makeCallDirect(setterInstance, [ valueWithCorrectType ]);\r\n }\r\n }\r\n\r\n // otherwise call the setter first, then the getter\r\n let getterPrototype = (target).getterPrototype;\r\n assert(getterPrototype != null); // must have one if there is a setter\r\n let getterInstance = this.resolver.resolveFunction(getterPrototype, null);\r\n if (!getterInstance) return module.createUnreachable();\r\n let returnType = getterInstance.signature.returnType;\r\n let nativeReturnType = returnType.toNativeType();\r\n if (setterInstance.is(CommonFlags.INSTANCE)) {\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 tempLocal = this.currentFunction.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 } else {\r\n // note that this must be performed here because `resolved` is shared\r\n return module.createBlock(null, [\r\n this.makeCallDirect(setterInstance, [ valueWithCorrectType ]),\r\n this.makeCallDirect(getterInstance)\r\n ], nativeReturnType);\r\n }\r\n } else {\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 }\r\n return module.createUnreachable();\r\n }\r\n case ElementKind.CLASS: {\r\n let elementExpression = this.resolver.currentElementExpression;\r\n if (elementExpression) {\r\n let isUnchecked = this.currentFunction.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 currentFunction = this.currentFunction;\r\n let tempLocalTarget = currentFunction.getTempLocal(targetType, false);\r\n let tempLocalElement = currentFunction.getAndFreeTempLocal(this.currentType, false);\r\n let returnType = indexedGet.signature.returnType;\r\n this.currentFunction.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 currentFunction = this.currentFunction;\r\n var target = this.resolver.resolveExpression(expression.expression, currentFunction); // 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 makeMap(this.currentFunction.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 typeParameters = assert(prototype.declaration.typeParameters);\r\n let numTypeParameters = typeParameters.length;\r\n for (let i = 0; i < numTypeParameters; ++i) {\r\n inferredTypes.set(typeParameters[i].name.text, null);\r\n }\r\n // let numInferred = 0;\r\n let parameterTypes = prototype.declaration.signature.parameters;\r\n let numParameterTypes = parameterTypes.length;\r\n let argumentExpressions = expression.arguments;\r\n let numArguments = argumentExpressions.length;\r\n let argumentExprs = new Array(numArguments);\r\n for (let i = 0; i < numParameterTypes; ++i) {\r\n let typeNode = parameterTypes[i].type;\r\n let name = typeNode.kind == NodeKind.TYPE ? (typeNode).name.text : null;\r\n let argumentExpression = i < numArguments\r\n ? argumentExpressions[i]\r\n : prototype.declaration.signature.parameters[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, numParameterTypes.toString(10), numArguments.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (name !== null && inferredTypes.has(name)) {\r\n let inferredType = inferredTypes.get(name);\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.commonCompatible(inferredType, this.currentType, true))) {\r\n if (!(commonType = Type.commonCompatible(inferredType, this.currentType, false))) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n parameterTypes[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(name, inferredType);\r\n } else {\r\n let concreteType = this.resolver.resolveType(\r\n parameterTypes[i].type,\r\n this.currentFunction.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(typeParameters[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(this.currentFunction.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 instance.hasDecorator(DecoratorFlags.INLINE)\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: {\r\n indexArg = this.compileGetter(target, expression.expression);\r\n let type = this.currentType;\r\n signature = type.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, type.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n break;\r\n }\r\n\r\n case ElementKind.CLASS: {\r\n\r\n // call to `super()`\r\n if (expression.expression.kind == NodeKind.SUPER) {\r\n if (!currentFunction.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(currentFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let baseClassInstance = assert((classInstance).base);\r\n let thisLocal = assert(currentFunction.flow.getScopedLocal(\"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 let flow = currentFunction.flow;\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 // otherwise fall-through\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 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(prototype.declaration.typeParameters),\r\n typeArgumentNodes,\r\n makeMap(this.currentFunction.flow.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 inline: bool = false\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 (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.compileCallInlineUnchecked(instance, argumentExpressions, reportNode, 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 compileCallInlineUnchecked(\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 var currentFunction = this.currentFunction;\r\n var module = this.module;\r\n var declaration = instance.prototype.declaration;\r\n\r\n // Create an empty child flow with its own scope and mark it for inlining\r\n var previousFlow = currentFunction.flow;\r\n var returnLabel = instance.internalName + \"|inlined.\" + (instance.nextInlineId++).toString(10);\r\n var returnType = instance.signature.returnType;\r\n var flow = Flow.create(currentFunction);\r\n flow.set(FlowFlags.INLINE_CONTEXT);\r\n flow.returnLabel = returnLabel;\r\n flow.returnType = returnType;\r\n flow.contextualTypeArguments = instance.contextualTypeArguments;\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 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 classType = thisType.classReference;\r\n let superType = classType\r\n ? classType.base\r\n ? classType.base.type\r\n : null\r\n : null;\r\n if (getExpressionId(thisArg) == ExpressionId.GetLocal) { // reuse this var\r\n flow.addScopedLocalAlias(getGetLocalIndex(thisArg), thisType, \"this\");\r\n if (superType) flow.addScopedLocalAlias(getGetLocalIndex(thisArg), superType, \"super\");\r\n } else { // use a temp var\r\n let thisLocal = flow.addScopedLocal(thisType, \"this\", false);\r\n body.push(\r\n module.createSetLocal(thisLocal.index, thisArg)\r\n );\r\n if (superType) flow.addScopedLocalAlias(thisLocal.index, superType, \"super\");\r\n }\r\n }\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 if (getExpressionId(paramExpr) == ExpressionId.GetLocal) {\r\n flow.addScopedLocalAlias(\r\n getGetLocalIndex(paramExpr),\r\n parameterTypes[i],\r\n signature.getParameterName(i)\r\n );\r\n // inherits wrap status\r\n } else {\r\n let argumentLocal = flow.addScopedLocal(\r\n parameterTypes[i],\r\n signature.getParameterName(i),\r\n !flow.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\r\n // Compile optional parameter initializers in the scope of the inlined flow\r\n currentFunction.flow = 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(declaration.signature.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 parameterTypes[i],\r\n signature.getParameterName(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 var bodyStatement = assert(declaration.body);\r\n if (bodyStatement.kind == NodeKind.BLOCK) {\r\n let statements = (bodyStatement).statements;\r\n for (let i = 0, k = statements.length; i < k; ++i) {\r\n let stmt = this.compileStatement(statements[i]);\r\n if (getExpressionId(stmt) != ExpressionId.Nop) {\r\n body.push(stmt);\r\n if (flow.isAny(FlowFlags.ANY_TERMINATING)) break;\r\n }\r\n }\r\n } else {\r\n body.push(this.compileStatement(bodyStatement));\r\n }\r\n\r\n // Free any new scoped locals and reset to the original flow\r\n var scopedLocals = flow.scopedLocals;\r\n if (scopedLocals) {\r\n for (let scopedLocal of scopedLocals.values()) {\r\n if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias\r\n currentFunction.freeTempLocal(scopedLocal);\r\n }\r\n }\r\n flow.scopedLocals = null;\r\n }\r\n flow.finalize();\r\n this.currentFunction.flow = previousFlow;\r\n this.currentType = returnType;\r\n\r\n // Check that all branches are terminated\r\n if (returnType != Type.void && !flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n this.error(\r\n DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,\r\n declaration.signature.returnType.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n return flow.is(FlowFlags.RETURNS)\r\n ? module.createBlock(returnLabel, body, returnType.toNativeType())\r\n : body.length > 1\r\n ? module.createBlock(null, body, returnType.toNativeType())\r\n : body.length\r\n ? body[0]\r\n : module.createNop();\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.declaration.signature.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 var trampolineName = originalName + \"|trampoline\";\r\n trampolineSignature.requiredParameters = maxArguments;\r\n trampoline = new Function(\r\n original.prototype,\r\n trampolineName,\r\n trampolineSignature,\r\n original.parent,\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 previousFunction = this.currentFunction;\r\n this.currentFunction = trampoline;\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(\"~argc\", NativeType.I32),\r\n module.createI32(minArguments)\r\n )\r\n : module.createGetGlobal(\"~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.currentFunction = previousFunction;\r\n assert(operandIndex == maxOperands);\r\n\r\n var funcRef = module.addFunction(\r\n trampolineName,\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 var internalName = \"~argc\";\r\n if (!this.argcVar) {\r\n let module = this.module;\r\n this.argcVar = module.addGlobal(\r\n internalName,\r\n NativeType.I32,\r\n true,\r\n module.createI32(0)\r\n );\r\n }\r\n return internalName;\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 = \"~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.declaration.signature.parameters;\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 !== null && 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 this.program.instancesLookup.set(instance.internalName, instance); // so canOverflow can find it\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.resolveElementAccess(expression, this.currentFunction, contextualType); // reports\r\n if (!target) return this.module.createUnreachable();\r\n switch (target.kind) {\r\n case ElementKind.CLASS: {\r\n let isUnchecked = this.currentFunction.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.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(expression: FunctionExpression, contextualType: Type): ExpressionRef {\r\n var declaration = expression.declaration;\r\n var name = declaration.name;\r\n var simpleName = (name.text.length\r\n ? name.text\r\n : \"anonymous\") + \"|\" + this.functionTable.length.toString(10);\r\n var currentFunction = this.currentFunction;\r\n var prototype = new FunctionPrototype(\r\n this.program,\r\n simpleName,\r\n currentFunction.internalName + INNER_DELIMITER + simpleName,\r\n declaration,\r\n null,\r\n DecoratorFlags.NONE\r\n );\r\n var flow = currentFunction.flow;\r\n var instance = this.compileFunctionUsingTypeArguments(\r\n prototype,\r\n [],\r\n makeMap(flow.contextualTypeArguments),\r\n flow,\r\n declaration\r\n );\r\n if (!instance) return this.module.createUnreachable();\r\n this.currentType = instance.signature.type; // TODO: get cached type?\r\n // NOTE that, in order to make this work in every case, the function must be represented by a\r\n // value, so we add it and rely on the optimizer to figure out where it can be called directly.\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 /**\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 currentFunction = this.currentFunction;\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 let flow = currentFunction.flow;\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let thisLocal = assert(flow.getScopedLocal(\"this\"));\r\n if (thisLocal) {\r\n this.currentType = thisLocal.type;\r\n return module.createGetLocal(thisLocal.index, thisLocal.type.toNativeType());\r\n }\r\n }\r\n if (currentFunction.is(CommonFlags.INSTANCE)) {\r\n let thisLocal = assert(flow.getScopedLocal(\"this\"));\r\n let classInstance = assert(currentFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let nativeSizeType = this.options.nativeSizeType;\r\n if (currentFunction.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(currentFunction.signature.thisType);\r\n this.currentType = thisType;\r\n return module.createGetLocal(0, 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 if (currentFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n if (!currentFunction.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 let flow = currentFunction.flow;\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let scopedThis = flow.getScopedLocal(\"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 (currentFunction.is(CommonFlags.INSTANCE)) {\r\n let classInstance = assert(currentFunction.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 // otherwise resolve\r\n var target = this.resolver.resolveIdentifier( // reports\r\n expression,\r\n this.currentEnum || currentFunction\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 return this.module.createI32((target).constantValue);\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(currentFunction.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 type = this.currentType;\r\n var isType = this.resolver.resolveType(expression.isType);\r\n this.currentType = Type.bool;\r\n if (!isType) return module.createUnreachable();\r\n return type.is(TypeFlags.NULLABLE) && !isType.is(TypeFlags.NULLABLE)\r\n ? type.nonNullableType.isAssignableTo(isType)\r\n ? module.createBinary( // not precomputeable\r\n type.is(TypeFlags.LONG)\r\n ? BinaryOp.NeI64\r\n : BinaryOp.NeI32,\r\n expr,\r\n type.toNativeZero(module)\r\n )\r\n : module.createI32(0)\r\n : module.createI32(type.isAssignableTo(isType, true) ? 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\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(\"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(\"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 if (usizeTypeSize == 8) {\r\n writeI64(bufferOffset, buf, pos + arrayInstance.offsetof(\"buffer_\"));\r\n writeI32(length, buf, pos + arrayInstance.offsetof(\"length_\"));\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, pos + arrayInstance.offsetof(\"buffer_\"));\r\n writeI32(length, buf, pos + arrayInstance.offsetof(\"length_\"));\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 expr = expressions[i]\r\n ? this.compileExpression(expressions[i], elementType, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : elementType.toNativeZero(module);\r\n compiledValues[i] = expr;\r\n if (isStatic) {\r\n expr = module.precomputeExpression(compiledValues[i]);\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 currentFunction = this.currentFunction;\r\n var tempLocal = currentFunction.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 currentFunction.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 tempLocal = this.currentFunction.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 options = this.options;\r\n var currentFunction = this.currentFunction;\r\n\r\n // obtain the class being instantiated\r\n var target = this.resolver.resolveExpression( // reports\r\n expression.expression,\r\n currentFunction\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(currentFunction.flow.contextualTypeArguments)\r\n );\r\n } else {\r\n classInstance = this.resolver.resolveClassInclTypeArguments(\r\n classPrototype,\r\n typeArguments,\r\n makeMap(currentFunction.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 ctorInstance = classInstance.constructorInstance;\r\n if (ctorInstance) {\r\n this.compileFunction(ctorInstance);\r\n return ctorInstance;\r\n }\r\n\r\n // use the signature of the parent constructor if a derived class\r\n var baseClass = classInstance.base;\r\n var signature = baseClass\r\n ? this.ensureConstructor(baseClass, reportNode).signature\r\n : new Signature(null, classInstance.type, classInstance.type);\r\n\r\n var internalName = classInstance.internalName + INSTANCE_DELIMITER + \"constructor\";\r\n\r\n var nativeDummy = assert(this.program.elementsLookup.get(\"NATIVE_CODE\"));\r\n assert(nativeDummy.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n\r\n ctorInstance = new Function(\r\n nativeDummy,\r\n internalName,\r\n signature,\r\n classInstance,\r\n null\r\n );\r\n ctorInstance.set(CommonFlags.INSTANCE | CommonFlags.CONSTRUCTOR | CommonFlags.COMPILED);\r\n classInstance.constructorInstance = ctorInstance;\r\n var previousFunction = this.currentFunction;\r\n this.currentFunction = ctorInstance;\r\n\r\n // generate body\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 funcRef = module.addFunction(ctorInstance.internalName, typeRef, null,\r\n stmts.length == 1\r\n ? stmts[0]\r\n : module.createBlock(null, stmts, nativeSizeType)\r\n );\r\n ctorInstance.finalize(module, funcRef);\r\n this.currentFunction = previousFunction;\r\n return ctorInstance;\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 ctor.hasDecorator(DecoratorFlags.INLINE)\r\n // FIXME: trying to inline a constructor that doesn't return a custom value doesn't work\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\r\n var target = this.resolver.resolvePropertyAccess(propertyAccess, this.currentFunction, contextualType); // reports\r\n if (!target) return module.createUnreachable();\r\n\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: { // static property\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 return module.createI32((target).constantValue);\r\n }\r\n return module.createGetGlobal((target).internalName, NativeType.I32);\r\n }\r\n case ElementKind.FIELD: { // instance field\r\n let thisExpression = assert(this.resolver.currentThisExpression);\r\n assert((target).memoryOffset >= 0);\r\n let thisExpr = this.compileExpressionRetainType(\r\n thisExpression,\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: {// instance property (here: getter)\r\n return this.compileGetter(target, propertyAccess);\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).simpleName\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: Property, 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 let inline = (instance.decoratorFlags & DecoratorFlags.INLINE) != 0;\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, inline);\r\n } else {\r\n this.currentType = signature.returnType;\r\n return this.compileCallDirect(instance, [], reportNode, 0, inline);\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).simpleName, (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 currentFunction = this.currentFunction;\r\n var parentFlow = currentFunction.flow;\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 if (\r\n !this.options.noTreeShaking ||\r\n this.currentFunction.isAny(CommonFlags.GENERIC | CommonFlags.GENERIC_CONTEXT)\r\n ) {\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n let 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\r\n var ifThenFlow = parentFlow.fork();\r\n currentFunction.flow = ifThenFlow;\r\n var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE);\r\n var ifThenType = this.currentType;\r\n ifThenFlow.free();\r\n\r\n var ifElseFlow = parentFlow.fork();\r\n currentFunction.flow = ifElseFlow;\r\n var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE);\r\n var ifElseType = this.currentType;\r\n currentFunction.flow = ifElseFlow.free();\r\n\r\n parentFlow.inheritMutual(ifThenFlow, ifElseFlow);\r\n\r\n var commonType = Type.commonCompatible(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 currentFunction = this.currentFunction;\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 = currentFunction.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 currentFunction.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.currentFunction.flow;\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\r\n // must not be used in an inline context as it makes assumptions about local indexes\r\n assert(!this.currentFunction.flow.is(FlowFlags.INLINE_CONTEXT));\r\n\r\n if (classInstance.members) {\r\n let module = this.module;\r\n let nativeSizeType = this.options.nativeSizeType;\r\n for (let member of classInstance.members.values()) {\r\n if (member.parent != classInstance) continue;\r\n if (member.kind == ElementKind.FIELD) {\r\n let field = member;\r\n let fieldType = field.type;\r\n let nativeFieldType = fieldType.toNativeType();\r\n let fieldDeclaration = field.prototype.declaration;\r\n assert(!field.isAny(CommonFlags.CONST));\r\n if (fieldDeclaration.initializer) { // use initializer\r\n stmts.push(module.createStore(fieldType.byteSize,\r\n module.createGetLocal(0, nativeSizeType),\r\n this.compileExpression( // reports\r\n fieldDeclaration.initializer,\r\n fieldType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n ),\r\n nativeFieldType,\r\n field.memoryOffset\r\n ));\r\n } else {\r\n // NOTE: if all fields have initializers then this way is best, but if they don't,\r\n // it would be more efficient to categorically zero memory on allocation.\r\n let parameterIndex = (field.prototype.declaration).parameterIndex;\r\n stmts.push(module.createStore(fieldType.byteSize,\r\n module.createGetLocal(0, nativeSizeType),\r\n parameterIndex >= 0 // initialized via parameter\r\n ? module.createGetLocal(1 + parameterIndex, nativeFieldType)\r\n : fieldType.toNativeZero(module),\r\n nativeFieldType,\r\n field.memoryOffset\r\n ));\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 currentFunction = this.currentFunction;\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 currentFunction.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 = declaration.programLevelInternalName;\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 * 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 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 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 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 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 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 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 * 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 FlowFlags,\r\n\r\n Element,\r\n Class,\r\n ClassPrototype,\r\n Function,\r\n FunctionTarget,\r\n FunctionPrototype,\r\n VariableLikeElement,\r\n Property,\r\n DecoratorFlags,\r\n FieldPrototype,\r\n Field,\r\n Global\r\n} from \"./program\";\r\n\r\nimport {\r\n SignatureNode,\r\n ParameterKind,\r\n CommonTypeNode,\r\n NodeKind,\r\n TypeNode,\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} 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 PATH_DELIMITER,\r\n INSTANCE_DELIMITER,\r\n CommonFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n makeMap\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(program: Program) {\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 node: CommonTypeNode,\r\n contextualTypeArguments: Map | null = null,\r\n reportMode = ReportMode.REPORT\r\n ): Type | null {\r\n\r\n // handle signatures specifically\r\n if (node.kind == NodeKind.SIGNATURE) {\r\n let signature = this.resolveSignature(node, contextualTypeArguments, reportMode);\r\n if (!signature) return null;\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 simpleName = typeNode.name.text;\r\n var globalName = simpleName;\r\n var localName = typeNode.range.source.internalPath + PATH_DELIMITER + simpleName; // TODO cache\r\n\r\n // check file-global / program-global enum or class\r\n {\r\n let elementsLookup = this.program.elementsLookup;\r\n let element: Element | null;\r\n if (\r\n (element = elementsLookup.get(localName)) || // file-global\r\n (element = elementsLookup.get(globalName)) // program-global\r\n ) {\r\n switch (element.kind) {\r\n case ElementKind.ENUM: {\r\n if (typeNode.typeArguments !== null && typeNode.typeArguments.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 return null;\r\n }\r\n return Type.i32;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instance = this.resolveClassInclTypeArguments(\r\n element,\r\n typeNode.typeArguments,\r\n makeMap(contextualTypeArguments),\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 }\r\n\r\n // check (global) type alias\r\n {\r\n let alias = this.program.typeAliases.get(simpleName);\r\n if (alias) return this.resolveType(alias.type, contextualTypeArguments, reportMode);\r\n }\r\n\r\n // resolve parameters\r\n var typeArgumentNodes = typeNode.typeArguments;\r\n var typeArguments: Type[] | null = null;\r\n if (typeArgumentNodes) {\r\n let numTypeArguments = typeArgumentNodes.length;\r\n typeArguments = new Array(numTypeArguments);\r\n for (let i = 0; i < numTypeArguments; ++i) {\r\n let paramType = this.resolveType( // reports\r\n typeArgumentNodes[i],\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!paramType) return null;\r\n typeArguments[i] = paramType;\r\n }\r\n if (numTypeArguments) { // can't be a placeholder if it has parameters\r\n let instanceKey = typesToString(typeArguments);\r\n if (instanceKey.length) {\r\n localName += \"<\" + instanceKey + \">\";\r\n globalName += \"<\" + instanceKey + \">\";\r\n }\r\n } else if (contextualTypeArguments) {\r\n let placeholderType = contextualTypeArguments.get(globalName);\r\n if (placeholderType) return placeholderType;\r\n }\r\n }\r\n\r\n // check file-global / program-global type\r\n {\r\n let typesLookup = this.program.typesLookup;\r\n let type: Type | null;\r\n if (\r\n (type = typesLookup.get(localName)) ||\r\n (type = typesLookup.get(globalName))\r\n ) {\r\n if (!type.is(TypeFlags.REFERENCE) && 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, type.toString()\r\n );\r\n }\r\n }\r\n return type;\r\n }\r\n }\r\n\r\n // check built-in macro types\r\n if (simpleName == \"NATIVE\") {\r\n if (!(typeArguments && typeArguments.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 switch (typeArguments[0].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.VOID: return Type.void;\r\n default: assert(false);\r\n }\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, globalName\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a {@link SignatureNode} to a concrete {@link Signature}. */\r\n resolveSignature(\r\n node: SignatureNode,\r\n contextualTypeArguments: Map | null = null,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Signature | null {\r\n var explicitThisType = node.explicitThisType;\r\n var thisType: Type | null = null;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(explicitThisType, contextualTypeArguments, reportMode);\r\n if (!thisType) return null;\r\n }\r\n var parameterTypeNodes = node.parameters;\r\n var numParameters = parameterTypeNodes.length;\r\n var parameterTypes = new Array(numParameters);\r\n var parameterNames = new Array(numParameters);\r\n var requiredParameters = 0;\r\n var hasRest = false;\r\n for (let i = 0; i < numParameters; ++i) {\r\n let parameterTypeNode = parameterTypeNodes[i];\r\n switch (parameterTypeNode.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 parameterType = this.resolveType(\r\n assert(parameterTypeNode.type),\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterTypeNode.name.text;\r\n }\r\n var returnTypeNode = node.returnType;\r\n var returnType: Type | null;\r\n if (returnTypeNode) {\r\n returnType = this.resolveType(returnTypeNode, contextualTypeArguments, reportMode);\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Type.void;\r\n }\r\n var signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.parameterNames = parameterNames;\r\n signature.requiredParameters = requiredParameters;\r\n signature.hasRest = hasRest;\r\n return signature;\r\n }\r\n\r\n /** Resolves an array of type arguments to concrete types. */\r\n resolveTypeArguments(\r\n typeParameters: TypeParameterNode[],\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n contextualTypeArguments: Map,\r\n alternativeReportNode: Node | null = null,\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.atEnd,\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 contextualTypeArguments,\r\n reportMode\r\n )\r\n : this.resolveType( // reports\r\n assert(typeParameters[i].defaultType),\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 element it refers to. */\r\n resolveIdentifier(\r\n identifier: IdentifierExpression,\r\n context: Element | null,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var name = identifier.text;\r\n var element: Element | null;\r\n\r\n if (context) {\r\n\r\n switch (context.kind) {\r\n case ElementKind.FUNCTION: { // search locals, use prototype\r\n element = (context).flow.getScopedLocal(name);\r\n if (element) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n context = (context).prototype.parent;\r\n break;\r\n }\r\n case ElementKind.CLASS: { // use prototype\r\n context = (context).prototype.parent;\r\n break;\r\n }\r\n }\r\n\r\n // search context\r\n while (context) {\r\n let members = context.members;\r\n if (members) {\r\n if (element = members.get(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n }\r\n context = context.parent;\r\n }\r\n }\r\n\r\n // search current file\r\n var elementsLookup = this.program.elementsLookup;\r\n if (element = elementsLookup.get(identifier.range.source.internalPath + PATH_DELIMITER + name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element; // GLOBAL, FUNCTION_PROTOTYPE, CLASS_PROTOTYPE\r\n }\r\n\r\n // search global scope\r\n if (element = elementsLookup.get(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element; // GLOBAL, FUNCTION_PROTOTYPE, CLASS_PROTOTYPE\r\n }\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 resolveType = assert(global.declaration).type;\r\n if (!resolveType) return false;\r\n var resolvedType = this.resolveType(resolveType, null, reportMode);\r\n if (!resolvedType) return false;\r\n global.type = resolvedType;\r\n global.set(CommonFlags.RESOLVED);\r\n return true;\r\n }\r\n\r\n /** Resolves a property access to the element it refers to. */\r\n resolvePropertyAccess(\r\n propertyAccess: PropertyAccessExpression,\r\n contextualFunction: Function,\r\n contextualType: Type,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n // start by resolving the lhs target (expression before the last dot)\r\n var targetExpression = propertyAccess.expression;\r\n var target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode); // reports\r\n if (!target) return null;\r\n\r\n // at this point we know exactly what the target is, so look up the element within\r\n var propertyName = propertyAccess.property.text;\r\n\r\n // Resolve variable-likes to the class type they reference 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;\r\n assert(type != Type.void);\r\n let classReference = type.classReference;\r\n if (!classReference) {\r\n let basicClasses = this.program.basicClasses;\r\n if (!type.is(TypeFlags.REFERENCE) && basicClasses.has(type.kind)) {\r\n classReference = assert(basicClasses.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: {\r\n let getter = this.resolveFunction(\r\n assert((target).getterPrototype),\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n if (!getter) return null;\r\n let classReference = getter.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, getter.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: {\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 let member: Element | null;\r\n if (members && (member = members.get(propertyName))) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return member; // 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) {\r\n let member = members.get(propertyName);\r\n if (member) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return member; // static ENUMVALUE, static GLOBAL, static FUNCTION_PROTOTYPE...\r\n }\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 resolveElementAccess(\r\n elementAccess: ElementAccessExpression,\r\n contextualFunction: Function,\r\n contextualType: Type,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = elementAccess.expression;\r\n var target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode);\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 determineIntegerLiteralType(\r\n intValue: I64,\r\n contextualType: Type\r\n ): Type {\r\n\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\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 resolveExpression(\r\n expression: Expression,\r\n contextualFunction: Function,\r\n contextualType: Type = Type.void,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n while (expression.kind == NodeKind.PARENTHESIZED) {\r\n expression = (expression).expression;\r\n }\r\n switch (expression.kind) {\r\n case NodeKind.ASSERTION: {\r\n if ((expression).assertionKind == AssertionKind.NONNULL) {\r\n return this.resolveExpression(\r\n (expression).expression,\r\n contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n let type = this.resolveType(\r\n assert((expression).toType),\r\n contextualFunction.flow.contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n let 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 case NodeKind.UNARYPREFIX: {\r\n // TODO: overloads\r\n switch ((expression).operator) {\r\n case Token.MINUS: {\r\n let operand = (expression).operand;\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 return assert(this.program.basicClasses.get(type.kind));\r\n }\r\n return this.resolveExpression(\r\n operand,\r\n contextualFunction,\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 contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case Token.EXCLAMATION: {\r\n return assert(this.program.basicClasses.get(TypeKind.BOOL));\r\n }\r\n case Token.TILDE: {\r\n let resolvedOperand = this.resolveExpression(\r\n (expression).operand,\r\n contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n if (!resolvedOperand) return null;\r\n throw new Error(\"not implemented\"); // TODO: should all elements have a corresponding type right away?\r\n }\r\n default: assert(false);\r\n }\r\n return null;\r\n }\r\n case NodeKind.UNARYPOSTFIX: {\r\n // TODO: 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 contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n default: assert(false);\r\n }\r\n return null;\r\n }\r\n case NodeKind.BINARY: {\r\n // TODO: all sorts of unary and binary expressions, which means looking up overloads and\r\n // evaluating their return types, knowing the semantics of different operators etc.\r\n // should probably share that code with the compiler somehow, as it also does exactly this.\r\n throw new Error(\"not implemented\");\r\n }\r\n case NodeKind.THIS: { // -> Class / ClassPrototype\r\n if (contextualFunction.flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let explicitLocal = contextualFunction.flow.getScopedLocal(\"this\");\r\n if (explicitLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return explicitLocal;\r\n }\r\n }\r\n let parent = contextualFunction.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 case NodeKind.SUPER: { // -> Class\r\n if (contextualFunction.flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let explicitLocal = contextualFunction.flow.getScopedLocal(\"super\");\r\n if (explicitLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return explicitLocal;\r\n }\r\n }\r\n let parent = contextualFunction.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 case NodeKind.IDENTIFIER: {\r\n return this.resolveIdentifier(expression, contextualFunction, reportMode);\r\n }\r\n case NodeKind.LITERAL: {\r\n switch ((expression).literalKind) {\r\n case LiteralKind.INTEGER: {\r\n return assert(\r\n this.program.basicClasses.get(\r\n this.determineIntegerLiteralType(\r\n (expression).value,\r\n contextualType\r\n ).kind\r\n )\r\n );\r\n }\r\n case LiteralKind.FLOAT: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n return assert(\r\n this.program.basicClasses.get(\r\n contextualType == Type.f32\r\n ? TypeKind.F32\r\n : TypeKind.F64\r\n )\r\n );\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 // case LiteralKind.ARRAY: // TODO\r\n }\r\n break;\r\n }\r\n case NodeKind.PROPERTYACCESS: {\r\n return this.resolvePropertyAccess(\r\n expression,\r\n contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case NodeKind.ELEMENTACCESS: {\r\n return this.resolveElementAccess(\r\n expression,\r\n contextualFunction,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case NodeKind.CALL: {\r\n let targetExpression = (expression).expression;\r\n let target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode);\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 makeMap(contextualFunction.flow.contextualTypeArguments),\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 break;\r\n }\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 to an instance using the specified concrete type arguments. */\r\n resolveFunction(\r\n prototype: FunctionPrototype,\r\n typeArguments: Type[] | null,\r\n contextualTypeArguments: Map = makeMap(),\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | null {\r\n var classTypeArguments = prototype.classTypeArguments; // set only if partially resolved\r\n var classInstanceKey = classTypeArguments ? typesToString(classTypeArguments) : \"\";\r\n var instanceKey = typeArguments ? typesToString(typeArguments) : \"\";\r\n var classInstances = prototype.instances.get(classInstanceKey);\r\n if (classInstances) {\r\n let instance = classInstances.get(instanceKey);\r\n if (instance) return instance;\r\n }\r\n\r\n var declaration = prototype.declaration;\r\n var isInstance = prototype.is(CommonFlags.INSTANCE);\r\n var classPrototype = prototype.classPrototype;\r\n\r\n // apply class type arguments if a partially resolved instance method\r\n if (classTypeArguments) prototype.applyClassTypeArguments(contextualTypeArguments);\r\n\r\n // override with function specific type arguments\r\n var signatureNode = declaration.signature;\r\n var functionTypeParameters = declaration.typeParameters;\r\n var numFunctionTypeArguments: i32;\r\n if (typeArguments && (numFunctionTypeArguments = typeArguments.length)) {\r\n assert(functionTypeParameters && numFunctionTypeArguments == functionTypeParameters.length);\r\n for (let i = 0; i < numFunctionTypeArguments; ++i) {\r\n contextualTypeArguments.set(\r\n (functionTypeParameters)[i].name.text,\r\n typeArguments[i]\r\n );\r\n }\r\n } else {\r\n assert(!functionTypeParameters || functionTypeParameters.length == 0);\r\n }\r\n\r\n // resolve class if an instance method\r\n var classInstance: Class | null = null;\r\n var thisType: Type | null = null;\r\n if (isInstance) {\r\n classInstance = this.resolveClass(\r\n assert(classPrototype),\r\n classTypeArguments,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!classInstance) return null;\r\n let explicitThisType = signatureNode.explicitThisType;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(explicitThisType, contextualTypeArguments, reportMode);\r\n if (!thisType) return null;\r\n } else {\r\n thisType = classInstance.type;\r\n }\r\n contextualTypeArguments.set(\"this\", thisType);\r\n } else {\r\n if (signatureNode.explicitThisType) {\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n signatureNode.explicitThisType.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n // resolve signature node\r\n var signatureParameters = signatureNode.parameters;\r\n var signatureParameterCount = signatureParameters.length;\r\n var parameterTypes = new Array(signatureParameterCount);\r\n var parameterNames = new Array(signatureParameterCount);\r\n var requiredParameters = 0;\r\n for (let i = 0; i < signatureParameterCount; ++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 = assert(parameterDeclaration.type);\r\n let parameterType = this.resolveType(typeNode, contextualTypeArguments, reportMode);\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterDeclaration.name.text;\r\n }\r\n\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 = assert(signatureNode.returnType);\r\n let type = this.resolveType(typeNode, contextualTypeArguments, reportMode);\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 internalName = prototype.internalName;\r\n if (instanceKey.length) internalName += \"<\" + instanceKey + \">\";\r\n var instance = new Function(\r\n prototype,\r\n internalName,\r\n signature,\r\n classInstance\r\n ? classInstance\r\n : classPrototype,\r\n contextualTypeArguments\r\n );\r\n if (!classInstances) prototype.instances.set(classInstanceKey, classInstances = new Map());\r\n classInstances.set(instanceKey, instance);\r\n this.program.instancesLookup.set(internalName, instance);\r\n return instance;\r\n }\r\n\r\n /** Resolves a function prototype partially by applying the specified type arguments. */\r\n resolveFunctionPartially(\r\n prototype: FunctionPrototype,\r\n typeArguments: Type[] | null,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): FunctionPrototype | null {\r\n assert(prototype.is(CommonFlags.INSTANCE));\r\n var classPrototype = assert(prototype.classPrototype);\r\n\r\n if (!(typeArguments && typeArguments.length)) return prototype; // no need to clone\r\n\r\n var simpleName = prototype.simpleName;\r\n var partialKey = typesToString(typeArguments);\r\n var partialPrototype = new FunctionPrototype(\r\n this.program,\r\n simpleName,\r\n classPrototype.internalName + \"<\" + partialKey + \">\" + INSTANCE_DELIMITER + simpleName,\r\n prototype.declaration,\r\n classPrototype,\r\n prototype.decoratorFlags\r\n );\r\n partialPrototype.flags = prototype.flags;\r\n partialPrototype.operatorKind = prototype.operatorKind;\r\n partialPrototype.classTypeArguments = typeArguments;\r\n partialPrototype.instances = prototype.instances;\r\n return partialPrototype;\r\n }\r\n\r\n /** Resolves a function prototype to an instance by first resolving the specified type arguments. */\r\n resolveFunctionInclTypeArguments(\r\n prototype: FunctionPrototype,\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n contextualTypeArguments: Map,\r\n reportNode: Node,\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | 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\r\n // apply class type arguments if a partially resolved instance method\r\n // FIXME: this is done once more in resolveFunction. required here for resolveTypeArguments,\r\n // required there for just resolving a function no matter if a partial or not.\r\n let classTypeArguments = prototype.classTypeArguments;\r\n if (classTypeArguments) prototype.applyClassTypeArguments(contextualTypeArguments);\r\n\r\n resolvedTypeArguments = this.resolveTypeArguments( // reports\r\n assert(prototype.declaration.typeParameters),\r\n typeArgumentNodes,\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 prototype: ClassPrototype,\r\n typeArguments: Type[] | null,\r\n contextualTypeArguments: Map = makeMap(),\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.instances.get(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 var declaration = prototype.declaration;\r\n if (typeArguments) {\r\n let typeParameters = declaration.typeParameters;\r\n let expectedTypeArguments = typeParameters.length;\r\n let actualTypeArguments = typeArguments.length;\r\n assert(actualTypeArguments == expectedTypeArguments);\r\n for (let i = 0; i < actualTypeArguments; ++i) {\r\n contextualTypeArguments.set(typeParameters[i].name.text, typeArguments[i]);\r\n }\r\n } else {\r\n assert(declaration.typeParameters.length == 0);\r\n }\r\n\r\n // Resolve base class if applicable\r\n var baseClass: Class | null = null;\r\n if (declaration.extendsType) {\r\n let baseClassType = this.resolveType(\r\n declaration.extendsType,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!baseClassType) return null;\r\n if (!(baseClass = baseClassType.classReference)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.program.error(\r\n DiagnosticCode.A_class_may_only_extend_another_class,\r\n declaration.extendsType.range\r\n );\r\n }\r\n return null;\r\n }\r\n if (baseClass.hasDecorator(DecoratorFlags.SEALED)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.program.error(\r\n DiagnosticCode.Class_0_is_sealed_and_cannot_be_extended,\r\n declaration.extendsType.range, baseClass.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n if (baseClass.hasDecorator(DecoratorFlags.UNMANAGED) != prototype.hasDecorator(DecoratorFlags.UNMANAGED)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.program.error(\r\n DiagnosticCode.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa,\r\n Range.join(declaration.name.range, declaration.extendsType.range)\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n // Construct the instance and remember that it has been resolved already\r\n var simpleName = prototype.simpleName;\r\n var internalName = prototype.internalName;\r\n if (instanceKey.length) {\r\n simpleName += \"<\" + instanceKey + \">\";\r\n internalName += \"<\" + instanceKey + \">\";\r\n }\r\n instance = new Class(prototype, simpleName, internalName, typeArguments, baseClass);\r\n instance.contextualTypeArguments = contextualTypeArguments;\r\n prototype.instances.set(instanceKey, instance);\r\n this.program.instancesLookup.set(internalName, 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 if (baseClass.members) {\r\n if (!instance.members) instance.members = new Map();\r\n for (let inheritedMember of baseClass.members.values()) {\r\n instance.members.set(inheritedMember.simpleName, inheritedMember);\r\n }\r\n }\r\n memoryOffset = baseClass.currentMemoryOffset;\r\n }\r\n\r\n // Resolve constructor by first applying the class type arguments\r\n var constructorPrototype = prototype.constructorPrototype;\r\n if (constructorPrototype) {\r\n let constructorPartial = this.resolveFunctionPartially(\r\n constructorPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!constructorPartial) return null;\r\n instance.constructorInstance = this.resolveFunction(\r\n constructorPartial,\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n }\r\n\r\n // Resolve instance members\r\n if (prototype.instanceMembers) {\r\n for (let member of prototype.instanceMembers.values()) {\r\n switch (member.kind) {\r\n\r\n // Lay out fields in advance\r\n case ElementKind.FIELD_PROTOTYPE: {\r\n let fieldDeclaration = (member).declaration;\r\n if (!instance.members) instance.members = new Map();\r\n else if (instance.members.has(member.simpleName)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n fieldDeclaration.name.range,\r\n member.simpleName\r\n );\r\n break;\r\n }\r\n let fieldType: Type | null = null;\r\n // TODO: handle duplicate non-private fields\r\n if (!fieldDeclaration.type) {\r\n if (baseClass !== null && baseClass.members !== null) {\r\n let baseField = baseClass.members.get((member).simpleName);\r\n if (baseField && !baseField.is(CommonFlags.PRIVATE)) {\r\n assert(baseField.kind == ElementKind.FIELD);\r\n fieldType = (baseField).type;\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 fieldDeclaration.name.range.atEnd\r\n );\r\n }\r\n }\r\n } else {\r\n fieldType = this.resolveType(\r\n fieldDeclaration.type,\r\n instance.contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n if (!fieldType) break;\r\n let fieldInstance = new Field(\r\n member,\r\n internalName + INSTANCE_DELIMITER + (member).simpleName,\r\n fieldType,\r\n fieldDeclaration,\r\n instance\r\n );\r\n switch (fieldType.byteSize) { // align\r\n case 1: break;\r\n case 2: { if (memoryOffset & 1) ++memoryOffset; break; }\r\n case 4: { if (memoryOffset & 3) memoryOffset = (memoryOffset | 3) + 1; break; }\r\n case 8: { if (memoryOffset & 7) memoryOffset = (memoryOffset | 7) + 1; break; }\r\n default: assert(false);\r\n }\r\n fieldInstance.memoryOffset = memoryOffset;\r\n memoryOffset += fieldType.byteSize;\r\n instance.members.set(member.simpleName, fieldInstance);\r\n break;\r\n }\r\n\r\n // Partially resolve methods as these might have type arguments on their own\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (!instance.members) instance.members = new Map();\r\n let partialPrototype = this.resolveFunctionPartially(\r\n member,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!partialPrototype) return null;\r\n partialPrototype.internalName = internalName + INSTANCE_DELIMITER + partialPrototype.simpleName;\r\n instance.members.set(member.simpleName, partialPrototype);\r\n break;\r\n }\r\n\r\n // Clone properties and partially resolve the wrapped accessors for consistence with other methods\r\n case ElementKind.PROPERTY: {\r\n if (!instance.members) instance.members = new Map();\r\n let getterPrototype = assert((member).getterPrototype); // must be present\r\n let setterPrototype = (member).setterPrototype; // might be present\r\n let instanceProperty = new Property(\r\n this.program,\r\n member.simpleName,\r\n internalName + INSTANCE_DELIMITER + member.simpleName,\r\n prototype\r\n );\r\n let partialGetterPrototype = this.resolveFunctionPartially(\r\n getterPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!partialGetterPrototype) return null;\r\n partialGetterPrototype\r\n .internalName = internalName + INSTANCE_DELIMITER + partialGetterPrototype.simpleName;\r\n instanceProperty.getterPrototype = partialGetterPrototype;\r\n if (setterPrototype) {\r\n let partialSetterPrototype = this.resolveFunctionPartially(\r\n setterPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!partialSetterPrototype) return null;\r\n partialSetterPrototype\r\n .internalName = internalName + INSTANCE_DELIMITER + partialSetterPrototype.simpleName;\r\n instanceProperty.setterPrototype = partialSetterPrototype;\r\n }\r\n instance.members.set(member.simpleName, instanceProperty);\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 // 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 operatorPartial = this.resolveFunctionPartially(\r\n overloadPrototype,\r\n typeArguments,\r\n reportMode\r\n );\r\n if (!operatorPartial) continue;\r\n operatorInstance = this.resolveFunction(\r\n operatorPartial,\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 prototype: ClassPrototype,\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n contextualTypeArguments: Map,\r\n reportNode: Node,\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(\r\n assert(prototype.declaration.typeParameters),\r\n typeArgumentNodes,\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 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.AtomicWake:\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.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} 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 exports and calls the respective handlers. */\r\n walk(): void {\r\n for (let moduleExport of this.program.moduleLevelExports.values()) {\r\n // FIXME: doesn't honor the actual externally visible name\r\n this.visitElement(moduleExport.element);\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: {\r\n let prop = element;\r\n let getter = prop.getterPrototype;\r\n if (getter) this.visitFunctionInstances(getter);\r\n let setter = prop.setterPrototype;\r\n if (setter) this.visitFunctionInstances(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 default: assert(false);\r\n }\r\n }\r\n\r\n private visitFunctionInstances(element: FunctionPrototype): void {\r\n for (let instances of element.instances.values()) {\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 for (let instance of element.instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) this.visitClass(instance);\r\n }\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.simpleName);\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.simpleName);\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 sb.push((member).constantValue.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.simpleName);\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.simpleName);\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.simpleName);\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.simpleName);\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.simpleName);\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.simpleName);\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 sb.push((member).constantValue.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.prototype.declaration.name.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.simpleName);\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.simpleName);\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.simpleName); // TODO: fqn\r\n }\r\n sb.push(\" {\\n\");\r\n var members = element.prototype.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.simpleName);\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.simpleName);\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.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 for (let instances of (member).instances.values()) {\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 for (let instance of (member).instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\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\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 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 IndexSignatureDeclaration\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);\r\n if (statement) {\r\n statement.parent = source;\r\n statements.push(statement);\r\n }\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: Node | 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 = [];\r\n 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 break;\r\n } else {\r\n statement = this.parseVariable(tn, flags, decorators, startPos);\r\n decorators = null;\r\n }\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, flags, startPos);\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.createIdentifierExpression(\"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.createThisExpression(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.createIdentifierExpression(\"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.createIdentifierExpression(\"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 identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let parameters = new Array();\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 // TODO: this works for now, but the representation isn't great\r\n identifier = Node.createIdentifierExpression(\r\n identifier.text + \".\" + tn.readIdentifier(),\r\n tn.range(identifier.range.start, tn.pos)\r\n );\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 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(identifier, parameters, nullable, tn.range(startPos, tn.pos));\r\n\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.createIdentifierExpression(\"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, flags, 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 = new Array();\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 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.length === 0) {\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 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 isArrow = false;\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 isArrow = true;\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, isArrow, startPos, signatureStart);\r\n }\r\n\r\n private parseFunctionExpressionCommon(\r\n tn: Tokenizer,\r\n name: IdentifierExpression,\r\n parameters: ParameterNode[],\r\n isArrow: bool,\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 (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 this.error(\r\n DiagnosticCode.Type_expected,\r\n returnType.range\r\n ); // recoverable\r\n }\r\n\r\n if (isArrow) {\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;\r\n if (isArrow) {\r\n body = this.parseStatement(tn, false);\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 isArrow ? CommonFlags.ARROW : CommonFlags.NONE,\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;\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 } else {\r\n typeParameters = [];\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 = [];\r\n 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) return null;\r\n member.parent = declaration;\r\n members.push(member);\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) return null;\r\n member.parent = declaration;\r\n members.push(member);\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 = new Array();\r\n if (tn.skip(Token.AT)) {\r\n do {\r\n let decorator = this.parseDecorator(tn);\r\n if (!decorator) break;\r\n decorators.push(decorator);\r\n } while (tn.skip(Token.AT));\r\n if (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 implicitFieldDeclaration.parent = parent;\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[]): IndexSignatureDeclaration | null {\r\n\r\n // at: '[': 'key' ':' Type ']' ':' Type\r\n\r\n if (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) return null;\r\n member.parent = ns;\r\n members.push(member);\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 flags: CommonFlags,\r\n startPos: i32\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, flags, 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, flags, 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 true\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.set(CommonFlags.QUOTED);\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.is(CommonFlags.QUOTED)) {\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 return Node.createIdentifierExpression(tn.readIdentifier(), tn.range(startPos, tn.pos));\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 = new Array();\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 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 }\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__18__;","/** @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_TREESHAKING = false;\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\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[\"isReference\"] = function isReference(arg) {\r\n return typeof arg === \"object\" || typeof arg === \"string\";\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\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\nglobalScope[\"JSMath\"].signbit = function signbit(x) {\r\n F64[0] = x; return Boolean((U64[1] >>> 31) & (x == x));\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} 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} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags\r\n} from \"./types\";\r\n\r\nimport {\r\n BinaryOp,\r\n UnaryOp,\r\n HostOp,\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} from \"./module\";\r\n\r\nimport {\r\n ElementKind,\r\n FunctionPrototype,\r\n Class,\r\n Field,\r\n OperatorKind,\r\n FlowFlags,\r\n Global,\r\n DecoratorFlags\r\n} from \"./program\";\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\n/** Compiles a call to a built-in function. */\r\nexport function compileCall(\r\n compiler: Compiler,\r\n prototype: FunctionPrototype,\r\n typeArguments: Type[] | null,\r\n operands: Expression[],\r\n contextualType: Type,\r\n reportNode: Node\r\n): ExpressionRef {\r\n var module = compiler.module;\r\n\r\n var arg0: ExpressionRef,\r\n arg1: ExpressionRef,\r\n arg2: ExpressionRef,\r\n ret: ExpressionRef;\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 switch (prototype.internalName) {\r\n\r\n // types\r\n\r\n case \"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 \"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 \"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 \"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 \"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 \"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 classType = type.classReference;\r\n return (\r\n classType !== null && classType.prototype.extends(compiler.program.arrayPrototype)\r\n ) ? module.createI32(1) : module.createI32(0);\r\n }\r\n case \"isDefined\": { // isDefined(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n let element = compiler.resolver.resolveExpression(\r\n operands[0],\r\n compiler.currentFunction,\r\n Type.void,\r\n ReportMode.SWALLOW\r\n );\r\n return module.createI32(element ? 1 : 0);\r\n }\r\n case \"isConstant\": { // isConstant(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\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 \"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\r\n // math\r\n\r\n case \"clz\": { // clz(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16: {\r\n ret = module.createUnary(UnaryOp.ClzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.BOOL: // usually overflows\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createUnary(UnaryOp.ClzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.ClzI64\r\n : UnaryOp.ClzI32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createUnary(UnaryOp.ClzI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"ctz\": { // ctz(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.NONE, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16: {\r\n ret = module.createUnary(UnaryOp.CtzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.BOOL: // usually overflows\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createUnary(UnaryOp.CtzI32, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.CtzI64\r\n : UnaryOp.CtzI32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createUnary(UnaryOp.CtzI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"popcnt\": { // popcnt(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16: {\r\n ret = module.createUnary(UnaryOp.PopcntI32, arg0);\r\n break;\r\n }\r\n case TypeKind.BOOL: // usually overflows\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createUnary(UnaryOp.PopcntI32, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.PopcntI64\r\n : UnaryOp.PopcntI32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createUnary(UnaryOp.PopcntI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"rotl\": { // rotl(value: T, shift: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n switch (compiler.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 ret = compiler.ensureSmallIntegerWrap(\r\n module.createBinary(BinaryOp.RotlI32, arg0, arg1),\r\n compiler.currentType\r\n );\r\n // fall-through\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createBinary(BinaryOp.RotlI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotlI64\r\n : BinaryOp.RotlI32,\r\n arg0,\r\n arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = 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.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret; // possibly overflows\r\n }\r\n case \"rotr\": { // rotr(value: T, shift: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n switch (compiler.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 ret = compiler.ensureSmallIntegerWrap(\r\n module.createBinary(BinaryOp.RotrI32, arg0, arg1),\r\n compiler.currentType\r\n );\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n ret = module.createBinary(BinaryOp.RotrI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n ret = module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotrI64\r\n : BinaryOp.RotrI32,\r\n arg0,\r\n arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = 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.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret; // possibly overflowws\r\n }\r\n case \"abs\": { // abs(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let currentFunction = compiler.currentFunction;\r\n\r\n // possibly overflows, e.g. abs(-128) == 128\r\n let tempLocal1 = currentFunction.getTempLocal(Type.i32, false);\r\n let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(Type.i32, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 31)) ^ (x >> 31)\r\n ret = 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 currentFunction.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = compiler.options;\r\n let currentFunction = compiler.currentFunction;\r\n let wasm64 = options.isWasm64;\r\n\r\n let tempLocal1 = currentFunction.getTempLocal(options.usizeType, false);\r\n let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(options.usizeType, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n ret = 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 currentFunction.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let currentFunction = compiler.currentFunction;\r\n\r\n let tempLocal1 = currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(Type.i64, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 63)) ^ (x >> 63)\r\n ret = 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 currentFunction.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\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 ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.AbsF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.AbsF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n default: { // void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"max\": { // max(left: T, right: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtI32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\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 let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtU32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtI64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.GtU64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.GtI64\r\n : BinaryOp.GtI32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.GtU64\r\n : BinaryOp.GtU32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createBinary(BinaryOp.MaxF32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createBinary(BinaryOp.MaxF64, arg0, arg1);\r\n break;\r\n }\r\n default: { // void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"min\": { // min(left: T, right: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtI32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\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 let flow = compiler.currentFunction.flow;\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg1, compiler.currentType)\r\n );\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtU32,\r\n module.createGetLocal(tempLocal0.index, NativeType.I32),\r\n module.createGetLocal(tempLocal1.index, NativeType.I32)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtI64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(BinaryOp.LtU64,\r\n module.createGetLocal(tempLocal0.index, NativeType.I64),\r\n module.createGetLocal(tempLocal1.index, NativeType.I64)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.LtI64\r\n : BinaryOp.LtI32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);\r\n let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n compiler.currentFunction.freeTempLocal(tempLocal0);\r\n ret = module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.LtU64\r\n : BinaryOp.LtU32,\r\n module.createGetLocal(tempLocal0.index, compiler.options.nativeSizeType),\r\n module.createGetLocal(tempLocal1.index, compiler.options.nativeSizeType)\r\n )\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createBinary(BinaryOp.MinF32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createBinary(BinaryOp.MinF64, arg0, arg1);\r\n break;\r\n }\r\n default: { // void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"ceil\": { // ceil(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.CeilF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.CeilF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"floor\": { // floor(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.FloorF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.FloorF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"copysign\": { // copysign(left: T, right: T) -> T\r\n if (operands.length != 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n arg1 = compiler.compileExpression(operands[1], compiler.currentType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n switch (compiler.currentType.kind) { // TODO: does an integer version make sense?\r\n case TypeKind.F32: {\r\n ret = module.createBinary(BinaryOp.CopysignF32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createBinary(BinaryOp.CopysignF64, arg0, arg1);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"nearest\": { // nearest(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.NearestF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.NearestF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"reinterpret\": { // reinterpret(value: *) -> T\r\n if (operands.length != 1) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n switch (typeArguments[0].kind) {\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n arg0 = compiler.compileExpression(operands[0], Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretF32, arg0);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretF64, arg0);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n if (typeArguments[0].is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n compiler.currentType = typeArguments[0];\r\n return module.createUnreachable();\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.ISIZE: {\r\n 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 ret = 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 arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretI32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n arg0 = compiler.compileExpression(operands[0], Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n ret = module.createUnary(UnaryOp.ReinterpretI64, arg0);\r\n break;\r\n }\r\n default: { // small integers and void\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n compiler.currentType = typeArguments[0];\r\n return ret;\r\n }\r\n case \"sqrt\": { // sqrt(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) { // TODO: integer versions (that return f64 or convert)?\r\n case TypeKind.F32: {\r\n ret = module.createUnary(UnaryOp.SqrtF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.SqrtF64, arg0);\r\n break;\r\n }\r\n // case TypeKind.VOID:\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"trunc\": { // trunc(value: T) -> T\r\n if (operands.length != 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments && typeArguments.length) {\r\n compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n }\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.USIZE: {\r\n if (compiler.currentType.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: { // any integer\r\n ret = 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 ret = module.createUnary(UnaryOp.TruncF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n ret = module.createUnary(UnaryOp.TruncF64, arg0);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n // memory access\r\n\r\n case \"load\": { // load(offset: usize, constantOffset?: usize) -> *\r\n if (operands.length < 1 || operands.length > 2) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n if (operands.length < 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n } else {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n }\r\n return module.createUnreachable();\r\n }\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n 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 offset = operands.length == 2 ? evaluateConstantOffset(compiler, operands[1]) : 0; // reports\r\n if (offset < 0) { // reported in evaluateConstantOffset\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = typeArguments[0];\r\n return module.createLoad(\r\n typeArguments[0].byteSize,\r\n typeArguments[0].is(TypeFlags.SIGNED | TypeFlags.INTEGER),\r\n arg0,\r\n typeArguments[0].is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n contextualType.size > typeArguments[0].size\r\n ? (compiler.currentType = contextualType).toNativeType()\r\n : (compiler.currentType = typeArguments[0]).toNativeType(),\r\n offset\r\n );\r\n }\r\n case \"store\": { // store(offset: usize, value: *, constantOffset?: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (operands.length < 2 || operands.length > 3) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n if (operands.length < 2) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n } else {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n }\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg1 = compiler.compileExpression(\r\n operands[1],\r\n typeArguments[0],\r\n typeArguments[0].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 type: Type;\r\n if (\r\n typeArguments[0].is(TypeFlags.INTEGER) &&\r\n (\r\n !compiler.currentType.is(TypeFlags.INTEGER) || // float to int\r\n compiler.currentType.size < typeArguments[0].size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(\r\n arg1,\r\n compiler.currentType, typeArguments[0],\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE, // still clears garbage bits\r\n operands[1]\r\n );\r\n type = typeArguments[0];\r\n } else {\r\n type = compiler.currentType;\r\n }\r\n let offset = operands.length == 3 ? evaluateConstantOffset(compiler, operands[2]) : 0; // reports\r\n if (offset < 0) { // reported in evaluateConstantOffset\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = Type.void;\r\n return module.createStore(typeArguments[0].byteSize, arg0, arg1, type.toNativeType(), offset);\r\n }\r\n case \"sizeof\": { // sizeof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (operands.length != 0) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n let byteSize = (typeArguments)[0].byteSize;\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 ret = module.createI32(byteSize);\r\n } else {\r\n ret = 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 ret = module.createI64(byteSize, 0);\r\n } else {\r\n ret = module.createI32(byteSize);\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"alignof\": { // alignof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (operands.length != 0) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n let byteSize = (typeArguments)[0].byteSize;\r\n let alignLog2: i32;\r\n switch (byteSize) {\r\n case 1: { alignLog2 = 0; break; }\r\n case 2: { alignLog2 = 1; break; }\r\n case 4: { alignLog2 = 2; break; }\r\n case 8: { alignLog2 = 3; break; }\r\n default: { assert(false); return module.createUnreachable(); }\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 ret = module.createI32(alignLog2);\r\n } else {\r\n ret = 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 ret = module.createI64(alignLog2, 0);\r\n } else {\r\n ret = module.createI32(alignLog2);\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"offsetof\": { // offsetof(fieldName?: string) -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (operands.length > 1) {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\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.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n let classType = typeArguments[0].classReference;\r\n if (!classType) {\r\n compiler.error( // TODO: better error\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\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 // control flow\r\n\r\n case \"select\": { // select(ifTrue: T, ifFalse: T, condition: bool) -> T\r\n if (operands.length != 3) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n arg0 = compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE);\r\n }\r\n let type = compiler.currentType;\r\n arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n 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 switch (compiler.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 ret = module.createSelect(arg0, arg1, arg2);\r\n break;\r\n }\r\n default: { // any other value type\r\n ret = module.createSelect(arg0, arg1, arg2);\r\n break;\r\n }\r\n case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"unreachable\": { // unreachable() -> *\r\n if (operands.length != 0) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n }\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return module.createUnreachable();\r\n }\r\n\r\n // host operations\r\n\r\n case \"memory.size\": { // memory.size() -> i32\r\n compiler.currentType = Type.i32;\r\n if (operands.length != 0) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n }\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return module.createHost(HostOp.CurrentMemory);\r\n }\r\n case \"memory.grow\": { // memory.grow(pages: i32) -> i32\r\n compiler.currentType = Type.i32;\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"0\", operands.length.toString(10)\r\n );\r\n arg0 = module.createUnreachable();\r\n } else {\r\n arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n }\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return module.createHost(HostOp.GrowMemory, null, [ arg0 ]);\r\n }\r\n // see: https://github.com/WebAssembly/bulk-memory-operations\r\n case \"memory.copy\": { // memory.copy(dest: usize, src: usize: n: usize) -> void\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 3) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg1 = compiler.compileExpression(\r\n operands[1],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg2 = compiler.compileExpression(\r\n operands[2],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.void;\r\n throw new Error(\"not implemented\");\r\n // return module.createHost(HostOp.MoveMemory, null, [ arg0, arg1, arg2 ]);\r\n }\r\n case \"memory.fill\": { // memory.fill(dest: usize, value: u8, n: usize) -> void\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 3) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"3\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg1 = compiler.compileExpression(\r\n operands[1],\r\n Type.u32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n arg2 = compiler.compileExpression(\r\n operands[2],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.void;\r\n throw new Error(\"not implemented\");\r\n // return module.createHost(HostOp.SetMemory, null, [ arg0, arg1, arg2 ]);\r\n }\r\n\r\n // other\r\n\r\n case \"changetype\": { // changetype(value: *) -> T\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = typeArguments[0];\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpressionRetainType(\r\n operands[0],\r\n typeArguments[0],\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = typeArguments[0];\r\n if (compiler.currentType.size != typeArguments[0].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 // if (reportNode.range.source.sourceKind != SourceKind.STDLIB)\r\n // compiler.warning(DiagnosticCode.Operation_is_unsafe, reportNode.range);\r\n return arg0; // any usize to any usize\r\n }\r\n case \"assert\": { // assert(isTrueish: T, message?: string) -> T with T != null\r\n if (operands.length < 1 || operands.length > 2) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0].nonNullableType;\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n if (operands.length < 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n } else if (operands.length > 2) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"2\", operands.length.toString(10)\r\n );\r\n }\r\n return module.createUnreachable();\r\n }\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0].nonNullableType;\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n arg0 = compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n arg0 = compiler.compileExpressionRetainType(operands[0], Type.bool, WrapMode.WRAP);\r\n }\r\n\r\n let type = compiler.currentType;\r\n compiler.currentType = type.nonNullableType;\r\n\r\n // just return ifTrueish if assertions are disabled, or simplify if dropped anyway\r\n if (compiler.options.noAssert) {\r\n if (contextualType == Type.void) {\r\n compiler.currentType = Type.void;\r\n return module.createNop();\r\n }\r\n return arg0;\r\n }\r\n\r\n let abort = compileAbort(compiler, operands.length == 2 ? operands[1] : null, reportNode);\r\n\r\n compiler.currentType = type.nonNullableType;\r\n\r\n if (contextualType == Type.void) { // simplify if dropped anyway\r\n switch (compiler.currentType.kind) {\r\n default: { // any integer up to 32-bits incl. bool\r\n ret = module.createIf(\r\n module.createUnary(UnaryOp.EqzI32,\r\n arg0\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n ret = module.createIf(\r\n module.createUnary(UnaryOp.EqzI64,\r\n arg0\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n ret = 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 ret = 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 ret = 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 case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = abort;\r\n break;\r\n }\r\n }\r\n compiler.currentType = Type.void;\r\n } else {\r\n switch (compiler.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 let flow = compiler.currentFunction.flow;\r\n let tempLocal = compiler.currentFunction.getAndFreeTempLocal(\r\n compiler.currentType,\r\n !flow.canOverflow(arg0, compiler.currentType)\r\n );\r\n ret = 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.I32:\r\n case TypeKind.U32:\r\n default: {\r\n let tempLocal = compiler.currentFunction.getAndFreeTempLocal(Type.i32, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(Type.i64, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(Type.f32, false);\r\n ret = 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.currentFunction.getAndFreeTempLocal(Type.f64, false);\r\n ret = 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 case TypeKind.VOID: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n ret = abort;\r\n break;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n case \"unchecked\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n let flow = compiler.currentFunction.flow;\r\n flow.set(FlowFlags.UNCHECKED_CONTEXT);\r\n ret = compiler.compileExpressionRetainType(operands[0], contextualType, WrapMode.NONE);\r\n flow.unset(FlowFlags.UNCHECKED_CONTEXT);\r\n return ret;\r\n }\r\n case \"call_indirect\": { // call_indirect(target: Function | u32, ...args: *[]) -> T\r\n if (operands.length < 1) {\r\n if (typeArguments) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n if (typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n let returnType: Type;\r\n if (typeArguments) {\r\n if (typeArguments.length != 1) {\r\n if (typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments.length.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n returnType = typeArguments[0];\r\n } else {\r\n returnType = contextualType;\r\n }\r\n arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32, WrapMode.NONE);\r\n if (compiler.currentType.kind != TypeKind.U32) {\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 signatureParts = new Array(numOperands + 1);\r\n let nativeReturnType = returnType.toNativeType();\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 signatureParts[i] = operandType.toSignatureString();\r\n nativeParamTypes[i] = operandType.toNativeType();\r\n }\r\n signatureParts[numOperands] = returnType.toSignatureString();\r\n let typeName = signatureParts.join(\"\");\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 \"instantiate\": {\r\n if (!(typeArguments && typeArguments.length == 1)) {\r\n if (typeArguments && typeArguments.length) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return module.createUnreachable();\r\n }\r\n let classInstance = typeArguments[0].classReference;\r\n if (!classInstance) {\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 compiler.compileInstantiate(classInstance, operands, reportNode);\r\n }\r\n\r\n // user-defined diagnostic macros\r\n\r\n case \"ERROR\": {\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 \"WARNING\": {\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 \"INFO\": {\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 // conversions\r\n\r\n case \"i8\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i8;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i8,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"i16\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i16;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i16,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"i32\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"i64\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.i64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.i64,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"isize\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = compiler.options.isWasm64\r\n ? Type.isize64\r\n : Type.isize32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n compiler.options.isWasm64\r\n ? Type.isize64\r\n : Type.isize32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u8\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u8;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u8,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u16\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u16;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u16,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u32\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"u64\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.u64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.u64,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"usize\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = compiler.options.usizeType;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"bool\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.bool;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.bool,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"f32\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.f32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.f32,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n case \"f64\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\r\n );\r\n compiler.currentType = Type.f64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(\r\n operands[0],\r\n Type.f64,\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n\r\n // gc\r\n\r\n case \"iterateRoots\": {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n if (operands.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, \"1\", operands.length.toString(10)\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 compiler.currentType = Type.void;\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 return module.createUnreachable();\r\n }\r\n compiler.currentType = Type.void;\r\n // just emit a call even if the function doesn't yet exist\r\n compiler.needsIterateRoots = true;\r\n return module.createCall(\"~iterateRoots\", [ expr ], NativeType.None);\r\n }\r\n }\r\n var expr = deferASMCall(compiler, prototype, operands, contextualType, reportNode);\r\n if (expr) {\r\n if (typeArguments && typeArguments.length) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return expr;\r\n }\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\r\n/** Defers an inline-assembler-like call to a built-in function. */\r\nfunction deferASMCall(\r\n compiler: Compiler,\r\n prototype: FunctionPrototype,\r\n operands: Expression[],\r\n contextualType: Type,\r\n reportNode: Node\r\n): ExpressionRef {\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 \"i32.clz\": return deferASM(\"clz\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.clz\": return deferASM(\"clz\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.ctz\": return deferASM(\"ctz\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.ctz\": return deferASM(\"ctz\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.popcnt\": return deferASM(\"popcnt\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.popcnt\": return deferASM(\"popcnt\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.rotl\": return deferASM(\"rotl\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.rotl\": return deferASM(\"rotl\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"i32.rotr\": return deferASM(\"rotr\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.rotr\": return deferASM(\"rotr\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case \"f32.abs\": return deferASM(\"abs\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.abs\": return deferASM(\"abs\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.max\": return deferASM(\"max\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.max\": return deferASM(\"max\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.min\": return deferASM(\"min\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.min\": return deferASM(\"min\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.ceil\": return deferASM(\"ceil\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.ceil\": return deferASM(\"ceil\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.floor\": return deferASM(\"floor\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.floor\": return deferASM(\"floor\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.copysign\": return deferASM(\"copysign\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.copysign\": return deferASM(\"copysign\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.nearest\": return deferASM(\"nearest\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.nearest\": return deferASM(\"nearest\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"i32.reinterpret_f32\": return deferASM(\"reinterpret\", compiler, Type.i32, operands, Type.f32, reportNode);\r\n case \"i64.reinterpret_f64\": return deferASM(\"reinterpret\", compiler, Type.i64, operands, Type.f64, reportNode);\r\n case \"f32.reinterpret_i32\": return deferASM(\"reinterpret\", compiler, Type.f32, operands, Type.i32, reportNode);\r\n case \"f64.reinterpret_i64\": return deferASM(\"reinterpret\", compiler, Type.f64, operands, Type.i64, reportNode);\r\n\r\n case \"f32.sqrt\": return deferASM(\"sqrt\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.sqrt\": return deferASM(\"sqrt\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"f32.trunc\": return deferASM(\"trunc\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.trunc\": return deferASM(\"trunc\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"i32.load8_s\": return deferASM(\"load\", compiler, Type.i8, operands, Type.i32, reportNode);\r\n case \"i32.load8_u\": return deferASM(\"load\", compiler, Type.u8, operands, Type.u32, reportNode);\r\n case \"i32.load16_s\": return deferASM(\"load\", compiler, Type.i16, operands, Type.i32, reportNode);\r\n case \"i32.load16_u\": return deferASM(\"load\", compiler, Type.u16, operands, Type.u32, reportNode);\r\n case \"i32.load\": return deferASM(\"load\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.load8_s\": return deferASM(\"load\", compiler, Type.i8, operands, Type.i64, reportNode);\r\n case \"i64.load8_u\": return deferASM(\"load\", compiler, Type.u8, operands, Type.u64, reportNode);\r\n case \"i64.load16_s\": return deferASM(\"load\", compiler, Type.i16, operands, Type.i64, reportNode);\r\n case \"i64.load16_u\": return deferASM(\"load\", compiler, Type.u16, operands, Type.u64, reportNode);\r\n case \"i64.load32_s\": return deferASM(\"load\", compiler, Type.i32, operands, Type.i64, reportNode);\r\n case \"i64.load32_u\": return deferASM(\"load\", compiler, Type.u32, operands, Type.u64, reportNode);\r\n case \"i64.load\": return deferASM(\"load\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n case \"f32.load\": return deferASM(\"load\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.load\": return deferASM(\"load\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n\r\n case \"i32.store8\": return deferASM(\"store\", compiler, Type.i8, operands, Type.i32, reportNode);\r\n case \"i32.store16\": return deferASM(\"store\", compiler, Type.i16, operands, Type.i32, reportNode);\r\n case \"i32.store\": return deferASM(\"store\", compiler, Type.i32, operands, Type.i32, reportNode);\r\n case \"i64.store8\": return deferASM(\"store\", compiler, Type.i8, operands, Type.i64, reportNode);\r\n case \"i64.store16\": return deferASM(\"store\", compiler, Type.i16, operands, Type.i64, reportNode);\r\n case \"i64.store32\": return deferASM(\"store\", compiler, Type.i32, operands, Type.i64, reportNode);\r\n case \"i64.store\": return deferASM(\"store\", compiler, Type.i64, operands, Type.i64, reportNode);\r\n case \"f32.store\": return deferASM(\"store\", compiler, Type.f32, operands, Type.f32, reportNode);\r\n case \"f64.store\": return deferASM(\"store\", compiler, Type.f64, operands, Type.f64, reportNode);\r\n }\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 valueType: Type,\r\n reportNode: Node\r\n): ExpressionRef {\r\n var prototype = assert(compiler.program.elementsLookup.get(name));\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n return compileCall(compiler, prototype, [ typeArgument ], operands, valueType, reportNode);\r\n}\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: Node\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.range, \"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.range, \"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.range, \"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.range, \"1\", operands.length.toString(10)\r\n );\r\n return null;\r\n}\r\n\r\n/** Evaluates a `constantOffset` argument.*/\r\nfunction evaluateConstantOffset(compiler: Compiler, expression: Expression): 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.Operation_not_supported,\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.Operation_not_supported,\r\n expression.range\r\n );\r\n value = -1;\r\n }\r\n }\r\n return value;\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 stringType = program.typesLookup.get(\"string\");\r\n if (!stringType) 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, stringType, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : stringType.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 requires. */\r\nexport function compileIterateRoots(compiler: Compiler): void {\r\n var module = compiler.module;\r\n var exprs = new Array();\r\n\r\n for (let element of compiler.program.elementsLookup.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 \"iv\"\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 \"iv\"\r\n )\r\n );\r\n }\r\n }\r\n }\r\n var typeRef = compiler.ensureFunctionType([ Type.i32 ], Type.void);\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 internals)\r\n var members = classInstance.members;\r\n if (classInstance.prototype.declaration.range.source.isLibrary) {\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 nativeSizeType == NativeType.I64 ? \"Iv\" : \"iv\"\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","/** @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.DOLLAR\r\n || c == CharCode._\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.DOLLAR\r\n || c == CharCode._\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\r\n while (lo + 1 < hi) {\r\n mid = lo + (hi - lo) / 2;\r\n mid -= mid % 2;\r\n if (map[mid] <= code && code <= map[mid + 1]) {\r\n return true;\r\n }\r\n if (code < map[mid]) {\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): Map {\r\n if (original) {\r\n let cloned = new Map();\r\n for (let [k, v] of original) cloned.set(k, v);\r\n return cloned;\r\n }\r\n return new Map();\r\n}\r\n","/** @module util *//***/\r\n\r\nimport {\r\n CharCode\r\n} from \"./charcode\";\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) + String.fromCharCode(separator) + 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 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 `noTreeShaking` option. */\r\nexport function setNoTreeShaking(options: Options, noTreeShaking: bool): void {\r\n options.noTreeShaking = noTreeShaking;\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 `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\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 \"./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 diff --git a/package-lock.json b/package-lock.json index a51e6b06..9d87142a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "integrity": "sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==", "dev": true, "requires": { - "@types/node": "*" + "@types/node": "10.12.18" } }, "@types/glob": { @@ -30,9 +30,9 @@ "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", "dev": true, "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" + "@types/events": "1.2.0", + "@types/minimatch": "3.0.3", + "@types/node": "10.12.18" } }, "@types/handlebars": { @@ -77,8 +77,8 @@ "integrity": "sha512-vs1hCC8RxLHRu2bwumNyYRNrU3o8BtZhLysH5A4I98iYmA2APl6R3uNQb5ihl+WiwH0xdC9LLO+vRrXLs/Kyxg==", "dev": true, "requires": { - "@types/glob": "*", - "@types/node": "*" + "@types/glob": "7.1.1", + "@types/node": "10.12.18" } }, "@webassemblyjs/ast": { @@ -155,7 +155,7 @@ "integrity": "sha512-Mmqx/cS68K1tSrvRLtaV/Lp3NZWzXtOHUW2IvDvl2sihAwJh4ACE0eL6A8FvMyDG9abes3saB6dMimLOs+HMoQ==", "dev": true, "requires": { - "@xtuc/ieee754": "^1.2.0" + "@xtuc/ieee754": "1.2.0" } }, "@webassemblyjs/leb128": { @@ -277,7 +277,7 @@ "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", "dev": true, "requires": { - "acorn": "^5.0.0" + "acorn": "5.7.3" } }, "ajv": { @@ -286,10 +286,10 @@ "integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" } }, "ajv-errors": { @@ -316,7 +316,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "color-convert": "1.9.3" } }, "anymatch": { @@ -325,8 +325,8 @@ "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" + "micromatch": "3.1.10", + "normalize-path": "2.1.1" } }, "aproba": { @@ -341,7 +341,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "~1.0.2" + "sprintf-js": "1.0.3" } }, "arr-diff": { @@ -380,9 +380,9 @@ "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" } }, "assert": { @@ -423,7 +423,7 @@ "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "4.17.11" } }, "async-each": { @@ -444,9 +444,9 @@ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" }, "dependencies": { "ansi-styles": { @@ -461,11 +461,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" } }, "supports-color": { @@ -487,13 +487,13 @@ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" }, "dependencies": { "define-property": { @@ -502,7 +502,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "^1.0.0" + "is-descriptor": "1.0.2" } }, "is-accessor-descriptor": { @@ -511,7 +511,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-data-descriptor": { @@ -520,7 +520,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-descriptor": { @@ -529,9 +529,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } } } @@ -555,9 +555,9 @@ "dev": true }, "binaryen": { - "version": "63.0.0-nightly.20190107", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-63.0.0-nightly.20190107.tgz", - "integrity": "sha512-vck6ZESU9q6DeEK9v/Fk2O8d2jBsSrNlia8jpmdLZv5eqmNWpkNli+QMRa9Ezfb4wi3c+NVMuxT3Ck0g9GYe8A==" + "version": "67.0.0-nightly.20190203", + "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-67.0.0-nightly.20190203.tgz", + "integrity": "sha512-2ngv8pWSckIsIq0VfY/PqOPXDEzcdQU4rm8Oi5AVqjAy18yexfaxQRWC3hx1ypDhj7Xydcb22IBAlZrlco2TKw==" }, "bluebird": { "version": "3.5.3", @@ -576,7 +576,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "^1.0.0", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, @@ -586,16 +586,16 @@ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.3", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" }, "dependencies": { "extend-shallow": { @@ -604,7 +604,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-extendable": "0.1.1" } } } @@ -627,12 +627,12 @@ "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "browserify-cipher": { @@ -641,9 +641,9 @@ "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" + "browserify-aes": "1.2.0", + "browserify-des": "1.0.2", + "evp_bytestokey": "1.0.3" } }, "browserify-des": { @@ -652,10 +652,10 @@ "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "dev": true, "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "browserify-rsa": { @@ -664,8 +664,8 @@ "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" + "bn.js": "4.11.8", + "randombytes": "2.0.6" } }, "browserify-sign": { @@ -674,13 +674,13 @@ "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "dev": true, "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "elliptic": "6.4.1", + "inherits": "2.0.3", + "parse-asn1": "5.1.1" } }, "browserify-zlib": { @@ -689,7 +689,7 @@ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "~1.0.5" + "pako": "1.0.7" } }, "buffer": { @@ -698,9 +698,9 @@ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" + "base64-js": "1.3.0", + "ieee754": "1.1.12", + "isarray": "1.0.0" } }, "buffer-from": { @@ -733,20 +733,20 @@ "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==", "dev": true, "requires": { - "bluebird": "^3.5.3", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.3", - "graceful-fs": "^4.1.15", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" + "bluebird": "3.5.3", + "chownr": "1.1.1", + "figgy-pudding": "3.5.1", + "glob": "7.1.3", + "graceful-fs": "4.1.15", + "lru-cache": "5.1.1", + "mississippi": "3.0.0", + "mkdirp": "0.5.1", + "move-concurrently": "1.0.1", + "promise-inflight": "1.0.1", + "rimraf": "2.6.3", + "ssri": "6.0.1", + "unique-filename": "1.1.1", + "y18n": "4.0.0" } }, "cache-base": { @@ -755,15 +755,15 @@ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" } }, "camelcase": { @@ -778,9 +778,9 @@ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.5.0" } }, "chokidar": { @@ -789,19 +789,19 @@ "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", "dev": true, "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.0", - "braces": "^2.3.0", - "fsevents": "^1.2.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "lodash.debounce": "^4.0.8", - "normalize-path": "^2.1.1", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0", - "upath": "^1.0.5" + "anymatch": "2.0.0", + "async-each": "1.0.1", + "braces": "2.3.2", + "fsevents": "1.2.4", + "glob-parent": "3.1.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "4.0.0", + "lodash.debounce": "4.0.8", + "normalize-path": "2.1.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.2.1", + "upath": "1.1.0" } }, "chownr": { @@ -816,7 +816,7 @@ "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==", "dev": true, "requires": { - "tslib": "^1.9.0" + "tslib": "1.9.3" } }, "cipher-base": { @@ -825,8 +825,8 @@ "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "class-utils": { @@ -835,10 +835,10 @@ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" }, "dependencies": { "define-property": { @@ -847,7 +847,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "is-descriptor": "0.1.6" } } } @@ -858,9 +858,9 @@ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" }, "dependencies": { "ansi-regex": { @@ -875,7 +875,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "3.0.0" } } } @@ -892,8 +892,8 @@ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" + "map-visit": "1.0.0", + "object-visit": "1.0.1" } }, "color-convert": { @@ -940,10 +940,10 @@ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" + "buffer-from": "1.1.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" } }, "console-browserify": { @@ -952,7 +952,7 @@ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "^0.1.4" + "date-now": "0.1.4" } }, "constants-browserify": { @@ -967,12 +967,12 @@ "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", "dev": true, "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" + "aproba": "1.2.0", + "fs-write-stream-atomic": "1.0.10", + "iferr": "0.1.5", + "mkdirp": "0.5.1", + "rimraf": "2.6.3", + "run-queue": "1.0.3" } }, "copy-descriptor": { @@ -993,8 +993,8 @@ "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", "dev": true, "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" + "bn.js": "4.11.8", + "elliptic": "6.4.1" } }, "create-hash": { @@ -1003,11 +1003,11 @@ "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "md5.js": "1.3.5", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" } }, "create-hmac": { @@ -1016,12 +1016,12 @@ "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "inherits": "2.0.3", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" } }, "cross-spawn": { @@ -1030,11 +1030,11 @@ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "nice-try": "1.0.5", + "path-key": "2.0.1", + "semver": "5.6.0", + "shebang-command": "1.2.0", + "which": "1.3.1" } }, "crypto-browserify": { @@ -1043,17 +1043,17 @@ "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" + "browserify-cipher": "1.0.1", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.3", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "diffie-hellman": "5.0.3", + "inherits": "2.0.3", + "pbkdf2": "3.0.17", + "public-encrypt": "4.0.3", + "randombytes": "2.0.6", + "randomfill": "1.0.4" } }, "cyclist": { @@ -1095,8 +1095,8 @@ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" + "is-descriptor": "1.0.2", + "isobject": "3.0.1" }, "dependencies": { "is-accessor-descriptor": { @@ -1105,7 +1105,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-data-descriptor": { @@ -1114,7 +1114,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-descriptor": { @@ -1123,9 +1123,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } } } @@ -1136,8 +1136,8 @@ "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "dev": true, "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" } }, "detect-file": { @@ -1158,9 +1158,9 @@ "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.6" } }, "domain-browser": { @@ -1175,10 +1175,10 @@ "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", "dev": true, "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" + "end-of-stream": "1.4.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "stream-shift": "1.0.0" } }, "elliptic": { @@ -1187,13 +1187,13 @@ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "dev": true, "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.7", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "emojis-list": { @@ -1208,7 +1208,7 @@ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "once": "^1.4.0" + "once": "1.4.0" } }, "enhanced-resolve": { @@ -1217,9 +1217,9 @@ "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "tapable": "^1.0.0" + "graceful-fs": "4.1.15", + "memory-fs": "0.4.1", + "tapable": "1.1.1" } }, "errno": { @@ -1228,7 +1228,7 @@ "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "dev": true, "requires": { - "prr": "~1.0.1" + "prr": "1.0.1" } }, "escape-string-regexp": { @@ -1243,8 +1243,8 @@ "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", "dev": true, "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "esrecurse": "4.2.1", + "estraverse": "4.2.0" } }, "esprima": { @@ -1259,7 +1259,7 @@ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "^4.1.0" + "estraverse": "4.2.0" } }, "estraverse": { @@ -1286,8 +1286,8 @@ "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" + "md5.js": "1.3.5", + "safe-buffer": "5.1.2" } }, "execa": { @@ -1296,13 +1296,13 @@ "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "cross-spawn": "6.0.5", + "get-stream": "4.1.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" } }, "expand-brackets": { @@ -1311,13 +1311,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" }, "dependencies": { "define-property": { @@ -1326,7 +1326,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "is-descriptor": "0.1.6" } }, "extend-shallow": { @@ -1335,7 +1335,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-extendable": "0.1.1" } } } @@ -1346,7 +1346,7 @@ "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "dev": true, "requires": { - "homedir-polyfill": "^1.0.1" + "homedir-polyfill": "1.0.1" } }, "extend-shallow": { @@ -1355,8 +1355,8 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" }, "dependencies": { "is-extendable": { @@ -1365,7 +1365,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "^2.0.4" + "is-plain-object": "2.0.4" } } } @@ -1376,14 +1376,14 @@ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" }, "dependencies": { "define-property": { @@ -1392,7 +1392,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "^1.0.0" + "is-descriptor": "1.0.2" } }, "extend-shallow": { @@ -1401,7 +1401,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-extendable": "0.1.1" } }, "is-accessor-descriptor": { @@ -1410,7 +1410,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-data-descriptor": { @@ -1419,7 +1419,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-descriptor": { @@ -1428,9 +1428,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } } } @@ -1459,10 +1459,10 @@ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" }, "dependencies": { "extend-shallow": { @@ -1471,7 +1471,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-extendable": "0.1.1" } } } @@ -1482,9 +1482,9 @@ "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", "dev": true, "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^3.0.0" + "commondir": "1.0.1", + "make-dir": "1.3.0", + "pkg-dir": "3.0.0" } }, "find-up": { @@ -1493,7 +1493,7 @@ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "3.0.0" } }, "findup-sync": { @@ -1502,10 +1502,10 @@ "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", "dev": true, "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" + "detect-file": "1.0.0", + "is-glob": "3.1.0", + "micromatch": "3.1.10", + "resolve-dir": "1.0.1" }, "dependencies": { "is-glob": { @@ -1514,7 +1514,7 @@ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { - "is-extglob": "^2.1.0" + "is-extglob": "2.1.1" } } } @@ -1525,8 +1525,8 @@ "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", "dev": true, "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" + "inherits": "2.0.3", + "readable-stream": "2.3.6" } }, "for-in": { @@ -1541,7 +1541,7 @@ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "map-cache": "^0.2.2" + "map-cache": "0.2.2" } }, "from2": { @@ -1550,8 +1550,8 @@ "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "dev": true, "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" + "inherits": "2.0.3", + "readable-stream": "2.3.6" } }, "fs-extra": { @@ -1560,9 +1560,9 @@ "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "graceful-fs": "4.1.15", + "jsonfile": "4.0.0", + "universalify": "0.1.2" } }, "fs-write-stream-atomic": { @@ -1571,10 +1571,10 @@ "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" + "graceful-fs": "4.1.15", + "iferr": "0.1.5", + "imurmurhash": "0.1.4", + "readable-stream": "2.3.6" } }, "fs.realpath": { @@ -1589,8 +1589,8 @@ "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "2.12.1", + "node-pre-gyp": "0.10.0" }, "dependencies": { "abbrev": { @@ -1616,8 +1616,8 @@ "dev": true, "optional": true, "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "delegates": "1.0.0", + "readable-stream": "2.3.6" } }, "balanced-match": { @@ -1630,7 +1630,7 @@ "bundled": true, "dev": true, "requires": { - "balanced-match": "^1.0.0", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, @@ -1694,7 +1694,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "2.2.4" } }, "fs.realpath": { @@ -1709,14 +1709,14 @@ "dev": true, "optional": true, "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" } }, "glob": { @@ -1725,12 +1725,12 @@ "dev": true, "optional": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "has-unicode": { @@ -1745,7 +1745,7 @@ "dev": true, "optional": true, "requires": { - "safer-buffer": "^2.1.0" + "safer-buffer": "2.1.2" } }, "ignore-walk": { @@ -1754,7 +1754,7 @@ "dev": true, "optional": true, "requires": { - "minimatch": "^3.0.4" + "minimatch": "3.0.4" } }, "inflight": { @@ -1763,8 +1763,8 @@ "dev": true, "optional": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { @@ -1783,7 +1783,7 @@ "bundled": true, "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "number-is-nan": "1.0.1" } }, "isarray": { @@ -1797,7 +1797,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -1810,8 +1810,8 @@ "bundled": true, "dev": true, "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" + "safe-buffer": "5.1.1", + "yallist": "3.0.2" } }, "minizlib": { @@ -1820,7 +1820,7 @@ "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "2.2.4" } }, "mkdirp": { @@ -1843,9 +1843,9 @@ "dev": true, "optional": true, "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" + "debug": "2.6.9", + "iconv-lite": "0.4.21", + "sax": "1.2.4" } }, "node-pre-gyp": { @@ -1854,16 +1854,16 @@ "dev": true, "optional": true, "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" + "detect-libc": "1.0.3", + "mkdirp": "0.5.1", + "needle": "2.2.0", + "nopt": "4.0.1", + "npm-packlist": "1.1.10", + "npmlog": "4.1.2", + "rc": "1.2.7", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.1" } }, "nopt": { @@ -1872,8 +1872,8 @@ "dev": true, "optional": true, "requires": { - "abbrev": "1", - "osenv": "^0.1.4" + "abbrev": "1.1.1", + "osenv": "0.1.5" } }, "npm-bundled": { @@ -1888,8 +1888,8 @@ "dev": true, "optional": true, "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" } }, "npmlog": { @@ -1898,10 +1898,10 @@ "dev": true, "optional": true, "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" } }, "number-is-nan": { @@ -1920,7 +1920,7 @@ "bundled": true, "dev": true, "requires": { - "wrappy": "1" + "wrappy": "1.0.2" } }, "os-homedir": { @@ -1941,8 +1941,8 @@ "dev": true, "optional": true, "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" } }, "path-is-absolute": { @@ -1963,10 +1963,10 @@ "dev": true, "optional": true, "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" + "deep-extend": "0.5.1", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" }, "dependencies": { "minimist": { @@ -1983,13 +1983,13 @@ "dev": true, "optional": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" } }, "rimraf": { @@ -1998,7 +1998,7 @@ "dev": true, "optional": true, "requires": { - "glob": "^7.0.5" + "glob": "7.1.2" } }, "safe-buffer": { @@ -2041,9 +2041,9 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" } }, "string_decoder": { @@ -2052,7 +2052,7 @@ "dev": true, "optional": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "5.1.1" } }, "strip-ansi": { @@ -2060,7 +2060,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" } }, "strip-json-comments": { @@ -2075,13 +2075,13 @@ "dev": true, "optional": true, "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.2.4", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.1", + "yallist": "3.0.2" } }, "util-deprecate": { @@ -2096,7 +2096,7 @@ "dev": true, "optional": true, "requires": { - "string-width": "^1.0.2" + "string-width": "1.0.2" } }, "wrappy": { @@ -2123,7 +2123,7 @@ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { - "pump": "^3.0.0" + "pump": "3.0.0" } }, "get-value": { @@ -2137,12 +2137,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "glob-parent": { @@ -2151,8 +2151,8 @@ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" + "is-glob": "3.1.0", + "path-dirname": "1.0.2" }, "dependencies": { "is-glob": { @@ -2161,7 +2161,7 @@ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { - "is-extglob": "^2.1.0" + "is-extglob": "2.1.1" } } } @@ -2172,9 +2172,9 @@ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" + "global-prefix": "1.0.2", + "is-windows": "1.0.2", + "resolve-dir": "1.0.1" } }, "global-modules-path": { @@ -2189,11 +2189,11 @@ "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "dev": true, "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" + "expand-tilde": "2.0.2", + "homedir-polyfill": "1.0.1", + "ini": "1.3.5", + "is-windows": "1.0.2", + "which": "1.3.1" } }, "graceful-fs": { @@ -2208,10 +2208,10 @@ "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", "dev": true, "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "async": "2.6.1", + "optimist": "0.6.1", + "source-map": "0.6.1", + "uglify-js": "3.4.9" }, "dependencies": { "source-map": { @@ -2228,7 +2228,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" } }, "has-flag": { @@ -2243,9 +2243,9 @@ "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" } }, "has-values": { @@ -2254,8 +2254,8 @@ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" + "is-number": "3.0.0", + "kind-of": "4.0.0" }, "dependencies": { "kind-of": { @@ -2264,7 +2264,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } } } @@ -2275,8 +2275,8 @@ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "hash.js": { @@ -2285,8 +2285,8 @@ "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" } }, "highlight.js": { @@ -2301,9 +2301,9 @@ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "hash.js": "1.1.7", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" } }, "homedir-polyfill": { @@ -2312,7 +2312,7 @@ "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", "dev": true, "requires": { - "parse-passwd": "^1.0.0" + "parse-passwd": "1.0.0" } }, "https-browserify": { @@ -2339,8 +2339,8 @@ "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", "dev": true, "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" + "pkg-dir": "3.0.0", + "resolve-cwd": "2.0.0" } }, "imurmurhash": { @@ -2360,8 +2360,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "^1.3.0", - "wrappy": "1" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { @@ -2393,7 +2393,7 @@ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { - "kind-of": "^3.0.2" + "kind-of": "3.2.2" }, "dependencies": { "kind-of": { @@ -2402,7 +2402,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } } } @@ -2413,7 +2413,7 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "^1.0.0" + "binary-extensions": "1.12.0" } }, "is-buffer": { @@ -2428,7 +2428,7 @@ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { - "kind-of": "^3.0.2" + "kind-of": "3.2.2" }, "dependencies": { "kind-of": { @@ -2437,7 +2437,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } } } @@ -2448,9 +2448,9 @@ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" }, "dependencies": { "kind-of": { @@ -2485,7 +2485,7 @@ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "^2.1.1" + "is-extglob": "2.1.1" } }, "is-number": { @@ -2494,7 +2494,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "^3.0.2" + "kind-of": "3.2.2" }, "dependencies": { "kind-of": { @@ -2503,7 +2503,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } } } @@ -2514,7 +2514,7 @@ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "isobject": "^3.0.1" + "isobject": "3.0.1" } }, "is-stream": { @@ -2559,8 +2559,8 @@ "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "1.0.10", + "esprima": "4.0.1" } }, "json-parse-better-errors": { @@ -2581,7 +2581,7 @@ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, "requires": { - "minimist": "^1.2.0" + "minimist": "1.2.0" } }, "jsonfile": { @@ -2590,7 +2590,7 @@ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "4.1.15" } }, "kind-of": { @@ -2605,7 +2605,7 @@ "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { - "invert-kv": "^2.0.0" + "invert-kv": "2.0.0" } }, "lightercollective": { @@ -2626,9 +2626,9 @@ "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", "dev": true, "requires": { - "big.js": "^5.2.2", - "emojis-list": "^2.0.0", - "json5": "^1.0.1" + "big.js": "5.2.2", + "emojis-list": "2.1.0", + "json5": "1.0.1" } }, "locate-path": { @@ -2637,8 +2637,8 @@ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "3.0.0", + "path-exists": "3.0.0" } }, "lodash": { @@ -2664,7 +2664,7 @@ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "requires": { - "yallist": "^3.0.2" + "yallist": "3.0.3" } }, "make-dir": { @@ -2673,7 +2673,7 @@ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { - "pify": "^3.0.0" + "pify": "3.0.0" } }, "make-error": { @@ -2688,7 +2688,7 @@ "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "requires": { - "p-defer": "^1.0.0" + "p-defer": "1.0.0" } }, "map-cache": { @@ -2703,7 +2703,7 @@ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { - "object-visit": "^1.0.0" + "object-visit": "1.0.1" } }, "marked": { @@ -2718,9 +2718,9 @@ "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "hash-base": "3.0.4", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "mem": { @@ -2729,9 +2729,9 @@ "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", "dev": true, "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" + "map-age-cleaner": "0.1.3", + "mimic-fn": "1.2.0", + "p-is-promise": "1.1.0" } }, "memory-fs": { @@ -2740,8 +2740,8 @@ "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", "dev": true, "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" + "errno": "0.1.7", + "readable-stream": "2.3.6" } }, "micromatch": { @@ -2750,19 +2750,19 @@ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" } }, "miller-rabin": { @@ -2771,8 +2771,8 @@ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" + "bn.js": "4.11.8", + "brorand": "1.1.0" } }, "mimic-fn": { @@ -2798,7 +2798,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -2813,16 +2813,16 @@ "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", "dev": true, "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" + "concat-stream": "1.6.2", + "duplexify": "3.6.1", + "end-of-stream": "1.4.1", + "flush-write-stream": "1.0.3", + "from2": "2.3.0", + "parallel-transform": "1.1.0", + "pump": "3.0.0", + "pumpify": "1.5.1", + "stream-each": "1.2.3", + "through2": "2.0.5" } }, "mixin-deep": { @@ -2831,8 +2831,8 @@ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" + "for-in": "1.0.2", + "is-extendable": "1.0.1" }, "dependencies": { "is-extendable": { @@ -2841,7 +2841,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "^2.0.4" + "is-plain-object": "2.0.4" } } } @@ -2869,12 +2869,12 @@ "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", "dev": true, "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" + "aproba": "1.2.0", + "copy-concurrently": "1.0.5", + "fs-write-stream-atomic": "1.0.10", + "mkdirp": "0.5.1", + "rimraf": "2.6.3", + "run-queue": "1.0.3" } }, "ms": { @@ -2896,17 +2896,17 @@ "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" } }, "neo-async": { @@ -2927,28 +2927,28 @@ "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", "dev": true, "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^1.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", + "assert": "1.4.1", + "browserify-zlib": "0.2.0", + "buffer": "4.9.1", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "domain-browser": "1.2.0", + "events": "1.1.1", + "https-browserify": "1.0.0", + "os-browserify": "0.3.0", "path-browserify": "0.0.0", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "readable-stream": "2.3.6", + "stream-browserify": "2.0.1", + "stream-http": "2.8.3", + "string_decoder": "1.1.1", + "timers-browserify": "2.0.10", "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.10.3", + "url": "0.11.0", + "util": "0.10.4", "vm-browserify": "0.0.4" }, "dependencies": { @@ -2966,7 +2966,7 @@ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "remove-trailing-separator": "^1.0.1" + "remove-trailing-separator": "1.1.0" } }, "npm-run-path": { @@ -2975,7 +2975,7 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { - "path-key": "^2.0.0" + "path-key": "2.0.1" } }, "number-is-nan": { @@ -2990,9 +2990,9 @@ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" }, "dependencies": { "define-property": { @@ -3001,7 +3001,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "is-descriptor": "0.1.6" } }, "kind-of": { @@ -3010,7 +3010,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } } } @@ -3021,7 +3021,7 @@ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "isobject": "^3.0.0" + "isobject": "3.0.1" } }, "object.pick": { @@ -3030,7 +3030,7 @@ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { - "isobject": "^3.0.1" + "isobject": "3.0.1" } }, "once": { @@ -3038,7 +3038,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1" + "wrappy": "1.0.2" } }, "optimist": { @@ -3047,8 +3047,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "minimist": "0.0.10", + "wordwrap": "0.0.3" }, "dependencies": { "minimist": { @@ -3071,9 +3071,9 @@ "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "execa": "1.0.0", + "lcid": "2.0.0", + "mem": "4.0.0" } }, "p-defer": { @@ -3100,7 +3100,7 @@ "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", "dev": true, "requires": { - "p-try": "^2.0.0" + "p-try": "2.0.0" } }, "p-locate": { @@ -3109,7 +3109,7 @@ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "2.1.0" } }, "p-try": { @@ -3130,9 +3130,9 @@ "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", "dev": true, "requires": { - "cyclist": "~0.2.2", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" + "cyclist": "0.2.2", + "inherits": "2.0.3", + "readable-stream": "2.3.6" } }, "parse-asn1": { @@ -3141,11 +3141,11 @@ "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" + "asn1.js": "4.10.1", + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.17" } }, "parse-passwd": { @@ -3201,11 +3201,11 @@ "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", "dev": true, "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" } }, "pify": { @@ -3220,7 +3220,7 @@ "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { - "find-up": "^3.0.0" + "find-up": "3.0.0" } }, "posix-character-classes": { @@ -3265,12 +3265,12 @@ "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", "dev": true, "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "parse-asn1": "5.1.1", + "randombytes": "2.0.6", + "safe-buffer": "5.1.2" } }, "pump": { @@ -3279,8 +3279,8 @@ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "end-of-stream": "1.4.1", + "once": "1.4.0" } }, "pumpify": { @@ -3289,9 +3289,9 @@ "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "dev": true, "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" + "duplexify": "3.6.1", + "inherits": "2.0.3", + "pump": "2.0.1" }, "dependencies": { "pump": { @@ -3300,8 +3300,8 @@ "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "end-of-stream": "1.4.1", + "once": "1.4.0" } } } @@ -3330,7 +3330,7 @@ "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "dev": true, "requires": { - "safe-buffer": "^5.1.0" + "safe-buffer": "5.1.2" } }, "randomfill": { @@ -3339,8 +3339,8 @@ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" + "randombytes": "2.0.6", + "safe-buffer": "5.1.2" } }, "readable-stream": { @@ -3349,13 +3349,13 @@ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" } }, "readdirp": { @@ -3364,9 +3364,9 @@ "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" + "graceful-fs": "4.1.15", + "micromatch": "3.1.10", + "readable-stream": "2.3.6" } }, "rechoir": { @@ -3375,7 +3375,7 @@ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "^1.1.6" + "resolve": "1.8.1" } }, "regex-not": { @@ -3384,8 +3384,8 @@ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" } }, "remove-trailing-separator": { @@ -3424,7 +3424,7 @@ "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { - "path-parse": "^1.0.5" + "path-parse": "1.0.6" } }, "resolve-cwd": { @@ -3433,7 +3433,7 @@ "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", "dev": true, "requires": { - "resolve-from": "^3.0.0" + "resolve-from": "3.0.0" } }, "resolve-dir": { @@ -3442,8 +3442,8 @@ "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "dev": true, "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" + "expand-tilde": "2.0.2", + "global-modules": "1.0.0" } }, "resolve-from": { @@ -3470,7 +3470,7 @@ "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "^7.1.3" + "glob": "7.1.3" } }, "ripemd160": { @@ -3479,8 +3479,8 @@ "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "hash-base": "3.0.4", + "inherits": "2.0.3" } }, "run-queue": { @@ -3489,7 +3489,7 @@ "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", "dev": true, "requires": { - "aproba": "^1.1.1" + "aproba": "1.2.0" } }, "safe-buffer": { @@ -3504,7 +3504,7 @@ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { - "ret": "~0.1.10" + "ret": "0.1.15" } }, "schema-utils": { @@ -3513,8 +3513,8 @@ "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0" + "ajv": "6.6.2", + "ajv-keywords": "3.2.0" } }, "semver": { @@ -3541,10 +3541,10 @@ "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" }, "dependencies": { "extend-shallow": { @@ -3553,7 +3553,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-extendable": "0.1.1" } } } @@ -3570,8 +3570,8 @@ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "shebang-command": { @@ -3580,7 +3580,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "1.0.0" } }, "shebang-regex": { @@ -3595,9 +3595,9 @@ "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", "dev": true, "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" + "glob": "7.1.3", + "interpret": "1.1.0", + "rechoir": "0.6.2" } }, "signal-exit": { @@ -3612,14 +3612,14 @@ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.1" }, "dependencies": { "define-property": { @@ -3628,7 +3628,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "is-descriptor": "0.1.6" } }, "extend-shallow": { @@ -3637,7 +3637,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-extendable": "0.1.1" } } } @@ -3648,9 +3648,9 @@ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" }, "dependencies": { "define-property": { @@ -3659,7 +3659,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "^1.0.0" + "is-descriptor": "1.0.2" } }, "is-accessor-descriptor": { @@ -3668,7 +3668,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-data-descriptor": { @@ -3677,7 +3677,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "kind-of": "6.0.2" } }, "is-descriptor": { @@ -3686,9 +3686,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" } } } @@ -3699,7 +3699,7 @@ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "kind-of": "^3.2.0" + "kind-of": "3.2.2" }, "dependencies": { "kind-of": { @@ -3708,7 +3708,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } } } @@ -3731,11 +3731,11 @@ "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "dev": true, "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" + "atob": "2.1.2", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" } }, "source-map-support": { @@ -3744,8 +3744,8 @@ "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "buffer-from": "1.1.1", + "source-map": "0.6.1" }, "dependencies": { "source-map": { @@ -3768,7 +3768,7 @@ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "extend-shallow": "^3.0.0" + "extend-shallow": "3.0.2" } }, "sprintf-js": { @@ -3783,7 +3783,7 @@ "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", "dev": true, "requires": { - "figgy-pudding": "^3.5.1" + "figgy-pudding": "3.5.1" } }, "static-extend": { @@ -3792,8 +3792,8 @@ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" + "define-property": "0.2.5", + "object-copy": "0.1.0" }, "dependencies": { "define-property": { @@ -3802,7 +3802,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "is-descriptor": "0.1.6" } } } @@ -3813,8 +3813,8 @@ "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" + "inherits": "2.0.3", + "readable-stream": "2.3.6" } }, "stream-each": { @@ -3823,8 +3823,8 @@ "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" + "end-of-stream": "1.4.1", + "stream-shift": "1.0.0" } }, "stream-http": { @@ -3833,11 +3833,11 @@ "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", "dev": true, "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" } }, "stream-shift": { @@ -3852,8 +3852,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" }, "dependencies": { "ansi-regex": { @@ -3868,7 +3868,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "3.0.0" } } } @@ -3879,7 +3879,7 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "5.1.2" } }, "strip-ansi": { @@ -3888,7 +3888,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" } }, "strip-eof": { @@ -3903,7 +3903,7 @@ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "3.0.0" } }, "tapable": { @@ -3918,9 +3918,9 @@ "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==", "dev": true, "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1", - "source-map-support": "~0.5.6" + "commander": "2.17.1", + "source-map": "0.6.1", + "source-map-support": "0.5.9" }, "dependencies": { "commander": { @@ -3943,14 +3943,14 @@ "integrity": "sha512-GGSt+gbT0oKcMDmPx4SRSfJPE1XaN3kQRWG4ghxKQw9cn5G9x6aCKSsgYdvyM0na9NJ4Drv0RG6jbBByZ5CMjw==", "dev": true, "requires": { - "cacache": "^11.0.2", - "find-cache-dir": "^2.0.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^1.4.0", - "source-map": "^0.6.1", - "terser": "^3.8.1", - "webpack-sources": "^1.1.0", - "worker-farm": "^1.5.2" + "cacache": "11.3.2", + "find-cache-dir": "2.0.0", + "schema-utils": "1.0.0", + "serialize-javascript": "1.6.1", + "source-map": "0.6.1", + "terser": "3.14.1", + "webpack-sources": "1.3.0", + "worker-farm": "1.6.0" }, "dependencies": { "schema-utils": { @@ -3959,9 +3959,9 @@ "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "ajv": "6.6.2", + "ajv-errors": "1.0.1", + "ajv-keywords": "3.2.0" } }, "source-map": { @@ -3978,8 +3978,8 @@ "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "readable-stream": "2.3.6", + "xtend": "4.0.1" } }, "timers-browserify": { @@ -3988,7 +3988,7 @@ "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", "dev": true, "requires": { - "setimmediate": "^1.0.4" + "setimmediate": "1.0.5" } }, "to-arraybuffer": { @@ -4003,7 +4003,7 @@ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { - "kind-of": "^3.0.2" + "kind-of": "3.2.2" }, "dependencies": { "kind-of": { @@ -4012,7 +4012,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-buffer": "1.1.6" } } } @@ -4023,10 +4023,10 @@ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" } }, "to-regex-range": { @@ -4035,8 +4035,8 @@ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "3.0.0", + "repeat-string": "1.6.1" } }, "ts-loader": { @@ -4045,11 +4045,11 @@ "integrity": "sha512-KwF1SplmOJepnoZ4eRIloH/zXL195F51skt7reEsS6jvDqzgc/YSbz9b8E07GxIUwLXdcD4ssrJu6v8CwaTafA==", "dev": true, "requires": { - "chalk": "^2.3.0", - "enhanced-resolve": "^4.0.0", - "loader-utils": "^1.0.2", - "micromatch": "^3.1.4", - "semver": "^5.0.1" + "chalk": "2.4.2", + "enhanced-resolve": "4.1.0", + "loader-utils": "1.2.3", + "micromatch": "3.1.10", + "semver": "5.6.0" } }, "ts-node": { @@ -4058,14 +4058,14 @@ "integrity": "sha512-ZNT+OEGfUNVMGkpIaDJJ44Zq3Yr0bkU/ugN1PHbU+/01Z7UV1fsELRiTx1KuQNvQ1A3pGh3y25iYF6jXgxV21A==", "dev": true, "requires": { - "arrify": "^1.0.0", - "buffer-from": "^1.1.0", - "diff": "^3.1.0", - "make-error": "^1.1.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "source-map-support": "^0.5.6", - "yn": "^2.0.0" + "arrify": "1.0.1", + "buffer-from": "1.1.1", + "diff": "3.5.0", + "make-error": "1.3.5", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "source-map-support": "0.5.9", + "yn": "2.0.0" }, "dependencies": { "diff": { @@ -4088,18 +4088,18 @@ "integrity": "sha512-CKEcH1MHUBhoV43SA/Jmy1l24HJJgI0eyLbBNSRyFlsQvb9v6Zdq+Nz2vEOH00nC5SUx4SneJ59PZUS/ARcokQ==", "dev": true, "requires": { - "babel-code-frame": "^6.22.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^3.2.0", - "glob": "^7.1.1", - "js-yaml": "^3.7.0", - "minimatch": "^3.0.4", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.27.2" + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.4.2", + "commander": "2.19.0", + "diff": "3.5.0", + "glob": "7.1.3", + "js-yaml": "3.12.1", + "minimatch": "3.0.4", + "resolve": "1.8.1", + "semver": "5.6.0", + "tslib": "1.9.3", + "tsutils": "2.29.0" }, "dependencies": { "diff": { @@ -4116,7 +4116,7 @@ "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", "dev": true, "requires": { - "tslib": "^1.8.1" + "tslib": "1.9.3" } }, "tty-browserify": { @@ -4137,23 +4137,23 @@ "integrity": "sha512-jQWtvPcV+0fiLZAXFEe70v5gqjDO6pJYJz4mlTtmGJeW2KRoIU/BEfktma6Uj8Xii7UakuZjbxFewl3UYOkU/w==", "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/fs-extra": "5.0.4", + "@types/handlebars": "4.0.39", + "@types/highlight.js": "9.12.3", + "@types/lodash": "4.14.118", + "@types/marked": "0.4.2", "@types/minimatch": "3.0.3", - "@types/shelljs": "^0.8.0", - "fs-extra": "^7.0.0", - "handlebars": "^4.0.6", - "highlight.js": "^9.0.0", - "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.1.x" + "@types/shelljs": "0.8.0", + "fs-extra": "7.0.1", + "handlebars": "4.0.12", + "highlight.js": "9.13.1", + "lodash": "4.17.11", + "marked": "0.4.0", + "minimatch": "3.0.4", + "progress": "2.0.1", + "shelljs": "0.8.2", + "typedoc-default-themes": "0.5.0", + "typescript": "3.1.6" }, "dependencies": { "typescript": { @@ -4189,8 +4189,8 @@ "dev": true, "optional": true, "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" + "commander": "2.17.1", + "source-map": "0.6.1" }, "dependencies": { "commander": { @@ -4215,10 +4215,10 @@ "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" }, "dependencies": { "extend-shallow": { @@ -4227,7 +4227,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "is-extendable": "0.1.1" } }, "set-value": { @@ -4236,10 +4236,10 @@ "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" } } } @@ -4250,7 +4250,7 @@ "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", "dev": true, "requires": { - "unique-slug": "^2.0.0" + "unique-slug": "2.0.1" } }, "unique-slug": { @@ -4259,7 +4259,7 @@ "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", "dev": true, "requires": { - "imurmurhash": "^0.1.4" + "imurmurhash": "0.1.4" } }, "universalify": { @@ -4274,8 +4274,8 @@ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" + "has-value": "0.3.1", + "isobject": "3.0.1" }, "dependencies": { "has-value": { @@ -4284,9 +4284,9 @@ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" }, "dependencies": { "isobject": { @@ -4320,7 +4320,7 @@ "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { - "punycode": "^2.1.0" + "punycode": "2.1.1" } }, "urix": { @@ -4389,9 +4389,9 @@ "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", "dev": true, "requires": { - "chokidar": "^2.0.2", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" + "chokidar": "2.0.4", + "graceful-fs": "4.1.15", + "neo-async": "2.6.0" } }, "webpack": { @@ -4404,26 +4404,26 @@ "@webassemblyjs/helper-module-context": "1.7.11", "@webassemblyjs/wasm-edit": "1.7.11", "@webassemblyjs/wasm-parser": "1.7.11", - "acorn": "^5.6.2", - "acorn-dynamic-import": "^3.0.0", - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0", - "chrome-trace-event": "^1.0.0", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.0", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.3.0", - "loader-utils": "^1.1.0", - "memory-fs": "~0.4.1", - "micromatch": "^3.1.8", - "mkdirp": "~0.5.0", - "neo-async": "^2.5.0", - "node-libs-browser": "^2.0.0", - "schema-utils": "^0.4.4", - "tapable": "^1.1.0", - "terser-webpack-plugin": "^1.1.0", - "watchpack": "^1.5.0", - "webpack-sources": "^1.3.0" + "acorn": "5.7.3", + "acorn-dynamic-import": "3.0.0", + "ajv": "6.6.2", + "ajv-keywords": "3.2.0", + "chrome-trace-event": "1.0.0", + "enhanced-resolve": "4.1.0", + "eslint-scope": "4.0.0", + "json-parse-better-errors": "1.0.2", + "loader-runner": "2.3.1", + "loader-utils": "1.2.3", + "memory-fs": "0.4.1", + "micromatch": "3.1.10", + "mkdirp": "0.5.1", + "neo-async": "2.6.0", + "node-libs-browser": "2.1.0", + "schema-utils": "0.4.7", + "tapable": "1.1.1", + "terser-webpack-plugin": "1.2.1", + "watchpack": "1.6.0", + "webpack-sources": "1.3.0" } }, "webpack-cli": { @@ -4432,19 +4432,19 @@ "integrity": "sha512-jeJveHwz/vwpJ3B8bxEL5a/rVKIpRNJDsKggfKnxuYeohNDW4Y/wB9N/XHJA093qZyS0r6mYL+/crLsIol4WKA==", "dev": true, "requires": { - "chalk": "^2.4.1", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.1.0", - "findup-sync": "^2.0.0", - "global-modules": "^1.0.0", - "global-modules-path": "^2.3.0", - "import-local": "^2.0.0", - "interpret": "^1.1.0", - "lightercollective": "^0.1.0", - "loader-utils": "^1.1.0", - "supports-color": "^5.5.0", - "v8-compile-cache": "^2.0.2", - "yargs": "^12.0.4" + "chalk": "2.4.2", + "cross-spawn": "6.0.5", + "enhanced-resolve": "4.1.0", + "findup-sync": "2.0.0", + "global-modules": "1.0.0", + "global-modules-path": "2.3.1", + "import-local": "2.0.0", + "interpret": "1.1.0", + "lightercollective": "0.1.0", + "loader-utils": "1.2.3", + "supports-color": "5.5.0", + "v8-compile-cache": "2.0.2", + "yargs": "12.0.5" } }, "webpack-sources": { @@ -4453,8 +4453,8 @@ "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==", "dev": true, "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" + "source-list-map": "2.0.1", + "source-map": "0.6.1" }, "dependencies": { "source-map": { @@ -4471,7 +4471,7 @@ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "^2.0.0" + "isexe": "2.0.0" } }, "which-module": { @@ -4492,7 +4492,7 @@ "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", "dev": true, "requires": { - "errno": "~0.1.7" + "errno": "0.1.7" } }, "wrap-ansi": { @@ -4501,8 +4501,8 @@ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "string-width": "1.0.2", + "strip-ansi": "3.0.1" }, "dependencies": { "is-fullwidth-code-point": { @@ -4511,7 +4511,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "number-is-nan": "1.0.1" } }, "string-width": { @@ -4520,9 +4520,9 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" } } } @@ -4556,18 +4556,18 @@ "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "cliui": "4.1.0", + "decamelize": "1.2.0", + "find-up": "3.0.0", + "get-caller-file": "1.0.3", + "os-locale": "3.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "4.0.0", + "yargs-parser": "11.1.1" } }, "yargs-parser": { @@ -4576,8 +4576,8 @@ "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "camelcase": "5.0.0", + "decamelize": "1.2.0" } }, "yn": { diff --git a/package.json b/package.json index 332b6886..c43e06b4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@protobufjs/utf8": "^1.1.0", - "binaryen": "63.0.0-nightly.20190107", + "binaryen": "67.0.0-nightly.20190203", "glob": "^7.1.3", "long": "^4.0.0" }, diff --git a/tests/compiler/abi.optimized.wat b/tests/compiler/abi.optimized.wat index 3b8485c5..5e67841f 100644 --- a/tests/compiler/abi.optimized.wat +++ b/tests/compiler/abi.optimized.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -20,10 +20,10 @@ ) (func $start (; 2 ;) (type $v) i32.const 1 - set_global $abi/condition + global.set $abi/condition i32.const 0 - set_global $abi/y - get_global $abi/y + global.set $abi/y + global.get $abi/y if i32.const 0 i32.const 8 diff --git a/tests/compiler/abi.untouched.wat b/tests/compiler/abi.untouched.wat index 5b716484..fd3022af 100644 --- a/tests/compiler/abi.untouched.wat +++ b/tests/compiler/abi.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s\00") - (table $0 1 anyfunc) + (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)) @@ -43,11 +43,11 @@ drop i32.const 0 i32.eqz - set_global $abi/condition + global.set $abi/condition block i32.const 256 - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -65,28 +65,28 @@ end block i32.const 256 - set_local $0 - get_global $abi/condition + local.set $0 + global.get $abi/condition if - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.const 2 i32.div_s - set_local $0 + local.set $0 else - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.const 2 i32.div_s - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -104,24 +104,24 @@ end block i32.const 256 - set_local $0 - get_global $abi/condition + local.set $0 + global.get $abi/condition if - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.const 24 i32.shr_s - set_local $0 + local.set $0 else - get_local $0 + local.get $0 i32.const 127 i32.and - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.eqz i32.eqz if @@ -139,8 +139,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $abi/y - get_global $abi/y + global.set $abi/y + global.get $abi/y i32.eqz i32.eqz if @@ -155,8 +155,8 @@ block i32.const 2 i32.ctz - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -170,8 +170,8 @@ end i32.const 1 i32.clz - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -185,8 +185,8 @@ end i32.const 2 i32.ctz - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.eqz if i32.const 0 @@ -198,8 +198,8 @@ end i32.const 1 i32.clz - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.eqz if i32.const 0 diff --git a/tests/compiler/asc-constants.optimized.wat b/tests/compiler/asc-constants.optimized.wat index be03ea1a..0a57311c 100644 --- a/tests/compiler/asc-constants.optimized.wat +++ b/tests/compiler/asc-constants.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/asc-constants.untouched.wat b/tests/compiler/asc-constants.untouched.wat index ebf9ddee..ff6256b0 100644 --- a/tests/compiler/asc-constants.untouched.wat +++ b/tests/compiler/asc-constants.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $ASC_TARGET i32 (i32.const 0)) (global $ASC_NO_TREESHAKING i32 (i32.const 0)) diff --git a/tests/compiler/assert.optimized.wat b/tests/compiler/assert.optimized.wat index 9c913d68..b521b3ab 100644 --- a/tests/compiler/assert.optimized.wat +++ b/tests/compiler/assert.optimized.wat @@ -3,7 +3,7 @@ (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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/assert.untouched.wat b/tests/compiler/assert.untouched.wat index d8ab90a2..02bfb3d8 100644 --- a/tests/compiler/assert.untouched.wat +++ b/tests/compiler/assert.untouched.wat @@ -5,7 +5,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 60)) (export "memory" (memory $0)) @@ -91,9 +91,9 @@ unreachable end i32.const 1 - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 else i32.const 32 i32.const 8 diff --git a/tests/compiler/binary.optimized.wat b/tests/compiler/binary.optimized.wat index 30199e3d..e0d70280 100644 --- a/tests/compiler/binary.optimized.wat +++ b/tests/compiler/binary.optimized.wat @@ -3,7 +3,7 @@ (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$ff (func (param f32) (result f32))) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -19,236 +19,236 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - i64.reinterpret/f64 - tee_local $2 - i32.wrap/i64 - set_local $3 + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i32.wrap_i64 + local.set $3 block (result i32) block (result i32) block (result i32) - get_local $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $4 + i32.wrap_i64 + local.tee $4 i32.const 2147483647 i32.and - tee_local $5 + local.tee $5 i32.const 2146435072 i32.gt_s - tee_local $1 + local.tee $1 i32.eqz if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq - tee_local $1 + local.tee $1 if - get_local $3 + local.get $3 i32.const 0 i32.ne - set_local $1 + local.set $1 end end - get_local $1 + local.get $1 i32.eqz end if i32.const 0 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.eqz end if i32.const 0 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 end if - get_local $0 + local.get $0 f64.const 1 f64.add return end - get_local $0 + local.get $0 ) (func $~lib/math/NativeMathf.mod (; 1 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - i32.reinterpret/f32 - tee_local $1 + local.get $0 + i32.reinterpret_f32 + local.tee $1 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const -2147483648 i32.and - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 255 i32.eq - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else i32.const 0 end if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.div return end block $folding-inner0 - get_local $1 + local.get $1 i32.const 1 i32.shl - tee_local $3 + local.tee $3 i32.const 2130706432 i32.le_u if - get_local $3 + local.get $3 i32.const 2130706432 i32.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $1 + local.get $1 i32.const 1 - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 9 i32.shl i32.clz i32.sub - tee_local $2 + local.tee $2 i32.sub i32.shl end - set_local $1 + local.set $1 loop $continue|0 - get_local $2 + local.get $2 i32.const 127 i32.gt_s if - get_local $1 + local.get $1 i32.const 8388608 i32.ge_u if - get_local $1 + local.get $1 i32.const 8388608 i32.eq br_if $folding-inner0 - get_local $1 + local.get $1 i32.const 8388608 i32.sub - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $1 + local.get $1 i32.const 8388608 i32.ge_u if - get_local $1 + local.get $1 i32.const 8388608 i32.eq br_if $folding-inner0 - get_local $1 + local.get $1 i32.const 8388608 i32.sub - set_local $1 + local.set $1 end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.const 8 i32.shl i32.clz - tee_local $3 + local.tee $3 i32.shl - set_local $1 - get_local $2 - get_local $3 + local.set $1 + local.get $2 + local.get $3 i32.sub - tee_local $2 + local.tee $2 i32.const 0 i32.gt_s if (result i32) - get_local $1 + local.get $1 i32.const 8388608 i32.sub - get_local $2 + local.get $2 i32.const 23 i32.shl i32.or else - get_local $1 + local.get $1 i32.const 1 - get_local $2 + local.get $2 i32.sub i32.shr_u end - get_local $4 + local.get $4 i32.or - f32.reinterpret/i32 + f32.reinterpret_i32 return end f32.const 0 - get_local $0 + local.get $0 f32.mul ) (func $~lib/math/NativeMathf.pow (; 2 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) block (result i32) - get_local $0 - i32.reinterpret/f32 - tee_local $2 + local.get $0 + i32.reinterpret_f32 + local.tee $2 i32.const 2147483647 i32.and i32.const 2139095040 i32.gt_s - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 end if - get_local $0 + local.get $0 f32.const 1 f32.add return end - get_local $0 + local.get $0 ) (func $~lib/math/NativeMath.mod (; 3 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) @@ -256,154 +256,154 @@ (local $3 i64) (local $4 i64) (local $5 i32) - get_local $0 - i64.reinterpret/f64 - tee_local $1 + local.get $0 + i64.reinterpret_f64 + local.tee $1 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i64.const 63 i64.shr_u - set_local $4 - get_local $2 + local.set $4 + local.get $2 i64.const 2047 i64.eq - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else i32.const 0 end if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.div return end block $folding-inner0 - get_local $1 + local.get $1 i64.const 1 i64.shl - tee_local $3 + local.tee $3 i64.const 9214364837600034816 i64.le_u if - get_local $3 + local.get $3 i64.const 9214364837600034816 i64.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 i64.eqz if (result i64) - get_local $1 + local.get $1 i64.const 0 - get_local $2 - get_local $1 + local.get $2 + local.get $1 i64.const 12 i64.shl i64.clz i64.sub - tee_local $2 + local.tee $2 i64.sub i64.const 1 i64.add i64.shl else - get_local $1 + local.get $1 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $1 + local.set $1 loop $continue|0 - get_local $2 + local.get $2 i64.const 1023 i64.gt_s if - get_local $1 + local.get $1 i64.const 4503599627370496 i64.ge_u if - get_local $1 + local.get $1 i64.const 4503599627370496 i64.eq br_if $folding-inner0 - get_local $1 + local.get $1 i64.const 4503599627370496 i64.sub - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i64.const 1 i64.shl - set_local $1 - get_local $2 + local.set $1 + local.get $2 i64.const 1 i64.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $1 + local.get $1 i64.const 4503599627370496 i64.ge_u if - get_local $1 + local.get $1 i64.const 4503599627370496 i64.eq br_if $folding-inner0 - get_local $1 + local.get $1 i64.const 4503599627370496 i64.sub - set_local $1 + local.set $1 end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i64.const 11 i64.shl i64.clz - tee_local $3 + local.tee $3 i64.shl - set_local $1 - get_local $2 - get_local $3 + local.set $1 + local.get $2 + local.get $3 i64.sub - tee_local $2 + local.tee $2 i64.const 0 i64.gt_s if (result i64) - get_local $1 + local.get $1 i64.const 4503599627370496 i64.sub - get_local $2 + local.get $2 i64.const 52 i64.shl i64.or else - get_local $1 + local.get $1 i64.const 0 - get_local $2 + local.get $2 i64.sub i64.const 1 i64.add i64.shr_u end - get_local $4 + local.get $4 i64.const 63 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 return end f64.const 0 - get_local $0 + local.get $0 f64.mul ) (func $start (; 4 ;) (type $v) @@ -412,342 +412,342 @@ (local $2 f32) (local $3 f64) (local $4 i32) - get_global $binary/i - tee_local $0 + global.get $binary/i + local.tee $0 i32.const 1 i32.rem_s drop - get_local $0 - f64.convert_s/i32 + local.get $0 + f64.convert_i32_s call $~lib/math/NativeMath.pow drop - get_global $binary/i - tee_local $0 + global.get $binary/i + local.tee $0 i32.const 1 i32.lt_s - set_global $binary/b - get_local $0 + global.set $binary/b + local.get $0 i32.const 1 i32.gt_s - set_global $binary/b - get_local $0 + global.set $binary/b + local.get $0 i32.const 1 i32.le_s - set_global $binary/b - get_local $0 + global.set $binary/b + local.get $0 i32.const 1 i32.ge_s - set_global $binary/b - get_local $0 + global.set $binary/b + local.get $0 i32.const 1 i32.eq - tee_local $4 - set_global $binary/b - get_local $4 - set_global $binary/b - get_local $0 + local.tee $4 + global.set $binary/b + local.get $4 + global.set $binary/b + local.get $0 i32.const 1 i32.add - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.sub - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.rem_s - set_global $binary/i - get_global $binary/i - f64.convert_s/i32 + global.set $binary/i + global.get $binary/i + f64.convert_i32_s call $~lib/math/NativeMath.pow - i32.trunc_s/f64 - set_global $binary/i - get_global $binary/i + i32.trunc_f64_s + global.set $binary/i + global.get $binary/i i32.const 1 i32.shl - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_s - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_u - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.and - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.or - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.xor - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.add - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.sub - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.rem_s - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shl - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_s - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_u - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.and - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.or - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.xor - set_global $binary/i - get_global $binary/I - tee_local $1 + global.set $binary/i + global.get $binary/I + local.tee $1 i64.const 1 i64.rem_s drop - get_local $1 - f64.convert_s/i64 + local.get $1 + f64.convert_i64_s call $~lib/math/NativeMath.pow drop - get_global $binary/I - tee_local $1 + global.get $binary/I + local.tee $1 i64.const 1 i64.lt_s - set_global $binary/b - get_local $1 + global.set $binary/b + local.get $1 i64.const 1 i64.gt_s - set_global $binary/b - get_local $1 + global.set $binary/b + local.get $1 i64.const 1 i64.le_s - set_global $binary/b - get_local $1 + global.set $binary/b + local.get $1 i64.const 1 i64.ge_s - set_global $binary/b - get_local $1 + global.set $binary/b + local.get $1 i64.const 1 i64.eq - tee_local $0 - set_global $binary/b - get_local $0 - set_global $binary/b - get_local $1 + local.tee $0 + global.set $binary/b + local.get $0 + global.set $binary/b + local.get $1 i64.const 1 i64.add - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.sub - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.rem_s - set_global $binary/I - get_global $binary/I - f64.convert_s/i64 + global.set $binary/I + global.get $binary/I + f64.convert_i64_s call $~lib/math/NativeMath.pow - i64.trunc_s/f64 - set_global $binary/I - get_global $binary/I + i64.trunc_f64_s + global.set $binary/I + global.get $binary/I i64.const 1 i64.shl - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_s - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_u - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.and - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.or - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.xor - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.add - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.sub - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.rem_s - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shl - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_s - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_u - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.and - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.or - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.xor - set_global $binary/I - get_global $binary/f + global.set $binary/I + global.get $binary/f call $~lib/math/NativeMathf.mod drop - get_global $binary/f + global.get $binary/f call $~lib/math/NativeMathf.pow drop - get_global $binary/f - tee_local $2 + global.get $binary/f + local.tee $2 f32.const 1 f32.lt - set_global $binary/b - get_local $2 + global.set $binary/b + local.get $2 f32.const 1 f32.gt - set_global $binary/b - get_local $2 + global.set $binary/b + local.get $2 f32.const 1 f32.le - set_global $binary/b - get_local $2 + global.set $binary/b + local.get $2 f32.const 1 f32.ge - set_global $binary/b - get_local $2 + global.set $binary/b + local.get $2 f32.const 1 f32.eq - tee_local $0 - set_global $binary/b - get_local $0 - set_global $binary/b - get_local $2 + local.tee $0 + global.set $binary/b + local.get $0 + global.set $binary/b + local.get $2 f32.const 1 f32.add - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.sub - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f call $~lib/math/NativeMathf.mod - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f call $~lib/math/NativeMathf.pow - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.add - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.sub - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f call $~lib/math/NativeMathf.mod - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f call $~lib/math/NativeMathf.pow - set_global $binary/f - get_global $binary/F + global.set $binary/f + global.get $binary/F call $~lib/math/NativeMath.mod drop - get_global $binary/F + global.get $binary/F call $~lib/math/NativeMath.pow drop - get_global $binary/F - tee_local $3 + global.get $binary/F + local.tee $3 f64.const 1 f64.lt - set_global $binary/b - get_local $3 + global.set $binary/b + local.get $3 f64.const 1 f64.gt - set_global $binary/b - get_local $3 + global.set $binary/b + local.get $3 f64.const 1 f64.le - set_global $binary/b - get_local $3 + global.set $binary/b + local.get $3 f64.const 1 f64.ge - set_global $binary/b - get_local $3 + global.set $binary/b + local.get $3 f64.const 1 f64.eq - tee_local $0 - set_global $binary/b - get_local $0 - set_global $binary/b - get_local $3 + local.tee $0 + global.set $binary/b + local.get $0 + global.set $binary/b + local.get $3 f64.const 1 f64.add - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.sub - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F call $~lib/math/NativeMath.mod - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F call $~lib/math/NativeMath.pow - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.add - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.sub - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F call $~lib/math/NativeMath.mod - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F call $~lib/math/NativeMath.pow - set_global $binary/F + global.set $binary/F ) (func $null (; 5 ;) (type $v) nop diff --git a/tests/compiler/binary.untouched.wat b/tests/compiler/binary.untouched.wat index fac5baa4..e087627d 100644 --- a/tests/compiler/binary.untouched.wat +++ b/tests/compiler/binary.untouched.wat @@ -5,7 +5,7 @@ (type $fif (func (param f32 i32) (result f32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -21,91 +21,91 @@ (local $2 f64) (local $3 i32) (local $4 i32) - get_local $0 - set_local $2 - get_local $1 + local.get $0 + local.set $2 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - tee_local $3 + local.tee $3 i32.const 1023 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - set_local $1 + local.set $1 end else - get_local $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.const 53 i32.sub i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.add i32.const 53 i32.sub - tee_local $3 + local.tee $3 i32.const -1022 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - set_local $1 + local.set $1 end end end - get_local $2 + local.get $2 i64.const 1023 - get_local $1 - i64.extend_s/i32 + local.get $1 + i64.extend_i32_s i64.add i64.const 52 i64.shl - f64.reinterpret/i64 + f64.reinterpret_i64 f64.mul ) (func $~lib/math/NativeMath.pow (; 1 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -149,38 +149,38 @@ (local $39 f64) (local $40 f64) (local $41 i32) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 - get_local $2 - i32.wrap/i64 - set_local $4 - get_local $1 - i64.reinterpret/f64 - set_local $2 - get_local $2 + i32.wrap_i64 + local.set $3 + local.get $2 + i32.wrap_i64 + local.set $4 + local.get $1 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $2 - i32.wrap/i64 - set_local $6 - get_local $3 + i32.wrap_i64 + local.set $5 + local.get $2 + i32.wrap_i64 + local.set $6 + local.get $3 i32.const 2147483647 i32.and - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 2147483647 i32.and - set_local $8 - get_local $8 - get_local $6 + local.set $8 + local.get $8 + local.get $6 i32.or i32.const 0 i32.eq @@ -188,126 +188,126 @@ f64.const 1 return end - get_local $7 + local.get $7 i32.const 2146435072 i32.gt_s - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $4 + local.get $4 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.gt_s end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $6 + local.get $6 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end i32.const 0 - set_local $10 - get_local $3 + local.set $10 + local.get $3 i32.const 0 i32.lt_s if - get_local $8 + local.get $8 i32.const 1128267776 i32.ge_s if i32.const 2 - set_local $10 + local.set $10 else - get_local $8 + local.get $8 i32.const 1072693248 i32.ge_s if - get_local $8 + local.get $8 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 - get_local $11 + local.set $11 + local.get $11 i32.const 20 i32.gt_s - set_local $9 + local.set $9 i32.const 52 i32.const 20 - get_local $9 + local.get $9 select - get_local $11 + local.get $11 i32.sub - set_local $12 - get_local $6 - get_local $8 - get_local $9 + local.set $12 + local.get $6 + local.get $8 + local.get $9 select - set_local $13 - get_local $13 - get_local $12 + local.set $13 + local.get $13 + local.get $12 i32.shr_s - set_local $14 - get_local $14 - get_local $12 + local.set $14 + local.get $14 + local.get $12 i32.shl - get_local $13 + local.get $13 i32.eq if i32.const 2 - get_local $14 + local.get $14 i32.const 1 i32.and i32.sub - set_local $10 + local.set $10 end end end end - get_local $6 + local.get $6 i32.const 0 i32.eq if - get_local $8 + local.get $8 i32.const 2146435072 i32.eq if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $4 + local.get $4 i32.or i32.const 0 i32.eq @@ -315,27 +315,27 @@ f64.const nan:0x8000000000000 return else - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) - get_local $1 + local.get $1 else f64.const 0 end return else - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) f64.const 0 else - get_local $1 + local.get $1 f64.neg end return @@ -345,158 +345,158 @@ unreachable unreachable end - get_local $8 + local.get $8 i32.const 1072693248 i32.eq if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 return end f64.const 1 - get_local $0 + local.get $0 f64.div return end - get_local $5 + local.get $5 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul return end - get_local $5 + local.get $5 i32.const 1071644672 i32.eq if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f64.sqrt return end end end - get_local $0 + local.get $0 f64.abs - set_local $15 - get_local $4 + local.set $15 + local.get $4 i32.const 0 i32.eq if - get_local $7 + local.get $7 i32.const 0 i32.eq - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq end - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 1072693248 i32.eq end if - get_local $15 - set_local $16 - get_local $5 + local.get $15 + local.set $16 + local.get $5 i32.const 0 i32.lt_s if f64.const 1 - get_local $16 + local.get $16 f64.div - set_local $16 + local.set $16 end - get_local $3 + local.get $3 i32.const 0 i32.lt_s if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $10 + local.get $10 i32.or i32.const 0 i32.eq if - get_local $16 - get_local $16 + local.get $16 + local.get $16 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div - set_local $16 + local.set $16 else - get_local $10 + local.get $10 i32.const 1 i32.eq if - get_local $16 + local.get $16 f64.neg - set_local $16 + local.set $16 end end end - get_local $16 + local.get $16 return end end f64.const 1 - set_local $18 - get_local $3 + local.set $18 + local.get $3 i32.const 0 i32.lt_s if - get_local $10 + local.get $10 i32.const 0 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div return end - get_local $10 + local.get $10 i32.const 1 i32.eq if f64.const -1 - set_local $18 + local.set $18 end end - get_local $8 + local.get $8 i32.const 1105199104 i32.gt_s if - get_local $8 + local.get $8 i32.const 1139802112 i32.gt_s if - get_local $7 + local.get $7 i32.const 1072693247 i32.le_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) @@ -510,11 +510,11 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) @@ -529,21 +529,21 @@ return end end - get_local $7 + local.get $7 i32.const 1072693247 i32.lt_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -551,21 +551,21 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.gt_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -573,205 +573,205 @@ end return end - get_local $15 + local.get $15 f64.const 1 f64.sub - set_local $24 - get_local $24 - get_local $24 + local.set $24 + local.get $24 + local.get $24 f64.mul f64.const 0.5 - get_local $24 + local.get $24 f64.const 0.3333333333333333 - get_local $24 + local.get $24 f64.const 0.25 f64.mul f64.sub f64.mul f64.sub f64.mul - set_local $27 + local.set $27 f64.const 1.4426950216293335 - get_local $24 + local.get $24 f64.mul - set_local $25 - get_local $24 + local.set $25 + local.get $24 f64.const 1.9259629911266175e-08 f64.mul - get_local $27 + local.get $27 f64.const 1.4426950408889634 f64.mul f64.sub - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $26 - get_local $19 - get_local $25 + f64.reinterpret_i64 + local.set $19 + local.get $26 + local.get $19 + local.get $25 f64.sub f64.sub - set_local $20 + local.set $20 else i32.const 0 - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.lt_s if - get_local $15 + local.get $15 f64.const 9007199254740992 f64.mul - set_local $15 - get_local $29 + local.set $15 + local.get $29 i32.const 53 i32.sub - set_local $29 - get_local $15 - i64.reinterpret/f64 + local.set $29 + local.get $15 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $7 + i32.wrap_i64 + local.set $7 end - get_local $29 - get_local $7 + local.get $29 + local.get $7 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048575 i32.and - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 1072693248 i32.or - set_local $7 - get_local $28 + local.set $7 + local.get $28 i32.const 235662 i32.le_s if i32.const 0 - set_local $11 + local.set $11 else - get_local $28 + local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - set_local $11 + local.set $11 else i32.const 0 - set_local $11 - get_local $29 + local.set $11 + local.get $29 i32.const 1 i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.sub - set_local $7 + local.set $7 end end - get_local $15 - i64.reinterpret/f64 + local.get $15 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $15 + f64.reinterpret_i64 + local.set $15 f64.const 1.5 f64.const 1 - get_local $11 + local.get $11 select - set_local $35 - get_local $15 - get_local $35 + local.set $35 + local.get $15 + local.get $35 f64.sub - set_local $25 + local.set $25 f64.const 1 - get_local $15 - get_local $35 + local.get $15 + local.get $35 f64.add f64.div - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.mul - set_local $17 - get_local $17 - set_local $31 - get_local $31 - i64.reinterpret/f64 + local.set $17 + local.get $17 + local.set $31 + local.get $31 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $31 - get_local $7 + f64.reinterpret_i64 + local.set $31 + local.get $7 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - get_local $11 + local.get $11 i32.const 18 i32.shl i32.add - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $33 - get_local $15 - get_local $33 - get_local $35 + f64.reinterpret_i64 + local.set $33 + local.get $15 + local.get $33 + local.get $35 f64.sub f64.sub - set_local $34 - get_local $26 - get_local $25 - get_local $31 - get_local $33 + local.set $34 + local.get $26 + local.get $25 + local.get $31 + local.get $33 f64.mul f64.sub - get_local $31 - get_local $34 + local.get $31 + local.get $34 f64.mul f64.sub f64.mul - set_local $32 - get_local $17 - get_local $17 + local.set $32 + local.get $17 + local.get $17 f64.mul - set_local $30 - get_local $30 - get_local $30 + local.set $30 + local.get $30 + local.get $30 f64.mul f64.const 0.5999999999999946 - get_local $30 + local.get $30 f64.const 0.4285714285785502 - get_local $30 + local.get $30 f64.const 0.33333332981837743 - get_local $30 + local.get $30 f64.const 0.272728123808534 - get_local $30 + local.get $30 f64.const 0.23066074577556175 - get_local $30 + local.get $30 f64.const 0.20697501780033842 f64.mul f64.add @@ -784,184 +784,184 @@ f64.mul f64.add f64.mul - set_local $23 - get_local $23 - get_local $32 - get_local $31 - get_local $17 + local.set $23 + local.get $23 + local.get $32 + local.get $31 + local.get $17 f64.add f64.mul f64.add - set_local $23 - get_local $31 - get_local $31 + local.set $23 + local.get $31 + local.get $31 f64.mul - set_local $30 + local.set $30 f64.const 3 - get_local $30 + local.get $30 f64.add - get_local $23 + local.get $23 f64.add - set_local $33 - get_local $33 - i64.reinterpret/f64 + local.set $33 + local.get $33 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $33 - get_local $23 - get_local $33 + f64.reinterpret_i64 + local.set $33 + local.get $23 + local.get $33 f64.const 3 f64.sub - get_local $30 + local.get $30 f64.sub f64.sub - set_local $34 - get_local $31 - get_local $33 + local.set $34 + local.get $31 + local.get $33 f64.mul - set_local $25 - get_local $32 - get_local $33 + local.set $25 + local.get $32 + local.get $33 f64.mul - get_local $34 - get_local $17 + local.get $34 + local.get $17 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $21 - get_local $21 - i64.reinterpret/f64 + local.set $21 + local.get $21 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $21 - get_local $26 - get_local $21 - get_local $25 + f64.reinterpret_i64 + local.set $21 + local.get $26 + local.get $21 + local.get $25 f64.sub f64.sub - set_local $22 + local.set $22 f64.const 0.9617967009544373 - get_local $21 + local.get $21 f64.mul - set_local $36 + local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - get_local $11 + local.get $11 select - set_local $37 + local.set $37 f64.const -7.028461650952758e-09 - get_local $21 + local.get $21 f64.mul - get_local $22 + local.get $22 f64.const 0.9617966939259756 f64.mul f64.add - get_local $37 + local.get $37 f64.add - set_local $38 - get_local $29 - f64.convert_s/i32 - set_local $24 + local.set $38 + local.get $29 + f64.convert_i32_s + local.set $24 f64.const 0.5849624872207642 f64.const 0 - get_local $11 + local.get $11 select - set_local $39 - get_local $36 - get_local $38 + local.set $39 + local.get $36 + local.get $38 f64.add - get_local $39 + local.get $39 f64.add - get_local $24 + local.get $24 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $38 - get_local $19 - get_local $24 + f64.reinterpret_i64 + local.set $19 + local.get $38 + local.get $19 + local.get $24 f64.sub - get_local $39 + local.get $39 f64.sub - get_local $36 + local.get $36 f64.sub f64.sub - set_local $20 + local.set $20 end - get_local $1 - set_local $40 - get_local $40 - i64.reinterpret/f64 + local.get $1 + local.set $40 + local.get $40 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $40 - get_local $1 - get_local $40 + f64.reinterpret_i64 + local.set $40 + local.get $1 + local.get $40 f64.sub - get_local $19 + local.get $19 f64.mul - get_local $1 - get_local $20 + local.get $1 + local.get $20 f64.mul f64.add - set_local $22 - get_local $40 - get_local $19 + local.set $22 + local.get $40 + local.get $19 f64.mul - set_local $21 - get_local $22 - get_local $21 + local.set $21 + local.get $22 + local.get $21 f64.add - set_local $16 - get_local $16 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.set $16 + local.get $16 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $2 - i32.wrap/i64 - set_local $41 - get_local $28 + i32.wrap_i64 + local.set $28 + local.get $2 + i32.wrap_i64 + local.set $41 + local.get $28 i32.const 1083179008 i32.ge_s if - get_local $28 + local.get $28 i32.const 1083179008 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - get_local $22 + local.get $22 f64.const 8.008566259537294e-17 f64.add - get_local $16 - get_local $21 + local.get $16 + local.get $21 f64.sub f64.gt if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 @@ -969,34 +969,34 @@ return end else - get_local $28 + local.get $28 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_s if - get_local $28 + local.get $28 i32.const -1064252416 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul return end - get_local $22 - get_local $16 - get_local $21 + local.get $22 + local.get $16 + local.get $21 f64.sub f64.le if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -1005,126 +1005,126 @@ end end end - get_local $28 + local.get $28 i32.const 2147483647 i32.and - set_local $41 - get_local $41 + local.set $41 + local.get $41 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 i32.const 0 - set_local $29 - get_local $41 + local.set $29 + local.get $41 i32.const 1071644672 i32.gt_s if - get_local $28 + local.get $28 i32.const 1048576 - get_local $11 + local.get $11 i32.const 1 i32.add i32.shr_s i32.add - set_local $29 - get_local $29 + local.set $29 + local.get $29 i32.const 2147483647 i32.and i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 f64.const 0 - set_local $24 - get_local $29 + local.set $24 + local.get $29 i32.const 1048575 - get_local $11 + local.get $11 i32.shr_s i32.const -1 i32.xor i32.and - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $24 - get_local $29 + f64.reinterpret_i64 + local.set $24 + local.get $29 i32.const 1048575 i32.and i32.const 1048576 i32.or i32.const 20 - get_local $11 + local.get $11 i32.sub i32.shr_s - set_local $29 - get_local $28 + local.set $29 + local.get $28 i32.const 0 i32.lt_s if i32.const 0 - get_local $29 + local.get $29 i32.sub - set_local $29 + local.set $29 end - get_local $21 - get_local $24 + local.get $21 + local.get $24 f64.sub - set_local $21 + local.set $21 end - get_local $22 - get_local $21 + local.get $22 + local.get $21 f64.add - set_local $24 - get_local $24 - i64.reinterpret/f64 + local.set $24 + local.get $24 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $24 - get_local $24 + f64.reinterpret_i64 + local.set $24 + local.get $24 f64.const 0.6931471824645996 f64.mul - set_local $25 - get_local $22 - get_local $24 - get_local $21 + local.set $25 + local.get $22 + local.get $24 + local.get $21 f64.sub f64.sub f64.const 0.6931471805599453 f64.mul - get_local $24 + local.get $24 f64.const -1.904654299957768e-09 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $16 - get_local $26 - get_local $16 - get_local $25 + local.set $16 + local.get $26 + local.get $16 + local.get $25 f64.sub f64.sub - set_local $27 - get_local $16 - get_local $16 + local.set $27 + local.get $16 + local.get $16 f64.mul - set_local $24 - get_local $16 - get_local $24 + local.set $24 + local.get $16 + local.get $24 f64.const 0.16666666666666602 - get_local $24 + local.get $24 f64.const -2.7777777777015593e-03 - get_local $24 + local.get $24 f64.const 6.613756321437934e-05 - get_local $24 + local.get $24 f64.const -1.6533902205465252e-06 - get_local $24 + local.get $24 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -1136,64 +1136,64 @@ f64.add f64.mul f64.sub - set_local $19 - get_local $16 - get_local $19 + local.set $19 + local.get $16 + local.get $19 f64.mul - get_local $19 + local.get $19 f64.const 2 f64.sub f64.div - get_local $27 - get_local $16 - get_local $27 + local.get $27 + local.get $16 + local.get $27 f64.mul f64.add f64.sub - set_local $23 + local.set $23 f64.const 1 - get_local $23 - get_local $16 + local.get $23 + local.get $16 f64.sub f64.sub - set_local $16 - get_local $16 - i64.reinterpret/f64 + local.set $16 + local.get $16 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $28 - get_local $29 + i32.wrap_i64 + local.set $28 + local.get $28 + local.get $29 i32.const 20 i32.shl i32.add - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 20 i32.shr_s i32.const 0 i32.le_s if - get_local $16 - get_local $29 + local.get $16 + local.get $29 call $~lib/math/NativeMath.scalbn - set_local $16 + local.set $16 else - get_local $16 - i64.reinterpret/f64 + local.get $16 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $28 - i64.extend_s/i32 + local.get $28 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $16 + f64.reinterpret_i64 + local.set $16 end - get_local $18 - get_local $16 + local.get $18 + local.get $16 f64.mul ) (func $~lib/math/NativeMathf.mod (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -1207,337 +1207,337 @@ (local $9 f32) (local $10 i32) (local $11 i32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + local.get $0 + i32.reinterpret_f32 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const -2147483648 i32.and - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.const 1 i32.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.const 0 i32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i32.const 255 i32.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f32.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i32.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i32.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i32.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.const 9 i32.shl i32.clz i32.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 0 - get_local $5 + local.get $5 i32.sub i32.const 1 i32.add i32.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.const 23 i32.shl i32.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 8 i32.shl i32.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i32.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 0 i32.gt_s if - get_local $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.or - set_local $2 - get_local $2 - f32.reinterpret/i32 + local.set $2 + local.get $2 + f32.reinterpret_i32 ) (func $~lib/math/NativeMathf.scalbn (; 3 ;) (type $fif) (param $0 f32) (param $1 i32) (result f32) (local $2 f32) (local $3 i32) (local $4 i32) - get_local $0 - set_local $2 - get_local $1 + local.get $0 + local.set $2 + local.get $1 i32.const 127 i32.gt_s if - get_local $2 + local.get $2 f32.const 1701411834604692317316873e14 f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 127 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 127 i32.gt_s if - get_local $2 + local.get $2 f32.const 1701411834604692317316873e14 f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 127 i32.sub - tee_local $3 + local.tee $3 i32.const 127 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - set_local $1 + local.set $1 end else - get_local $1 + local.get $1 i32.const -126 i32.lt_s if - get_local $2 + local.get $2 f32.const 1.1754943508222875e-38 f32.const 16777216 f32.mul f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 126 i32.const 24 i32.sub i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const -126 i32.lt_s if - get_local $2 + local.get $2 f32.const 1.1754943508222875e-38 f32.const 16777216 f32.mul f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 126 i32.add i32.const 24 i32.sub - tee_local $3 + local.tee $3 i32.const -126 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - set_local $1 + local.set $1 end end end - get_local $2 + local.get $2 i32.const 127 - get_local $1 + local.get $1 i32.add i32.const 23 i32.shl - f32.reinterpret/i32 + f32.reinterpret_i32 f32.mul ) (func $~lib/math/NativeMathf.pow (; 4 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -1576,123 +1576,123 @@ (local $34 f32) (local $35 f32) (local $36 i32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + 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 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 2147483647 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.eq if f32.const 1 return end - get_local $4 + local.get $4 i32.const 2139095040 i32.gt_s - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $5 + local.get $5 i32.const 2139095040 i32.gt_s end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add return end i32.const 0 - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.const 0 i32.lt_s if - get_local $5 + local.get $5 i32.const 1266679808 i32.ge_s if i32.const 2 - set_local $7 + local.set $7 else - get_local $5 + local.get $5 i32.const 1065353216 i32.ge_s if - get_local $5 + local.get $5 i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $9 + local.set $9 i32.const 23 - get_local $9 + local.get $9 i32.sub - set_local $6 - get_local $5 - get_local $6 + local.set $6 + local.get $5 + local.get $6 i32.shr_s - set_local $8 - get_local $8 - get_local $6 + local.set $8 + local.get $8 + local.get $6 i32.shl - get_local $5 + local.get $5 i32.eq if i32.const 2 - get_local $8 + local.get $8 i32.const 1 i32.and i32.sub - set_local $7 + local.set $7 end end end end - get_local $5 + local.get $5 i32.const 2139095040 i32.eq if - get_local $4 + local.get $4 i32.const 1065353216 i32.eq if f32.const nan:0x400000 return else - get_local $4 + local.get $4 i32.const 1065353216 i32.gt_s if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if (result f32) - get_local $1 + local.get $1 else f32.const 0 end return else - get_local $3 + local.get $3 i32.const 0 i32.ge_s if (result f32) f32.const 0 else - get_local $1 + local.get $1 f32.neg end return @@ -1702,158 +1702,158 @@ unreachable unreachable end - get_local $5 + local.get $5 i32.const 1065353216 i32.eq if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if (result f32) - get_local $0 + local.get $0 else f32.const 1 - get_local $0 + local.get $0 f32.div end return end - get_local $3 + local.get $3 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul return end - get_local $3 + local.get $3 i32.const 1056964608 i32.eq if - get_local $2 + local.get $2 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f32.sqrt return end end - get_local $0 + local.get $0 f32.abs - set_local $10 - get_local $4 + local.set $10 + local.get $4 i32.const 2139095040 i32.eq - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $4 + local.get $4 i32.const 0 i32.eq end - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $4 + local.get $4 i32.const 1065353216 i32.eq end if - get_local $10 - set_local $11 - get_local $3 + local.get $10 + local.set $11 + local.get $3 i32.const 0 i32.lt_s if f32.const 1 - get_local $11 + local.get $11 f32.div - set_local $11 + local.set $11 end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $4 + local.get $4 i32.const 1065353216 i32.sub - get_local $7 + local.get $7 i32.or i32.const 0 i32.eq if - get_local $11 - get_local $11 + local.get $11 + local.get $11 f32.sub - set_local $12 - get_local $12 - get_local $12 + local.set $12 + local.get $12 + local.get $12 f32.div - set_local $11 + local.set $11 else - get_local $7 + local.get $7 i32.const 1 i32.eq if - get_local $11 + local.get $11 f32.neg - set_local $11 + local.set $11 end end end - get_local $11 + local.get $11 return end f32.const 1 - set_local $13 - get_local $2 + local.set $13 + local.get $2 i32.const 0 i32.lt_s if - get_local $7 + local.get $7 i32.const 0 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub - set_local $12 - get_local $12 - get_local $12 + local.set $12 + local.get $12 + local.get $12 f32.div return end - get_local $7 + local.get $7 i32.const 1 i32.eq if f32.const -1 - set_local $13 + local.set $13 end end - get_local $5 + local.get $5 i32.const 1291845632 i32.gt_s if - get_local $4 + local.get $4 i32.const 1065353208 i32.lt_s if - get_local $3 + local.get $3 i32.const 0 i32.lt_s if (result f32) - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul else - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -1861,21 +1861,21 @@ end return end - get_local $4 + local.get $4 i32.const 1065353223 i32.gt_s if - get_local $3 + local.get $3 i32.const 0 i32.gt_s if (result f32) - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul else - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -1883,199 +1883,199 @@ end return end - get_local $10 + local.get $10 f32.const 1 f32.sub - set_local $18 - get_local $18 - get_local $18 + local.set $18 + local.get $18 + local.get $18 f32.mul f32.const 0.5 - get_local $18 + local.get $18 f32.const 0.3333333432674408 - get_local $18 + local.get $18 f32.const 0.25 f32.mul f32.sub f32.mul f32.sub f32.mul - set_local $21 + local.set $21 f32.const 1.44268798828125 - get_local $18 + local.get $18 f32.mul - set_local $19 - get_local $18 + local.set $19 + local.get $18 f32.const 7.052607543300837e-06 f32.mul - get_local $21 + local.get $21 f32.const 1.4426950216293335 f32.mul f32.sub - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.add - set_local $14 - get_local $14 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $14 + local.get $14 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $14 - get_local $20 - get_local $14 - get_local $19 + f32.reinterpret_i32 + local.set $14 + local.get $20 + local.get $14 + local.get $19 f32.sub f32.sub - set_local $15 + local.set $15 else i32.const 0 - set_local $24 - get_local $4 + local.set $24 + local.get $4 i32.const 8388608 i32.lt_s if - get_local $10 + local.get $10 f32.const 16777216 f32.mul - set_local $10 - get_local $24 + local.set $10 + local.get $24 i32.const 24 i32.sub - set_local $24 - get_local $10 - i32.reinterpret/f32 - set_local $4 + local.set $24 + local.get $10 + i32.reinterpret_f32 + local.set $4 end - get_local $24 - get_local $4 + local.get $24 + local.get $4 i32.const 23 i32.shr_s i32.const 127 i32.sub i32.add - set_local $24 - get_local $4 + local.set $24 + local.get $4 i32.const 8388607 i32.and - set_local $8 - get_local $8 + local.set $8 + local.get $8 i32.const 1065353216 i32.or - set_local $4 - get_local $8 + local.set $4 + local.get $8 i32.const 1885297 i32.le_s if i32.const 0 - set_local $9 + local.set $9 else - get_local $8 + local.get $8 i32.const 6140887 i32.lt_s if i32.const 1 - set_local $9 + local.set $9 else i32.const 0 - set_local $9 - get_local $24 + local.set $9 + local.get $24 i32.const 1 i32.add - set_local $24 - get_local $4 + local.set $24 + local.get $4 i32.const 8388608 i32.sub - set_local $4 + local.set $4 end end - get_local $4 - f32.reinterpret/i32 - set_local $10 + local.get $4 + f32.reinterpret_i32 + local.set $10 f32.const 1.5 f32.const 1 - get_local $9 + local.get $9 select - set_local $30 - get_local $10 - get_local $30 + local.set $30 + local.get $10 + local.get $30 f32.sub - set_local $19 + local.set $19 f32.const 1 - get_local $10 - get_local $30 + local.get $10 + local.get $30 f32.add f32.div - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.mul - set_local $17 - get_local $17 - set_local $26 - get_local $26 - i32.reinterpret/f32 - set_local $25 - get_local $25 + 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 - set_local $26 - get_local $4 + 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 - set_local $25 - get_local $25 + local.set $25 + local.get $25 i32.const 4194304 i32.add - get_local $9 + local.get $9 i32.const 21 i32.shl i32.add - f32.reinterpret/i32 - set_local $28 - get_local $10 - get_local $28 - get_local $30 + f32.reinterpret_i32 + local.set $28 + local.get $10 + local.get $28 + local.get $30 f32.sub f32.sub - set_local $29 - get_local $20 - get_local $19 - get_local $26 - get_local $28 + local.set $29 + local.get $20 + local.get $19 + local.get $26 + local.get $28 f32.mul f32.sub - get_local $26 - get_local $29 + local.get $26 + local.get $29 f32.mul f32.sub f32.mul - set_local $27 - get_local $17 - get_local $17 + local.set $27 + local.get $17 + local.get $17 f32.mul - set_local $12 - get_local $12 - get_local $12 + local.set $12 + local.get $12 + local.get $12 f32.mul f32.const 0.6000000238418579 - get_local $12 + local.get $12 f32.const 0.4285714328289032 - get_local $12 + local.get $12 f32.const 0.3333333432674408 - get_local $12 + local.get $12 f32.const 0.2727281153202057 - get_local $12 + local.get $12 f32.const 0.23066075146198273 - get_local $12 + local.get $12 f32.const 0.20697501301765442 f32.mul f32.add @@ -2088,178 +2088,178 @@ f32.mul f32.add f32.mul - set_local $16 - get_local $16 - get_local $27 - get_local $26 - get_local $17 + local.set $16 + local.get $16 + local.get $27 + local.get $26 + local.get $17 f32.add f32.mul f32.add - set_local $16 - get_local $26 - get_local $26 + local.set $16 + local.get $26 + local.get $26 f32.mul - set_local $12 + local.set $12 f32.const 3 - get_local $12 + local.get $12 f32.add - get_local $16 + local.get $16 f32.add - set_local $28 - get_local $28 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $28 + local.get $28 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $28 - get_local $16 - get_local $28 + f32.reinterpret_i32 + local.set $28 + local.get $16 + local.get $28 f32.const 3 f32.sub - get_local $12 + local.get $12 f32.sub f32.sub - set_local $29 - get_local $26 - get_local $28 + local.set $29 + local.get $26 + local.get $28 f32.mul - set_local $19 - get_local $27 - get_local $28 + local.set $19 + local.get $27 + local.get $28 f32.mul - get_local $29 - get_local $17 + local.get $29 + local.get $17 f32.mul f32.add - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.add - set_local $22 - get_local $22 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $22 + local.get $22 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $22 - get_local $20 - get_local $22 - get_local $19 + f32.reinterpret_i32 + local.set $22 + local.get $20 + local.get $22 + local.get $19 f32.sub f32.sub - set_local $23 + local.set $23 f32.const 0.9619140625 - get_local $22 + local.get $22 f32.mul - set_local $31 + local.set $31 f32.const 1.5632208487659227e-06 f32.const 0 - get_local $9 + local.get $9 select - set_local $32 + local.set $32 f32.const -1.1736857413779944e-04 - get_local $22 + local.get $22 f32.mul - get_local $23 + local.get $23 f32.const 0.9617967009544373 f32.mul f32.add - get_local $32 + local.get $32 f32.add - set_local $33 - get_local $24 - f32.convert_s/i32 - set_local $18 + local.set $33 + local.get $24 + f32.convert_i32_s + local.set $18 f32.const 0.5849609375 f32.const 0 - get_local $9 + local.get $9 select - set_local $34 - get_local $31 - get_local $33 + local.set $34 + local.get $31 + local.get $33 f32.add - get_local $34 + local.get $34 f32.add - get_local $18 + local.get $18 f32.add - set_local $14 - get_local $14 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $14 + local.get $14 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $14 - get_local $33 - get_local $14 - get_local $18 + f32.reinterpret_i32 + local.set $14 + local.get $33 + local.get $14 + local.get $18 f32.sub - get_local $34 + local.get $34 f32.sub - get_local $31 + local.get $31 f32.sub f32.sub - set_local $15 + local.set $15 end - get_local $1 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.get $1 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $35 - get_local $1 - get_local $35 + f32.reinterpret_i32 + local.set $35 + local.get $1 + local.get $35 f32.sub - get_local $14 + local.get $14 f32.mul - get_local $1 - get_local $15 + local.get $1 + local.get $15 f32.mul f32.add - set_local $23 - get_local $35 - get_local $14 + local.set $23 + local.get $35 + local.get $14 f32.mul - set_local $22 - get_local $23 - get_local $22 + local.set $22 + local.get $23 + local.get $22 f32.add - set_local $11 - get_local $11 - i32.reinterpret/f32 - set_local $8 - get_local $8 + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $8 + local.get $8 i32.const 1124073472 i32.gt_s if - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul return else - get_local $8 + local.get $8 i32.const 1124073472 i32.eq if - get_local $23 + local.get $23 f32.const 4.299566569443414e-08 f32.add - get_local $11 - get_local $22 + local.get $11 + local.get $22 f32.sub f32.gt if - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 @@ -2267,30 +2267,30 @@ return end else - get_local $8 + local.get $8 i32.const 2147483647 i32.and i32.const 1125515264 i32.gt_s if - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 f32.mul return else - get_local $8 + local.get $8 i32.const -1021968384 i32.eq if - get_local $23 - get_local $11 - get_local $22 + local.get $23 + local.get $11 + local.get $22 f32.sub f32.le if - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -2301,123 +2301,123 @@ end end end - get_local $8 + local.get $8 i32.const 2147483647 i32.and - set_local $36 - get_local $36 + local.set $36 + local.get $36 i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $9 + local.set $9 i32.const 0 - set_local $24 - get_local $36 + local.set $24 + local.get $36 i32.const 1056964608 i32.gt_s if - get_local $8 + local.get $8 i32.const 8388608 - get_local $9 + local.get $9 i32.const 1 i32.add i32.shr_s i32.add - set_local $24 - get_local $24 + local.set $24 + local.get $24 i32.const 2147483647 i32.and i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $9 - get_local $24 + local.set $9 + local.get $24 i32.const 8388607 - get_local $9 + local.get $9 i32.shr_s i32.const -1 i32.xor i32.and - f32.reinterpret/i32 - set_local $18 - get_local $24 + f32.reinterpret_i32 + local.set $18 + local.get $24 i32.const 8388607 i32.and i32.const 8388608 i32.or i32.const 23 - get_local $9 + local.get $9 i32.sub i32.shr_s - set_local $24 - get_local $8 + local.set $24 + local.get $8 i32.const 0 i32.lt_s if i32.const 0 - get_local $24 + local.get $24 i32.sub - set_local $24 + local.set $24 end - get_local $22 - get_local $18 + local.get $22 + local.get $18 f32.sub - set_local $22 + local.set $22 end - get_local $23 - get_local $22 + local.get $23 + local.get $22 f32.add - set_local $18 - get_local $18 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $18 + local.get $18 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -32768 i32.and - f32.reinterpret/i32 - set_local $18 - get_local $18 + f32.reinterpret_i32 + local.set $18 + local.get $18 f32.const 0.693145751953125 f32.mul - set_local $19 - get_local $23 - get_local $18 - get_local $22 + local.set $19 + local.get $23 + local.get $18 + local.get $22 f32.sub f32.sub f32.const 0.6931471824645996 f32.mul - get_local $18 + local.get $18 f32.const 1.4286065379565116e-06 f32.mul f32.add - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.add - set_local $11 - get_local $20 - get_local $11 - get_local $19 + local.set $11 + local.get $20 + local.get $11 + local.get $19 f32.sub f32.sub - set_local $21 - get_local $11 - get_local $11 + local.set $21 + local.get $11 + local.get $11 f32.mul - set_local $18 - get_local $11 - get_local $18 + local.set $18 + local.get $11 + local.get $18 f32.const 0.1666666716337204 - get_local $18 + local.get $18 f32.const -2.7777778450399637e-03 - get_local $18 + local.get $18 f32.const 6.61375597701408e-05 - get_local $18 + local.get $18 f32.const -1.6533901998627698e-06 - get_local $18 + local.get $18 f32.const 4.138136944220605e-08 f32.mul f32.add @@ -2429,53 +2429,53 @@ f32.add f32.mul f32.sub - set_local $14 - get_local $11 - get_local $14 + local.set $14 + local.get $11 + local.get $14 f32.mul - get_local $14 + local.get $14 f32.const 2 f32.sub f32.div - get_local $21 - get_local $11 - get_local $21 + local.get $21 + local.get $11 + local.get $21 f32.mul f32.add f32.sub - set_local $16 + local.set $16 f32.const 1 - get_local $16 - get_local $11 + local.get $16 + local.get $11 f32.sub f32.sub - set_local $11 - get_local $11 - i32.reinterpret/f32 - set_local $8 - get_local $8 - get_local $24 + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $8 + local.get $8 + local.get $24 i32.const 23 i32.shl i32.add - set_local $8 - get_local $8 + local.set $8 + local.get $8 i32.const 23 i32.shr_s i32.const 0 i32.le_s if - get_local $11 - get_local $24 + local.get $11 + local.get $24 call $~lib/math/NativeMathf.scalbn - set_local $11 + local.set $11 else - get_local $8 - f32.reinterpret/i32 - set_local $11 + local.get $8 + f32.reinterpret_i32 + local.set $11 end - get_local $13 - get_local $11 + local.get $13 + local.get $11 f32.mul ) (func $~lib/math/NativeMath.mod (; 5 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -2489,858 +2489,858 @@ (local $9 f64) (local $10 i64) (local $11 i64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 + 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 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i64.const 63 i64.shr_u - set_local $6 - get_local $3 + local.set $6 + local.get $3 i64.const 1 i64.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i64.const 0 i64.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i64.const 2047 i64.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f64.div return end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i64.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i64.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i64.const 12 i64.shl i64.clz i64.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i64.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.const 12 i64.shl i64.clz i64.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i64.const 0 - get_local $5 + local.get $5 i64.sub i64.const 1 i64.add i64.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 1 i64.const 52 i64.shl i64.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 1 i64.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 11 i64.shl i64.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i64.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 0 i64.gt_s if - get_local $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i64.const 63 i64.shl i64.or - set_local $2 - get_local $2 - f64.reinterpret/i64 + local.set $2 + local.get $2 + f64.reinterpret_i64 ) (func $start (; 6 ;) (type $v) - get_global $binary/i + global.get $binary/i i32.const 1 i32.lt_s drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.gt_s drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.le_s drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.ge_s drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.eq drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.eq drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.add drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.sub drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.mul drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.div_s drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.rem_s drop - get_global $binary/i - f64.convert_s/i32 + global.get $binary/i + f64.convert_i32_s f64.const 1 call $~lib/math/NativeMath.pow drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.shl drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.shr_s drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.shr_u drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.and drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.or drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.xor drop - get_global $binary/i + global.get $binary/i i32.const 1 i32.lt_s - set_global $binary/b - get_global $binary/i + global.set $binary/b + global.get $binary/i i32.const 1 i32.gt_s - set_global $binary/b - get_global $binary/i + global.set $binary/b + global.get $binary/i i32.const 1 i32.le_s - set_global $binary/b - get_global $binary/i + global.set $binary/b + global.get $binary/i i32.const 1 i32.ge_s - set_global $binary/b - get_global $binary/i + global.set $binary/b + global.get $binary/i i32.const 1 i32.eq - set_global $binary/b - get_global $binary/i + global.set $binary/b + global.get $binary/i i32.const 1 i32.eq - set_global $binary/b - get_global $binary/i + global.set $binary/b + global.get $binary/i i32.const 1 i32.add - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.sub - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.mul - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.div_s - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.rem_s - set_global $binary/i - get_global $binary/i - f64.convert_s/i32 + global.set $binary/i + global.get $binary/i + f64.convert_i32_s f64.const 1 call $~lib/math/NativeMath.pow - i32.trunc_s/f64 - set_global $binary/i - get_global $binary/i + i32.trunc_f64_s + global.set $binary/i + global.get $binary/i i32.const 1 i32.shl - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_s - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_u - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.and - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.or - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.xor - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.add - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.sub - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.mul - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.rem_s - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shl - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_s - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.shr_u - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.and - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.or - set_global $binary/i - get_global $binary/i + global.set $binary/i + global.get $binary/i i32.const 1 i32.xor - set_global $binary/i - get_global $binary/I + global.set $binary/i + global.get $binary/I i64.const 1 i64.lt_s drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.gt_s drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.le_s drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.ge_s drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.eq drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.eq drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.add drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.sub drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.mul drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.div_s drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.rem_s drop - get_global $binary/I - f64.convert_s/i64 + global.get $binary/I + f64.convert_i64_s f64.const 1 call $~lib/math/NativeMath.pow drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.shl drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.shr_s drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.shr_u drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.and drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.or drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.xor drop - get_global $binary/I + global.get $binary/I i64.const 1 i64.lt_s - set_global $binary/b - get_global $binary/I + global.set $binary/b + global.get $binary/I i64.const 1 i64.gt_s - set_global $binary/b - get_global $binary/I + global.set $binary/b + global.get $binary/I i64.const 1 i64.le_s - set_global $binary/b - get_global $binary/I + global.set $binary/b + global.get $binary/I i64.const 1 i64.ge_s - set_global $binary/b - get_global $binary/I + global.set $binary/b + global.get $binary/I i64.const 1 i64.eq - set_global $binary/b - get_global $binary/I + global.set $binary/b + global.get $binary/I i64.const 1 i64.eq - set_global $binary/b - get_global $binary/I + global.set $binary/b + global.get $binary/I i64.const 1 i64.add - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.sub - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.mul - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.div_s - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.rem_s - set_global $binary/I - get_global $binary/I - f64.convert_s/i64 + global.set $binary/I + global.get $binary/I + f64.convert_i64_s f64.const 1 call $~lib/math/NativeMath.pow - i64.trunc_s/f64 - set_global $binary/I - get_global $binary/I + i64.trunc_f64_s + global.set $binary/I + global.get $binary/I i64.const 1 i64.shl - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_s - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_u - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.and - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.or - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.xor - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.add - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.sub - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.mul - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.rem_s - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shl - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_s - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.shr_u - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.and - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.or - set_global $binary/I - get_global $binary/I + global.set $binary/I + global.get $binary/I i64.const 1 i64.xor - set_global $binary/I - get_global $binary/f + global.set $binary/I + global.get $binary/f f32.const 1 f32.lt drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.gt drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.le drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.ge drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.eq drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.eq drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.add drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.sub drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.mul drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.div drop - get_global $binary/f + global.get $binary/f f32.const 1 call $~lib/math/NativeMathf.mod drop - get_global $binary/f + global.get $binary/f f32.const 1 call $~lib/math/NativeMathf.pow drop - get_global $binary/f + global.get $binary/f f32.const 1 f32.lt - set_global $binary/b - get_global $binary/f + global.set $binary/b + global.get $binary/f f32.const 1 f32.gt - set_global $binary/b - get_global $binary/f + global.set $binary/b + global.get $binary/f f32.const 1 f32.le - set_global $binary/b - get_global $binary/f + global.set $binary/b + global.get $binary/f f32.const 1 f32.ge - set_global $binary/b - get_global $binary/f + global.set $binary/b + global.get $binary/f f32.const 1 f32.eq - set_global $binary/b - get_global $binary/f + global.set $binary/b + global.get $binary/f f32.const 1 f32.eq - set_global $binary/b - get_global $binary/f + global.set $binary/b + global.get $binary/f f32.const 1 f32.add - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.sub - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.mul - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.div - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 call $~lib/math/NativeMathf.mod - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 call $~lib/math/NativeMathf.pow - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.add - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.sub - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 f32.mul - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 call $~lib/math/NativeMathf.mod - set_global $binary/f - get_global $binary/f + global.set $binary/f + global.get $binary/f f32.const 1 call $~lib/math/NativeMathf.pow - set_global $binary/f - get_global $binary/F + global.set $binary/f + global.get $binary/F f64.const 1 f64.lt drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.gt drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.le drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.ge drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.eq drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.eq drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.add drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.sub drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.mul drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.div drop - get_global $binary/F + global.get $binary/F f64.const 1 call $~lib/math/NativeMath.mod drop - get_global $binary/F + global.get $binary/F f64.const 1 call $~lib/math/NativeMath.pow drop - get_global $binary/F + global.get $binary/F f64.const 1 f64.lt - set_global $binary/b - get_global $binary/F + global.set $binary/b + global.get $binary/F f64.const 1 f64.gt - set_global $binary/b - get_global $binary/F + global.set $binary/b + global.get $binary/F f64.const 1 f64.le - set_global $binary/b - get_global $binary/F + global.set $binary/b + global.get $binary/F f64.const 1 f64.ge - set_global $binary/b - get_global $binary/F + global.set $binary/b + global.get $binary/F f64.const 1 f64.eq - set_global $binary/b - get_global $binary/F + global.set $binary/b + global.get $binary/F f64.const 1 f64.eq - set_global $binary/b - get_global $binary/F + global.set $binary/b + global.get $binary/F f64.const 1 f64.add - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.sub - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.mul - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.div - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 call $~lib/math/NativeMath.mod - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 call $~lib/math/NativeMath.pow - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.add - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.sub - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 f64.mul - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 call $~lib/math/NativeMath.mod - set_global $binary/F - get_global $binary/F + global.set $binary/F + global.get $binary/F f64.const 1 call $~lib/math/NativeMath.pow - set_global $binary/F + global.set $binary/F ) (func $null (; 7 ;) (type $v) ) diff --git a/tests/compiler/bool.optimized.wat b/tests/compiler/bool.optimized.wat index dc54b333..bc2b1716 100644 --- a/tests/compiler/bool.optimized.wat +++ b/tests/compiler/bool.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -17,7 +17,7 @@ (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $v) - get_global $bool/i + global.get $bool/i i32.const 0 i32.ne i32.const 1 @@ -30,7 +30,7 @@ call $~lib/env/abort unreachable end - get_global $bool/I + global.get $bool/I i64.const 0 i64.ne i32.const 1 @@ -43,7 +43,7 @@ call $~lib/env/abort unreachable end - get_global $bool/u + global.get $bool/u i32.const 0 i32.ne i32.const 1 @@ -56,7 +56,7 @@ call $~lib/env/abort unreachable end - get_global $bool/U + global.get $bool/U i64.const 0 i64.ne i32.const 1 @@ -69,7 +69,7 @@ call $~lib/env/abort unreachable end - get_global $bool/f + global.get $bool/f f32.const 0 f32.ne i32.const 1 @@ -82,7 +82,7 @@ call $~lib/env/abort unreachable end - get_global $bool/F + global.get $bool/F f64.const 0 f64.ne i32.const 1 @@ -95,7 +95,7 @@ call $~lib/env/abort unreachable end - get_global $bool/uu + global.get $bool/uu i32.const 0 i32.ne i32.const 1 diff --git a/tests/compiler/bool.untouched.wat b/tests/compiler/bool.untouched.wat index 553e59a8..0a830279 100644 --- a/tests/compiler/bool.untouched.wat +++ b/tests/compiler/bool.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\07\00\00\00b\00o\00o\00l\00.\00t\00s\00") - (table $0 1 anyfunc) + (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)) @@ -18,7 +18,7 @@ (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $v) - get_global $bool/i + global.get $bool/i i32.const 0 i32.ne i32.const 1 @@ -32,7 +32,7 @@ call $~lib/env/abort unreachable end - get_global $bool/I + global.get $bool/I i64.const 0 i64.ne i32.const 1 @@ -46,7 +46,7 @@ call $~lib/env/abort unreachable end - get_global $bool/u + global.get $bool/u i32.const 0 i32.ne i32.const 1 @@ -60,7 +60,7 @@ call $~lib/env/abort unreachable end - get_global $bool/U + global.get $bool/U i64.const 0 i64.ne i32.const 1 @@ -74,7 +74,7 @@ call $~lib/env/abort unreachable end - get_global $bool/f + global.get $bool/f f32.const 0 f32.ne i32.const 1 @@ -88,7 +88,7 @@ call $~lib/env/abort unreachable end - get_global $bool/F + global.get $bool/F f64.const 0 f64.ne i32.const 1 @@ -102,7 +102,7 @@ call $~lib/env/abort unreachable end - get_global $bool/uu + global.get $bool/uu i32.const 0 i32.ne i32.const 1 diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index d849c0ec..9e4272a9 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -6,7 +6,7 @@ (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") - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $builtins/test $start~anonymous|1) (global $builtins/b (mut i32) (i32.const 0)) (global $builtins/i (mut i32) (i32.const 0)) @@ -29,18 +29,18 @@ ) (func $start (; 3 ;) (type $v) i32.const 31 - set_global $builtins/i + global.set $builtins/i i32.const 0 - set_global $builtins/i + global.set $builtins/i i32.const 1 - set_global $builtins/i + global.set $builtins/i i32.const 2 - set_global $builtins/i + global.set $builtins/i i32.const -2147483648 - set_global $builtins/i + global.set $builtins/i i32.const 42 - set_global $builtins/i - get_global $builtins/i + global.set $builtins/i + global.get $builtins/i i32.const 42 i32.ne if @@ -52,8 +52,8 @@ unreachable end i32.const 2 - set_global $builtins/i - get_global $builtins/i + global.set $builtins/i + global.get $builtins/i i32.const 2 i32.ne if @@ -65,8 +65,8 @@ unreachable end i32.const 1 - set_global $builtins/i - get_global $builtins/i + global.set $builtins/i + global.get $builtins/i i32.const 1 i32.ne if @@ -78,18 +78,18 @@ unreachable end i64.const 63 - set_global $builtins/I + global.set $builtins/I i64.const 0 - set_global $builtins/I + global.set $builtins/I i64.const 1 - set_global $builtins/I + global.set $builtins/I i64.const 2 - set_global $builtins/I + global.set $builtins/I i64.const -9223372036854775808 - set_global $builtins/I + global.set $builtins/I i64.const 42 - set_global $builtins/I - get_global $builtins/I + global.set $builtins/I + global.get $builtins/I i64.const 42 i64.ne if @@ -101,8 +101,8 @@ unreachable end i64.const 2 - set_global $builtins/I - get_global $builtins/I + global.set $builtins/I + global.get $builtins/I i64.const 2 i64.ne if @@ -114,8 +114,8 @@ unreachable end i64.const 1 - set_global $builtins/I - get_global $builtins/i + global.set $builtins/I + global.get $builtins/i i32.const 1 i32.ne if @@ -127,62 +127,62 @@ unreachable end f32.const nan:0x400000 - set_global $builtins/f + global.set $builtins/f f32.const inf - set_global $builtins/f + global.set $builtins/f f32.const 1.25 - set_global $builtins/f + global.set $builtins/f f32.const 2 - set_global $builtins/f + global.set $builtins/f f32.const 1.25 - set_global $builtins/f + global.set $builtins/f f32.const 1 - set_global $builtins/f + global.set $builtins/f f32.const 2.5 - set_global $builtins/f + global.set $builtins/f f32.const 1.25 - set_global $builtins/f + global.set $builtins/f f32.const 1 - set_global $builtins/f + global.set $builtins/f f32.const 1.1180340051651 - set_global $builtins/f + global.set $builtins/f f32.const 1 - set_global $builtins/f + global.set $builtins/f i32.const 0 - set_global $builtins/b + global.set $builtins/b i32.const 1 - set_global $builtins/b + global.set $builtins/b f64.const nan:0x8000000000000 - set_global $builtins/F + global.set $builtins/F f64.const inf - set_global $builtins/F + global.set $builtins/F f64.const 1.25 - set_global $builtins/F + global.set $builtins/F f64.const 2 - set_global $builtins/F + global.set $builtins/F f64.const 1.25 - set_global $builtins/F + global.set $builtins/F f64.const 1 - set_global $builtins/F + global.set $builtins/F f64.const 2.5 - set_global $builtins/F + global.set $builtins/F f64.const 1.25 - set_global $builtins/F + global.set $builtins/F f64.const 1 - set_global $builtins/F + global.set $builtins/F f64.const 1.118033988749895 - set_global $builtins/F + global.set $builtins/F f64.const 1 - set_global $builtins/F + global.set $builtins/F i32.const 0 - set_global $builtins/b + global.set $builtins/b i32.const 1 - set_global $builtins/b + global.set $builtins/b i32.const 8 i32.load - set_global $builtins/i + global.set $builtins/i i32.const 8 - get_global $builtins/i + global.get $builtins/i i32.store i32.const 8 i32.const 8 @@ -190,9 +190,9 @@ i32.store i32.const 8 i64.load - set_global $builtins/I + global.set $builtins/I i32.const 8 - get_global $builtins/I + global.get $builtins/I i64.store i32.const 8 i32.const 8 @@ -200,9 +200,9 @@ i64.store i32.const 8 f32.load - set_global $builtins/f + global.set $builtins/f i32.const 8 - get_global $builtins/f + global.get $builtins/f f32.store i32.const 8 i32.const 8 @@ -210,9 +210,9 @@ f32.store i32.const 8 f64.load - set_global $builtins/F + global.set $builtins/F i32.const 8 - get_global $builtins/F + global.get $builtins/F f64.store i32.const 8 i32.const 8 @@ -220,9 +220,9 @@ f64.store i32.const 8 i32.load - set_global $builtins/i + global.set $builtins/i i32.const 8 - get_global $builtins/i + global.get $builtins/i i32.store i32.const 8 i32.const 8 @@ -230,9 +230,9 @@ i32.store i32.const 8 i64.load - set_global $builtins/I + global.set $builtins/I i32.const 8 - get_global $builtins/I + global.get $builtins/I i64.store i32.const 8 i32.const 8 @@ -240,9 +240,9 @@ i64.store i32.const 8 f32.load - set_global $builtins/f + global.set $builtins/f i32.const 8 - get_global $builtins/f + global.get $builtins/f f32.store i32.const 8 i32.const 8 @@ -250,9 +250,9 @@ f32.store i32.const 8 f64.load - set_global $builtins/F + global.set $builtins/F i32.const 8 - get_global $builtins/F + global.get $builtins/F f64.store i32.const 8 i32.const 8 @@ -260,64 +260,64 @@ f64.store i32.const 8 i32.load8_s - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load16_s - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load8_u - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load16_u - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load8_u - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load16_u - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load8_s - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load16_s - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load - set_global $builtins/u + global.set $builtins/u i32.const 8 i64.load8_s - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load16_s - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load32_s - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load8_u - set_global $builtins/U + global.set $builtins/U i32.const 8 i64.load16_u - set_global $builtins/U + global.set $builtins/U i32.const 8 i64.load32_u - set_global $builtins/U + global.set $builtins/U i32.const 8 i64.load - set_global $builtins/U + global.set $builtins/U i32.const 8 i32.const 1 i32.store8 @@ -343,39 +343,39 @@ i64.const 1 i64.store i32.const 1067450368 - set_global $builtins/i + global.set $builtins/i f32.const 3.5032461608120427e-44 - set_global $builtins/f + global.set $builtins/f i64.const 4608308318706860032 - set_global $builtins/I + global.set $builtins/I f64.const 1.24e-322 - set_global $builtins/F + global.set $builtins/F current_memory drop i32.const 1 grow_memory drop current_memory - set_global $builtins/s + global.set $builtins/s i32.const 1 grow_memory - set_global $builtins/s + global.set $builtins/s i32.const 10 - set_global $builtins/i + global.set $builtins/i i64.const 200 - set_global $builtins/I + global.set $builtins/I f32.const 1.25 - set_global $builtins/f + global.set $builtins/f f64.const 25 - set_global $builtins/F - get_global $builtins/i + global.set $builtins/F + global.get $builtins/i i32.eqz if unreachable end i32.const 1 i32.const 2 - get_global $builtins/fn + global.get $builtins/fn call_indirect (type $iiv) i32.const 8 i32.load8_s diff --git a/tests/compiler/builtins.untouched.wat b/tests/compiler/builtins.untouched.wat index b0a1d268..6ee70187 100644 --- a/tests/compiler/builtins.untouched.wat +++ b/tests/compiler/builtins.untouched.wat @@ -6,7 +6,7 @@ (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") - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $start~anonymous|1) (global $builtins/b (mut i32) (i32.const 0)) (global $builtins/i (mut i32) (i32.const 0)) @@ -317,61 +317,61 @@ i32.rotr drop i32.const -42 - tee_local $0 + local.tee $0 i32.const 31 i32.shr_s - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add - get_local $1 + local.get $1 i32.xor drop i32.const 1 - tee_local $0 + local.tee $0 i32.const 2 - tee_local $1 - get_local $0 - get_local $1 + local.tee $1 + local.get $0 + local.get $1 i32.gt_s select drop i32.const 1 - tee_local $0 + local.tee $0 i32.const 2 - tee_local $1 - get_local $0 - get_local $1 + local.tee $1 + local.get $0 + local.get $1 i32.lt_s select drop i32.const 1 i32.clz - set_global $builtins/i + global.set $builtins/i i32.const 1 i32.ctz - set_global $builtins/i + global.set $builtins/i i32.const 1 i32.popcnt - set_global $builtins/i + global.set $builtins/i i32.const 1 i32.const 1 i32.rotl - set_global $builtins/i + global.set $builtins/i i32.const 1 i32.const 1 i32.rotr - set_global $builtins/i + global.set $builtins/i i32.const -42 - tee_local $0 + local.tee $0 i32.const 31 i32.shr_s - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add - get_local $1 + local.get $1 i32.xor - set_global $builtins/i - get_global $builtins/i + global.set $builtins/i + global.get $builtins/i i32.const 42 i32.eq i32.eqz @@ -384,15 +384,15 @@ unreachable end i32.const 1 - tee_local $0 + local.tee $0 i32.const 2 - tee_local $1 - get_local $0 - get_local $1 + local.tee $1 + local.get $0 + local.get $1 i32.gt_s select - set_global $builtins/i - get_global $builtins/i + global.set $builtins/i + global.get $builtins/i i32.const 2 i32.eq i32.eqz @@ -405,15 +405,15 @@ unreachable end i32.const 1 - tee_local $0 + local.tee $0 i32.const 2 - tee_local $1 - get_local $0 - get_local $1 + local.tee $1 + local.get $0 + local.get $1 i32.lt_s select - set_global $builtins/i - get_global $builtins/i + global.set $builtins/i + global.get $builtins/i i32.const 1 i32.eq i32.eqz @@ -443,43 +443,43 @@ i64.rotr drop i64.const -42 - tee_local $2 + local.tee $2 i64.const 63 i64.shr_s - tee_local $3 - get_local $2 + local.tee $3 + local.get $2 i64.add - get_local $3 + local.get $3 i64.xor drop i64.const 1 i64.clz - set_global $builtins/I + global.set $builtins/I i64.const 1 i64.ctz - set_global $builtins/I + global.set $builtins/I i64.const 1 i64.popcnt - set_global $builtins/I + global.set $builtins/I i64.const 1 i64.const 1 i64.rotl - set_global $builtins/I + global.set $builtins/I i64.const 1 i64.const 1 i64.rotr - set_global $builtins/I + global.set $builtins/I i64.const -42 - tee_local $2 + local.tee $2 i64.const 63 i64.shr_s - tee_local $3 - get_local $2 + local.tee $3 + local.get $2 i64.add - get_local $3 + local.get $3 i64.xor - set_global $builtins/I - get_global $builtins/I + global.set $builtins/I + global.get $builtins/I i64.const 42 i64.eq i32.eqz @@ -492,15 +492,15 @@ unreachable end i64.const 1 - tee_local $2 + local.tee $2 i64.const 2 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i64.gt_s select - set_global $builtins/I - get_global $builtins/I + global.set $builtins/I + global.get $builtins/I i64.const 2 i64.eq i32.eqz @@ -513,15 +513,15 @@ unreachable end i64.const 1 - tee_local $2 + local.tee $2 i64.const 2 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i64.lt_s select - set_global $builtins/I - get_global $builtins/i + global.set $builtins/I + global.get $builtins/i i32.const 1 i32.eq i32.eqz @@ -569,9 +569,9 @@ drop block $~lib/builtins/isNaN|inlined.0 (result i32) f32.const 1.25 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.ne end i32.const 0 @@ -589,9 +589,9 @@ end block $~lib/builtins/isNaN|inlined.1 (result i32) f32.const nan:0x400000 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.ne end i32.const 0 @@ -609,9 +609,9 @@ end block $~lib/builtins/isFinite|inlined.0 (result i32) f32.const 1.25 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq @@ -631,9 +631,9 @@ end block $~lib/builtins/isFinite|inlined.1 (result i32) f32.const inf - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq @@ -654,9 +654,9 @@ block $~lib/builtins/isFinite|inlined.2 (result i32) f32.const inf f32.neg - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq @@ -676,9 +676,9 @@ end block $~lib/builtins/isFinite|inlined.3 (result i32) f32.const nan:0x400000 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq @@ -697,61 +697,61 @@ unreachable end f32.const nan:0x400000 - set_global $builtins/f + global.set $builtins/f f32.const inf - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.abs - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.ceil - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.const 2.5 f32.copysign - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.floor - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.const 2.5 f32.max - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.const 2.5 f32.min - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.nearest - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.sqrt - set_global $builtins/f + global.set $builtins/f f32.const 1.25 f32.trunc - set_global $builtins/f + global.set $builtins/f block $~lib/builtins/isNaN|inlined.2 (result i32) f32.const 1.25 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.ne end i32.const 0 i32.ne - set_global $builtins/b + global.set $builtins/b block $~lib/builtins/isFinite|inlined.4 (result i32) f32.const 1.25 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq end i32.const 0 i32.ne - set_global $builtins/b + global.set $builtins/b f64.const nan:0x8000000000000 drop f64.const inf @@ -792,9 +792,9 @@ drop block $~lib/builtins/isNaN|inlined.0 (result i32) f64.const 1.25 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.ne end i32.const 0 @@ -812,9 +812,9 @@ end block $~lib/builtins/isNaN|inlined.1 (result i32) f64.const nan:0x8000000000000 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.ne end i32.const 0 @@ -832,9 +832,9 @@ end block $~lib/builtins/isFinite|inlined.0 (result i32) f64.const 1.25 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq @@ -854,9 +854,9 @@ end block $~lib/builtins/isFinite|inlined.1 (result i32) f64.const inf - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq @@ -877,9 +877,9 @@ block $~lib/builtins/isFinite|inlined.2 (result i32) f64.const inf f64.neg - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq @@ -899,9 +899,9 @@ end block $~lib/builtins/isFinite|inlined.3 (result i32) f64.const nan:0x8000000000000 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq @@ -920,66 +920,66 @@ unreachable end f64.const nan:0x8000000000000 - set_global $builtins/F + global.set $builtins/F f64.const inf - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.abs - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.ceil - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.const 2.5 f64.copysign - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.floor - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.const 2.5 f64.max - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.const 2.5 f64.min - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.nearest - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.sqrt - set_global $builtins/F + global.set $builtins/F f64.const 1.25 f64.trunc - set_global $builtins/F + global.set $builtins/F block $~lib/builtins/isNaN|inlined.2 (result i32) f64.const 1.25 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.ne end i32.const 0 i32.ne - set_global $builtins/b + global.set $builtins/b block $~lib/builtins/isFinite|inlined.4 (result i32) f64.const 1.25 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq end i32.const 0 i32.ne - set_global $builtins/b + global.set $builtins/b i32.const 8 i32.load - set_global $builtins/i + global.set $builtins/i i32.const 8 - get_global $builtins/i + global.get $builtins/i i32.store i32.const 8 i32.const 8 @@ -987,9 +987,9 @@ i32.store i32.const 8 i64.load - set_global $builtins/I + global.set $builtins/I i32.const 8 - get_global $builtins/I + global.get $builtins/I i64.store i32.const 8 i32.const 8 @@ -997,9 +997,9 @@ i64.store i32.const 8 f32.load - set_global $builtins/f + global.set $builtins/f i32.const 8 - get_global $builtins/f + global.get $builtins/f f32.store i32.const 8 i32.const 8 @@ -1007,9 +1007,9 @@ f32.store i32.const 8 f64.load - set_global $builtins/F + global.set $builtins/F i32.const 8 - get_global $builtins/F + global.get $builtins/F f64.store i32.const 8 i32.const 8 @@ -1017,9 +1017,9 @@ f64.store i32.const 0 i32.load offset=8 - set_global $builtins/i + global.set $builtins/i i32.const 0 - get_global $builtins/i + global.get $builtins/i i32.store offset=8 i32.const 0 i32.const 0 @@ -1027,9 +1027,9 @@ i32.store offset=8 i32.const 0 i64.load offset=8 - set_global $builtins/I + global.set $builtins/I i32.const 0 - get_global $builtins/I + global.get $builtins/I i64.store offset=8 i32.const 0 i32.const 0 @@ -1037,9 +1037,9 @@ i64.store offset=8 i32.const 0 f32.load offset=8 - set_global $builtins/f + global.set $builtins/f i32.const 0 - get_global $builtins/f + global.get $builtins/f f32.store offset=8 i32.const 0 i32.const 0 @@ -1047,9 +1047,9 @@ f32.store offset=8 i32.const 0 f64.load offset=8 - set_global $builtins/F + global.set $builtins/F i32.const 0 - get_global $builtins/F + global.get $builtins/F f64.store offset=8 i32.const 0 i32.const 0 @@ -1057,64 +1057,64 @@ f64.store offset=8 i32.const 8 i32.load8_s - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load16_s - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load8_u - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load16_u - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load - set_global $builtins/i + global.set $builtins/i i32.const 8 i32.load8_u - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load16_u - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load8_s - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load16_s - set_global $builtins/u + global.set $builtins/u i32.const 8 i32.load - set_global $builtins/u + global.set $builtins/u i32.const 8 i64.load8_s - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load16_s - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load32_s - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load - set_global $builtins/I + global.set $builtins/I i32.const 8 i64.load8_u - set_global $builtins/U + global.set $builtins/U i32.const 8 i64.load16_u - set_global $builtins/U + global.set $builtins/U i32.const 8 i64.load32_u - set_global $builtins/U + global.set $builtins/U i32.const 8 i64.load - set_global $builtins/U + global.set $builtins/U i32.const 8 i32.const 1 i32.store8 @@ -1138,42 +1138,42 @@ i64.store i32.const 8 i32.const 1 - i64.extend_s/i32 + i64.extend_i32_s i64.store f32.const 1.25 - i32.reinterpret/f32 + i32.reinterpret_f32 drop i32.const 25 - f32.reinterpret/i32 + f32.reinterpret_i32 drop f64.const 1.25 - i64.reinterpret/f64 + i64.reinterpret_f64 drop i64.const 25 - f64.reinterpret/i64 + f64.reinterpret_i64 drop f32.const 1.25 - i32.reinterpret/f32 - set_global $builtins/i + i32.reinterpret_f32 + global.set $builtins/i i32.const 25 - f32.reinterpret/i32 - set_global $builtins/f + f32.reinterpret_i32 + global.set $builtins/f f64.const 1.25 - i64.reinterpret/f64 - set_global $builtins/I + i64.reinterpret_f64 + global.set $builtins/I i64.const 25 - f64.reinterpret/i64 - set_global $builtins/F + f64.reinterpret_i64 + global.set $builtins/F current_memory drop i32.const 1 grow_memory drop current_memory - set_global $builtins/s + global.set $builtins/s i32.const 1 grow_memory - set_global $builtins/s + global.set $builtins/s i32.const 10 i32.const 20 i32.const 1 @@ -1198,30 +1198,30 @@ i32.const 20 i32.const 1 select - set_global $builtins/i + global.set $builtins/i i64.const 100 i64.const 200 i32.const 0 select - set_global $builtins/I + global.set $builtins/I f32.const 1.25 f32.const 2.5 i32.const 1 select - set_global $builtins/f + global.set $builtins/f f64.const 12.5 f64.const 25 i32.const 0 select - set_global $builtins/F - get_global $builtins/i + global.set $builtins/F + global.get $builtins/i i32.eqz if unreachable end i32.const 1 i32.const 2 - get_global $builtins/fn + global.get $builtins/fn call_indirect (type $iiv) i32.const 1 i32.const 1 @@ -1445,9 +1445,9 @@ end block $~lib/builtins/isNaN|inlined.3 (result i32) f32.const nan:0x400000 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.ne end i32.const 0 @@ -1463,9 +1463,9 @@ end block $~lib/builtins/isNaN|inlined.3 (result i32) f64.const nan:0x8000000000000 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.ne end i32.const 0 @@ -1481,9 +1481,9 @@ end block $~lib/builtins/isFinite|inlined.5 (result i32) f32.const nan:0x400000 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq @@ -1502,9 +1502,9 @@ end block $~lib/builtins/isFinite|inlined.6 (result i32) f32.const inf - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq @@ -1523,9 +1523,9 @@ end block $~lib/builtins/isFinite|inlined.5 (result i32) f64.const nan:0x8000000000000 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq @@ -1544,9 +1544,9 @@ end block $~lib/builtins/isFinite|inlined.6 (result i32) f64.const inf - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq @@ -1565,9 +1565,9 @@ end block $~lib/builtins/isFinite|inlined.7 (result i32) f32.const 0 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.sub f32.const 0 f32.eq @@ -1585,9 +1585,9 @@ end block $~lib/builtins/isFinite|inlined.7 (result i32) f64.const 0 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.sub f64.const 0 f64.eq @@ -1603,7 +1603,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE i32.const 128 i32.const 24 i32.shl @@ -1619,7 +1619,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE i32.const 127 i32.eq i32.eqz @@ -1631,7 +1631,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i16.MIN_VALUE + global.get $~lib/builtins/i16.MIN_VALUE i32.const 32768 i32.const 16 i32.shl @@ -1647,7 +1647,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i16.MAX_VALUE + global.get $~lib/builtins/i16.MAX_VALUE i32.const 32767 i32.eq i32.eqz @@ -1659,7 +1659,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i32.MIN_VALUE + global.get $~lib/builtins/i32.MIN_VALUE i32.const -2147483648 i32.eq i32.eqz @@ -1671,7 +1671,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i32.MAX_VALUE + global.get $~lib/builtins/i32.MAX_VALUE i32.const 2147483647 i32.eq i32.eqz @@ -1683,7 +1683,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i64.MIN_VALUE + global.get $~lib/builtins/i64.MIN_VALUE i64.const -9223372036854775808 i64.eq i32.eqz @@ -1695,7 +1695,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i64.MAX_VALUE + global.get $~lib/builtins/i64.MAX_VALUE i64.const 9223372036854775807 i64.eq i32.eqz @@ -1707,7 +1707,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u8.MIN_VALUE + global.get $~lib/builtins/u8.MIN_VALUE i32.const 0 i32.eq i32.eqz @@ -1719,7 +1719,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE i32.const 255 i32.eq i32.eqz @@ -1731,7 +1731,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u16.MIN_VALUE + global.get $~lib/builtins/u16.MIN_VALUE i32.const 0 i32.eq i32.eqz @@ -1743,7 +1743,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u16.MAX_VALUE + global.get $~lib/builtins/u16.MAX_VALUE i32.const 65535 i32.eq i32.eqz @@ -1755,7 +1755,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u32.MIN_VALUE + global.get $~lib/builtins/u32.MIN_VALUE i32.const 0 i32.eq i32.eqz @@ -1767,7 +1767,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u32.MAX_VALUE + global.get $~lib/builtins/u32.MAX_VALUE i32.const -1 i32.eq i32.eqz @@ -1779,7 +1779,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u64.MIN_VALUE + global.get $~lib/builtins/u64.MIN_VALUE i64.const 0 i64.eq i32.eqz @@ -1791,7 +1791,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u64.MAX_VALUE + global.get $~lib/builtins/u64.MAX_VALUE i64.const -1 i64.eq i32.eqz @@ -1803,7 +1803,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/bool.MIN_VALUE + global.get $~lib/builtins/bool.MIN_VALUE i32.const 0 i32.eq i32.eqz @@ -1815,7 +1815,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/bool.MIN_VALUE + global.get $~lib/builtins/bool.MIN_VALUE i32.const 0 i32.eq i32.eqz @@ -1827,7 +1827,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/bool.MAX_VALUE + global.get $~lib/builtins/bool.MAX_VALUE i32.const 1 i32.eq i32.eqz @@ -1839,7 +1839,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/bool.MAX_VALUE + global.get $~lib/builtins/bool.MAX_VALUE i32.const 1 i32.eq i32.eqz @@ -1851,7 +1851,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MIN_NORMAL_VALUE + global.get $~lib/builtins/f32.MIN_NORMAL_VALUE f32.const 1.1754943508222875e-38 f32.eq i32.eqz @@ -1863,7 +1863,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MIN_VALUE + global.get $~lib/builtins/f32.MIN_VALUE f32.const 1.401298464324817e-45 f32.eq i32.eqz @@ -1875,7 +1875,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MAX_VALUE + global.get $~lib/builtins/f32.MAX_VALUE f32.const 3402823466385288598117041e14 f32.eq i32.eqz @@ -1887,7 +1887,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MIN_SAFE_INTEGER + global.get $~lib/builtins/f32.MIN_SAFE_INTEGER f32.const -16777215 f32.eq i32.eqz @@ -1899,7 +1899,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MAX_SAFE_INTEGER + global.get $~lib/builtins/f32.MAX_SAFE_INTEGER f32.const 16777215 f32.eq i32.eqz @@ -1911,7 +1911,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.EPSILON + global.get $~lib/builtins/f32.EPSILON f32.const 1.1920928955078125e-07 f32.eq i32.eqz @@ -1923,7 +1923,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_NORMAL_VALUE + global.get $~lib/builtins/f64.MIN_NORMAL_VALUE f64.const 2.2250738585072014e-308 f64.eq i32.eqz @@ -1935,7 +1935,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_VALUE + global.get $~lib/builtins/f64.MIN_VALUE f64.const 5e-324 f64.eq i32.eqz @@ -1947,7 +1947,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_VALUE + global.get $~lib/builtins/f64.MAX_VALUE f64.const 1797693134862315708145274e284 f64.eq i32.eqz @@ -1959,7 +1959,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_SAFE_INTEGER + global.get $~lib/builtins/f64.MIN_SAFE_INTEGER f64.const -9007199254740991 f64.eq i32.eqz @@ -1971,7 +1971,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_SAFE_INTEGER + global.get $~lib/builtins/f64.MAX_SAFE_INTEGER f64.const 9007199254740991 f64.eq i32.eqz @@ -1983,7 +1983,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.EPSILON + global.get $~lib/builtins/f64.EPSILON f64.const 2.220446049250313e-16 f64.eq i32.eqz @@ -2104,16 +2104,16 @@ f64.min drop f32.const 1 - i32.reinterpret/f32 + i32.reinterpret_f32 drop f64.const 1 - i64.reinterpret/f64 + i64.reinterpret_f64 drop i32.const 1 - f32.reinterpret/i32 + f32.reinterpret_i32 drop i64.const 1 - f64.reinterpret/i64 + f64.reinterpret_i64 drop i32.const 1 i32.const 2 @@ -2172,9 +2172,9 @@ drop block $~lib/builtins/isNaN|inlined.4 (result i32) f64.const 1 - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f64.ne end drop diff --git a/tests/compiler/call-inferred.optimized.wat b/tests/compiler/call-inferred.optimized.wat index 7ed5514f..15a1835b 100644 --- a/tests/compiler/call-inferred.optimized.wat +++ b/tests/compiler/call-inferred.optimized.wat @@ -2,7 +2,7 @@ (type $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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/call-inferred.untouched.wat b/tests/compiler/call-inferred.untouched.wat index 923a3db0..a31148c9 100644 --- a/tests/compiler/call-inferred.untouched.wat +++ b/tests/compiler/call-inferred.untouched.wat @@ -7,23 +7,23 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 44)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) (func $call-inferred/foo (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $call-inferred/foo (; 2 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 ) (func $call-inferred/foo (; 3 ;) (type $ff) (param $0 f32) (result f32) - get_local $0 + local.get $0 ) (func $call-inferred/bar (; 4 ;) (type $ff) (param $0 f32) (result f32) - get_local $0 + local.get $0 ) (func $start (; 5 ;) (type $v) i32.const 42 diff --git a/tests/compiler/call-optional.optimized.wat b/tests/compiler/call-optional.optimized.wat index ea1c2c37..5c7c4bf9 100644 --- a/tests/compiler/call-optional.optimized.wat +++ b/tests/compiler/call-optional.optimized.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $call-optional/opt|trampoline) (global $~argc (mut i32) (i32.const 0)) (global $call-optional/optIndirect (mut i32) (i32.const 1)) @@ -17,7 +17,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -25,27 +25,27 @@ unreachable end i32.const -1 - set_local $1 + local.set $1 end i32.const -2 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - get_local $2 + local.get $2 i32.add ) (func $start (; 2 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 1 - set_global $~argc + global.set $~argc block $2of2 block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -53,15 +53,15 @@ unreachable end i32.const -1 - set_local $0 + local.set $0 end i32.const -2 - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.add if i32.const 0 @@ -72,16 +72,16 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc i32.const 4 - set_local $0 + local.set $0 i32.const 0 - set_local $1 + local.set $1 block $2of21 block $1of22 block $0of23 block $outOfRange4 - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of23 $1of22 $2of21 $outOfRange4 @@ -89,15 +89,15 @@ unreachable end i32.const -1 - set_local $0 + local.set $0 end i32.const -2 - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.add i32.const 5 i32.ne @@ -110,11 +110,11 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 3 i32.const 0 i32.const 0 - get_global $call-optional/optIndirect + global.get $call-optional/optIndirect call_indirect (type $iiii) if i32.const 0 @@ -125,11 +125,11 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc i32.const 3 i32.const 4 i32.const 0 - get_global $call-optional/optIndirect + global.get $call-optional/optIndirect call_indirect (type $iiii) i32.const 5 i32.ne @@ -142,11 +142,11 @@ unreachable end i32.const 3 - set_global $~argc + global.set $~argc i32.const 3 i32.const 4 i32.const 5 - get_global $call-optional/optIndirect + global.get $call-optional/optIndirect call_indirect (type $iiii) i32.const 12 i32.ne diff --git a/tests/compiler/call-optional.untouched.wat b/tests/compiler/call-optional.untouched.wat index 4cf2d5c5..75b348a8 100644 --- a/tests/compiler/call-optional.untouched.wat +++ b/tests/compiler/call-optional.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $call-optional/opt|trampoline) (global $~argc (mut i32) (i32.const 0)) (global $call-optional/optIndirect (mut i32) (i32.const 1)) @@ -14,10 +14,10 @@ (export "table" (table $0)) (start $start) (func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - get_local $2 + local.get $2 i32.add ) (func $call-optional/opt|trampoline (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -25,7 +25,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -33,20 +33,20 @@ unreachable end i32.const -1 - set_local $1 + local.set $1 end i32.const -2 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $call-optional/opt ) (func $start (; 3 ;) (type $v) block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 3 i32.const 0 i32.const 0 @@ -65,7 +65,7 @@ end block (result i32) i32.const 2 - set_global $~argc + global.set $~argc i32.const 3 i32.const 4 i32.const 0 @@ -99,11 +99,11 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 3 i32.const 0 i32.const 0 - get_global $call-optional/optIndirect + global.get $call-optional/optIndirect call_indirect (type $iiii) end i32.const 0 @@ -119,11 +119,11 @@ end block (result i32) i32.const 2 - set_global $~argc + global.set $~argc i32.const 3 i32.const 4 i32.const 0 - get_global $call-optional/optIndirect + global.get $call-optional/optIndirect call_indirect (type $iiii) end i32.const 5 @@ -139,11 +139,11 @@ end block (result i32) i32.const 3 - set_global $~argc + global.set $~argc i32.const 3 i32.const 4 i32.const 5 - get_global $call-optional/optIndirect + global.get $call-optional/optIndirect call_indirect (type $iiii) end i32.const 12 diff --git a/tests/compiler/call-super.optimized.wat b/tests/compiler/call-super.optimized.wat index fe291712..34e46240 100644 --- a/tests/compiler/call-super.optimized.wat +++ b/tests/compiler/call-super.optimized.wat @@ -6,7 +6,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -17,17 +17,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -36,16 +36,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -53,16 +53,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -71,22 +71,22 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $call-super/A#constructor (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 i32.load i32.const 1 i32.ne @@ -98,17 +98,17 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/B#constructor (; 3 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 call $~lib/allocator/arena/__memory_allocate call $call-super/A#constructor - tee_local $0 + local.tee $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 i32.load i32.const 1 i32.ne @@ -120,7 +120,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.ne @@ -132,12 +132,12 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/test1 (; 4 ;) (type $v) (local $0 i32) call $call-super/B#constructor - tee_local $0 + local.tee $0 i32.load i32.const 1 i32.ne @@ -149,7 +149,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.ne @@ -163,27 +163,27 @@ end ) (func $call-super/C#constructor (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + 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 - tee_local $0 + local.tee $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 i32.load i32.const 1 i32.ne @@ -195,7 +195,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.ne @@ -207,12 +207,12 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/test2 (; 7 ;) (type $v) (local $0 i32) call $call-super/D#constructor - tee_local $0 + local.tee $0 i32.load i32.const 1 i32.ne @@ -224,7 +224,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.ne @@ -238,17 +238,17 @@ end ) (func $call-super/E#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 i32.load i32.const 1 i32.ne @@ -260,17 +260,17 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/test3 (; 9 ;) (type $v) (local $0 i32) i32.const 8 call $~lib/allocator/arena/__memory_allocate call $call-super/E#constructor - tee_local $0 + local.tee $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 i32.load i32.const 1 i32.ne @@ -282,7 +282,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.ne @@ -300,15 +300,15 @@ i32.const 8 call $~lib/allocator/arena/__memory_allocate call $call-super/C#constructor - tee_local $0 + local.tee $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 ) (func $call-super/test4 (; 11 ;) (type $v) (local $0 i32) call $call-super/H#constructor - tee_local $0 + local.tee $0 i32.load i32.const 1 i32.ne @@ -320,7 +320,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.ne @@ -336,7 +336,7 @@ (func $call-super/test5 (; 12 ;) (type $v) (local $0 i32) call $call-super/H#constructor - tee_local $0 + local.tee $0 i32.load i32.const 1 i32.ne @@ -348,7 +348,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.ne @@ -363,9 +363,9 @@ ) (func $start (; 13 ;) (type $v) i32.const 40 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset call $call-super/test1 call $call-super/test2 call $call-super/test3 diff --git a/tests/compiler/call-super.untouched.wat b/tests/compiler/call-super.untouched.wat index 9fa0e839..fa6f3a95 100644 --- a/tests/compiler/call-super.untouched.wat +++ b/tests/compiler/call-super.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -24,41 +24,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -68,22 +68,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -92,28 +92,28 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $call-super/A#constructor (; 3 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 end i32.load i32.const 1 @@ -127,22 +127,22 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/B#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if (result i32) - get_local $0 + local.get $0 else i32.const 8 call $~lib/memory/memory.allocate end call $call-super/A#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -155,7 +155,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.eq @@ -168,14 +168,14 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/test1 (; 5 ;) (type $v) (local $0 i32) i32.const 0 call $call-super/B#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -188,7 +188,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.eq @@ -203,32 +203,32 @@ end ) (func $call-super/C#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 ) (func $call-super/D#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if (result i32) - get_local $0 + local.get $0 else i32.const 8 call $~lib/memory/memory.allocate end call $call-super/C#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -241,7 +241,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.eq @@ -254,14 +254,14 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/test2 (; 8 ;) (type $v) (local $0 i32) i32.const 0 call $call-super/D#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -274,7 +274,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.eq @@ -290,17 +290,17 @@ ) (func $call-super/E#constructor (; 9 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 end i32.load i32.const 1 @@ -314,30 +314,30 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 ) (func $call-super/F#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $call-super/E#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 ) (func $call-super/test3 (; 11 ;) (type $v) (local $0 i32) i32.const 0 call $call-super/F#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -350,7 +350,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.eq @@ -365,40 +365,40 @@ end ) (func $call-super/G#constructor (; 12 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 ) (func $call-super/H#constructor (; 13 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $call-super/G#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 ) (func $call-super/test4 (; 14 ;) (type $v) (local $0 i32) i32.const 0 call $call-super/H#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -411,7 +411,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.eq @@ -426,40 +426,40 @@ end ) (func $call-super/I#constructor (; 15 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 ) (func $call-super/J#constructor (; 16 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $call-super/I#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 ) (func $call-super/test5 (; 17 ;) (type $v) (local $0 i32) i32.const 0 call $call-super/J#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -472,7 +472,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.eq @@ -487,16 +487,16 @@ end ) (func $start (; 18 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset call $call-super/test1 call $call-super/test2 call $call-super/test3 diff --git a/tests/compiler/class-extends.optimized.wat b/tests/compiler/class-extends.optimized.wat index 4ad5a10a..a9565529 100644 --- a/tests/compiler/class-extends.optimized.wat +++ b/tests/compiler/class-extends.optimized.wat @@ -2,22 +2,22 @@ (type $iv (func (param i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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 $iv) (param $0 i32) - get_local $0 + local.get $0 i32.load drop - get_local $0 + local.get $0 i32.load16_s offset=4 drop - get_local $0 + local.get $0 i32.const 2 i32.store - get_local $0 + local.get $0 i32.const 3 i32.store16 offset=4 ) diff --git a/tests/compiler/class-extends.untouched.wat b/tests/compiler/class-extends.untouched.wat index 61e50990..37683117 100644 --- a/tests/compiler/class-extends.untouched.wat +++ b/tests/compiler/class-extends.untouched.wat @@ -2,23 +2,23 @@ (type $iv (func (param i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $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 $iv) (param $0 i32) - get_local $0 + local.get $0 i32.load drop - get_local $0 + local.get $0 i32.load16_s offset=4 drop - get_local $0 + local.get $0 i32.const 2 i32.store - get_local $0 + local.get $0 i32.const 3 i32.store16 offset=4 ) diff --git a/tests/compiler/class-overloading.optimized.wat b/tests/compiler/class-overloading.optimized.wat index e547460b..b600a337 100644 --- a/tests/compiler/class-overloading.optimized.wat +++ b/tests/compiler/class-overloading.optimized.wat @@ -2,7 +2,7 @@ (type $iv (func (param i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/class-overloading.untouched.wat b/tests/compiler/class-overloading.untouched.wat index 162d4f3b..47f1b796 100644 --- a/tests/compiler/class-overloading.untouched.wat +++ b/tests/compiler/class-overloading.untouched.wat @@ -2,7 +2,7 @@ (type $iv (func (param i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) @@ -13,7 +13,7 @@ nop ) (func $class-overloading/test (; 1 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 call $class-overloading/Foo#baz ) (func $start (; 2 ;) (type $v) diff --git a/tests/compiler/class-with-boolean-field.optimized.wat b/tests/compiler/class-with-boolean-field.optimized.wat index 3c7b8550..94f507e8 100644 --- a/tests/compiler/class-with-boolean-field.optimized.wat +++ b/tests/compiler/class-with-boolean-field.optimized.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/class-with-boolean-field.untouched.wat b/tests/compiler/class-with-boolean-field.untouched.wat index 2954e085..742517ef 100644 --- a/tests/compiler/class-with-boolean-field.untouched.wat +++ b/tests/compiler/class-with-boolean-field.untouched.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) @@ -10,10 +10,10 @@ (export "test" (func $class-with-boolean-field/test)) (func $class-with-boolean-field/test (; 0 ;) (type $i) (result i32) (local $0 i32) - get_local $0 + local.get $0 i32.const 1 i32.store8 - get_local $0 + local.get $0 i32.load8_u i32.const 0 i32.ne diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index 58980ff8..5aa5dd91 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -3,31 +3,31 @@ (type $v (func)) (memory $0 1) (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) (export "test" (func $class/test)) (func $class/test (; 0 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load drop - get_local $0 + local.get $0 i32.load16_s offset=4 drop - get_local $0 + local.get $0 i32.load8_s offset=6 drop - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 i32.const 2 i32.store16 offset=4 - get_local $0 + local.get $0 i32.const 3 i32.store8 offset=6 - get_local $0 + local.get $0 ) (func $start (; 1 ;) (type $v) nop diff --git a/tests/compiler/class.untouched.wat b/tests/compiler/class.untouched.wat index 7a7096de..3f6b5545 100644 --- a/tests/compiler/class.untouched.wat +++ b/tests/compiler/class.untouched.wat @@ -9,7 +9,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $class/Animal.ONE (mut i32) (i32.const 1)) (global $HEAP_BASE i32 (i32.const 28)) @@ -18,79 +18,79 @@ (export "test" (func $class/test)) (start $start) (func $class/Animal.add (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - get_global $class/Animal.ONE + global.get $class/Animal.ONE i32.add ) (func $class/Animal.sub (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.sub - get_global $class/Animal.ONE - f32.convert_s/i32 + global.get $class/Animal.ONE + f32.convert_i32_s f32.add ) (func $class/Animal#instanceAdd (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_global $class/Animal.ONE + global.get $class/Animal.ONE i32.add ) (func $class/Animal#instanceSub (; 4 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32) - get_local $1 - get_local $2 + local.get $1 + local.get $2 f32.sub - get_global $class/Animal.ONE - f32.convert_s/i32 + global.get $class/Animal.ONE + f32.convert_i32_s f32.add ) (func $class/test (; 5 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $class/Animal#instanceAdd drop - get_local $0 + local.get $0 f32.const 1 f32.const 2 call $class/Animal#instanceSub drop - get_local $0 + local.get $0 i32.load drop - get_local $0 + local.get $0 i32.load16_s offset=4 drop - get_local $0 + local.get $0 i32.load8_s offset=6 drop - get_local $0 + local.get $0 i32.const 0 i32.const 1 i32.add i32.store - get_local $0 + local.get $0 i32.const 1 i32.const 1 i32.add i32.store16 offset=4 - get_local $0 + local.get $0 i32.const 1 i32.const 1 i32.add i32.const 1 i32.add i32.store8 offset=6 - get_local $0 - set_local $1 - get_local $1 - set_local $2 - get_local $2 + local.get $0 + local.set $1 + local.get $1 + local.set $2 + local.get $2 ) (func $start (; 6 ;) (type $v) i32.const 4 @@ -105,7 +105,7 @@ call $~lib/env/abort unreachable end - get_global $class/Animal.ONE + global.get $class/Animal.ONE drop i32.const 1 i32.const 2 diff --git a/tests/compiler/closure.optimized.wat b/tests/compiler/closure.optimized.wat index f90cb84b..946d2ca9 100644 --- a/tests/compiler/closure.optimized.wat +++ b/tests/compiler/closure.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/closure.untouched.wat b/tests/compiler/closure.untouched.wat index 99c47340..5f786cb1 100644 --- a/tests/compiler/closure.untouched.wat +++ b/tests/compiler/closure.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index df03b9a9..dc4689c3 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -13,14 +13,14 @@ (start $start) (func $start (; 1 ;) (type $v) (local $0 i32) - get_global $comma/a - tee_local $0 + global.get $comma/a + local.tee $0 i32.const 1 i32.add - set_global $comma/a - get_local $0 - set_global $comma/b - get_global $comma/a + global.set $comma/a + local.get $0 + global.set $comma/b + global.get $comma/a i32.const 1 i32.ne if @@ -31,7 +31,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b if i32.const 0 i32.const 8 @@ -40,14 +40,14 @@ call $~lib/env/abort unreachable end - get_global $comma/a + global.get $comma/a i32.const 1 i32.add - set_global $comma/a - get_global $comma/a - tee_local $0 - set_global $comma/b - get_local $0 + global.set $comma/a + global.get $comma/a + local.tee $0 + global.set $comma/b + local.get $0 i32.const 2 i32.ne if @@ -58,7 +58,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b i32.const 2 i32.ne if @@ -70,17 +70,17 @@ unreachable end i32.const 0 - set_global $comma/b - get_global $comma/b - set_global $comma/a - get_global $comma/a + global.set $comma/b + global.get $comma/b + global.set $comma/a + global.get $comma/a i32.const 1 i32.add - set_global $comma/a - get_global $comma/a - tee_local $0 - set_global $comma/b - get_local $0 + global.set $comma/a + global.get $comma/a + local.tee $0 + global.set $comma/b + local.get $0 i32.const 1 i32.ne if @@ -91,7 +91,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b i32.const 1 i32.ne if @@ -102,15 +102,15 @@ call $~lib/env/abort unreachable end - get_global $comma/a + global.get $comma/a i32.const 1 i32.add - set_global $comma/a - get_global $comma/a - set_global $comma/b - get_global $comma/b - set_global $comma/a - get_global $comma/a + global.set $comma/a + global.get $comma/a + global.set $comma/b + global.get $comma/b + global.set $comma/a + global.get $comma/a i32.const 2 i32.ne if @@ -121,7 +121,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b i32.const 2 i32.ne if @@ -133,25 +133,25 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 block $break|0 - get_local $0 - get_global $comma/a + local.get $0 + global.get $comma/a i32.ge_s br_if $break|0 - get_global $comma/a + global.get $comma/a i32.const 1 i32.sub - set_global $comma/a - get_local $0 + global.set $comma/a + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $0 + local.get $0 i32.const 1 i32.ne if diff --git a/tests/compiler/comma.untouched.wat b/tests/compiler/comma.untouched.wat index c929bd9c..c8afdb68 100644 --- a/tests/compiler/comma.untouched.wat +++ b/tests/compiler/comma.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (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)) @@ -17,18 +17,18 @@ (local $1 i32) block block (result i32) - get_global $comma/a - tee_local $0 + global.get $comma/a + local.tee $0 i32.const 1 i32.add - set_global $comma/a - get_local $0 + global.set $comma/a + local.get $0 end - set_global $comma/b - get_global $comma/a + global.set $comma/b + global.get $comma/a drop end - get_global $comma/a + global.get $comma/a i32.const 1 i32.eq i32.eqz @@ -40,7 +40,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b i32.const 0 i32.eq i32.eqz @@ -53,14 +53,14 @@ unreachable end block - get_global $comma/a + global.get $comma/a i32.const 1 i32.add - set_global $comma/a - get_global $comma/a - set_global $comma/b + global.set $comma/a + global.get $comma/a + global.set $comma/b end - get_global $comma/a + global.get $comma/a i32.const 2 i32.eq i32.eqz @@ -72,7 +72,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b i32.const 2 i32.eq i32.eqz @@ -86,19 +86,19 @@ end block (result i32) i32.const 0 - set_global $comma/b - get_global $comma/b + global.set $comma/b + global.get $comma/b end - set_global $comma/a + global.set $comma/a block (result i32) - get_global $comma/a + global.get $comma/a i32.const 1 i32.add - set_global $comma/a - get_global $comma/a + global.set $comma/a + global.get $comma/a end - set_global $comma/b - get_global $comma/a + global.set $comma/b + global.get $comma/a i32.const 1 i32.eq i32.eqz @@ -110,7 +110,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b i32.const 1 i32.eq i32.eqz @@ -123,18 +123,18 @@ unreachable end block (result i32) - get_global $comma/a + global.get $comma/a i32.const 1 i32.add - set_global $comma/a + global.set $comma/a block (result i32) - get_global $comma/a - set_global $comma/b - get_global $comma/b + global.get $comma/a + global.set $comma/b + global.get $comma/b end end - set_global $comma/a - get_global $comma/a + global.set $comma/a + global.get $comma/a i32.const 2 i32.eq i32.eqz @@ -146,7 +146,7 @@ call $~lib/env/abort unreachable end - get_global $comma/b + global.get $comma/b i32.const 2 i32.eq i32.eqz @@ -160,30 +160,30 @@ end block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 - get_global $comma/a + local.get $1 + global.get $comma/a i32.lt_s i32.eqz br_if $break|0 nop block - get_global $comma/a + global.get $comma/a i32.const 1 i32.sub - set_global $comma/a - get_local $1 + global.set $comma/a + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 end br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 i32.const 1 i32.eq i32.eqz diff --git a/tests/compiler/declare.optimized.wat b/tests/compiler/declare.optimized.wat index 1708077c..8d57a1d1 100644 --- a/tests/compiler/declare.optimized.wat +++ b/tests/compiler/declare.optimized.wat @@ -8,14 +8,14 @@ (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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) (func $start (; 3 ;) (type $v) call $declare/externalFunction - get_global $declare/externalConstant + global.get $declare/externalConstant i32.const 1 i32.ne if @@ -27,7 +27,7 @@ unreachable end call $declare/my.externalFunction - get_global $declare/my.externalConstant + global.get $declare/my.externalConstant i32.const 2 i32.ne if diff --git a/tests/compiler/declare.untouched.wat b/tests/compiler/declare.untouched.wat index fdc27314..fd62e5e3 100644 --- a/tests/compiler/declare.untouched.wat +++ b/tests/compiler/declare.untouched.wat @@ -8,7 +8,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) @@ -16,7 +16,7 @@ (start $start) (func $start (; 3 ;) (type $v) call $declare/externalFunction - get_global $declare/externalConstant + global.get $declare/externalConstant i32.const 1 i32.eq i32.eqz @@ -29,7 +29,7 @@ unreachable end call $declare/my.externalFunction - get_global $declare/my.externalConstant + global.get $declare/my.externalConstant i32.const 2 i32.eq i32.eqz diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 6033f633..5532e073 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s") - (table $0 1 anyfunc) + (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)) @@ -15,18 +15,18 @@ (func $start (; 1 ;) (type $v) (local $0 i32) loop $continue|0 - get_global $do/n + global.get $do/n i32.const 1 i32.sub - set_global $do/n - get_global $do/m + global.set $do/n + global.get $do/m i32.const 1 i32.add - set_global $do/m - get_global $do/n + global.set $do/m + global.get $do/n br_if $continue|0 end - get_global $do/n + global.get $do/n if i32.const 0 i32.const 8 @@ -35,7 +35,7 @@ call $~lib/env/abort unreachable end - get_global $do/m + global.get $do/m i32.const 10 i32.ne if @@ -47,17 +47,17 @@ unreachable end i32.const 10 - set_global $do/n + global.set $do/n loop $continue|1 - get_global $do/n - tee_local $0 + global.get $do/n + local.tee $0 i32.const 1 i32.sub - set_global $do/n - get_local $0 + global.set $do/n + local.get $0 br_if $continue|1 end - get_global $do/n + global.get $do/n i32.const -1 i32.ne if @@ -69,31 +69,31 @@ unreachable end i32.const 10 - set_global $do/n + global.set $do/n i32.const 0 - set_global $do/m + global.set $do/m loop $continue|2 - get_global $do/n + global.get $do/n i32.const 1 i32.sub - set_global $do/n - get_global $do/m + global.set $do/n + global.get $do/m i32.const 1 i32.add - set_global $do/m + global.set $do/m loop $continue|3 - get_global $do/n + global.get $do/n i32.const 1 i32.sub - set_global $do/n - get_global $do/o + global.set $do/n + global.get $do/o i32.const 1 i32.add - set_global $do/o - get_global $do/n + global.set $do/o + global.get $do/n br_if $continue|3 end - get_global $do/n + global.get $do/n if i32.const 0 i32.const 8 @@ -102,7 +102,7 @@ call $~lib/env/abort unreachable end - get_global $do/o + global.get $do/o i32.const 9 i32.ne if @@ -113,10 +113,10 @@ call $~lib/env/abort unreachable end - get_global $do/n + global.get $do/n br_if $continue|2 end - get_global $do/n + global.get $do/n if i32.const 0 i32.const 8 @@ -125,7 +125,7 @@ call $~lib/env/abort unreachable end - get_global $do/m + global.get $do/m i32.const 1 i32.ne if @@ -136,7 +136,7 @@ call $~lib/env/abort unreachable end - get_global $do/o + global.get $do/o i32.const 9 i32.ne if diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 8c8c316f..d6708190 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s\00") - (table $0 1 anyfunc) + (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)) @@ -18,20 +18,20 @@ block $break|0 loop $continue|0 block - get_global $do/n + global.get $do/n i32.const 1 i32.sub - set_global $do/n - get_global $do/m + global.set $do/n + global.get $do/m i32.const 1 i32.add - set_global $do/m + global.set $do/m end - get_global $do/n + global.get $do/n br_if $continue|0 end end - get_global $do/n + global.get $do/n i32.const 0 i32.eq i32.eqz @@ -43,7 +43,7 @@ call $~lib/env/abort unreachable end - get_global $do/m + global.get $do/m i32.const 10 i32.eq i32.eqz @@ -56,22 +56,22 @@ unreachable end i32.const 10 - set_global $do/n + global.set $do/n block $break|1 loop $continue|1 nop block (result i32) - get_global $do/n - tee_local $0 + global.get $do/n + local.tee $0 i32.const 1 i32.sub - set_global $do/n - get_local $0 + global.set $do/n + local.get $0 end br_if $continue|1 end end - get_global $do/n + global.get $do/n i32.const -1 i32.eq i32.eqz @@ -84,37 +84,37 @@ unreachable end i32.const 10 - set_global $do/n + global.set $do/n i32.const 0 - set_global $do/m + global.set $do/m block $break|2 loop $continue|2 block - get_global $do/n + global.get $do/n i32.const 1 i32.sub - set_global $do/n - get_global $do/m + global.set $do/n + global.get $do/m i32.const 1 i32.add - set_global $do/m + global.set $do/m block $break|3 loop $continue|3 block - get_global $do/n + global.get $do/n i32.const 1 i32.sub - set_global $do/n - get_global $do/o + global.set $do/n + global.get $do/o i32.const 1 i32.add - set_global $do/o + global.set $do/o end - get_global $do/n + global.get $do/n br_if $continue|3 end end - get_global $do/n + global.get $do/n i32.const 0 i32.eq i32.eqz @@ -126,7 +126,7 @@ call $~lib/env/abort unreachable end - get_global $do/o + global.get $do/o i32.const 9 i32.eq i32.eqz @@ -139,11 +139,11 @@ unreachable end end - get_global $do/n + global.get $do/n br_if $continue|2 end end - get_global $do/n + global.get $do/n i32.const 0 i32.eq i32.eqz @@ -155,7 +155,7 @@ call $~lib/env/abort unreachable end - get_global $do/m + global.get $do/m i32.const 1 i32.eq i32.eqz @@ -167,7 +167,7 @@ call $~lib/env/abort unreachable end - get_global $do/o + global.get $do/o i32.const 9 i32.eq i32.eqz diff --git a/tests/compiler/empty.optimized.wat b/tests/compiler/empty.optimized.wat index f90cb84b..946d2ca9 100644 --- a/tests/compiler/empty.optimized.wat +++ b/tests/compiler/empty.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/empty.untouched.wat b/tests/compiler/empty.untouched.wat index 99c47340..5f786cb1 100644 --- a/tests/compiler/empty.untouched.wat +++ b/tests/compiler/empty.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) diff --git a/tests/compiler/enum.optimized.wat b/tests/compiler/enum.optimized.wat index ad861254..4dcb431e 100644 --- a/tests/compiler/enum.optimized.wat +++ b/tests/compiler/enum.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -38,9 +38,9 @@ (start $start) (func $start (; 0 ;) (type $v) i32.const 0 - set_global $enum/NonConstant.ZERO + global.set $enum/NonConstant.ZERO i32.const 1 - set_global $enum/NonConstant.ONE + global.set $enum/NonConstant.ONE ) (func $null (; 1 ;) (type $v) nop diff --git a/tests/compiler/enum.untouched.wat b/tests/compiler/enum.untouched.wat index 94c97a81..105add17 100644 --- a/tests/compiler/enum.untouched.wat +++ b/tests/compiler/enum.untouched.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -44,14 +44,14 @@ ) (func $start (; 1 ;) (type $v) call $enum/getZero - set_global $enum/NonConstant.ZERO + global.set $enum/NonConstant.ZERO call $enum/getZero i32.const 1 i32.add - set_global $enum/NonConstant.ONE - get_global $enum/NonConstant.ZERO + global.set $enum/NonConstant.ONE + global.get $enum/NonConstant.ZERO drop - get_global $enum/NonConstant.ONE + global.get $enum/NonConstant.ONE drop ) (func $null (; 2 ;) (type $v) diff --git a/tests/compiler/export.optimized.wat b/tests/compiler/export.optimized.wat index 2f643b64..d471e078 100644 --- a/tests/compiler/export.optimized.wat +++ b/tests/compiler/export.optimized.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $export/ns.two) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -17,18 +17,18 @@ (export "renamed_c" (global $export/c)) (export "ns.two" (func $export/ns.two)) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul ) (func $export/ns.two (; 3 ;) (type $v) diff --git a/tests/compiler/export.untouched.wat b/tests/compiler/export.untouched.wat index 7af9840e..dd6fe647 100644 --- a/tests/compiler/export.untouched.wat +++ b/tests/compiler/export.untouched.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -18,18 +18,18 @@ (export "renamed_c" (global $export/c)) (export "ns.two" (func $export/ns.two)) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul ) (func $export/ns.two (; 3 ;) (type $v) diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index 14254c2c..3a01992b 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -6,7 +6,7 @@ (type $iv (func (param i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -47,13 +47,13 @@ (export "outer.inner.a" (global $exports/outer.inner.a)) (start $start) (func $exports/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $exports/subOpt (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $exports/Car.getNumTires (; 2 ;) (type $i) (result i32) @@ -63,17 +63,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -82,16 +82,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -99,16 +99,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -117,17 +117,17 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $exports/Car#get:numDoors (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $exports/Car#set:numDoors (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store ) (func $exports/Car#openDoors (; 6 ;) (type $iv) (param $0 i32) @@ -135,9 +135,9 @@ ) (func $start (; 7 ;) (type $v) i32.const 8 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset ) (func $null (; 8 ;) (type $v) nop @@ -146,7 +146,7 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -154,41 +154,41 @@ unreachable end i32.const 0 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $~setargc (; 10 ;) (type $iv) (param $0 i32) - get_local $0 - set_global $~argc + local.get $0 + global.set $~argc ) (func $exports/Car#constructor|trampoline (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable end i32.const 2 - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 + local.get $0 ) ) diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index 4d479fd6..6de81f76 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -6,7 +6,7 @@ (type $iv (func (param i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -52,22 +52,22 @@ (export "outer.inner.a" (global $exports/outer.inner.a)) (start $start) (func $exports/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $exports/subOpt (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $exports/math.sub (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $exports/Car.getNumTires (; 3 ;) (type $i) (result i32) - get_global $exports/Car.TIRES + global.get $exports/Car.TIRES ) (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -76,41 +76,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -120,22 +120,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -144,89 +144,89 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + 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) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $exports/Car#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 + local.get $0 end - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 ) (func $exports/Car#get:numDoors (; 7 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $exports/Car#set:numDoors (; 8 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store ) (func $exports/Car#openDoors (; 9 ;) (type $iv) (param $0 i32) nop ) (func $exports/vehicles.Car.getNumTires (; 10 ;) (type $i) (result i32) - get_global $exports/vehicles.Car.TIRES + global.get $exports/vehicles.Car.TIRES ) (func $exports/vehicles.Car#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 + local.get $0 end - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 ) (func $exports/vehicles.Car#get:numDoors (; 12 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $exports/vehicles.Car#set:numDoors (; 13 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store ) (func $exports/vehicles.Car#openDoors (; 14 ;) (type $iv) (param $0 i32) nop ) (func $start (; 15 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset ) (func $null (; 16 ;) (type $v) ) @@ -234,7 +234,7 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -242,64 +242,64 @@ unreachable end i32.const 0 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $exports/subOpt ) (func $~setargc (; 18 ;) (type $iv) (param $0 i32) - get_local $0 - set_global $~argc + local.get $0 + global.set $~argc ) (func $exports/Car#constructor|trampoline (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable end i32.const 2 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $exports/Car#constructor ) (func $Car#get:doors (; 20 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $Car#set:doors (; 21 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store ) (func $exports/vehicles.Car#constructor|trampoline (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable end i32.const 2 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $exports/vehicles.Car#constructor ) (func $vehicles.Car#get:doors (; 23 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $vehicles.Car#set:doors (; 24 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store ) ) diff --git a/tests/compiler/external.optimized.wat b/tests/compiler/external.optimized.wat index f369cce1..91bc0339 100644 --- a/tests/compiler/external.optimized.wat +++ b/tests/compiler/external.optimized.wat @@ -6,7 +6,7 @@ (import "external" "bar" (func $external/two)) (import "foo" "baz" (func $external/three)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/external.untouched.wat b/tests/compiler/external.untouched.wat index 245320ee..58f4a0b2 100644 --- a/tests/compiler/external.untouched.wat +++ b/tests/compiler/external.untouched.wat @@ -6,7 +6,7 @@ (import "external" "bar" (func $external/two)) (import "foo" "baz" (func $external/three)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index b5c51b49..5e7b2da9 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $for/i (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -14,21 +14,21 @@ (local $0 i32) (local $1 i32) i32.const 0 - set_global $for/i + global.set $for/i loop $repeat|0 block $break|0 - get_global $for/i + global.get $for/i i32.const 10 i32.ge_s br_if $break|0 - get_global $for/i + global.get $for/i i32.const 1 i32.add - set_global $for/i + global.set $for/i br $repeat|0 end end - get_global $for/i + global.get $for/i i32.const 10 i32.ne if @@ -41,31 +41,31 @@ end loop $repeat|1 block $break|1 - get_local $0 + local.get $0 i32.const 10 i32.ge_s br_if $break|1 - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end end loop $repeat|2 - get_global $for/i + global.get $for/i i32.const 0 i32.le_s i32.eqz if - get_global $for/i + global.get $for/i i32.const 1 i32.sub - set_global $for/i + global.set $for/i br $repeat|2 end end - get_global $for/i + global.get $for/i if i32.const 0 i32.const 8 @@ -75,42 +75,42 @@ unreachable end loop $repeat|3 - get_global $for/i + global.get $for/i i32.const 10 i32.eq i32.eqz if - get_global $for/i + global.get $for/i i32.const 1 i32.add - set_global $for/i + global.set $for/i br $repeat|3 end end loop $repeat|4 - get_global $for/i + global.get $for/i i32.const 1 i32.sub - set_global $for/i - get_global $for/i + global.set $for/i + global.get $for/i br_if $repeat|4 end i32.const 0 - set_local $0 + local.set $0 loop $repeat|5 block $break|5 - get_local $0 + local.get $0 i32.const 10 i32.ge_s br_if $break|5 - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|5 end end - get_local $0 + local.get $0 i32.const 10 i32.ne if @@ -122,38 +122,38 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|6 block $break|6 - get_local $0 + local.get $0 i32.const 10 i32.ge_s br_if $break|6 i32.const 0 - set_local $1 + local.set $1 loop $repeat|7 block $break|7 - get_local $1 + local.get $1 i32.const 10 i32.ge_s br_if $break|7 block $continue|7 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq br_if $continue|7 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|7 end end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|6 end end diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 56f73f68..7a830986 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s\00") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $for/i (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 24)) @@ -18,24 +18,24 @@ (local $3 i32) block $break|0 i32.const 0 - set_global $for/i + global.set $for/i loop $repeat|0 - get_global $for/i + global.get $for/i i32.const 10 i32.lt_s i32.eqz br_if $break|0 nop - get_global $for/i + global.get $for/i i32.const 1 i32.add - set_global $for/i + global.set $for/i br $repeat|0 unreachable end unreachable end - get_global $for/i + global.get $for/i i32.const 10 i32.eq i32.eqz @@ -49,18 +49,18 @@ end block $break|1 i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 10 i32.lt_s i32.eqz br_if $break|1 nop - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 unreachable end @@ -68,22 +68,22 @@ end block $break|2 loop $repeat|2 - get_global $for/i + global.get $for/i i32.const 0 i32.gt_s i32.eqz br_if $break|2 nop - get_global $for/i + global.get $for/i i32.const 1 i32.sub - set_global $for/i + global.set $for/i br $repeat|2 unreachable end unreachable end - get_global $for/i + global.get $for/i i32.const 0 i32.eq i32.eqz @@ -100,16 +100,16 @@ i32.const 1 i32.eqz br_if $break|3 - get_global $for/i + global.get $for/i i32.const 10 i32.eq if br $break|3 end - get_global $for/i + global.get $for/i i32.const 1 i32.add - set_global $for/i + global.set $for/i br $repeat|3 unreachable end @@ -121,11 +121,11 @@ i32.eqz br_if $break|4 block (result i32) - get_global $for/i + global.get $for/i i32.const 1 i32.sub - set_global $for/i - get_global $for/i + global.set $for/i + global.get $for/i end i32.const 0 i32.eq @@ -139,26 +139,26 @@ end block $break|5 i32.const 0 - set_local $1 + local.set $1 loop $repeat|5 block $continue|5 - get_local $1 + local.get $1 i32.const 10 i32.lt_s i32.eqz br_if $break|5 br $continue|5 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|5 unreachable end unreachable end - get_local $1 + local.get $1 i32.const 10 i32.eq i32.eqz @@ -172,43 +172,43 @@ end block $break|6 i32.const 0 - set_local $2 + local.set $2 loop $repeat|6 - get_local $2 + local.get $2 i32.const 10 i32.lt_s i32.eqz br_if $break|6 block $break|7 i32.const 0 - set_local $3 + local.set $3 loop $repeat|7 block $continue|7 - get_local $3 + local.get $3 i32.const 10 i32.lt_s i32.eqz br_if $break|7 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if br $continue|7 end end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|7 unreachable end unreachable end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|6 unreachable end diff --git a/tests/compiler/function-expression.optimized.wat b/tests/compiler/function-expression.optimized.wat index eeaa45bc..f0d1d547 100644 --- a/tests/compiler/function-expression.optimized.wat +++ b/tests/compiler/function-expression.optimized.wat @@ -6,7 +6,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 5 anyfunc) + (table $0 5 funcref) (elem (i32.const 0) $start~someName|3 $start~anonymous|1 $start~anonymous|1 $start~someName|3 $start~anonymous|4) (global $function-expression/f1 (mut i32) (i32.const 1)) (global $~argc (mut i32) (i32.const 0)) @@ -17,7 +17,7 @@ (export "table" (table $0)) (start $start) (func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $start~someName|3 (; 2 ;) (type $v) nop @@ -27,9 +27,9 @@ ) (func $start (; 4 ;) (type $v) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1 - get_global $function-expression/f1 + global.get $function-expression/f1 call_indirect (type $ii) i32.const 1 i32.ne @@ -42,9 +42,9 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 2 - get_global $function-expression/f2 + global.get $function-expression/f2 call_indirect (type $ii) i32.const 2 i32.ne @@ -57,12 +57,12 @@ unreachable end i32.const 0 - set_global $~argc - get_global $function-expression/f3 + global.set $~argc + global.get $function-expression/f3 call_indirect (type $v) i32.const 0 - set_global $~argc - get_global $function-expression/f4 + global.set $~argc + global.get $function-expression/f4 call_indirect (type $i) i32.const 1 i32.ne diff --git a/tests/compiler/function-expression.untouched.wat b/tests/compiler/function-expression.untouched.wat index 43960e0f..00554495 100644 --- a/tests/compiler/function-expression.untouched.wat +++ b/tests/compiler/function-expression.untouched.wat @@ -6,7 +6,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 5 anyfunc) + (table $0 5 funcref) (elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~someName|3 $start~anonymous|4) (global $function-expression/f1 (mut i32) (i32.const 1)) (global $~argc (mut i32) (i32.const 0)) @@ -18,10 +18,10 @@ (export "table" (table $0)) (start $start) (func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $start~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $start~someName|3 (; 3 ;) (type $v) nop @@ -32,9 +32,9 @@ (func $start (; 5 ;) (type $v) block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1 - get_global $function-expression/f1 + global.get $function-expression/f1 call_indirect (type $ii) end i32.const 1 @@ -50,9 +50,9 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 2 - get_global $function-expression/f2 + global.get $function-expression/f2 call_indirect (type $ii) end i32.const 2 @@ -68,14 +68,14 @@ end block i32.const 0 - set_global $~argc - get_global $function-expression/f3 + global.set $~argc + global.get $function-expression/f3 call_indirect (type $v) end block (result i32) i32.const 0 - set_global $~argc - get_global $function-expression/f4 + global.set $~argc + global.get $function-expression/f4 call_indirect (type $i) end i32.const 1 diff --git a/tests/compiler/function-types.optimized.wat b/tests/compiler/function-types.optimized.wat index 46dc74b3..a76b5101 100644 --- a/tests/compiler/function-types.optimized.wat +++ b/tests/compiler/function-types.optimized.wat @@ -7,7 +7,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 5 anyfunc) + (table $0 5 funcref) (elem (i32.const 0) $null $function-types/makeAdder~anonymous|1 $function-types/makeAdder~anonymous|2 $function-types/makeAdder~anonymous|3 $function-types/makeAdder~anonymous|1) (global $function-types/i32Adder (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0)) @@ -16,29 +16,29 @@ (export "table" (table $0)) (start $start) (func $function-types/makeAdder~anonymous|1 (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $function-types/makeAdder~anonymous|2 (; 2 ;) (type $III) (param $0 i64) (param $1 i64) (result i64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.add ) (func $function-types/makeAdder~anonymous|3 (; 3 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add ) (func $start (; 4 ;) (type $v) (local $0 i32) i32.const 1 - set_global $function-types/i32Adder + global.set $function-types/i32Adder i32.const 2 - set_global $~argc + global.set $~argc i32.const 1 i32.const 2 - get_global $function-types/i32Adder + global.get $function-types/i32Adder call_indirect (type $iii) i32.const 3 i32.ne @@ -51,12 +51,12 @@ unreachable end i32.const 2 - set_global $function-types/i64Adder + global.set $function-types/i64Adder i32.const 2 - set_global $~argc + global.set $~argc i64.const 10 i64.const 20 - get_global $function-types/i64Adder + global.get $function-types/i64Adder call_indirect (type $III) i64.const 30 i64.ne @@ -69,7 +69,7 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc f64.const 1.5 f64.const 2.5 i32.const 3 @@ -85,10 +85,10 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc i32.const 2 i32.const 3 - get_global $function-types/i32Adder + global.get $function-types/i32Adder call_indirect (type $iii) i32.const 5 i32.ne @@ -101,7 +101,7 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc i32.const 3 i32.const 4 i32.const 1 @@ -117,7 +117,7 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc i32.const 4 i32.const 5 i32.const 4 @@ -133,11 +133,11 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 2 i32.sub br_table $0of1 $1of1 $outOfRange @@ -145,13 +145,13 @@ unreachable end i32.const 1 - set_local $0 + local.set $0 end i32.const 2 - set_global $~argc + global.set $~argc i32.const 1 i32.const 2 - get_local $0 + local.get $0 call_indirect (type $iii) i32.const 3 i32.ne @@ -164,7 +164,7 @@ unreachable end i32.const 2 - set_global $~argc + global.set $~argc i32.const 1 i32.const 2 i32.const 1 diff --git a/tests/compiler/function-types.untouched.wat b/tests/compiler/function-types.untouched.wat index da13a2e1..8e3cb19a 100644 --- a/tests/compiler/function-types.untouched.wat +++ b/tests/compiler/function-types.untouched.wat @@ -9,7 +9,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 5 anyfunc) + (table $0 5 funcref) (elem (i32.const 0) $null $function-types/makeAdder~anonymous|1 $function-types/makeAdder~anonymous|2 $function-types/makeAdder~anonymous|3 $function-types/addI32) (global $function-types/i32Adder (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0)) @@ -19,24 +19,24 @@ (export "table" (table $0)) (start $start) (func $function-types/makeAdder~anonymous|1 (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $function-types/makeAdder (; 2 ;) (type $i) (result i32) i32.const 1 ) (func $function-types/makeAdder~anonymous|2 (; 3 ;) (type $III) (param $0 i64) (param $1 i64) (result i64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.add ) (func $function-types/makeAdder (; 4 ;) (type $i) (result i32) i32.const 2 ) (func $function-types/makeAdder~anonymous|3 (; 5 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add ) (func $function-types/makeAdder (; 6 ;) (type $i) (result i32) @@ -44,38 +44,38 @@ ) (func $function-types/doAddWithFn (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) i32.const 2 - set_global $~argc - get_local $0 - get_local $1 - get_local $2 + global.set $~argc + local.get $0 + local.get $1 + local.get $2 call_indirect (type $iii) ) (func $function-types/doAdd (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 2 - set_global $~argc - get_local $0 - get_local $1 + global.set $~argc + local.get $0 + local.get $1 call $function-types/makeAdder call_indirect (type $iii) ) (func $function-types/addI32 (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $function-types/makeAndAdd (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) i32.const 2 - set_global $~argc - get_local $0 - get_local $1 - get_local $2 + global.set $~argc + local.get $0 + local.get $1 + local.get $2 call_indirect (type $iii) ) (func $function-types/makeAndAdd|trampoline (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 2 i32.sub br_table $0of1 $1of1 $outOfRange @@ -83,23 +83,23 @@ unreachable end call $function-types/makeAdder - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $function-types/makeAndAdd ) (func $start (; 12 ;) (type $v) nop call $function-types/makeAdder - set_global $function-types/i32Adder + global.set $function-types/i32Adder block (result i32) i32.const 2 - set_global $~argc + global.set $~argc i32.const 1 i32.const 2 - get_global $function-types/i32Adder + global.get $function-types/i32Adder call_indirect (type $iii) end i32.const 3 @@ -114,13 +114,13 @@ unreachable end call $function-types/makeAdder - set_global $function-types/i64Adder + global.set $function-types/i64Adder block (result i64) i32.const 2 - set_global $~argc + global.set $~argc i64.const 10 i64.const 20 - get_global $function-types/i64Adder + global.get $function-types/i64Adder call_indirect (type $III) end i64.const 30 @@ -136,7 +136,7 @@ end block (result f64) i32.const 2 - set_global $~argc + global.set $~argc f64.const 1.5 f64.const 2.5 call $function-types/makeAdder @@ -155,7 +155,7 @@ end i32.const 2 i32.const 3 - get_global $function-types/i32Adder + global.get $function-types/i32Adder call $function-types/doAddWithFn i32.const 5 i32.eq @@ -199,7 +199,7 @@ end block (result i32) i32.const 2 - set_global $~argc + global.set $~argc i32.const 1 i32.const 2 i32.const 0 diff --git a/tests/compiler/function.optimized.wat b/tests/compiler/function.optimized.wat index be03ea1a..0a57311c 100644 --- a/tests/compiler/function.optimized.wat +++ b/tests/compiler/function.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/function.untouched.wat b/tests/compiler/function.untouched.wat index 0cb347e5..7d00303c 100644 --- a/tests/compiler/function.untouched.wat +++ b/tests/compiler/function.untouched.wat @@ -15,7 +15,7 @@ (type $fff (func (param f32 f32) (result f32))) (type $FFF (func (param f64 f64) (result f64))) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) @@ -40,39 +40,39 @@ nop ) (func $function/ii (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $function/II (; 7 ;) (type $II) (param $0 i64) (result i64) - get_local $0 + local.get $0 ) (func $function/ff (; 8 ;) (type $ff) (param $0 f32) (result f32) - get_local $0 + local.get $0 ) (func $function/FF (; 9 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 ) (func $function/iiv (; 10 ;) (type $iiv) (param $0 i32) (param $1 i32) nop ) (func $function/iii (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $function/III (; 12 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64) - get_local $0 - get_local $1 - i64.extend_s/i32 + local.get $0 + local.get $1 + i64.extend_i32_s i64.add ) (func $function/fff (; 13 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add ) (func $function/FFF (; 14 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add ) (func $start (; 15 ;) (type $v) diff --git a/tests/compiler/getter-call.optimized.wat b/tests/compiler/getter-call.optimized.wat index aad02b15..dab576dd 100644 --- a/tests/compiler/getter-call.optimized.wat +++ b/tests/compiler/getter-call.optimized.wat @@ -3,7 +3,7 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) @@ -16,17 +16,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -35,16 +35,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -52,16 +52,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -70,9 +70,9 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $getter-call/C#get:x~anonymous|1 (; 1 ;) (type $i) (result i32) i32.const 42 @@ -82,15 +82,15 @@ call $~lib/allocator/arena/__memory_allocate drop i32.const 0 - set_global $~argc + global.set $~argc i32.const 1 call_indirect (type $i) ) (func $start (; 3 ;) (type $v) i32.const 8 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset ) (func $null (; 4 ;) (type $v) nop diff --git a/tests/compiler/getter-call.untouched.wat b/tests/compiler/getter-call.untouched.wat index d10f9eb0..e02e593f 100644 --- a/tests/compiler/getter-call.untouched.wat +++ b/tests/compiler/getter-call.untouched.wat @@ -3,7 +3,7 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -24,41 +24,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -68,22 +68,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -92,24 +92,24 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $getter-call/C#constructor (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $getter-call/C#get:x~anonymous|1 (; 3 ;) (type $i) (result i32) i32.const 42 @@ -121,24 +121,24 @@ (local $0 i32) i32.const 0 call $getter-call/C#constructor - set_local $0 + local.set $0 i32.const 0 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 call $getter-call/C#get:x call_indirect (type $i) ) (func $start (; 6 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset ) (func $null (; 7 ;) (type $v) ) diff --git a/tests/compiler/getter-setter.optimized.wat b/tests/compiler/getter-setter.optimized.wat index 793ad4bc..c90128a5 100644 --- a/tests/compiler/getter-setter.optimized.wat +++ b/tests/compiler/getter-setter.optimized.wat @@ -4,14 +4,14 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $v) - get_global $getter-setter/Foo._bar + global.get $getter-setter/Foo._bar if i32.const 0 i32.const 8 @@ -21,8 +21,8 @@ unreachable end i32.const 1 - set_global $getter-setter/Foo._bar - get_global $getter-setter/Foo._bar + global.set $getter-setter/Foo._bar + global.get $getter-setter/Foo._bar i32.const 1 i32.ne if @@ -34,8 +34,8 @@ unreachable end i32.const 2 - set_global $getter-setter/Foo._bar - get_global $getter-setter/Foo._bar + global.set $getter-setter/Foo._bar + global.get $getter-setter/Foo._bar i32.const 2 i32.ne if diff --git a/tests/compiler/getter-setter.untouched.wat b/tests/compiler/getter-setter.untouched.wat index 40e33e17..b61a4ed1 100644 --- a/tests/compiler/getter-setter.untouched.wat +++ b/tests/compiler/getter-setter.untouched.wat @@ -6,7 +6,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 44)) @@ -14,11 +14,11 @@ (export "table" (table $0)) (start $start) (func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32) - get_global $getter-setter/Foo._bar + global.get $getter-setter/Foo._bar ) (func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32) - get_local $0 - set_global $getter-setter/Foo._bar + local.get $0 + global.set $getter-setter/Foo._bar ) (func $start (; 3 ;) (type $v) call $getter-setter/Foo.get:bar diff --git a/tests/compiler/i64-polyfill.optimized.wat b/tests/compiler/i64-polyfill.optimized.wat index 5f7147a8..17613452 100644 --- a/tests/compiler/i64-polyfill.optimized.wat +++ b/tests/compiler/i64-polyfill.optimized.wat @@ -4,7 +4,7 @@ (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -42,655 +42,655 @@ (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 $i) (result i32) - get_global $../../examples/i64-polyfill/assembly/i64/hi + global.get $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/getLo (; 1 ;) (type $i) (result i32) - get_global $../../examples/i64-polyfill/assembly/i64/lo + global.get $../../examples/i64-polyfill/assembly/i64/lo ) (func $../../examples/i64-polyfill/assembly/i64/clz (; 2 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.clz - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ctz (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ctz - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/popcnt (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.popcnt - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/eqz (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.eqz - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/add (; 6 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.add - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/sub (; 7 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.sub - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/mul (; 8 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.mul - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/div_s (; 9 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.div_s - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/div_u (; 10 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.div_u - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rem_s (; 11 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rem_s - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rem_u (; 12 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rem_u - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/and (; 13 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.and - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/or (; 14 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.or - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/xor (; 15 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.xor - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/shl (; 16 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.shl - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/shr_s (; 17 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.shr_s - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/shr_u (; 18 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.shr_u - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rotl (; 19 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rotl - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rotr (; 20 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rotr - tee_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.tee $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/eq (; 21 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.eq - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ne (; 22 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ne - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/lt_s (; 23 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.lt_s - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/lt_u (; 24 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.lt_u - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/le_s (; 25 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.le_s - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/le_u (; 26 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.le_u - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/gt_s (; 27 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.gt_s - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/gt_u (; 28 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.gt_u - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ge_s (; 29 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ge_s - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ge_u (; 30 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ge_u - set_global $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $null (; 31 ;) (type $v) nop diff --git a/tests/compiler/i64-polyfill.untouched.wat b/tests/compiler/i64-polyfill.untouched.wat index ed4e956b..6696d628 100644 --- a/tests/compiler/i64-polyfill.untouched.wat +++ b/tests/compiler/i64-polyfill.untouched.wat @@ -4,7 +4,7 @@ (type $iiiiv (func (param i32 i32 i32 i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -45,712 +45,712 @@ (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 $i) (result i32) - get_global $../../examples/i64-polyfill/assembly/i64/hi + global.get $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/getLo (; 1 ;) (type $i) (result i32) - get_global $../../examples/i64-polyfill/assembly/i64/lo + global.get $../../examples/i64-polyfill/assembly/i64/lo ) (func $../../examples/i64-polyfill/assembly/i64/clz (; 2 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.clz - set_local $2 - get_local $2 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $2 + local.get $2 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ctz (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ctz - set_local $2 - get_local $2 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $2 + local.get $2 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/popcnt (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.popcnt - set_local $2 - get_local $2 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $2 + local.get $2 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/eqz (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.eqz - set_local $2 - get_local $2 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $2 + local.get $2 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/add (; 6 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.add - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/sub (; 7 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.sub - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/mul (; 8 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.mul - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/div_s (; 9 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.div_s - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/div_u (; 10 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.div_u - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rem_s (; 11 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rem_s - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rem_u (; 12 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rem_u - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/and (; 13 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.and - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/or (; 14 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.or - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/xor (; 15 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.xor - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/shl (; 16 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.shl - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/shr_s (; 17 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.shr_s - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/shr_u (; 18 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.shr_u - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rotl (; 19 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rotl - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/rotr (; 20 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.rotr - set_local $4 - get_local $4 - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/lo - get_local $4 + local.set $4 + local.get $4 + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/lo + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_global $../../examples/i64-polyfill/assembly/i64/hi + i32.wrap_i64 + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/eq (; 21 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.eq - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ne (; 22 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ne - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/lt_s (; 23 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.lt_s - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/lt_u (; 24 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.lt_u - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/le_s (; 25 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.le_s - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/le_u (; 26 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.le_u - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/gt_s (; 27 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.gt_s - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/gt_u (; 28 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.gt_u - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ge_s (; 29 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ge_s - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $../../examples/i64-polyfill/assembly/i64/ge_u (; 30 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - get_local $0 - i64.extend_u/i32 - get_local $1 - i64.extend_u/i32 + local.get $0 + i64.extend_i32_u + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or - get_local $2 - i64.extend_u/i32 - get_local $3 - i64.extend_u/i32 + local.get $2 + i64.extend_i32_u + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or i64.ge_u - set_local $4 - get_local $4 - set_global $../../examples/i64-polyfill/assembly/i64/lo + local.set $4 + local.get $4 + global.set $../../examples/i64-polyfill/assembly/i64/lo i32.const 0 - set_global $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../examples/i64-polyfill/assembly/i64/hi ) (func $null (; 31 ;) (type $v) ) diff --git a/tests/compiler/if.optimized.wat b/tests/compiler/if.optimized.wat index b2e726de..02b6a846 100644 --- a/tests/compiler/if.optimized.wat +++ b/tests/compiler/if.optimized.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) @@ -16,11 +16,11 @@ (func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 0 - get_local $0 + local.get $0 select ) (func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if i32.const 1 return @@ -28,7 +28,7 @@ i32.const 0 ) (func $if/ifAlwaysReturns (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if (result i32) i32.const 1 else diff --git a/tests/compiler/if.untouched.wat b/tests/compiler/if.untouched.wat index ec6deea9..b5f143a7 100644 --- a/tests/compiler/if.untouched.wat +++ b/tests/compiler/if.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s\00") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 24)) (export "memory" (memory $0)) @@ -16,7 +16,7 @@ (export "ifAlwaysReturns" (func $if/ifAlwaysReturns)) (start $start) (func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if i32.const 1 return @@ -28,7 +28,7 @@ unreachable ) (func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if i32.const 1 return @@ -36,7 +36,7 @@ i32.const 0 ) (func $if/ifThenElseBlock (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if i32.const 1 return @@ -48,7 +48,7 @@ unreachable ) (func $if/ifAlwaysReturns (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 if i32.const 1 return diff --git a/tests/compiler/import.optimized.wat b/tests/compiler/import.optimized.wat index be03ea1a..0a57311c 100644 --- a/tests/compiler/import.optimized.wat +++ b/tests/compiler/import.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/import.untouched.wat b/tests/compiler/import.untouched.wat index e91d9c2b..7184e630 100644 --- a/tests/compiler/import.untouched.wat +++ b/tests/compiler/import.untouched.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -12,46 +12,46 @@ (export "table" (table $0)) (start $start) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul ) (func $export/ns.two (; 3 ;) (type $v) nop ) (func $start (; 4 ;) (type $v) - get_global $export/a - get_global $export/b + global.get $export/a + global.get $export/b call $export/add - get_global $export/b - get_global $export/c + global.get $export/b + global.get $export/c call $export/sub i32.add - get_global $export/c - get_global $export/a + global.get $export/c + global.get $export/a call $export/mul i32.add drop call $export/ns.two - get_global $export/a - get_global $export/b + global.get $export/a + global.get $export/b call $export/add - get_global $export/b - get_global $export/c + global.get $export/b + global.get $export/c call $export/sub i32.add - get_global $export/c - get_global $export/a + global.get $export/c + global.get $export/a call $export/mul i32.add drop diff --git a/tests/compiler/infer-type.optimized.wat b/tests/compiler/infer-type.optimized.wat index 5e8b5370..898f398b 100644 --- a/tests/compiler/infer-type.optimized.wat +++ b/tests/compiler/infer-type.optimized.wat @@ -2,7 +2,7 @@ (type $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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $infer-type/ri (mut i32) (i32.const 0)) (global $infer-type/rI (mut i64) (i64.const 0)) @@ -14,22 +14,22 @@ (func $start (; 0 ;) (type $v) (local $0 i32) i32.const 0 - set_global $infer-type/ri + global.set $infer-type/ri i64.const 0 - set_global $infer-type/rI + global.set $infer-type/rI f32.const 0 - set_global $infer-type/rf + global.set $infer-type/rf f64.const 0 - set_global $infer-type/rF + global.set $infer-type/rF loop $repeat|0 - get_local $0 + local.get $0 i32.const 10 i32.lt_s if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end diff --git a/tests/compiler/infer-type.untouched.wat b/tests/compiler/infer-type.untouched.wat index 207eddab..e098e395 100644 --- a/tests/compiler/infer-type.untouched.wat +++ b/tests/compiler/infer-type.untouched.wat @@ -8,7 +8,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $infer-type/i i32 (i32.const 10)) (global $infer-type/I i64 (i64.const 4294967296)) @@ -31,17 +31,17 @@ (local $4 i64) (local $5 f64) i32.const 10 - set_local $0 + local.set $0 i64.const 4294967296 - set_local $1 + local.set $1 f64.const 1.5 - set_local $2 - get_global $infer-type/i - set_local $3 - get_global $infer-type/I - set_local $4 - get_global $infer-type/F - set_local $5 + local.set $2 + global.get $infer-type/i + local.set $3 + global.get $infer-type/I + local.set $4 + global.get $infer-type/F + local.set $5 ) (func $infer-type/reti (; 2 ;) (type $i) (result i32) i32.const 0 @@ -58,47 +58,47 @@ (func $start (; 6 ;) (type $v) (local $0 i32) (local $1 i32) - get_global $infer-type/i + global.get $infer-type/i drop - get_global $infer-type/I + global.get $infer-type/I drop - get_global $infer-type/F + global.get $infer-type/F drop call $infer-type/locals call $infer-type/reti - set_global $infer-type/ri - get_global $infer-type/ri + global.set $infer-type/ri + global.get $infer-type/ri drop call $infer-type/retI - set_global $infer-type/rI - get_global $infer-type/rI + global.set $infer-type/rI + global.get $infer-type/rI drop call $infer-type/retf - set_global $infer-type/rf - get_global $infer-type/rf + global.set $infer-type/rf + global.get $infer-type/rf drop call $infer-type/refF - set_global $infer-type/rF - get_global $infer-type/rF + global.set $infer-type/rF + global.get $infer-type/rF drop block $break|0 block i32.const 0 - set_local $0 + local.set $0 i32.const 10 - set_local $1 + local.set $1 end loop $repeat|0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_s i32.eqz br_if $break|0 nop - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 unreachable end diff --git a/tests/compiler/inlining-recursive.optimized.wat b/tests/compiler/inlining-recursive.optimized.wat index 8fbb6c1f..d8e3fdd6 100644 --- a/tests/compiler/inlining-recursive.optimized.wat +++ b/tests/compiler/inlining-recursive.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/inlining-recursive.untouched.wat b/tests/compiler/inlining-recursive.untouched.wat index 04081e73..6b21e117 100644 --- a/tests/compiler/inlining-recursive.untouched.wat +++ b/tests/compiler/inlining-recursive.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) diff --git a/tests/compiler/inlining.optimized.wat b/tests/compiler/inlining.optimized.wat index d4534c17..5388cb62 100644 --- a/tests/compiler/inlining.optimized.wat +++ b/tests/compiler/inlining.optimized.wat @@ -6,7 +6,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $inlining/test_funcs~anonymous|1) (global $~argc (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -17,11 +17,11 @@ i32.const 3 ) (func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $inlining/test_funcs (; 3 ;) (type $v) i32.const 1 - set_global $~argc + global.set $~argc i32.const 2 i32.const 1 call_indirect (type $ii) diff --git a/tests/compiler/inlining.untouched.wat b/tests/compiler/inlining.untouched.wat index 8ae32ff4..c7285437 100644 --- a/tests/compiler/inlining.untouched.wat +++ b/tests/compiler/inlining.untouched.wat @@ -6,7 +6,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 2 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $inlining/test_funcs~anonymous|1) (global $inlining/constantGlobal i32 (i32.const 1)) (global $~argc (mut i32) (i32.const 0)) @@ -16,12 +16,12 @@ (export "test" (func $inlining/test)) (start $start) (func $inlining/test (; 1 ;) (type $i) (result i32) - get_global $inlining/constantGlobal + global.get $inlining/constantGlobal i32.const 2 i32.add ) (func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $inlining/test_funcs (; 3 ;) (type $v) (local $0 f32) @@ -33,20 +33,20 @@ (local $6 i32) (local $7 i32) f32.const -1 - set_local $0 + local.set $0 f64.const -2 - set_local $1 + local.set $1 block $inlining/func_ii|inlined.0 (result i32) i32.const 42 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 42 i32.eq if i32.const 1 br $inlining/func_ii|inlined.0 end - get_local $2 + local.get $2 i32.const 42 i32.lt_s if (result i32) @@ -68,15 +68,15 @@ end block $inlining/func_ii|inlined.1 (result i32) i32.const 41 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 42 i32.eq if i32.const 1 br $inlining/func_ii|inlined.1 end - get_local $2 + local.get $2 i32.const 42 i32.lt_s if (result i32) @@ -98,15 +98,15 @@ end block $inlining/func_ii|inlined.2 (result i32) i32.const 43 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 42 i32.eq if i32.const 1 br $inlining/func_ii|inlined.2 end - get_local $2 + local.get $2 i32.const 42 i32.lt_s if (result i32) @@ -128,8 +128,8 @@ end block $inlining/func_ii_opt|inlined.0 (result i32) i32.const 0 - set_local $2 - get_local $2 + local.set $2 + local.get $2 end i32.const 0 i32.eq @@ -144,8 +144,8 @@ end block $inlining/func_ii_opt|inlined.1 (result i32) i32.const 1 - set_local $2 - get_local $2 + local.set $2 + local.get $2 end i32.const 1 i32.eq @@ -160,20 +160,20 @@ end block $inlining/func_ii_loc|inlined.0 (result i32) i32.const 2 - set_local $2 - get_local $2 - set_local $3 + local.set $2 + local.get $2 + local.set $3 block - get_local $3 - set_local $5 - get_local $5 - set_local $6 - get_local $6 + local.get $3 + local.set $5 + local.get $5 + local.set $6 + local.get $6 i32.const 1 i32.add - set_local $4 + local.set $4 end - get_local $4 + local.get $4 end i32.const 3 i32.eq @@ -188,20 +188,20 @@ end block $inlining/func_ii_loc|inlined.1 (result i32) i32.const 3 - set_local $4 - get_local $4 - set_local $3 + local.set $4 + local.get $4 + local.set $3 block - get_local $3 - set_local $6 - get_local $6 - set_local $5 - get_local $5 + local.get $3 + local.set $6 + local.get $6 + local.set $5 + local.get $5 i32.const 1 i32.add - set_local $2 + local.set $2 end - get_local $2 + local.get $2 end i32.const 4 i32.eq @@ -215,10 +215,10 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 2 block $inlining/func_fe|inlined.0 (result i32) i32.const 1 @@ -238,11 +238,11 @@ end block $inlining/Foo.method_static|inlined.0 (result i32) i32.const 42 - set_local $2 + local.set $2 i32.const 2 - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.add end i32.const 44 @@ -257,13 +257,13 @@ unreachable end i32.const 123 - set_local $7 + local.set $7 block $inlining/Foo#method_this|inlined.0 (result i32) i32.const 43 - set_local $3 + local.set $3 i32.const 3 - set_local $2 - get_local $7 + local.set $2 + local.get $7 end i32.const 123 i32.eq diff --git a/tests/compiler/instanceof.optimized.wat b/tests/compiler/instanceof.optimized.wat index 841deca3..029d10cc 100644 --- a/tests/compiler/instanceof.optimized.wat +++ b/tests/compiler/instanceof.optimized.wat @@ -4,14 +4,14 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $instanceof/an (mut i32) (i32.const 0)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $v) - get_global $instanceof/an + global.get $instanceof/an if i32.const 0 i32.const 8 @@ -21,8 +21,8 @@ unreachable end i32.const 1 - set_global $instanceof/an - get_global $instanceof/an + global.set $instanceof/an + global.get $instanceof/an i32.eqz if i32.const 0 diff --git a/tests/compiler/instanceof.untouched.wat b/tests/compiler/instanceof.untouched.wat index c8a88b5b..040b30e3 100644 --- a/tests/compiler/instanceof.untouched.wat +++ b/tests/compiler/instanceof.untouched.wat @@ -6,7 +6,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $instanceof/a (mut i32) (i32.const 0)) (global $instanceof/b (mut i32) (i32.const 0)) @@ -236,7 +236,7 @@ call $~lib/env/abort unreachable end - get_global $instanceof/an + global.get $instanceof/an i32.const 0 i32.ne i32.eqz @@ -260,8 +260,8 @@ unreachable end i32.const 1 - set_global $instanceof/an - get_global $instanceof/an + global.set $instanceof/an + global.get $instanceof/an i32.const 0 i32.ne i32.eqz diff --git a/tests/compiler/limits.optimized.wat b/tests/compiler/limits.optimized.wat index be03ea1a..0a57311c 100644 --- a/tests/compiler/limits.optimized.wat +++ b/tests/compiler/limits.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/limits.untouched.wat b/tests/compiler/limits.untouched.wat index 861970dc..ac6520b4 100644 --- a/tests/compiler/limits.untouched.wat +++ b/tests/compiler/limits.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128)) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) @@ -34,57 +34,57 @@ (export "table" (table $0)) (start $start) (func $start (; 0 ;) (type $v) - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE drop - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE drop - get_global $~lib/builtins/i16.MIN_VALUE + global.get $~lib/builtins/i16.MIN_VALUE drop - get_global $~lib/builtins/i16.MAX_VALUE + global.get $~lib/builtins/i16.MAX_VALUE drop - get_global $~lib/builtins/i32.MIN_VALUE + global.get $~lib/builtins/i32.MIN_VALUE drop - get_global $~lib/builtins/i32.MAX_VALUE + global.get $~lib/builtins/i32.MAX_VALUE drop - get_global $~lib/builtins/i64.MIN_VALUE + global.get $~lib/builtins/i64.MIN_VALUE drop - get_global $~lib/builtins/i64.MAX_VALUE + global.get $~lib/builtins/i64.MAX_VALUE drop - get_global $~lib/builtins/isize.MIN_VALUE + global.get $~lib/builtins/isize.MIN_VALUE drop - get_global $~lib/builtins/isize.MAX_VALUE + global.get $~lib/builtins/isize.MAX_VALUE drop - get_global $~lib/builtins/u8.MIN_VALUE + global.get $~lib/builtins/u8.MIN_VALUE drop - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE drop - get_global $~lib/builtins/u16.MIN_VALUE + global.get $~lib/builtins/u16.MIN_VALUE drop - get_global $~lib/builtins/u16.MAX_VALUE + global.get $~lib/builtins/u16.MAX_VALUE drop - get_global $~lib/builtins/u32.MIN_VALUE + global.get $~lib/builtins/u32.MIN_VALUE drop - get_global $~lib/builtins/u32.MAX_VALUE + global.get $~lib/builtins/u32.MAX_VALUE drop - get_global $~lib/builtins/u64.MIN_VALUE + global.get $~lib/builtins/u64.MIN_VALUE drop - get_global $~lib/builtins/u64.MAX_VALUE + global.get $~lib/builtins/u64.MAX_VALUE drop - get_global $~lib/builtins/usize.MIN_VALUE + global.get $~lib/builtins/usize.MIN_VALUE drop - get_global $~lib/builtins/usize.MAX_VALUE + global.get $~lib/builtins/usize.MAX_VALUE drop - get_global $~lib/builtins/bool.MIN_VALUE + global.get $~lib/builtins/bool.MIN_VALUE drop - get_global $~lib/builtins/bool.MAX_VALUE + global.get $~lib/builtins/bool.MAX_VALUE drop - get_global $~lib/builtins/f32.MIN_SAFE_INTEGER + global.get $~lib/builtins/f32.MIN_SAFE_INTEGER drop - get_global $~lib/builtins/f32.MAX_SAFE_INTEGER + global.get $~lib/builtins/f32.MAX_SAFE_INTEGER drop - get_global $~lib/builtins/f64.MIN_SAFE_INTEGER + global.get $~lib/builtins/f64.MIN_SAFE_INTEGER drop - get_global $~lib/builtins/f64.MAX_SAFE_INTEGER + global.get $~lib/builtins/f64.MAX_SAFE_INTEGER drop ) (func $null (; 1 ;) (type $v) diff --git a/tests/compiler/literals.optimized.wat b/tests/compiler/literals.optimized.wat index be03ea1a..0a57311c 100644 --- a/tests/compiler/literals.optimized.wat +++ b/tests/compiler/literals.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/literals.untouched.wat b/tests/compiler/literals.untouched.wat index a4c7e43f..1402a081 100644 --- a/tests/compiler/literals.untouched.wat +++ b/tests/compiler/literals.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index 471d6bcf..c8415d3d 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -15,8 +15,8 @@ (start $start) (func $start (; 1 ;) (type $v) i32.const 2 - set_global $logical/i - get_global $logical/i + global.set $logical/i + global.get $logical/i i32.const 2 i32.ne if @@ -28,8 +28,8 @@ unreachable end i32.const 1 - set_global $logical/i - get_global $logical/i + global.set $logical/i + global.get $logical/i i32.const 1 i32.ne if @@ -41,8 +41,8 @@ unreachable end i64.const 2 - set_global $logical/I - get_global $logical/I + global.set $logical/I + global.get $logical/I i64.const 2 i64.ne if @@ -54,8 +54,8 @@ unreachable end i64.const 1 - set_global $logical/I - get_global $logical/I + global.set $logical/I + global.get $logical/I i64.const 1 i64.ne if @@ -67,8 +67,8 @@ unreachable end f32.const 2 - set_global $logical/f - get_global $logical/f + global.set $logical/f + global.get $logical/f f32.const 2 f32.ne if @@ -80,8 +80,8 @@ unreachable end f32.const 1 - set_global $logical/f - get_global $logical/f + global.set $logical/f + global.get $logical/f f32.const 1 f32.ne if @@ -93,8 +93,8 @@ unreachable end f64.const 2 - set_global $logical/F - get_global $logical/F + global.set $logical/F + global.get $logical/F f64.const 2 f64.ne if @@ -106,8 +106,8 @@ unreachable end f64.const 1 - set_global $logical/F - get_global $logical/F + global.set $logical/F + global.get $logical/F f64.const 1 f64.ne if diff --git a/tests/compiler/logical.untouched.wat b/tests/compiler/logical.untouched.wat index d6c4ab61..68c7444c 100644 --- a/tests/compiler/logical.untouched.wat +++ b/tests/compiler/logical.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (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)) @@ -55,9 +55,9 @@ else i32.const 1 end - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 else unreachable end @@ -70,11 +70,11 @@ else f64.const 1 end - tee_local $1 + local.tee $1 f64.const 0 f64.ne if (result f64) - get_local $1 + local.get $1 else unreachable end @@ -85,8 +85,8 @@ else i32.const 1 end - set_global $logical/i - get_global $logical/i + global.set $logical/i + global.get $logical/i i32.const 2 i32.eq i32.eqz @@ -104,8 +104,8 @@ else i32.const 1 end - set_global $logical/i - get_global $logical/i + global.set $logical/i + global.get $logical/i i32.const 1 i32.eq i32.eqz @@ -125,8 +125,8 @@ else i64.const 1 end - set_global $logical/I - get_global $logical/I + global.set $logical/I + global.get $logical/I i64.const 2 i64.eq i32.eqz @@ -146,8 +146,8 @@ else i64.const 1 end - set_global $logical/I - get_global $logical/I + global.set $logical/I + global.get $logical/I i64.const 1 i64.eq i32.eqz @@ -167,8 +167,8 @@ else f32.const 1 end - set_global $logical/f - get_global $logical/f + global.set $logical/f + global.get $logical/f f32.const 2 f32.eq i32.eqz @@ -188,8 +188,8 @@ else f32.const 1 end - set_global $logical/f - get_global $logical/f + global.set $logical/f + global.get $logical/f f32.const 1 f32.eq i32.eqz @@ -209,8 +209,8 @@ else f64.const 1 end - set_global $logical/F - get_global $logical/F + global.set $logical/F + global.get $logical/F f64.const 2 f64.eq i32.eqz @@ -230,8 +230,8 @@ else f64.const 1 end - set_global $logical/F - get_global $logical/F + global.set $logical/F + global.get $logical/F f64.const 1 f64.eq i32.eqz diff --git a/tests/compiler/main.optimized.wat b/tests/compiler/main.optimized.wat index 259adbe0..b0597fca 100644 --- a/tests/compiler/main.optimized.wat +++ b/tests/compiler/main.optimized.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $main/code (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) @@ -10,15 +10,15 @@ (export "table" (table $0)) (export "main" (func $main/main)) (func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_global $~started + global.get $~started i32.eqz if i32.const 1 - set_global $main/code + global.set $main/code i32.const 1 - set_global $~started + global.set $~started end - get_global $main/code + global.get $main/code ) (func $null (; 1 ;) (type $v) nop diff --git a/tests/compiler/main.untouched.wat b/tests/compiler/main.untouched.wat index d97b144a..351e861b 100644 --- a/tests/compiler/main.untouched.wat +++ b/tests/compiler/main.untouched.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $main/code (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) @@ -11,18 +11,18 @@ (export "table" (table $0)) (export "main" (func $main/main)) (func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end - get_global $main/code + global.get $main/code ) (func $start (; 1 ;) (type $v) i32.const 1 - set_global $main/code + global.set $main/code ) (func $null (; 2 ;) (type $v) ) diff --git a/tests/compiler/mandelbrot.optimized.wat b/tests/compiler/mandelbrot.optimized.wat index 4ab4a130..99e951eb 100644 --- a/tests/compiler/mandelbrot.optimized.wat +++ b/tests/compiler/mandelbrot.optimized.wat @@ -3,7 +3,7 @@ (type $FF (func (param f64) (result f64))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) @@ -16,139 +16,139 @@ (local $5 f64) (local $6 f64) (local $7 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $4 + local.get $0 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 1048576 i32.lt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.const 31 i32.shr_u - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $4 + local.get $4 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $4 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 + i32.wrap_i64 + local.set $1 else - get_local $1 + local.get $1 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1072693248 i32.eq - tee_local $2 + local.tee $2 if - get_local $4 + local.get $4 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if f64.const 0 return end end end - get_local $1 + local.get $1 i32.const 614242 i32.add - tee_local $1 + local.tee $1 i32.const 20 i32.shr_s i32.const 1023 i32.sub - get_local $3 + local.get $3 i32.add - set_local $3 - get_local $4 + local.set $3 + local.get $4 i64.const 4294967295 i64.and - get_local $1 + local.get $1 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $5 + local.tee $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f64.mul - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - set_local $0 - get_local $6 + local.set $0 + local.get $6 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - tee_local $6 - get_local $7 + local.tee $6 + local.get $7 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -157,11 +157,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -171,17 +171,17 @@ f64.add f64.add f64.mul - get_local $3 - f64.convert_s/i32 - tee_local $0 + local.get $3 + f64.convert_i32_s + local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add - get_local $6 + local.get $6 f64.sub - get_local $5 + local.get $5 f64.add - get_local $0 + local.get $0 f64.const 0.6931471803691238 f64.mul f64.add @@ -195,151 +195,151 @@ (local $6 f64) (local $7 f64) (local $8 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $5 + local.get $0 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $2 + i32.wrap_i64 + local.tee $2 i32.const 1048576 i32.lt_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $2 + local.get $2 i32.const 31 i32.shr_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $5 + local.get $5 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $5 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if f64.const 0 return end end end - get_local $2 + local.get $2 i32.const 614242 i32.add - tee_local $2 + local.tee $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - get_local $4 + local.get $4 i32.add - set_local $4 - get_local $5 + local.set $4 + local.get $5 i64.const 4294967295 i64.and - get_local $2 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $1 + local.tee $1 f64.const 2 - get_local $1 + local.get $1 f64.add f64.div - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f64.mul - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - set_local $0 - get_local $1 - get_local $1 + local.set $0 + local.get $1 + local.get $1 f64.const 0.5 - get_local $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $1 + local.tee $1 f64.sub - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 + f64.reinterpret_i64 + local.tee $8 f64.sub - get_local $1 + local.get $1 f64.sub - get_local $6 - get_local $1 - get_local $7 + local.get $6 + local.get $1 + local.get $7 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -348,11 +348,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -363,33 +363,33 @@ f64.add f64.mul f64.add - tee_local $0 - get_local $8 + local.tee $0 + local.get $8 f64.add f64.const 1.6751713164886512e-10 f64.mul - get_local $0 + local.get $0 f64.const 1.4426950407214463 f64.mul f64.add - set_local $6 - get_local $4 - f64.convert_s/i32 - tee_local $7 - get_local $8 + local.set $6 + local.get $4 + f64.convert_i32_s + local.tee $7 + local.get $8 f64.const 1.4426950407214463 f64.mul - tee_local $1 + local.tee $1 f64.add - set_local $0 - get_local $6 - get_local $7 - get_local $0 + local.set $0 + local.get $6 + local.get $7 + local.get $0 f64.sub - get_local $1 + local.get $1 f64.add f64.add - get_local $0 + local.get $0 f64.add ) (func $../../examples/mandelbrot/assembly/index/computeLine (; 2 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) @@ -406,183 +406,183 @@ (local $14 f64) f64.const 10 f64.const 3 - get_local $1 - f64.convert_u/i32 - tee_local $8 + local.get $1 + f64.convert_i32_u + local.tee $8 f64.mul f64.const 4 - get_local $2 - f64.convert_u/i32 - tee_local $4 + local.get $2 + f64.convert_i32_u + local.tee $4 f64.mul f64.min f64.div - set_local $9 - get_local $0 - f64.convert_u/i32 - get_local $4 + local.set $9 + local.get $0 + f64.convert_i32_u + local.get $4 f64.const 0.5 f64.mul f64.sub - get_local $9 + local.get $9 f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.625 f64.mul - get_local $9 + local.get $9 f64.mul - set_local $12 - get_local $0 - get_local $1 + local.set $12 + local.get $0 + local.get $1 i32.mul i32.const 1 i32.shl - set_local $0 + local.set $0 f64.const 1 - get_local $3 - f64.convert_u/i32 - tee_local $6 + local.get $3 + f64.convert_i32_u + local.tee $6 f64.div - set_local $13 + local.set $13 f64.const 8 - get_local $6 + local.get $6 f64.min - set_local $8 + local.set $8 loop $repeat|0 - get_local $7 - get_local $1 + local.get $7 + local.get $1 i32.lt_u if - get_local $7 - f64.convert_u/i32 - get_local $9 + local.get $7 + f64.convert_i32_u + local.get $9 f64.mul - get_local $12 + local.get $12 f64.sub - set_local $11 + local.set $11 f64.const 0 - set_local $4 + local.set $4 f64.const 0 - set_local $5 + local.set $5 i32.const 0 - set_local $2 + local.set $2 loop $continue|1 - get_local $4 - get_local $4 + local.get $4 + local.get $4 f64.mul - tee_local $14 - get_local $5 - get_local $5 + local.tee $14 + local.get $5 + local.get $5 f64.mul - tee_local $6 + local.tee $6 f64.add f64.const 4 f64.le if block $break|1 f64.const 2 - get_local $4 + local.get $4 f64.mul - get_local $5 + local.get $5 f64.mul - get_local $10 + local.get $10 f64.add - set_local $5 - get_local $14 - get_local $6 + local.set $5 + local.get $14 + local.get $6 f64.sub - get_local $11 + local.get $11 f64.add - set_local $4 - get_local $2 - get_local $3 + local.set $4 + local.get $2 + local.get $3 i32.ge_u br_if $break|1 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $continue|1 end end end loop $continue|2 - get_local $2 - f64.convert_u/i32 - get_local $8 + local.get $2 + f64.convert_i32_u + local.get $8 f64.lt if - get_local $4 - get_local $4 + local.get $4 + local.get $4 f64.mul - get_local $5 - get_local $5 + local.get $5 + local.get $5 f64.mul f64.sub - get_local $11 + local.get $11 f64.add - set_local $6 + local.set $6 f64.const 2 - get_local $4 + local.get $4 f64.mul - get_local $5 + local.get $5 f64.mul - get_local $10 + local.get $10 f64.add - set_local $5 - get_local $6 - set_local $4 - get_local $2 + local.set $5 + local.get $6 + local.set $4 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $continue|2 end end - get_local $7 + local.get $7 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $4 - get_local $4 + local.get $4 + local.get $4 f64.mul - get_local $5 - get_local $5 + local.get $5 + local.get $5 f64.mul f64.add - tee_local $6 + local.tee $6 f64.const 1 f64.gt if (result i32) f64.const 2047 - get_local $2 + local.get $2 i32.const 1 i32.add - f64.convert_u/i32 + f64.convert_i32_u f64.const 0.5 - get_local $6 + local.get $6 call $~lib/math/NativeMath.log f64.mul call $~lib/math/NativeMath.log2 f64.sub - get_local $13 + local.get $13 f64.mul f64.const 0 f64.max f64.const 1 f64.min f64.mul - i32.trunc_u/f64 + i32.trunc_f64_u else i32.const 2047 end i32.store16 - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 end end diff --git a/tests/compiler/mandelbrot.untouched.wat b/tests/compiler/mandelbrot.untouched.wat index ee048390..f180010b 100644 --- a/tests/compiler/mandelbrot.untouched.wat +++ b/tests/compiler/mandelbrot.untouched.wat @@ -4,7 +4,7 @@ (type $FFFF (func (param f64 f64 f64) (result f64))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $../../examples/mandelbrot/assembly/index/NUM_COLORS i32 (i32.const 2048)) (global $HEAP_BASE i32 (i32.const 8)) @@ -25,88 +25,88 @@ (local $11 f64) (local $12 f64) (local $13 i32) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -114,81 +114,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -197,29 +197,29 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $3 - set_local $13 - get_local $7 - get_local $6 - get_local $12 + local.set $12 + local.get $3 + local.set $13 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul - get_local $13 - f64.convert_s/i32 + local.get $13 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul f64.add - get_local $6 + local.get $6 f64.sub - get_local $5 + local.get $5 f64.add - get_local $13 - f64.convert_s/i32 + local.get $13 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add @@ -242,88 +242,88 @@ (local $15 f64) (local $16 f64) (local $17 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -331,81 +331,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -414,77 +414,77 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $5 - get_local $6 + local.set $12 + local.get $5 + local.get $6 f64.sub - set_local $13 - get_local $13 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $13 + local.get $13 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const -4294967296 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $13 - get_local $5 - get_local $13 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $13 + local.get $5 + local.get $13 f64.sub - get_local $6 + local.get $6 f64.sub - get_local $7 - get_local $6 - get_local $12 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul f64.add - set_local $14 - get_local $13 + local.set $14 + local.get $13 f64.const 1.4426950407214463 f64.mul - set_local $15 - get_local $14 - get_local $13 + local.set $15 + local.get $14 + local.get $13 f64.add f64.const 1.6751713164886512e-10 f64.mul - get_local $14 + local.get $14 f64.const 1.4426950407214463 f64.mul f64.add - set_local $16 - get_local $3 - f64.convert_s/i32 - set_local $17 - get_local $17 - get_local $15 + local.set $16 + local.get $3 + f64.convert_i32_s + local.set $17 + local.get $17 + local.get $15 f64.add - set_local $9 - get_local $16 - get_local $17 - get_local $9 + local.set $9 + local.get $16 + local.get $17 + local.get $9 f64.sub - get_local $15 + local.get $15 f64.add f64.add - set_local $16 - get_local $9 - set_local $15 - get_local $16 - get_local $15 + local.set $16 + local.get $9 + local.set $15 + local.get $16 + local.get $15 f64.add ) (func $../../examples/mandelbrot/assembly/index/clamp (; 2 ;) (type $FFFF) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.max - get_local $2 + local.get $2 f64.min ) (func $../../examples/mandelbrot/assembly/index/computeLine (; 3 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) @@ -506,121 +506,121 @@ (local $19 f64) (local $20 i32) (local $21 f64) - get_local $1 - f64.convert_u/i32 + local.get $1 + f64.convert_i32_u f64.const 1 f64.const 1.6 f64.div f64.mul - set_local $4 - get_local $2 - f64.convert_u/i32 + local.set $4 + local.get $2 + f64.convert_i32_u f64.const 1 f64.const 2 f64.div f64.mul - set_local $5 + local.set $5 f64.const 10 f64.const 3 - get_local $1 - f64.convert_u/i32 + local.get $1 + f64.convert_i32_u f64.mul f64.const 4 - get_local $2 - f64.convert_u/i32 + local.get $2 + f64.convert_i32_u f64.mul f64.min f64.div - set_local $6 - get_local $0 - f64.convert_u/i32 - get_local $5 + local.set $6 + local.get $0 + f64.convert_i32_u + local.get $5 f64.sub - get_local $6 + local.get $6 f64.mul - set_local $7 - get_local $4 - get_local $6 + local.set $7 + local.get $4 + local.get $6 f64.mul - set_local $8 - get_local $0 - get_local $1 + local.set $8 + local.get $0 + local.get $1 i32.mul i32.const 1 i32.shl - set_local $9 + local.set $9 f64.const 1 - get_local $3 - f64.convert_u/i32 + local.get $3 + f64.convert_i32_u f64.div - set_local $10 + local.set $10 f64.const 8 - get_local $3 - f64.convert_u/i32 + local.get $3 + f64.convert_i32_u f64.min - set_local $11 + local.set $11 block $break|0 i32.const 0 - set_local $12 + local.set $12 loop $repeat|0 - get_local $12 - get_local $1 + local.get $12 + local.get $1 i32.lt_u i32.eqz br_if $break|0 block - get_local $12 - f64.convert_u/i32 - get_local $6 + local.get $12 + f64.convert_i32_u + local.get $6 f64.mul - get_local $8 + local.get $8 f64.sub - set_local $13 + local.set $13 f64.const 0 - set_local $14 + local.set $14 f64.const 0 - set_local $15 + local.set $15 i32.const 0 - set_local $18 + local.set $18 block $break|1 loop $continue|1 - get_local $14 - get_local $14 + local.get $14 + local.get $14 f64.mul - tee_local $16 - get_local $15 - get_local $15 + local.tee $16 + local.get $15 + local.get $15 f64.mul - tee_local $17 + local.tee $17 f64.add f64.const 4 f64.le if block f64.const 2 - get_local $14 + local.get $14 f64.mul - get_local $15 + local.get $15 f64.mul - get_local $7 + local.get $7 f64.add - set_local $15 - get_local $16 - get_local $17 + local.set $15 + local.get $16 + local.get $17 f64.sub - get_local $13 + local.get $13 f64.add - set_local $14 - get_local $18 - get_local $3 + local.set $14 + local.get $18 + local.get $3 i32.ge_u if br $break|1 end - get_local $18 + local.get $18 i32.const 1 i32.add - set_local $18 + local.set $18 end br $continue|1 end @@ -628,94 +628,94 @@ end block $break|2 loop $continue|2 - get_local $18 - f64.convert_u/i32 - get_local $11 + local.get $18 + f64.convert_i32_u + local.get $11 f64.lt if block - get_local $14 - get_local $14 + local.get $14 + local.get $14 f64.mul - get_local $15 - get_local $15 + local.get $15 + local.get $15 f64.mul f64.sub - get_local $13 + local.get $13 f64.add - set_local $19 + local.set $19 f64.const 2 - get_local $14 + local.get $14 f64.mul - get_local $15 + local.get $15 f64.mul - get_local $7 + local.get $7 f64.add - set_local $15 - get_local $19 - set_local $14 - get_local $18 + local.set $15 + local.get $19 + local.set $14 + local.get $18 i32.const 1 i32.add - set_local $18 + local.set $18 end br $continue|2 end end end - get_global $../../examples/mandelbrot/assembly/index/NUM_COLORS + global.get $../../examples/mandelbrot/assembly/index/NUM_COLORS i32.const 1 i32.sub - set_local $20 - get_local $14 - get_local $14 + local.set $20 + local.get $14 + local.get $14 f64.mul - get_local $15 - get_local $15 + local.get $15 + local.get $15 f64.mul f64.add - set_local $19 - get_local $19 + local.set $19 + local.get $19 f64.const 1 f64.gt if f64.const 0.5 - get_local $19 + local.get $19 call $~lib/math/NativeMath.log f64.mul call $~lib/math/NativeMath.log2 - set_local $21 - get_global $../../examples/mandelbrot/assembly/index/NUM_COLORS + local.set $21 + global.get $../../examples/mandelbrot/assembly/index/NUM_COLORS i32.const 1 i32.sub - f64.convert_s/i32 - get_local $18 + f64.convert_i32_s + local.get $18 i32.const 1 i32.add - f64.convert_u/i32 - get_local $21 + f64.convert_i32_u + local.get $21 f64.sub - get_local $10 + local.get $10 f64.mul f64.const 0 f64.const 1 call $../../examples/mandelbrot/assembly/index/clamp f64.mul - i32.trunc_u/f64 - set_local $20 + i32.trunc_f64_u + local.set $20 end - get_local $9 - get_local $12 + local.get $9 + local.get $12 i32.const 1 i32.shl i32.add - get_local $20 + local.get $20 i32.store16 end - get_local $12 + local.get $12 i32.const 1 i32.add - set_local $12 + local.set $12 br $repeat|0 unreachable end diff --git a/tests/compiler/many-locals.optimized.wat b/tests/compiler/many-locals.optimized.wat index f35f79e3..0c9ab7e4 100644 --- a/tests/compiler/many-locals.optimized.wat +++ b/tests/compiler/many-locals.optimized.wat @@ -3,17 +3,17 @@ (type $v (func)) (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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (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 $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $many-locals/testI8 (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 diff --git a/tests/compiler/many-locals.untouched.wat b/tests/compiler/many-locals.untouched.wat index 2b419607..ebaec1db 100644 --- a/tests/compiler/many-locals.untouched.wat +++ b/tests/compiler/many-locals.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 40)) (export "memory" (memory $0)) @@ -142,263 +142,263 @@ (local $126 i32) (local $127 i32) (local $128 i32) - get_local $0 - set_local $1 - get_local $1 - set_local $2 - get_local $2 - set_local $3 - get_local $3 - set_local $4 - get_local $4 - set_local $5 - get_local $5 - set_local $6 - get_local $6 - set_local $7 - get_local $7 - set_local $8 - get_local $8 - set_local $9 - get_local $9 - set_local $10 - get_local $10 - set_local $11 - get_local $11 - set_local $12 - get_local $12 - set_local $13 - get_local $13 - set_local $14 - get_local $14 - set_local $15 - get_local $15 - set_local $16 - get_local $16 - set_local $17 - get_local $17 - set_local $18 - get_local $18 - set_local $19 - get_local $19 - set_local $20 - get_local $20 - set_local $21 - get_local $21 - set_local $22 - get_local $22 - set_local $23 - get_local $23 - set_local $24 - get_local $24 - set_local $25 - get_local $25 - set_local $26 - get_local $26 - set_local $27 - get_local $27 - set_local $28 - get_local $28 - set_local $29 - get_local $29 - set_local $30 - get_local $30 - set_local $31 - get_local $31 - set_local $32 - get_local $32 - set_local $33 - get_local $33 - set_local $34 - get_local $34 - set_local $35 - get_local $35 - set_local $36 - get_local $36 - set_local $37 - get_local $37 - set_local $38 - get_local $38 - set_local $39 - get_local $39 - set_local $40 - get_local $40 - set_local $41 - get_local $41 - set_local $42 - get_local $42 - set_local $43 - get_local $43 - set_local $44 - get_local $44 - set_local $45 - get_local $45 - set_local $46 - get_local $46 - set_local $47 - get_local $47 - set_local $48 - get_local $48 - set_local $49 - get_local $49 - set_local $50 - get_local $50 - set_local $51 - get_local $51 - set_local $52 - get_local $52 - set_local $53 - get_local $53 - set_local $54 - get_local $54 - set_local $55 - get_local $55 - set_local $56 - get_local $56 - set_local $57 - get_local $57 - set_local $58 - get_local $58 - set_local $59 - get_local $59 - set_local $60 - get_local $60 - set_local $61 - get_local $61 - set_local $62 - get_local $62 - set_local $63 - get_local $63 - set_local $64 - get_local $64 - set_local $65 - get_local $65 - set_local $66 - get_local $66 - set_local $67 - get_local $67 - set_local $68 - get_local $68 - set_local $69 - get_local $69 - set_local $70 - get_local $70 - set_local $71 - get_local $71 - set_local $72 - get_local $72 - set_local $73 - get_local $73 - set_local $74 - get_local $74 - set_local $75 - get_local $75 - set_local $76 - get_local $76 - set_local $77 - get_local $77 - set_local $78 - get_local $78 - set_local $79 - get_local $79 - set_local $80 - get_local $80 - set_local $81 - get_local $81 - set_local $82 - get_local $82 - set_local $83 - get_local $83 - set_local $84 - get_local $84 - set_local $85 - get_local $85 - set_local $86 - get_local $86 - set_local $87 - get_local $87 - set_local $88 - get_local $88 - set_local $89 - get_local $89 - set_local $90 - get_local $90 - set_local $91 - get_local $91 - set_local $92 - get_local $92 - set_local $93 - get_local $93 - set_local $94 - get_local $94 - set_local $95 - get_local $95 - set_local $96 - get_local $96 - set_local $97 - get_local $97 - set_local $98 - get_local $98 - set_local $99 - get_local $99 - set_local $100 - get_local $100 - set_local $101 - get_local $101 - set_local $102 - get_local $102 - set_local $103 - get_local $103 - set_local $104 - get_local $104 - set_local $105 - get_local $105 - set_local $106 - get_local $106 - set_local $107 - get_local $107 - set_local $108 - get_local $108 - set_local $109 - get_local $109 - set_local $110 - get_local $110 - set_local $111 - get_local $111 - set_local $112 - get_local $112 - set_local $113 - get_local $113 - set_local $114 - get_local $114 - set_local $115 - get_local $115 - set_local $116 - get_local $116 - set_local $117 - get_local $117 - set_local $118 - get_local $118 - set_local $119 - get_local $119 - set_local $120 - get_local $120 - set_local $121 - get_local $121 - set_local $122 - get_local $122 - set_local $123 - get_local $123 - set_local $124 - get_local $124 - set_local $125 - get_local $125 - set_local $126 - get_local $126 - set_local $127 - get_local $127 - set_local $128 - get_local $128 + local.get $0 + local.set $1 + local.get $1 + local.set $2 + local.get $2 + local.set $3 + local.get $3 + local.set $4 + local.get $4 + local.set $5 + local.get $5 + local.set $6 + local.get $6 + local.set $7 + local.get $7 + local.set $8 + local.get $8 + local.set $9 + local.get $9 + local.set $10 + local.get $10 + local.set $11 + local.get $11 + local.set $12 + local.get $12 + local.set $13 + local.get $13 + local.set $14 + local.get $14 + local.set $15 + local.get $15 + local.set $16 + local.get $16 + local.set $17 + local.get $17 + local.set $18 + local.get $18 + local.set $19 + local.get $19 + local.set $20 + local.get $20 + local.set $21 + local.get $21 + local.set $22 + local.get $22 + local.set $23 + local.get $23 + local.set $24 + local.get $24 + local.set $25 + local.get $25 + local.set $26 + local.get $26 + local.set $27 + local.get $27 + local.set $28 + local.get $28 + local.set $29 + local.get $29 + local.set $30 + local.get $30 + local.set $31 + local.get $31 + local.set $32 + local.get $32 + local.set $33 + local.get $33 + local.set $34 + local.get $34 + local.set $35 + local.get $35 + local.set $36 + local.get $36 + local.set $37 + local.get $37 + local.set $38 + local.get $38 + local.set $39 + local.get $39 + local.set $40 + local.get $40 + local.set $41 + local.get $41 + local.set $42 + local.get $42 + local.set $43 + local.get $43 + local.set $44 + local.get $44 + local.set $45 + local.get $45 + local.set $46 + local.get $46 + local.set $47 + local.get $47 + local.set $48 + local.get $48 + local.set $49 + local.get $49 + local.set $50 + local.get $50 + local.set $51 + local.get $51 + local.set $52 + local.get $52 + local.set $53 + local.get $53 + local.set $54 + local.get $54 + local.set $55 + local.get $55 + local.set $56 + local.get $56 + local.set $57 + local.get $57 + local.set $58 + local.get $58 + local.set $59 + local.get $59 + local.set $60 + local.get $60 + local.set $61 + local.get $61 + local.set $62 + local.get $62 + local.set $63 + local.get $63 + local.set $64 + local.get $64 + local.set $65 + local.get $65 + local.set $66 + local.get $66 + local.set $67 + local.get $67 + local.set $68 + local.get $68 + local.set $69 + local.get $69 + local.set $70 + local.get $70 + local.set $71 + local.get $71 + local.set $72 + local.get $72 + local.set $73 + local.get $73 + local.set $74 + local.get $74 + local.set $75 + local.get $75 + local.set $76 + local.get $76 + local.set $77 + local.get $77 + local.set $78 + local.get $78 + local.set $79 + local.get $79 + local.set $80 + local.get $80 + local.set $81 + local.get $81 + local.set $82 + local.get $82 + local.set $83 + local.get $83 + local.set $84 + local.get $84 + local.set $85 + local.get $85 + local.set $86 + local.get $86 + local.set $87 + local.get $87 + local.set $88 + local.get $88 + local.set $89 + local.get $89 + local.set $90 + local.get $90 + local.set $91 + local.get $91 + local.set $92 + local.get $92 + local.set $93 + local.get $93 + local.set $94 + local.get $94 + local.set $95 + local.get $95 + local.set $96 + local.get $96 + local.set $97 + local.get $97 + local.set $98 + local.get $98 + local.set $99 + local.get $99 + local.set $100 + local.get $100 + local.set $101 + local.get $101 + local.set $102 + local.get $102 + local.set $103 + local.get $103 + local.set $104 + local.get $104 + local.set $105 + local.get $105 + local.set $106 + local.get $106 + local.set $107 + local.get $107 + local.set $108 + local.get $108 + local.set $109 + local.get $109 + local.set $110 + local.get $110 + local.set $111 + local.get $111 + local.set $112 + local.get $112 + local.set $113 + local.get $113 + local.set $114 + local.get $114 + local.set $115 + local.get $115 + local.set $116 + local.get $116 + local.set $117 + local.get $117 + local.set $118 + local.get $118 + local.set $119 + local.get $119 + local.set $120 + local.get $120 + local.set $121 + local.get $121 + local.set $122 + local.get $122 + local.set $123 + local.get $123 + local.set $124 + local.get $124 + local.set $125 + local.get $125 + local.set $126 + local.get $126 + local.set $127 + local.get $127 + local.set $128 + local.get $128 ) (func $many-locals/testI8 (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -529,263 +529,263 @@ (local $126 i32) (local $127 i32) (local $128 i32) - get_local $0 - set_local $1 - get_local $1 - set_local $2 - get_local $2 - set_local $3 - get_local $3 - set_local $4 - get_local $4 - set_local $5 - get_local $5 - set_local $6 - get_local $6 - set_local $7 - get_local $7 - set_local $8 - get_local $8 - set_local $9 - get_local $9 - set_local $10 - get_local $10 - set_local $11 - get_local $11 - set_local $12 - get_local $12 - set_local $13 - get_local $13 - set_local $14 - get_local $14 - set_local $15 - get_local $15 - set_local $16 - get_local $16 - set_local $17 - get_local $17 - set_local $18 - get_local $18 - set_local $19 - get_local $19 - set_local $20 - get_local $20 - set_local $21 - get_local $21 - set_local $22 - get_local $22 - set_local $23 - get_local $23 - set_local $24 - get_local $24 - set_local $25 - get_local $25 - set_local $26 - get_local $26 - set_local $27 - get_local $27 - set_local $28 - get_local $28 - set_local $29 - get_local $29 - set_local $30 - get_local $30 - set_local $31 - get_local $31 - set_local $32 - get_local $32 - set_local $33 - get_local $33 - set_local $34 - get_local $34 - set_local $35 - get_local $35 - set_local $36 - get_local $36 - set_local $37 - get_local $37 - set_local $38 - get_local $38 - set_local $39 - get_local $39 - set_local $40 - get_local $40 - set_local $41 - get_local $41 - set_local $42 - get_local $42 - set_local $43 - get_local $43 - set_local $44 - get_local $44 - set_local $45 - get_local $45 - set_local $46 - get_local $46 - set_local $47 - get_local $47 - set_local $48 - get_local $48 - set_local $49 - get_local $49 - set_local $50 - get_local $50 - set_local $51 - get_local $51 - set_local $52 - get_local $52 - set_local $53 - get_local $53 - set_local $54 - get_local $54 - set_local $55 - get_local $55 - set_local $56 - get_local $56 - set_local $57 - get_local $57 - set_local $58 - get_local $58 - set_local $59 - get_local $59 - set_local $60 - get_local $60 - set_local $61 - get_local $61 - set_local $62 - get_local $62 - set_local $63 - get_local $63 - set_local $64 - get_local $64 - set_local $65 - get_local $65 - set_local $66 - get_local $66 - set_local $67 - get_local $67 - set_local $68 - get_local $68 - set_local $69 - get_local $69 - set_local $70 - get_local $70 - set_local $71 - get_local $71 - set_local $72 - get_local $72 - set_local $73 - get_local $73 - set_local $74 - get_local $74 - set_local $75 - get_local $75 - set_local $76 - get_local $76 - set_local $77 - get_local $77 - set_local $78 - get_local $78 - set_local $79 - get_local $79 - set_local $80 - get_local $80 - set_local $81 - get_local $81 - set_local $82 - get_local $82 - set_local $83 - get_local $83 - set_local $84 - get_local $84 - set_local $85 - get_local $85 - set_local $86 - get_local $86 - set_local $87 - get_local $87 - set_local $88 - get_local $88 - set_local $89 - get_local $89 - set_local $90 - get_local $90 - set_local $91 - get_local $91 - set_local $92 - get_local $92 - set_local $93 - get_local $93 - set_local $94 - get_local $94 - set_local $95 - get_local $95 - set_local $96 - get_local $96 - set_local $97 - get_local $97 - set_local $98 - get_local $98 - set_local $99 - get_local $99 - set_local $100 - get_local $100 - set_local $101 - get_local $101 - set_local $102 - get_local $102 - set_local $103 - get_local $103 - set_local $104 - get_local $104 - set_local $105 - get_local $105 - set_local $106 - get_local $106 - set_local $107 - get_local $107 - set_local $108 - get_local $108 - set_local $109 - get_local $109 - set_local $110 - get_local $110 - set_local $111 - get_local $111 - set_local $112 - get_local $112 - set_local $113 - get_local $113 - set_local $114 - get_local $114 - set_local $115 - get_local $115 - set_local $116 - get_local $116 - set_local $117 - get_local $117 - set_local $118 - get_local $118 - set_local $119 - get_local $119 - set_local $120 - get_local $120 - set_local $121 - get_local $121 - set_local $122 - get_local $122 - set_local $123 - get_local $123 - set_local $124 - get_local $124 - set_local $125 - get_local $125 - set_local $126 - get_local $126 - set_local $127 - get_local $127 - set_local $128 - get_local $128 + local.get $0 + local.set $1 + local.get $1 + local.set $2 + local.get $2 + local.set $3 + local.get $3 + local.set $4 + local.get $4 + local.set $5 + local.get $5 + local.set $6 + local.get $6 + local.set $7 + local.get $7 + local.set $8 + local.get $8 + local.set $9 + local.get $9 + local.set $10 + local.get $10 + local.set $11 + local.get $11 + local.set $12 + local.get $12 + local.set $13 + local.get $13 + local.set $14 + local.get $14 + local.set $15 + local.get $15 + local.set $16 + local.get $16 + local.set $17 + local.get $17 + local.set $18 + local.get $18 + local.set $19 + local.get $19 + local.set $20 + local.get $20 + local.set $21 + local.get $21 + local.set $22 + local.get $22 + local.set $23 + local.get $23 + local.set $24 + local.get $24 + local.set $25 + local.get $25 + local.set $26 + local.get $26 + local.set $27 + local.get $27 + local.set $28 + local.get $28 + local.set $29 + local.get $29 + local.set $30 + local.get $30 + local.set $31 + local.get $31 + local.set $32 + local.get $32 + local.set $33 + local.get $33 + local.set $34 + local.get $34 + local.set $35 + local.get $35 + local.set $36 + local.get $36 + local.set $37 + local.get $37 + local.set $38 + local.get $38 + local.set $39 + local.get $39 + local.set $40 + local.get $40 + local.set $41 + local.get $41 + local.set $42 + local.get $42 + local.set $43 + local.get $43 + local.set $44 + local.get $44 + local.set $45 + local.get $45 + local.set $46 + local.get $46 + local.set $47 + local.get $47 + local.set $48 + local.get $48 + local.set $49 + local.get $49 + local.set $50 + local.get $50 + local.set $51 + local.get $51 + local.set $52 + local.get $52 + local.set $53 + local.get $53 + local.set $54 + local.get $54 + local.set $55 + local.get $55 + local.set $56 + local.get $56 + local.set $57 + local.get $57 + local.set $58 + local.get $58 + local.set $59 + local.get $59 + local.set $60 + local.get $60 + local.set $61 + local.get $61 + local.set $62 + local.get $62 + local.set $63 + local.get $63 + local.set $64 + local.get $64 + local.set $65 + local.get $65 + local.set $66 + local.get $66 + local.set $67 + local.get $67 + local.set $68 + local.get $68 + local.set $69 + local.get $69 + local.set $70 + local.get $70 + local.set $71 + local.get $71 + local.set $72 + local.get $72 + local.set $73 + local.get $73 + local.set $74 + local.get $74 + local.set $75 + local.get $75 + local.set $76 + local.get $76 + local.set $77 + local.get $77 + local.set $78 + local.get $78 + local.set $79 + local.get $79 + local.set $80 + local.get $80 + local.set $81 + local.get $81 + local.set $82 + local.get $82 + local.set $83 + local.get $83 + local.set $84 + local.get $84 + local.set $85 + local.get $85 + local.set $86 + local.get $86 + local.set $87 + local.get $87 + local.set $88 + local.get $88 + local.set $89 + local.get $89 + local.set $90 + local.get $90 + local.set $91 + local.get $91 + local.set $92 + local.get $92 + local.set $93 + local.get $93 + local.set $94 + local.get $94 + local.set $95 + local.get $95 + local.set $96 + local.get $96 + local.set $97 + local.get $97 + local.set $98 + local.get $98 + local.set $99 + local.get $99 + local.set $100 + local.get $100 + local.set $101 + local.get $101 + local.set $102 + local.get $102 + local.set $103 + local.get $103 + local.set $104 + local.get $104 + local.set $105 + local.get $105 + local.set $106 + local.get $106 + local.set $107 + local.get $107 + local.set $108 + local.get $108 + local.set $109 + local.get $109 + local.set $110 + local.get $110 + local.set $111 + local.get $111 + local.set $112 + local.get $112 + local.set $113 + local.get $113 + local.set $114 + local.get $114 + local.set $115 + local.get $115 + local.set $116 + local.get $116 + local.set $117 + local.get $117 + local.set $118 + local.get $118 + local.set $119 + local.get $119 + local.set $120 + local.get $120 + local.set $121 + local.get $121 + local.set $122 + local.get $122 + local.set $123 + local.get $123 + local.set $124 + local.get $124 + local.set $125 + local.get $125 + local.set $126 + local.get $126 + local.set $127 + local.get $127 + local.set $128 + local.get $128 i32.const 24 i32.shl i32.const 24 diff --git a/tests/compiler/memcpy.optimized.wat b/tests/compiler/memcpy.optimized.wat index ab9e94fd..6341c48e 100644 --- a/tests/compiler/memcpy.optimized.wat +++ b/tests/compiler/memcpy.optimized.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $memcpy/dest (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -17,902 +17,902 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - set_local $6 + local.get $0 + local.set $6 loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end - get_local $6 + local.get $6 return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end - get_local $6 + local.get $6 ) (func $start (; 2 ;) (type $v) i32.const 8 @@ -931,8 +931,8 @@ i32.const 24 i32.const 4 call $memcpy/memcpy - set_global $memcpy/dest - get_global $memcpy/dest + global.set $memcpy/dest + global.get $memcpy/dest i32.const 9 i32.ne if @@ -959,8 +959,8 @@ i32.const 8 i32.const 32 call $memcpy/memcpy - set_global $memcpy/dest - get_global $memcpy/dest + global.set $memcpy/dest + global.get $memcpy/dest i32.const 8 i32.ne if @@ -1023,7 +1023,7 @@ i32.const 36 i32.const 3 call $memcpy/memcpy - set_global $memcpy/dest + global.set $memcpy/dest i32.const 8 i64.load i64.const 4919131679688438545 @@ -1040,7 +1040,7 @@ i32.const 24 i32.const 15 call $memcpy/memcpy - set_global $memcpy/dest + global.set $memcpy/dest i32.const 8 i64.load i64.const 4919131679688438545 diff --git a/tests/compiler/memcpy.untouched.wat b/tests/compiler/memcpy.untouched.wat index 6d55210a..6073f645 100644 --- a/tests/compiler/memcpy.untouched.wat +++ b/tests/compiler/memcpy.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $memcpy/base i32 (i32.const 8)) (global $memcpy/dest (mut i32) (i32.const 0)) @@ -19,48 +19,48 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - set_local $3 + local.get $0 + local.set $3 block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 4 i32.rem_u else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 4 i32.rem_u i32.const 0 @@ -68,142 +68,142 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 end - get_local $3 + local.get $3 return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -211,166 +211,166 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 4 i32.rem_u - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 1 i32.eq br_if $case0|2 - get_local $6 + local.get $6 i32.const 2 i32.eq br_if $case1|2 - get_local $6 + local.get $6 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $4 + local.set $4 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $5 - get_local $0 - get_local $4 + local.set $5 + local.get $0 + local.get $4 i32.const 24 i32.shr_u - get_local $5 + local.get $5 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 4 i32.add - get_local $5 + local.get $5 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $5 + local.get $5 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 12 i32.add - get_local $5 + local.get $5 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -378,130 +378,130 @@ end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $4 + local.set $4 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $5 - get_local $0 - get_local $4 + local.set $5 + local.get $0 + local.get $4 i32.const 16 i32.shr_u - get_local $5 + local.get $5 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 4 i32.add - get_local $5 + local.get $5 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $5 + local.get $5 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 12 i32.add - get_local $5 + local.get $5 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -509,112 +509,112 @@ end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $4 + local.set $4 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $5 - get_local $0 - get_local $4 + local.set $5 + local.get $0 + local.get $4 i32.const 8 i32.shr_u - get_local $5 + local.get $5 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 4 i32.add - get_local $5 + local.get $5 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $5 + local.get $5 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 12 i32.add - get_local $5 + local.get $5 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -623,621 +623,621 @@ br $break|2 end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $6 + local.get $0 + local.tee $6 i32.const 1 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 end block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.add - set_local $1 - get_local $6 + local.set $1 + local.get $6 end i32.load8_u i32.store8 end - get_local $3 + local.get $3 ) (func $start (; 2 ;) (type $v) - get_global $memcpy/base + global.get $memcpy/base i64.const 1229782938247303441 i64.store - get_global $memcpy/base + global.get $memcpy/base i32.const 8 i32.add i64.const 2459565876494606882 i64.store - get_global $memcpy/base + global.get $memcpy/base i32.const 16 i32.add i64.const 3689348814741910323 i64.store - get_global $memcpy/base + global.get $memcpy/base i32.const 24 i32.add i64.const 4919131752989213764 i64.store - get_global $memcpy/base + global.get $memcpy/base i32.const 1 i32.add - get_global $memcpy/base + global.get $memcpy/base i32.const 16 i32.add i32.const 4 call $memcpy/memcpy - set_global $memcpy/dest - get_global $memcpy/dest - get_global $memcpy/base + global.set $memcpy/dest + global.get $memcpy/dest + global.get $memcpy/base i32.const 1 i32.add i32.eq @@ -1250,7 +1250,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i64.load i64.const 1229783084848853777 i64.eq @@ -1263,13 +1263,13 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base - get_global $memcpy/base + global.get $memcpy/base + global.get $memcpy/base i32.const 32 call $memcpy/memcpy - set_global $memcpy/dest - get_global $memcpy/dest - get_global $memcpy/base + global.set $memcpy/dest + global.get $memcpy/dest + global.get $memcpy/base i32.eq i32.eqz if @@ -1280,7 +1280,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i64.load i64.const 1229783084848853777 i64.eq @@ -1293,7 +1293,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 8 i32.add i64.load @@ -1308,7 +1308,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 16 i32.add i64.load @@ -1323,7 +1323,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 24 i32.add i64.load @@ -1338,16 +1338,16 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 5 i32.add - get_global $memcpy/base + global.get $memcpy/base i32.const 28 i32.add i32.const 3 call $memcpy/memcpy - set_global $memcpy/dest - get_global $memcpy/base + global.set $memcpy/dest + global.get $memcpy/base i64.load i64.const 4919131679688438545 i64.eq @@ -1360,16 +1360,16 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 8 i32.add - get_global $memcpy/base + global.get $memcpy/base i32.const 16 i32.add i32.const 15 call $memcpy/memcpy - set_global $memcpy/dest - get_global $memcpy/base + global.set $memcpy/dest + global.get $memcpy/base i64.load i64.const 4919131679688438545 i64.eq @@ -1382,7 +1382,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 8 i32.add i64.load @@ -1397,7 +1397,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 16 i32.add i64.load @@ -1412,7 +1412,7 @@ call $~lib/env/abort unreachable end - get_global $memcpy/base + global.get $memcpy/base i32.const 24 i32.add i64.load diff --git a/tests/compiler/memmove.optimized.wat b/tests/compiler/memmove.optimized.wat index 199b1ba7..e5bfd202 100644 --- a/tests/compiler/memmove.optimized.wat +++ b/tests/compiler/memmove.optimized.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $memmove/dest (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -15,138 +15,138 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - set_local $3 - get_local $0 - get_local $1 + local.get $0 + local.set $3 + local.get $0 + local.get $1 i32.eq if - get_local $3 + local.get $3 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if - get_local $3 + local.get $3 return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $5 + local.set $0 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $5 + local.set $1 + local.get $4 + local.get $5 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $5 + local.set $0 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $5 + local.set $1 + local.get $4 + local.get $5 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if - get_local $3 + local.get $3 return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -154,18 +154,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -174,16 +174,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -191,7 +191,7 @@ end end end - get_local $3 + local.get $3 ) (func $start (; 2 ;) (type $v) i32.const 8 @@ -210,8 +210,8 @@ i32.const 24 i32.const 4 call $memmove/memmove - set_global $memmove/dest - get_global $memmove/dest + global.set $memmove/dest + global.get $memmove/dest i32.const 9 i32.ne if @@ -238,8 +238,8 @@ i32.const 8 i32.const 32 call $memmove/memmove - set_global $memmove/dest - get_global $memmove/dest + global.set $memmove/dest + global.get $memmove/dest i32.const 8 i32.ne if @@ -302,7 +302,7 @@ i32.const 36 i32.const 3 call $memmove/memmove - set_global $memmove/dest + global.set $memmove/dest i32.const 8 i64.load i64.const 4919131679688438545 @@ -319,7 +319,7 @@ i32.const 24 i32.const 15 call $memmove/memmove - set_global $memmove/dest + global.set $memmove/dest i32.const 8 i64.load i64.const 4919131679688438545 diff --git a/tests/compiler/memmove.untouched.wat b/tests/compiler/memmove.untouched.wat index 45ca5b6f..0526df92 100644 --- a/tests/compiler/memmove.untouched.wat +++ b/tests/compiler/memmove.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $memmove/base i32 (i32.const 8)) (global $memmove/dest (mut i32) (i32.const 0)) @@ -16,59 +16,59 @@ (func $memmove/memmove (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 - set_local $3 - get_local $0 - get_local $1 + local.get $0 + local.set $3 + local.get $0 + local.get $1 i32.eq if - get_local $3 + local.get $3 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 8 i32.rem_u - get_local $0 + local.get $0 i32.const 8 i32.rem_u i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 8 i32.rem_u if block - get_local $2 + local.get $2 i32.eqz if - get_local $3 + local.get $3 return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $4 + local.set $0 + local.get $4 end block (result i32) - get_local $1 - tee_local $4 + local.get $1 + local.tee $4 i32.const 1 i32.add - set_local $1 - get_local $4 + local.set $1 + local.get $4 end i32.load8_u i32.store8 @@ -79,27 +79,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -108,68 +108,68 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $4 + local.set $0 + local.get $4 end block (result i32) - get_local $1 - tee_local $4 + local.get $1 + local.tee $4 i32.const 1 i32.add - set_local $1 - get_local $4 + local.set $1 + local.get $4 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 8 i32.rem_u - get_local $0 + local.get $0 i32.const 8 i32.rem_u i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.rem_u if block - get_local $2 + local.get $2 i32.eqz if - get_local $3 + local.get $3 return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -180,20 +180,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -205,16 +205,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -223,38 +223,38 @@ end end end - get_local $3 + local.get $3 ) (func $start (; 2 ;) (type $v) - get_global $memmove/base + global.get $memmove/base i64.const 1229782938247303441 i64.store - get_global $memmove/base + global.get $memmove/base i32.const 8 i32.add i64.const 2459565876494606882 i64.store - get_global $memmove/base + global.get $memmove/base i32.const 16 i32.add i64.const 3689348814741910323 i64.store - get_global $memmove/base + global.get $memmove/base i32.const 24 i32.add i64.const 4919131752989213764 i64.store - get_global $memmove/base + global.get $memmove/base i32.const 1 i32.add - get_global $memmove/base + global.get $memmove/base i32.const 16 i32.add i32.const 4 call $memmove/memmove - set_global $memmove/dest - get_global $memmove/dest - get_global $memmove/base + global.set $memmove/dest + global.get $memmove/dest + global.get $memmove/base i32.const 1 i32.add i32.eq @@ -267,7 +267,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i64.load i64.const 1229783084848853777 i64.eq @@ -280,13 +280,13 @@ call $~lib/env/abort unreachable end - get_global $memmove/base - get_global $memmove/base + global.get $memmove/base + global.get $memmove/base i32.const 32 call $memmove/memmove - set_global $memmove/dest - get_global $memmove/dest - get_global $memmove/base + global.set $memmove/dest + global.get $memmove/dest + global.get $memmove/base i32.eq i32.eqz if @@ -297,7 +297,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i64.load i64.const 1229783084848853777 i64.eq @@ -310,7 +310,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 8 i32.add i64.load @@ -325,7 +325,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 16 i32.add i64.load @@ -340,7 +340,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 24 i32.add i64.load @@ -355,16 +355,16 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 5 i32.add - get_global $memmove/base + global.get $memmove/base i32.const 28 i32.add i32.const 3 call $memmove/memmove - set_global $memmove/dest - get_global $memmove/base + global.set $memmove/dest + global.get $memmove/base i64.load i64.const 4919131679688438545 i64.eq @@ -377,16 +377,16 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 8 i32.add - get_global $memmove/base + global.get $memmove/base i32.const 16 i32.add i32.const 15 call $memmove/memmove - set_global $memmove/dest - get_global $memmove/base + global.set $memmove/dest + global.get $memmove/base i64.load i64.const 4919131679688438545 i64.eq @@ -399,7 +399,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 8 i32.add i64.load @@ -414,7 +414,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 16 i32.add i64.load @@ -429,7 +429,7 @@ call $~lib/env/abort unreachable end - get_global $memmove/base + global.get $memmove/base i32.const 24 i32.add i64.load diff --git a/tests/compiler/memset.optimized.wat b/tests/compiler/memset.optimized.wat index 539d5c63..6edb2514 100644 --- a/tests/compiler/memset.optimized.wat +++ b/tests/compiler/memset.optimized.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $memset/dest (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -15,242 +15,242 @@ (local $3 i32) (local $4 i32) (local $5 i64) - get_local $0 - set_local $3 + local.get $0 + local.set $3 block $folding-inner0 - get_local $2 + local.get $2 i32.eqz br_if $folding-inner0 - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.store8 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u br_if $folding-inner0 - get_local $3 + local.get $3 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $3 + local.get $3 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - tee_local $0 + local.tee $0 i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u br_if $folding-inner0 - get_local $3 + local.get $3 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u br_if $folding-inner0 - get_local $2 + local.get $2 i32.const 0 - get_local $3 + local.get $3 i32.sub i32.const 3 i32.and - tee_local $4 + local.tee $4 i32.sub - set_local $2 - get_local $3 - get_local $4 + local.set $2 + local.get $3 + local.get $4 i32.add - tee_local $0 - get_local $1 + local.tee $0 + local.get $1 i32.const 255 i32.and i32.const 16843009 i32.mul - tee_local $1 + local.tee $1 i32.store - get_local $2 + local.get $2 i32.const -4 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u br_if $folding-inner0 - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $4 + local.tee $4 i32.const 12 i32.sub - get_local $1 + local.get $1 i32.store - get_local $4 + local.get $4 i32.const 8 i32.sub - get_local $1 + local.get $1 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u br_if $folding-inner0 - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $4 + local.tee $4 i32.const 28 i32.sub - get_local $1 + local.get $1 i32.store - get_local $4 + local.get $4 i32.const 24 i32.sub - get_local $1 + local.get $1 i32.store - get_local $4 + local.get $4 i32.const 20 i32.sub - get_local $1 + local.get $1 i32.store - get_local $4 + local.get $4 i32.const 16 i32.sub - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $4 - get_local $0 + local.tee $4 + local.get $0 i32.add - set_local $0 - get_local $2 - get_local $4 + local.set $0 + local.get $2 + local.get $4 i32.sub - set_local $2 - get_local $1 - i64.extend_u/i32 - tee_local $5 - get_local $5 + local.set $2 + local.get $1 + i64.extend_i32_u + local.tee $5 + local.get $5 i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 ) (func $start (; 2 ;) (type $v) i32.const 32 - set_global $memset/dest - get_global $memset/dest + global.set $memset/dest + global.get $memset/dest i32.const 1 i32.const 16 call $memset/memset drop - get_global $memset/dest + global.get $memset/dest i32.load8_u i32.const 1 i32.ne @@ -262,7 +262,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 15 i32.add i32.load8_u @@ -276,14 +276,14 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 1 i32.add i32.const 2 i32.const 14 call $memset/memset drop - get_global $memset/dest + global.get $memset/dest i32.load8_u i32.const 1 i32.ne @@ -295,7 +295,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 1 i32.add i32.load8_u @@ -309,7 +309,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 14 i32.add i32.load8_u @@ -323,7 +323,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 15 i32.add i32.load8_u diff --git a/tests/compiler/memset.untouched.wat b/tests/compiler/memset.untouched.wat index 4d6df259..1135c5d7 100644 --- a/tests/compiler/memset.untouched.wat +++ b/tests/compiler/memset.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $memset/dest (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 32)) @@ -17,274 +17,274 @@ (local $4 i32) (local $5 i32) (local $6 i64) - get_local $0 - set_local $3 - get_local $2 + local.get $0 + local.set $3 + local.get $2 i32.eqz if - get_local $3 + local.get $3 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if - get_local $3 + local.get $3 return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if - get_local $3 + local.get $3 return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if - get_local $3 + local.get $3 return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.add - set_local $0 - get_local $2 - get_local $4 + local.set $0 + local.get $2 + local.get $4 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $5 - get_local $0 - get_local $5 + local.set $5 + local.get $0 + local.get $5 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $5 + local.get $5 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if - get_local $3 + local.get $3 return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $5 + local.get $5 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $5 + local.get $5 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $5 + local.get $5 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if - get_local $3 + local.get $3 return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $5 + local.get $5 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $5 + local.get $5 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $5 + local.get $5 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $5 + local.get $5 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $5 + local.get $5 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $5 + local.get $5 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.add - set_local $0 - get_local $2 - get_local $4 + local.set $0 + local.get $2 + local.get $4 i32.sub - set_local $2 - get_local $5 - i64.extend_u/i32 - get_local $5 - i64.extend_u/i32 + local.set $2 + local.get $5 + i64.extend_i32_u + local.get $5 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $6 + local.set $6 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $6 + local.get $0 + local.get $6 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $6 + local.get $6 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $6 + local.get $6 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $6 + local.get $6 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end end end - get_local $3 + local.get $3 ) (func $start (; 2 ;) (type $v) - get_global $HEAP_BASE - set_global $memset/dest - get_global $memset/dest + global.get $HEAP_BASE + global.set $memset/dest + global.get $memset/dest i32.const 1 i32.const 16 call $memset/memset drop - get_global $memset/dest + global.get $memset/dest i32.load8_u i32.const 1 i32.eq @@ -297,7 +297,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 15 i32.add i32.load8_u @@ -312,14 +312,14 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 1 i32.add i32.const 2 i32.const 14 call $memset/memset drop - get_global $memset/dest + global.get $memset/dest i32.load8_u i32.const 1 i32.eq @@ -332,7 +332,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 1 i32.add i32.load8_u @@ -347,7 +347,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 14 i32.add i32.load8_u @@ -362,7 +362,7 @@ call $~lib/env/abort unreachable end - get_global $memset/dest + global.get $memset/dest i32.const 15 i32.add i32.load8_u diff --git a/tests/compiler/named-export-default.optimized.wat b/tests/compiler/named-export-default.optimized.wat index 0187b396..9fda9d9b 100644 --- a/tests/compiler/named-export-default.optimized.wat +++ b/tests/compiler/named-export-default.optimized.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/named-export-default.untouched.wat b/tests/compiler/named-export-default.untouched.wat index a29c233a..00c9d88b 100644 --- a/tests/compiler/named-export-default.untouched.wat +++ b/tests/compiler/named-export-default.untouched.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) diff --git a/tests/compiler/named-import-default.optimized.wat b/tests/compiler/named-import-default.optimized.wat index 174f6a47..930a2c61 100644 --- a/tests/compiler/named-import-default.optimized.wat +++ b/tests/compiler/named-import-default.optimized.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/named-import-default.untouched.wat b/tests/compiler/named-import-default.untouched.wat index 38555cdb..17456538 100644 --- a/tests/compiler/named-import-default.untouched.wat +++ b/tests/compiler/named-import-default.untouched.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) diff --git a/tests/compiler/namespace.optimized.wat b/tests/compiler/namespace.optimized.wat index be03ea1a..0a57311c 100644 --- a/tests/compiler/namespace.optimized.wat +++ b/tests/compiler/namespace.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/namespace.untouched.wat b/tests/compiler/namespace.untouched.wat index efa06983..610c87ee 100644 --- a/tests/compiler/namespace.untouched.wat +++ b/tests/compiler/namespace.untouched.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0)) (global $namespace/Outer.Inner.anEnum.ONE i32 (i32.const 1)) @@ -13,17 +13,17 @@ (export "table" (table $0)) (start $start) (func $namespace/Outer.Inner.aFunc (; 0 ;) (type $i) (result i32) - get_global $namespace/Outer.Inner.aVar + global.get $namespace/Outer.Inner.aVar ) (func $namespace/Joined.anotherFunc (; 1 ;) (type $i) (result i32) - get_global $namespace/Joined.THREE + global.get $namespace/Joined.THREE ) (func $start (; 2 ;) (type $v) - get_global $namespace/Outer.Inner.aVar + global.get $namespace/Outer.Inner.aVar drop call $namespace/Outer.Inner.aFunc drop - get_global $namespace/Outer.Inner.anEnum.ONE + global.get $namespace/Outer.Inner.anEnum.ONE drop call $namespace/Joined.anotherFunc drop diff --git a/tests/compiler/new-without-allocator.optimized.wat b/tests/compiler/new-without-allocator.optimized.wat index e18b8440..709dd3ca 100644 --- a/tests/compiler/new-without-allocator.optimized.wat +++ b/tests/compiler/new-without-allocator.optimized.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/new-without-allocator.untouched.wat b/tests/compiler/new-without-allocator.untouched.wat index d74b38ca..c40ef93c 100644 --- a/tests/compiler/new-without-allocator.untouched.wat +++ b/tests/compiler/new-without-allocator.untouched.wat @@ -3,7 +3,7 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) @@ -13,20 +13,20 @@ unreachable ) (func $new-without-allocator/A#constructor (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $new-without-allocator/test (; 2 ;) (type $i) (result i32) (local $0 i32) i32.const 0 call $new-without-allocator/A#constructor - set_local $0 + local.set $0 i32.const 3 ) (func $null (; 3 ;) (type $v) diff --git a/tests/compiler/nonNullAssertion.optimized.wat b/tests/compiler/nonNullAssertion.optimized.wat index db8bd74f..4d3b114c 100644 --- a/tests/compiler/nonNullAssertion.optimized.wat +++ b/tests/compiler/nonNullAssertion.optimized.wat @@ -3,7 +3,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -24,23 +24,23 @@ (export "testObjRet" (func $nonNullAssertion/testObjFn)) (start $start) (func $nonNullAssertion/testVar (; 0 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $nonNullAssertion/testObj (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $nonNullAssertion/testArr (; 2 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -48,15 +48,15 @@ ) (func $nonNullAssertion/testAll (; 3 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -65,22 +65,22 @@ ) (func $nonNullAssertion/testFn (; 4 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 call_indirect (type $i) ) (func $nonNullAssertion/testObjFn (; 5 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.load offset=4 call_indirect (type $i) ) (func $start (; 6 ;) (type $v) i32.const 8 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset ) (func $null (; 7 ;) (type $v) nop diff --git a/tests/compiler/nonNullAssertion.untouched.wat b/tests/compiler/nonNullAssertion.untouched.wat index 1f49a62d..8fb2a28f 100644 --- a/tests/compiler/nonNullAssertion.untouched.wat +++ b/tests/compiler/nonNullAssertion.untouched.wat @@ -4,7 +4,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -31,37 +31,37 @@ (export "testObjRet" (func $nonNullAssertion/testObjRet)) (start $start) (func $nonNullAssertion/testVar (; 0 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $nonNullAssertion/testObj (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $nonNullAssertion/testProp (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load ) (func $~lib/array/Array#__get (; 3 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -69,31 +69,31 @@ end ) (func $nonNullAssertion/testArr (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array#__get ) (func $~lib/array/Array#__get (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -101,68 +101,68 @@ end ) (func $nonNullAssertion/testElem (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array#__get ) (func $nonNullAssertion/testAll (; 7 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.load ) (func $nonNullAssertion/testAll2 (; 8 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.load ) (func $nonNullAssertion/testFn (; 9 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 call_indirect (type $i) ) (func $nonNullAssertion/testFn2 (; 10 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 - set_local $1 + local.get $0 + local.set $1 i32.const 0 - set_global $~argc - get_local $1 + global.set $~argc + local.get $1 call_indirect (type $i) ) (func $nonNullAssertion/testRet (; 11 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 call_indirect (type $i) ) (func $nonNullAssertion/testObjFn (; 12 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.load offset=4 call_indirect (type $i) ) (func $nonNullAssertion/testObjRet (; 13 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.load offset=4 call_indirect (type $i) ) (func $start (; 14 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset ) (func $null (; 15 ;) (type $v) ) diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index 86e89617..accdd29c 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -36,7 +36,7 @@ (data (i32.const 2152) "\01\00\00\002") (data (i32.const 2160) "\04\00\00\00t\00r\00u\00e") (data (i32.const 2176) "\05\00\00\00f\00a\00l\00s\00e") - (table $0 1 anyfunc) + (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)) @@ -51,17 +51,17 @@ (export "table" (table $0)) (start $start) (func $~lib/internal/number/decimalCount32 (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 100000 i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 100 i32.lt_u if (result i32) i32.const 1 i32.const 2 - get_local $0 + local.get $0 i32.const 10 i32.lt_u select @@ -69,23 +69,23 @@ i32.const 3 i32.const 4 i32.const 5 - get_local $0 + local.get $0 i32.const 10000 i32.lt_u select - get_local $0 + local.get $0 i32.const 1000 i32.lt_u select end else - get_local $0 + local.get $0 i32.const 10000000 i32.lt_u if (result i32) i32.const 6 i32.const 7 - get_local $0 + local.get $0 i32.const 1000000 i32.lt_u select @@ -93,11 +93,11 @@ i32.const 8 i32.const 9 i32.const 10 - get_local $0 + local.get $0 i32.const 1000000000 i32.lt_u select - get_local $0 + local.get $0 i32.const 100000000 i32.lt_u select @@ -108,17 +108,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -127,16 +127,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -144,16 +144,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -162,23 +162,23 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/string/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if - get_local $0 + local.get $0 i32.const 536870910 i32.le_s - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -188,54 +188,54 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.shl i32.const 4 i32.add call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/number/utoa32_lut (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) i32.const 584 i32.load - set_local $3 + local.set $3 loop $continue|0 - get_local $1 + local.get $1 i32.const 10000 i32.ge_u if - get_local $1 + local.get $1 i32.const 10000 i32.rem_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 10000 i32.div_u - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 4 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.div_u i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.rem_u i32.const 2 @@ -249,61 +249,61 @@ br $continue|0 end end - get_local $1 + local.get $1 i32.const 100 i32.ge_u if - get_local $1 + local.get $1 i32.const 100 i32.rem_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 100 i32.div_u - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 2 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=4 end - get_local $1 + local.get $1 i32.const 10 i32.ge_u if - get_local $2 + local.get $2 i32.const 2 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=4 else - get_local $2 + local.get $2 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.const 48 i32.add i32.store16 offset=4 @@ -313,109 +313,109 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 return end - get_local $0 + local.get $0 i32.const 0 i32.lt_s - tee_local $1 + local.tee $1 if i32.const 0 - get_local $0 + local.get $0 i32.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - tee_local $3 + local.tee $3 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 - get_local $3 + local.tee $2 + local.get $0 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 if - get_local $2 + local.get $2 i32.const 45 i32.store16 offset=4 end - get_local $2 + local.get $2 ) (func $~lib/internal/string/compareUnsafe (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $0 + local.get $0 i32.load16_u offset=4 - get_local $1 + local.get $1 i32.load16_u offset=4 i32.sub - tee_local $3 + local.tee $3 i32.eqz else - get_local $2 + local.get $2 end if - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 br $continue|0 end end - get_local $3 + local.get $3 ) (func $~lib/string/String.__eq (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $0 + local.get $0 i32.load - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/string/compareUnsafe i32.eqz ) @@ -428,37 +428,37 @@ (local $12 i32) (local $13 i64) (local $14 i64) - get_local $3 - get_local $1 + local.get $3 + local.get $1 i64.sub - set_local $8 + local.set $8 i64.const 1 i32.const 0 - get_local $4 + local.get $4 i32.sub - tee_local $11 - i64.extend_s/i32 - tee_local $13 + local.tee $11 + i64.extend_i32_s + local.tee $13 i64.shl - tee_local $10 + local.tee $10 i64.const 1 i64.sub - tee_local $14 - get_local $3 + local.tee $14 + local.get $3 i64.and - set_local $1 - get_local $3 - get_local $13 + local.set $1 + local.get $3 + local.get $13 i64.shr_u - i32.wrap/i64 - tee_local $7 + i32.wrap_i64 + local.tee $7 call $~lib/internal/number/decimalCount32 - set_local $9 + local.set $9 i32.const 2064 i32.load - set_local $12 + local.set $12 loop $continue|0 - get_local $9 + local.get $9 i32.const 0 i32.gt_s if @@ -473,357 +473,357 @@ block $case3|1 block $case2|1 block $case1|1 - get_local $9 - tee_local $2 + local.get $9 + local.tee $2 i32.const 10 i32.ne if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case9|1 $case8|1 $case7|1 $case6|1 $case5|1 $case4|1 $case3|1 $case2|1 $case1|1 $case10|1 end - get_local $7 + local.get $7 i32.const 1000000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 1000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 1000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 - set_local $4 + local.get $7 + local.set $4 i32.const 0 - set_local $7 + local.set $7 br $break|1 end i32.const 0 - set_local $4 + local.set $4 end - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.or if - get_local $6 - tee_local $2 + local.get $6 + local.tee $2 i32.const 1 i32.add - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $4 + local.get $4 i32.const 65535 i32.and i32.const 48 i32.add i32.store16 offset=4 end - get_local $9 + local.get $9 i32.const 1 i32.sub - set_local $9 - get_local $7 - i64.extend_u/i32 - get_local $11 - i64.extend_s/i32 + local.set $9 + local.get $7 + i64.extend_i32_u + local.get $11 + i64.extend_i32_s i64.shl - get_local $1 + local.get $1 i64.add - tee_local $3 - get_local $5 + local.tee $3 + local.get $5 i64.le_u if - get_global $~lib/internal/number/_K - get_local $9 + global.get $~lib/internal/number/_K + local.get $9 i32.add - set_global $~lib/internal/number/_K - get_local $12 - get_local $9 + global.set $~lib/internal/number/_K + local.get $12 + local.get $9 i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $11 - i64.extend_s/i32 + local.get $11 + i64.extend_i32_s i64.shl - set_local $1 - get_local $6 + local.set $1 + local.get $6 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $2 + local.tee $2 i32.load16_u offset=4 - set_local $7 + local.set $7 loop $continue|2 - get_local $3 - get_local $8 + local.get $3 + local.get $8 i64.lt_u - tee_local $0 + local.tee $0 if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.sub - get_local $1 + local.get $1 i64.ge_u - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $1 - get_local $3 + local.get $1 + local.get $3 i64.add - get_local $8 + local.get $8 i64.lt_u - tee_local $0 + local.tee $0 i32.eqz if - get_local $8 - get_local $3 + local.get $8 + local.get $3 i64.sub - get_local $1 - get_local $3 + local.get $1 + local.get $3 i64.add - get_local $8 + local.get $8 i64.sub i64.gt_u - set_local $0 + local.set $0 end end - get_local $0 + local.get $0 if - get_local $7 + local.get $7 i32.const 1 i32.sub - set_local $7 - get_local $1 - get_local $3 + local.set $7 + local.get $1 + local.get $3 i64.add - set_local $3 + local.set $3 br $continue|2 end end - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.store16 offset=4 - get_local $6 + local.get $6 return end br $continue|0 end end loop $continue|3 (result i32) - get_local $5 + local.get $5 i64.const 10 i64.mul - set_local $5 - get_local $1 + local.set $5 + local.get $1 i64.const 10 i64.mul - tee_local $1 - get_local $11 - i64.extend_s/i32 + local.tee $1 + local.get $11 + i64.extend_i32_s i64.shr_u - tee_local $3 - get_local $6 - i64.extend_s/i32 + local.tee $3 + local.get $6 + i64.extend_i32_s i64.or i64.const 0 i64.ne if - get_local $6 - tee_local $4 + local.get $6 + local.tee $4 i32.const 1 i32.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - i32.wrap/i64 + local.get $3 + i32.wrap_i64 i32.const 65535 i32.and i32.const 48 i32.add i32.store16 offset=4 end - get_local $9 + local.get $9 i32.const 1 i32.sub - set_local $9 - get_local $1 - get_local $14 + local.set $9 + local.get $1 + local.get $14 i64.and - tee_local $1 - get_local $5 + local.tee $1 + local.get $5 i64.ge_u br_if $continue|3 - get_global $~lib/internal/number/_K - get_local $9 + global.get $~lib/internal/number/_K + local.get $9 i32.add - set_global $~lib/internal/number/_K - get_local $12 + global.set $~lib/internal/number/_K + local.get $12 i32.const 0 - get_local $9 + local.get $9 i32.sub i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $8 + local.get $8 i64.mul - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $7 + local.tee $7 i32.load16_u offset=4 - set_local $4 + local.set $4 loop $continue|4 - get_local $1 - get_local $8 + local.get $1 + local.get $8 i64.lt_u - tee_local $2 + local.tee $2 if - get_local $5 - get_local $1 + local.get $5 + local.get $1 i64.sub - get_local $10 + local.get $10 i64.ge_u - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $1 - get_local $10 + local.get $1 + local.get $10 i64.add - get_local $8 + local.get $8 i64.lt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $8 - get_local $1 + local.get $8 + local.get $1 i64.sub - get_local $1 - get_local $10 + local.get $1 + local.get $10 i64.add - get_local $8 + local.get $8 i64.sub i64.gt_u - set_local $2 + local.set $2 end end - get_local $2 + local.get $2 if - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $1 - get_local $10 + local.set $4 + local.get $1 + local.get $10 i64.add - set_local $1 + local.set $1 br $continue|4 end end - get_local $7 - get_local $4 + local.get $7 + local.get $4 i32.store16 offset=4 - get_local $6 + local.get $6 end ) (func $~lib/internal/memory/memcpy (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) @@ -831,894 +831,894 @@ (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -1726,156 +1726,156 @@ (func $~lib/internal/memory/memmove (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1883,18 +1883,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1903,16 +1903,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1925,265 +1925,265 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $2 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 3145774 i32.store offset=4 - get_local $1 + local.get $1 i32.const 2 i32.add return end - get_local $1 - get_local $1 - get_local $2 + local.get $1 + local.get $1 + local.get $2 i32.add - tee_local $5 + local.tee $5 i32.le_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 21 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $1 - set_local $3 + local.get $1 + local.set $3 loop $repeat|0 block $break|0 - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.ge_s br_if $break|0 - get_local $3 + local.get $3 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 48 i32.store16 offset=4 - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end - get_local $5 + local.get $5 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 3145774 i32.store offset=4 - get_local $5 + local.get $5 i32.const 2 i32.add else - get_local $5 + local.get $5 i32.const 0 i32.gt_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 21 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $5 + local.get $5 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $3 + local.tee $3 i32.const 4 i32.add - tee_local $0 + local.tee $0 i32.const 2 i32.add - get_local $0 + local.get $0 i32.const 0 - get_local $2 + local.get $2 i32.sub i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $3 + local.get $3 i32.const 46 i32.store16 offset=4 - get_local $1 + local.get $1 i32.const 1 i32.add else i32.const -6 - get_local $5 + local.get $5 i32.lt_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 0 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $2 + local.tee $2 i32.const 2 - get_local $5 + local.get $5 i32.sub - tee_local $3 + local.tee $3 i32.const 1 i32.shl i32.add - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $0 + local.get $0 i32.const 3014704 i32.store offset=4 i32.const 2 - set_local $4 + local.set $4 loop $repeat|1 block $break|1 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.ge_s br_if $break|1 - get_local $4 + local.get $4 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 48 i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|1 end end - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add else - get_local $1 + local.get $1 i32.const 1 i32.eq if (result i32) - get_local $0 + local.get $0 i32.const 101 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 block (result i32) - get_local $5 + local.get $5 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s - tee_local $2 + local.tee $2 if i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $4 + local.set $4 end - get_local $4 + local.get $4 end - get_local $4 + local.get $4 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - tee_local $4 + local.tee $4 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 i32.const 45 i32.const 43 - get_local $2 + local.get $2 select i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 2 i32.add else - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 i32.const 4 i32.add - get_local $3 + local.get $3 i32.const 2 i32.add - get_local $1 + local.get $1 i32.const 1 i32.shl - tee_local $4 + local.tee $4 i32.const 2 i32.sub call $~lib/internal/memory/memmove - get_local $0 + local.get $0 i32.const 46 i32.store16 offset=6 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.add - tee_local $0 + local.tee $0 i32.const 101 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 block (result i32) - get_local $5 + local.get $5 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s - tee_local $2 + local.tee $2 if i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $4 + local.set $4 end - get_local $4 + local.get $4 end - get_local $4 + local.get $4 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - tee_local $0 + local.tee $0 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 i32.const 45 i32.const 43 - get_local $2 + local.get $2 select i32.store16 offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 2 i32.add @@ -2207,166 +2207,166 @@ (local $13 i32) (local $14 i32) (local $15 i64) - get_local $1 + local.get $1 f64.const 0 f64.lt - tee_local $13 + local.tee $13 if (result f64) - get_local $0 + local.get $0 i32.const 45 i32.store16 offset=4 - get_local $1 + local.get $1 f64.neg else - get_local $1 + local.get $1 end - i64.reinterpret/f64 - tee_local $2 + i64.reinterpret_f64 + local.tee $2 i64.const 9218868437227405312 i64.and i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $8 - get_local $2 + i32.wrap_i64 + local.set $8 + local.get $2 i64.const 4503599627370495 i64.and - get_local $8 + local.get $8 i32.const 0 i32.ne - tee_local $6 - i64.extend_u/i32 + local.tee $6 + i64.extend_i32_u i64.const 52 i64.shl i64.add - set_local $2 - get_local $8 + local.set $2 + local.get $8 i32.const 1 - get_local $6 + local.get $6 select i32.const 1075 i32.sub - tee_local $8 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $2 + local.set $6 + local.get $2 i64.const 1 i64.shl i64.const 1 i64.add - tee_local $5 + local.tee $5 i64.clz - i32.wrap/i64 - set_local $4 - get_local $5 - get_local $4 - i64.extend_s/i32 + i32.wrap_i64 + local.set $4 + local.get $5 + local.get $4 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_plus - get_local $2 - get_local $2 + global.set $~lib/internal/number/_frc_plus + local.get $2 + local.get $2 i64.const 4503599627370496 i64.eq i32.const 1 i32.add - tee_local $14 - i64.extend_s/i32 + local.tee $14 + i64.extend_i32_s i64.shl i64.const 1 i64.sub - get_local $8 - get_local $14 + local.get $8 + local.get $14 i32.sub - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.sub - tee_local $6 + local.tee $6 i32.sub - i64.extend_s/i32 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_minus - get_local $6 - set_global $~lib/internal/number/_exp + global.set $~lib/internal/number/_frc_minus + local.get $6 + global.set $~lib/internal/number/_exp i32.const 348 i32.const -61 - get_global $~lib/internal/number/_exp + global.get $~lib/internal/number/_exp i32.sub - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.30102999566398114 f64.mul f64.const 347 f64.add - tee_local $1 - i32.trunc_s/f64 - tee_local $4 - get_local $4 - f64.convert_s/i32 - get_local $1 + local.tee $1 + i32.trunc_f64_s + local.tee $4 + local.get $4 + f64.convert_i32_s + local.get $1 f64.ne i32.add i32.const 3 i32.shr_s i32.const 1 i32.add - tee_local $6 + local.tee $6 i32.const 3 i32.shl i32.sub - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K i32.const 1992 i32.load - set_local $4 + local.set $4 i32.const 1728 i32.load - get_local $6 + local.get $6 i32.const 3 i32.shl i32.add i64.load offset=8 - set_global $~lib/internal/number/_frc_pow - get_local $4 - get_local $6 + global.set $~lib/internal/number/_frc_pow + local.get $4 + local.get $6 i32.const 1 i32.shl i32.add i32.load16_s offset=8 - set_global $~lib/internal/number/_exp_pow - get_local $2 - get_local $2 + global.set $~lib/internal/number/_exp_pow + local.get $2 + local.get $2 i64.clz - i32.wrap/i64 - tee_local $4 - i64.extend_s/i32 + i32.wrap_i64 + local.tee $4 + i64.extend_i32_s i64.shl - tee_local $2 + local.tee $2 i64.const 4294967295 i64.and - tee_local $7 - get_global $~lib/internal/number/_frc_pow - tee_local $5 + local.tee $7 + global.get $~lib/internal/number/_frc_pow + local.tee $5 i64.const 4294967295 i64.and - tee_local $9 + local.tee $9 i64.mul - set_local $10 - get_local $5 + local.set $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $11 - get_local $7 + local.tee $11 + local.get $7 i64.mul - get_local $2 + local.get $2 i64.const 32 i64.shr_u - tee_local $12 - get_local $9 + local.tee $12 + local.get $9 i64.mul - get_local $10 + local.get $10 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add @@ -2374,43 +2374,43 @@ i64.add i64.const 32 i64.shr_u - get_local $11 - get_local $12 + local.get $11 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add i64.add - set_local $2 - get_local $5 + local.set $2 + local.get $5 i64.const 4294967295 i64.and - tee_local $11 - get_global $~lib/internal/number/_frc_plus - tee_local $3 + local.tee $11 + global.get $~lib/internal/number/_frc_plus + local.tee $3 i64.const 4294967295 i64.and - tee_local $10 + local.tee $10 i64.mul - set_local $7 - get_local $10 - get_local $5 + local.set $7 + local.get $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $9 + local.tee $9 i64.mul - get_local $11 - get_local $3 + local.get $11 + local.get $3 i64.const 32 i64.shr_u - tee_local $12 + local.tee $12 i64.mul - get_local $7 + local.get $7 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add @@ -2418,59 +2418,59 @@ i64.add i64.const 32 i64.shr_u - get_local $9 - get_local $12 + local.get $9 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add i64.add - set_local $15 - get_global $~lib/internal/number/_frc_minus - tee_local $3 + local.set $15 + global.get $~lib/internal/number/_frc_minus + local.tee $3 i64.const 4294967295 i64.and - tee_local $7 - get_local $5 + local.tee $7 + local.get $5 i64.const 4294967295 i64.and - tee_local $9 + local.tee $9 i64.mul - set_local $10 - get_local $5 + local.set $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $11 - get_local $7 + local.tee $11 + local.get $7 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u - tee_local $12 - get_local $9 + local.tee $12 + local.get $9 i64.mul - get_local $10 + local.get $10 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add - set_local $5 - get_local $15 + local.set $5 + local.get $15 i64.const 1 i64.sub - tee_local $7 - get_local $11 - get_local $12 + local.tee $7 + local.get $11 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add - get_local $5 + local.get $5 i64.const 2147483647 i64.add i64.const 32 @@ -2479,43 +2479,43 @@ i64.const 1 i64.add i64.sub - set_local $3 - get_local $13 + local.set $3 + local.get $13 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $0 - get_local $2 - get_local $8 - get_local $4 + local.get $0 + local.get $2 + local.get $8 + local.get $4 i32.sub - get_global $~lib/internal/number/_exp_pow - tee_local $4 + global.get $~lib/internal/number/_exp_pow + local.tee $4 i32.add i32.const -64 i32.sub - get_local $7 - get_local $4 - get_global $~lib/internal/number/_exp + local.get $7 + local.get $4 + global.get $~lib/internal/number/_exp i32.add i32.const -64 i32.sub - get_local $3 - get_local $13 + local.get $3 + local.get $13 call $~lib/internal/number/genDigits - get_local $13 + local.get $13 i32.sub - get_global $~lib/internal/number/_K + global.get $~lib/internal/number/_K call $~lib/internal/number/prettify - get_local $13 + local.get $13 i32.add ) (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) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -2525,100 +2525,100 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 - get_local $1 + local.get $1 i32.const 0 i32.gt_s select - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.lt_s select - set_local $1 + local.set $1 i32.const 0 - get_local $3 + local.get $3 i32.const 0 - get_local $3 + local.get $3 i32.lt_s select - tee_local $2 - get_local $1 - get_local $2 - get_local $1 + local.tee $2 + local.get $1 + local.get $2 + local.get $1 i32.lt_s select - set_local $4 - get_local $2 - get_local $1 - get_local $2 - get_local $1 + local.set $4 + local.get $2 + local.get $1 + local.get $2 + local.get $1 i32.gt_s select - tee_local $1 - get_local $4 + local.tee $1 + local.get $4 i32.sub - tee_local $3 + local.tee $3 i32.eqz if i32.const 2104 return end - get_local $4 + local.get $4 i32.eqz - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.eq - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 4 i32.add - get_local $3 + local.get $3 i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $2 + local.get $2 ) (func $~lib/internal/number/dtoa (; 14 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 f64.const 0 f64.eq if i32.const 624 return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.ne if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if i32.const 640 @@ -2626,7 +2626,7 @@ end i32.const 656 i32.const 680 - get_local $0 + local.get $0 f64.const 0 f64.lt select @@ -2634,15 +2634,15 @@ end i32.const 28 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 call $~lib/internal/number/dtoa_core - set_local $1 - get_local $2 - get_local $1 + local.set $1 + local.get $2 + local.get $1 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -2652,15 +2652,15 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 ) (func $start (; 15 ;) (type $v) (local $0 i32) i32.const 2192 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $number/a + 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 @@ -2725,11 +2725,11 @@ call $~lib/env/abort unreachable end - get_global $number/a + global.get $number/a i32.const 1 i32.add - set_global $number/a - get_global $number/a + global.set $number/a + global.get $number/a call $~lib/internal/number/itoa32 i32.const 2152 call $~lib/string/String.__eq @@ -2742,11 +2742,11 @@ call $~lib/env/abort unreachable end - get_global $number/a + global.get $number/a i32.const 1 i32.sub - set_global $number/a - get_global $number/a + global.set $number/a + global.get $number/a call $~lib/internal/number/itoa32 i32.const 592 call $~lib/string/String.__eq @@ -2783,12 +2783,12 @@ call $~lib/env/abort unreachable end - get_global $number/a - tee_local $0 + global.get $number/a + local.tee $0 i32.const 1 i32.add - set_global $number/a - get_local $0 + global.set $number/a + local.get $0 call $~lib/internal/number/itoa32 i32.const 592 call $~lib/string/String.__eq @@ -2801,12 +2801,12 @@ call $~lib/env/abort unreachable end - get_global $number/a - tee_local $0 + global.get $number/a + local.tee $0 i32.const 1 i32.sub - set_global $number/a - get_local $0 + global.set $number/a + local.get $0 call $~lib/internal/number/itoa32 i32.const 2152 call $~lib/string/String.__eq diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 15718bef..451223b7 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -39,7 +39,7 @@ (data (i32.const 2152) "\01\00\00\002\00") (data (i32.const 2160) "\04\00\00\00t\00r\00u\00e\00") (data (i32.const 2176) "\05\00\00\00f\00a\00l\00s\00e\00") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -102,17 +102,17 @@ (start $start) (func $~lib/internal/number/decimalCount32 (; 1 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 100000 i32.lt_u if - get_local $0 + local.get $0 i32.const 100 i32.lt_u if i32.const 1 i32.const 2 - get_local $0 + local.get $0 i32.const 10 i32.lt_u select @@ -120,14 +120,14 @@ else i32.const 4 i32.const 5 - get_local $0 + local.get $0 i32.const 10000 i32.lt_u select - set_local $1 + local.set $1 i32.const 3 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 1000 i32.lt_u select @@ -136,13 +136,13 @@ unreachable unreachable else - get_local $0 + local.get $0 i32.const 10000000 i32.lt_u if i32.const 6 i32.const 7 - get_local $0 + local.get $0 i32.const 1000000 i32.lt_u select @@ -150,14 +150,14 @@ else i32.const 9 i32.const 10 - get_local $0 + local.get $0 i32.const 1000000000 i32.lt_u select - set_local $1 + local.set $1 i32.const 8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 100000000 i32.lt_u select @@ -176,41 +176,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -220,22 +220,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -244,23 +244,23 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/string/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if (result i32) - get_local $0 - get_global $~lib/internal/string/MAX_LENGTH + local.get $0 + global.get $~lib/internal/string/MAX_LENGTH i32.le_s else - get_local $1 + local.get $1 end i32.eqz if @@ -272,21 +272,21 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_global $~lib/internal/string/HEADER_SIZE - get_local $0 + global.get $~lib/internal/string/HEADER_SIZE + local.get $0 i32.const 1 i32.shl i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $2 - get_local $2 - get_local $0 + local.set $2 + local.get $2 + local.get $0 i32.store - get_local $2 + local.get $2 ) (func $~lib/internal/number/utoa32_lut (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -301,69 +301,69 @@ i32.const 584 end i32.load - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $1 + local.get $1 i32.const 10000 i32.ge_u if block - get_local $1 + local.get $1 i32.const 10000 i32.div_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 10000 i32.rem_u - set_local $5 - get_local $4 - set_local $1 - get_local $5 + local.set $5 + local.get $4 + local.set $1 + local.get $5 i32.const 100 i32.div_u - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 100 i32.rem_u - set_local $7 + local.set $7 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 - set_local $8 - get_local $3 - get_local $6 + local.set $8 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i64.load32_u offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) i32.const 0 - set_local $8 - get_local $3 - get_local $7 + local.set $8 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i64.load32_u offset=8 end - set_local $10 - get_local $2 + local.set $10 + local.get $2 i32.const 4 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $9 - get_local $10 + local.get $9 + local.get $10 i64.const 32 i64.shl i64.or @@ -373,88 +373,88 @@ end end end - get_local $1 + local.get $1 i32.const 100 i32.ge_u if - get_local $1 + local.get $1 i32.const 100 i32.div_u - set_local $7 - get_local $1 + local.set $7 + local.get $1 i32.const 100 i32.rem_u - set_local $6 - get_local $7 - set_local $1 - get_local $2 + local.set $6 + local.get $7 + local.set $1 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $5 - get_local $3 - get_local $6 + local.set $5 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store offset=4 end - get_local $1 + local.get $1 i32.const 10 i32.ge_u if - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store offset=4 else - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_global $~lib/internal/string/CharCode._0 - get_local $1 + local.set $2 + global.get $~lib/internal/string/CharCode._0 + local.get $1 i32.add - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store16 offset=4 end ) @@ -462,50 +462,50 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 return end - get_local $0 + local.get $0 i32.const 0 i32.lt_s - set_local $1 - get_local $1 + local.set $1 + local.get $1 if i32.const 0 - get_local $0 + local.get $0 i32.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/string/allocateUnsafe - set_local $3 - get_local $3 - get_local $0 - get_local $2 + local.set $3 + local.get $3 + local.get $0 + local.get $2 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 if - get_local $3 - get_global $~lib/internal/string/CharCode.MINUS + local.get $3 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/internal/number/itoa (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/internal/number/itoa32 return ) (func $~lib/number/I32#toString (; 7 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/internal/number/itoa ) (func $~lib/internal/string/compareUnsafe (; 8 ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) @@ -513,72 +513,72 @@ (local $6 i32) (local $7 i32) i32.const 0 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_local $3 + local.set $6 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|0 loop $continue|0 - get_local $4 + local.get $4 if (result i32) - get_local $6 + local.get $6 i32.load16_u offset=4 - get_local $7 + local.get $7 i32.load16_u offset=4 i32.sub - tee_local $5 + local.tee $5 i32.eqz else - get_local $4 + local.get $4 end if block - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2 i32.add - set_local $6 - get_local $7 + local.set $6 + local.get $7 i32.const 2 i32.add - set_local $7 + local.set $7 end br $continue|0 end end end - get_local $5 + local.get $5 ) (func $~lib/string/String.__eq (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -586,35 +586,35 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $~lib/builtins/isFinite (; 10 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.eq ) (func $~lib/builtins/isNaN (; 11 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne ) (func $~lib/internal/number/genDigits (; 12 ;) (type $iIiIiIii) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) @@ -635,47 +635,47 @@ (local $21 i32) (local $22 i32) i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $7 + local.set $7 i64.const 1 - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.shl - set_local $8 - get_local $8 + local.set $8 + local.get $8 i64.const 1 i64.sub - set_local $9 - get_local $3 - get_local $1 + local.set $9 + local.get $3 + local.get $1 i64.sub - set_local $10 - get_local $4 - set_local $11 - get_local $3 - get_local $7 - i64.extend_s/i32 + 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 - set_local $12 - get_local $3 - get_local $9 + i32.wrap_i64 + local.set $12 + local.get $3 + local.get $9 i64.and - set_local $13 - get_local $12 + local.set $13 + local.get $12 call $~lib/internal/number/decimalCount32 - set_local $14 - get_local $6 - set_local $15 + local.set $14 + local.get $6 + local.set $15 block $~lib/internal/number/POWERS10|inlined.0 (result i32) i32.const 2064 end i32.load - set_local $16 + local.set $16 block $break|0 loop $continue|0 - get_local $14 + local.get $14 i32.const 0 i32.gt_s if @@ -692,181 +692,181 @@ block $case2|1 block $case1|1 block $case0|1 - get_local $14 - set_local $18 - get_local $18 + local.get $14 + local.set $18 + local.get $18 i32.const 10 i32.eq br_if $case0|1 - get_local $18 + local.get $18 i32.const 9 i32.eq br_if $case1|1 - get_local $18 + local.get $18 i32.const 8 i32.eq br_if $case2|1 - get_local $18 + local.get $18 i32.const 7 i32.eq br_if $case3|1 - get_local $18 + local.get $18 i32.const 6 i32.eq br_if $case4|1 - get_local $18 + local.get $18 i32.const 5 i32.eq br_if $case5|1 - get_local $18 + local.get $18 i32.const 4 i32.eq br_if $case6|1 - get_local $18 + local.get $18 i32.const 3 i32.eq br_if $case7|1 - get_local $18 + local.get $18 i32.const 2 i32.eq br_if $case8|1 - get_local $18 + local.get $18 i32.const 1 i32.eq br_if $case9|1 br $case10|1 end block - get_local $12 + local.get $12 i32.const 1000000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 1000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 1000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 - set_local $17 + local.get $12 + local.set $17 i32.const 0 - set_local $12 + local.set $12 br $break|1 unreachable end @@ -874,140 +874,140 @@ end block i32.const 0 - set_local $17 + local.set $17 br $break|1 unreachable end unreachable end - get_local $17 - get_local $15 + local.get $17 + local.get $15 i32.or if - get_local $0 + local.get $0 block (result i32) - get_local $15 - tee_local $18 + local.get $15 + local.tee $18 i32.const 1 i32.add - set_local $15 - get_local $18 + local.set $15 + local.get $18 end i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 - get_local $17 + global.get $~lib/internal/string/CharCode._0 + local.get $17 i32.const 65535 i32.and i32.add i32.store16 offset=4 end - get_local $14 + local.get $14 i32.const 1 i32.sub - set_local $14 - get_local $12 - i64.extend_u/i32 - get_local $7 - i64.extend_s/i32 + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s i64.shl - get_local $13 + local.get $13 i64.add - set_local $19 - get_local $19 - get_local $5 + local.set $19 + local.get $19 + local.get $5 i64.le_u if - get_global $~lib/internal/number/_K - get_local $14 + global.get $~lib/internal/number/_K + local.get $14 i32.add - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) i32.const 0 - set_local $18 - get_local $16 - get_local $14 + local.set $18 + local.get $16 + local.get $14 i32.const 2 i32.shl i32.add - get_local $18 + local.get $18 i32.add i64.load32_u offset=8 end - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.shl - set_local $20 - get_local $0 - get_local $15 + local.set $20 + local.get $0 + local.get $15 i32.const 1 i32.sub i32.const 1 i32.shl i32.add - set_local $18 - get_local $18 + local.set $18 + local.get $18 i32.load16_u offset=4 - set_local $21 + local.set $21 block $break|2 loop $continue|2 - get_local $19 - get_local $10 + local.get $19 + local.get $10 i64.lt_u - tee_local $22 + local.tee $22 if (result i32) - get_local $5 - get_local $19 + local.get $5 + local.get $19 i64.sub - get_local $20 + local.get $20 i64.ge_u else - get_local $22 + local.get $22 end - tee_local $22 + local.tee $22 if (result i32) - get_local $19 - get_local $20 + local.get $19 + local.get $20 i64.add - get_local $10 + local.get $10 i64.lt_u - tee_local $22 + local.tee $22 if (result i32) - get_local $22 + local.get $22 else - get_local $10 - get_local $19 + local.get $10 + local.get $19 i64.sub - get_local $19 - get_local $20 + local.get $19 + local.get $20 i64.add - get_local $10 + local.get $10 i64.sub i64.gt_u end else - get_local $22 + local.get $22 end if block - get_local $21 + local.get $21 i32.const 1 i32.sub - set_local $21 - get_local $19 - get_local $20 + local.set $21 + local.get $19 + local.get $20 i64.add - set_local $19 + local.set $19 end br $continue|2 end end end - get_local $18 - get_local $21 + local.get $18 + local.get $21 i32.store16 offset=4 - get_local $15 + local.get $15 return end end @@ -1020,150 +1020,150 @@ i32.const 1 if block - get_local $13 + local.get $13 i64.const 10 i64.mul - set_local $13 - get_local $5 + local.set $13 + local.get $5 i64.const 10 i64.mul - set_local $5 - get_local $13 - get_local $7 - i64.extend_s/i32 + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s i64.shr_u - set_local $19 - get_local $19 - get_local $15 - i64.extend_s/i32 + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s i64.or i64.const 0 i64.ne if - get_local $0 + local.get $0 block (result i32) - get_local $15 - tee_local $17 + local.get $15 + local.tee $17 i32.const 1 i32.add - set_local $15 - get_local $17 + local.set $15 + local.get $17 end i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 - get_local $19 - i32.wrap/i64 + global.get $~lib/internal/string/CharCode._0 + local.get $19 + i32.wrap_i64 i32.const 65535 i32.and i32.add i32.store16 offset=4 end - get_local $13 - get_local $9 + local.get $13 + local.get $9 i64.and - set_local $13 - get_local $14 + local.set $13 + local.get $14 i32.const 1 i32.sub - set_local $14 - get_local $13 - get_local $5 + local.set $14 + local.get $13 + local.get $5 i64.lt_u if - get_global $~lib/internal/number/_K - get_local $14 + global.get $~lib/internal/number/_K + local.get $14 i32.add - set_global $~lib/internal/number/_K - get_local $10 + global.set $~lib/internal/number/_K + local.get $10 block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) i32.const 0 - get_local $14 + local.get $14 i32.sub - set_local $17 + local.set $17 i32.const 0 - set_local $21 - get_local $16 - get_local $17 + local.set $21 + local.get $16 + local.get $17 i32.const 2 i32.shl i32.add - get_local $21 + local.get $21 i32.add i64.load32_u offset=8 end i64.mul - set_local $10 - get_local $0 - get_local $15 + local.set $10 + local.get $0 + local.get $15 i32.const 1 i32.sub i32.const 1 i32.shl i32.add - set_local $21 - get_local $21 + local.set $21 + local.get $21 i32.load16_u offset=4 - set_local $17 + local.set $17 block $break|4 loop $continue|4 - get_local $13 - get_local $10 + local.get $13 + local.get $10 i64.lt_u - tee_local $18 + local.tee $18 if (result i32) - get_local $5 - get_local $13 + local.get $5 + local.get $13 i64.sub - get_local $8 + local.get $8 i64.ge_u else - get_local $18 + local.get $18 end - tee_local $18 + local.tee $18 if (result i32) - get_local $13 - get_local $8 + local.get $13 + local.get $8 i64.add - get_local $10 + local.get $10 i64.lt_u - tee_local $18 + local.tee $18 if (result i32) - get_local $18 + local.get $18 else - get_local $10 - get_local $13 + local.get $10 + local.get $13 i64.sub - get_local $13 - get_local $8 + local.get $13 + local.get $8 i64.add - get_local $10 + local.get $10 i64.sub i64.gt_u end else - get_local $18 + local.get $18 end if block - get_local $17 + local.get $17 i32.const 1 i32.sub - set_local $17 - get_local $13 - get_local $8 + local.set $17 + local.get $13 + local.get $8 i64.add - set_local $13 + local.set $13 end br $continue|4 end end end - get_local $21 - get_local $17 + local.get $21 + local.get $17 i32.store16 offset=4 - get_local $15 + local.get $15 return end end @@ -1171,7 +1171,7 @@ end end end - get_local $15 + local.get $15 ) (func $~lib/internal/memory/memcpy (; 13 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -1179,44 +1179,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -1224,141 +1224,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -1366,167 +1366,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -1538,130 +1538,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -1673,112 +1673,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -1790,585 +1790,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -2376,77 +2376,77 @@ ) (func $~lib/internal/memory/memmove (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -2457,27 +2457,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -2486,67 +2486,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2557,20 +2557,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -2582,16 +2582,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2608,330 +2608,330 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $2 + local.get $2 i32.eqz if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode._0 i32.const 16 i32.shl i32.or i32.store offset=4 - get_local $1 + local.get $1 i32.const 2 i32.add return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - set_local $3 - get_local $1 - get_local $3 + local.set $3 + local.get $1 + local.get $3 i32.le_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 21 i32.le_s else - get_local $4 + local.get $4 end if block $break|0 - get_local $1 - set_local $4 + local.get $1 + local.set $4 loop $repeat|0 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end unreachable end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode._0 i32.const 16 i32.shl i32.or i32.store offset=4 - get_local $3 + local.get $3 i32.const 2 i32.add return else - get_local $3 + local.get $3 i32.const 0 i32.gt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 21 i32.le_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - set_local $4 - get_local $4 - get_global $~lib/internal/string/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 2 i32.add - set_local $5 - get_local $4 - get_global $~lib/internal/string/HEADER_SIZE + local.set $5 + local.get $4 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 + local.set $6 i32.const 0 - get_local $2 + local.get $2 i32.sub i32.const 1 i32.shl - set_local $7 - get_local $5 - get_local $6 - get_local $7 + local.set $7 + local.get $5 + local.get $6 + local.get $7 call $~lib/internal/memory/memmove - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode.DOT i32.store16 offset=4 - get_local $1 + local.get $1 i32.const 1 i32.add return else i32.const -6 - get_local $3 + local.get $3 i32.lt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 0 i32.le_s else - get_local $4 + local.get $4 end if i32.const 2 - get_local $3 + local.get $3 i32.sub - set_local $4 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - get_local $4 + local.get $4 i32.const 1 i32.shl i32.add - set_local $7 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $1 + local.set $6 + local.get $1 i32.const 1 i32.shl - set_local $5 - get_local $7 - get_local $6 - get_local $5 + local.set $5 + local.get $7 + local.get $6 + local.get $5 call $~lib/internal/memory/memmove - get_local $0 - get_global $~lib/internal/string/CharCode._0 - get_global $~lib/internal/string/CharCode.DOT + local.get $0 + global.get $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT i32.const 16 i32.shl i32.or i32.store offset=4 block $break|1 i32.const 2 - set_local $5 + local.set $5 loop $repeat|1 - get_local $5 - get_local $4 + local.get $5 + local.get $4 i32.lt_s i32.eqz br_if $break|1 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|1 unreachable end unreachable end - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add return else - get_local $1 + local.get $1 i32.const 1 i32.eq if - get_local $0 - get_global $~lib/internal/string/CharCode.e + local.get $0 + global.get $~lib/internal/string/CharCode.e i32.store16 offset=6 block $~lib/internal/number/genExponent|inlined.0 (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1 i32.sub - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.lt_s - set_local $6 - get_local $6 + local.set $6 + local.get $6 if i32.const 0 - get_local $5 + local.get $5 i32.sub - set_local $5 + local.set $5 end - get_local $5 + local.get $5 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - set_local $7 - get_local $4 - get_local $5 - get_local $7 + local.set $7 + local.get $4 + local.get $5 + local.get $7 call $~lib/internal/number/utoa32_lut - get_local $4 - get_global $~lib/internal/string/CharCode.MINUS - get_global $~lib/internal/string/CharCode.PLUS - get_local $6 + local.get $4 + global.get $~lib/internal/string/CharCode.MINUS + global.get $~lib/internal/string/CharCode.PLUS + local.get $6 select i32.store16 offset=4 - get_local $7 + local.get $7 end - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 2 i32.add return else - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $7 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 4 i32.add - set_local $6 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $6 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 2 i32.add - set_local $5 - get_local $7 + local.set $5 + local.get $7 i32.const 2 i32.sub - set_local $4 - get_local $6 - get_local $5 - get_local $4 + local.set $4 + local.get $6 + local.get $5 + local.get $4 call $~lib/internal/memory/memmove - get_local $0 - get_global $~lib/internal/string/CharCode.DOT + local.get $0 + global.get $~lib/internal/string/CharCode.DOT i32.store16 offset=6 - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.add - get_global $~lib/internal/string/CharCode.e + global.get $~lib/internal/string/CharCode.e i32.store16 offset=6 - get_local $1 + local.get $1 block $~lib/internal/number/genExponent|inlined.1 (result i32) - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.add i32.const 4 i32.add - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1 i32.sub - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.lt_s - set_local $6 - get_local $6 + local.set $6 + local.get $6 if i32.const 0 - get_local $5 + local.get $5 i32.sub - set_local $5 + local.set $5 end - get_local $5 + local.get $5 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - set_local $8 - get_local $4 - get_local $5 - get_local $8 + local.set $8 + local.get $4 + local.get $5 + local.get $8 call $~lib/internal/number/utoa32_lut - get_local $4 - get_global $~lib/internal/string/CharCode.MINUS - get_global $~lib/internal/string/CharCode.PLUS - get_local $6 + local.get $4 + global.get $~lib/internal/string/CharCode.MINUS + global.get $~lib/internal/string/CharCode.PLUS + local.get $6 select i32.store16 offset=4 - get_local $8 + local.get $8 end i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 2 i32.add return @@ -2970,46 +2970,46 @@ (local $23 i64) (local $24 i64) (local $25 i32) - get_local $1 + local.get $1 f64.const 0 f64.lt - set_local $2 - get_local $2 + local.set $2 + local.get $2 if - get_local $1 + local.get $1 f64.neg - set_local $1 - get_local $0 - get_global $~lib/internal/string/CharCode.MINUS + local.set $1 + local.get $0 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end block $~lib/internal/number/grisu2|inlined.0 (result i32) - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $3 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $3 i64.const 9218868437227405312 i64.and i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $3 + i32.wrap_i64 + local.set $4 + local.get $3 i64.const 4503599627370495 i64.and - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 0 i32.ne - i64.extend_u/i32 + i64.extend_i32_u i64.const 52 i64.shl - get_local $5 + local.get $5 i64.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 - get_local $4 + local.get $4 i32.const 0 i32.ne select @@ -3017,400 +3017,400 @@ i32.const 52 i32.add i32.sub - set_local $4 + local.set $4 block - get_local $6 + local.get $6 i64.const 1 i64.shl i64.const 1 i64.add - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.const 1 i32.sub - set_local $8 - get_local $7 + local.set $8 + local.get $7 i64.clz - i32.wrap/i64 - set_local $9 - get_local $7 - get_local $9 - i64.extend_s/i32 + i32.wrap_i64 + local.set $9 + local.get $7 + local.get $9 + i64.extend_i32_s i64.shl - set_local $7 - get_local $8 - get_local $9 + local.set $7 + local.get $8 + local.get $9 i32.sub - set_local $8 + local.set $8 i32.const 1 - get_local $6 + local.get $6 i64.const 4503599627370496 i64.eq i32.add - set_local $10 - get_local $7 - set_global $~lib/internal/number/_frc_plus - get_local $6 - get_local $10 - i64.extend_s/i32 + local.set $10 + local.get $7 + global.set $~lib/internal/number/_frc_plus + local.get $6 + local.get $10 + i64.extend_i32_s i64.shl i64.const 1 i64.sub - get_local $4 - get_local $10 + local.get $4 + local.get $10 i32.sub - get_local $8 + local.get $8 i32.sub - i64.extend_s/i32 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_minus - get_local $8 - set_global $~lib/internal/number/_exp + global.set $~lib/internal/number/_frc_minus + local.get $8 + global.set $~lib/internal/number/_exp end block - get_global $~lib/internal/number/_exp - set_local $10 + global.get $~lib/internal/number/_exp + local.set $10 i32.const -61 - get_local $10 + local.get $10 i32.sub - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.30102999566398114 f64.mul f64.const 347 f64.add - set_local $11 - get_local $11 - i32.trunc_s/f64 - set_local $9 - get_local $9 - get_local $9 - f64.convert_s/i32 - get_local $11 + local.set $11 + local.get $11 + i32.trunc_f64_s + local.set $9 + local.get $9 + local.get $9 + f64.convert_i32_s + local.get $11 f64.ne i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 i32.const 3 i32.shr_s i32.const 1 i32.add - set_local $8 + local.set $8 i32.const 348 - get_local $8 + local.get $8 i32.const 3 i32.shl i32.sub - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K block $~lib/internal/number/FRC_POWERS|inlined.0 (result i32) i32.const 1728 end i32.load - set_local $12 + local.set $12 block $~lib/internal/number/EXP_POWERS|inlined.0 (result i32) i32.const 1992 end i32.load - set_local $13 + local.set $13 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 - set_local $14 - get_local $12 - get_local $8 + local.set $14 + local.get $12 + local.get $8 i32.const 3 i32.shl i32.add - get_local $14 + local.get $14 i32.add i64.load offset=8 end - set_global $~lib/internal/number/_frc_pow + global.set $~lib/internal/number/_frc_pow block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $14 - get_local $13 - get_local $8 + local.set $14 + local.get $13 + local.get $8 i32.const 1 i32.shl i32.add - get_local $14 + local.get $14 i32.add i32.load16_s offset=8 end - set_global $~lib/internal/number/_exp_pow + global.set $~lib/internal/number/_exp_pow end - get_local $6 + local.get $6 i64.clz - i32.wrap/i64 - set_local $13 - get_local $6 - get_local $13 - i64.extend_s/i32 + i32.wrap_i64 + local.set $13 + local.get $6 + local.get $13 + i64.extend_i32_s i64.shl - set_local $6 - get_local $4 - get_local $13 + local.set $6 + local.get $4 + local.get $13 i32.sub - set_local $4 - get_global $~lib/internal/number/_frc_pow - set_local $7 - get_global $~lib/internal/number/_exp_pow - set_local $12 + local.set $4 + global.get $~lib/internal/number/_frc_pow + local.set $7 + global.get $~lib/internal/number/_exp_pow + local.set $12 block $~lib/internal/number/umul64f|inlined.0 (result i64) - get_local $6 + local.get $6 i64.const 4294967295 i64.and - set_local $15 - get_local $7 + local.set $15 + local.get $7 i64.const 4294967295 i64.and - set_local $16 - get_local $6 + local.set $16 + local.get $6 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $18 - get_local $15 - get_local $16 + local.set $18 + local.get $15 + local.get $16 i64.mul - set_local $19 - get_local $17 - get_local $16 + local.set $19 + local.get $17 + local.get $16 i64.mul - get_local $19 + local.get $19 i64.const 32 i64.shr_u i64.add - set_local $20 - get_local $15 - get_local $18 + local.set $20 + local.get $15 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.const 4294967295 i64.and i64.add - set_local $21 - get_local $21 + local.set $21 + local.get $21 i64.const 2147483647 i64.add - set_local $21 - get_local $20 + local.set $21 + local.get $20 i64.const 32 i64.shr_u - set_local $20 - get_local $21 + local.set $20 + local.get $21 i64.const 32 i64.shr_u - set_local $21 - get_local $17 - get_local $18 + local.set $21 + local.get $17 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.add - get_local $21 + local.get $21 i64.add end - set_local $21 + local.set $21 block $~lib/internal/number/umul64e|inlined.0 (result i32) - get_local $4 - get_local $12 + local.get $4 + local.get $12 i32.add i32.const 64 i32.add end - set_local $8 + local.set $8 block $~lib/internal/number/umul64f|inlined.1 (result i64) - get_global $~lib/internal/number/_frc_plus - set_local $20 - get_local $20 + global.get $~lib/internal/number/_frc_plus + local.set $20 + local.get $20 i64.const 4294967295 i64.and - set_local $19 - get_local $7 + local.set $19 + local.get $7 i64.const 4294967295 i64.and - set_local $18 - get_local $20 + local.set $18 + local.get $20 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $16 - get_local $19 - get_local $18 + local.set $16 + local.get $19 + local.get $18 i64.mul - set_local $15 - get_local $17 - get_local $18 + local.set $15 + local.get $17 + local.get $18 i64.mul - get_local $15 + local.get $15 i64.const 32 i64.shr_u i64.add - set_local $22 - get_local $19 - get_local $16 + local.set $22 + local.get $19 + local.get $16 i64.mul - get_local $22 + local.get $22 i64.const 4294967295 i64.and i64.add - set_local $23 - get_local $23 + local.set $23 + local.get $23 i64.const 2147483647 i64.add - set_local $23 - get_local $22 + local.set $23 + local.get $22 i64.const 32 i64.shr_u - set_local $22 - get_local $23 + local.set $22 + local.get $23 i64.const 32 i64.shr_u - set_local $23 - get_local $17 - get_local $16 + local.set $23 + local.get $17 + local.get $16 i64.mul - get_local $22 + local.get $22 i64.add - get_local $23 + local.get $23 i64.add end i64.const 1 i64.sub - set_local $23 + local.set $23 block $~lib/internal/number/umul64e|inlined.1 (result i32) - get_global $~lib/internal/number/_exp - set_local $9 - get_local $9 - get_local $12 + global.get $~lib/internal/number/_exp + local.set $9 + local.get $9 + local.get $12 i32.add i32.const 64 i32.add end - set_local $9 + local.set $9 block $~lib/internal/number/umul64f|inlined.2 (result i64) - get_global $~lib/internal/number/_frc_minus - set_local $22 - get_local $22 + global.get $~lib/internal/number/_frc_minus + local.set $22 + local.get $22 i64.const 4294967295 i64.and - set_local $15 - get_local $7 + local.set $15 + local.get $7 i64.const 4294967295 i64.and - set_local $16 - get_local $22 + local.set $16 + local.get $22 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $18 - get_local $15 - get_local $16 + local.set $18 + local.get $15 + local.get $16 i64.mul - set_local $19 - get_local $17 - get_local $16 + local.set $19 + local.get $17 + local.get $16 i64.mul - get_local $19 + local.get $19 i64.const 32 i64.shr_u i64.add - set_local $20 - get_local $15 - get_local $18 + local.set $20 + local.get $15 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.const 4294967295 i64.and i64.add - set_local $24 - get_local $24 + local.set $24 + local.get $24 i64.const 2147483647 i64.add - set_local $24 - get_local $20 + local.set $24 + local.get $20 i64.const 32 i64.shr_u - set_local $20 - get_local $24 + local.set $20 + local.get $24 i64.const 32 i64.shr_u - set_local $24 - get_local $17 - get_local $18 + local.set $24 + local.get $17 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.add - get_local $24 + local.get $24 i64.add end i64.const 1 i64.add - set_local $24 - get_local $23 - get_local $24 + local.set $24 + local.get $23 + local.get $24 i64.sub - set_local $20 - get_local $0 - get_local $21 - get_local $8 - get_local $23 - get_local $9 - get_local $20 - get_local $2 + local.set $20 + local.get $0 + local.get $21 + local.get $8 + local.get $23 + local.get $9 + local.get $20 + local.get $2 call $~lib/internal/number/genDigits end - set_local $25 - get_local $0 - get_local $2 + local.set $25 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $25 - get_local $2 + local.get $25 + local.get $2 i32.sub - get_global $~lib/internal/number/_K + global.get $~lib/internal/number/_K call $~lib/internal/number/prettify - set_local $25 - get_local $25 - get_local $2 + local.set $25 + local.get $25 + local.get $2 i32.add ) (func $~lib/internal/string/copyUnsafe (; 17 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $5 - get_local $2 - get_local $3 + local.set $5 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.shl - set_local $7 - get_local $5 - get_local $6 - get_local $7 + local.set $7 + local.get $5 + local.get $6 + local.get $7 call $~lib/internal/memory/memmove ) (func $~lib/string/String#substring (; 18 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -3422,7 +3422,7 @@ (local $8 i32) (local $9 i32) (local $10 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -3434,94 +3434,94 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 - tee_local $4 + local.set $3 + local.get $1 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $6 - get_local $2 - tee_local $4 + local.set $6 + local.get $2 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $7 - get_local $6 - tee_local $4 - get_local $7 - tee_local $5 - get_local $4 - get_local $5 + 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 - set_local $8 - get_local $6 - tee_local $4 - get_local $7 - tee_local $5 - get_local $4 - get_local $5 + 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 - set_local $9 - get_local $9 - get_local $8 + local.set $9 + local.get $9 + local.get $8 i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if i32.const 2104 return end - get_local $8 + local.get $8 i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $9 - get_local $0 + local.get $9 + local.get $0 i32.load i32.eq else - get_local $4 + local.get $4 end if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - set_local $10 - get_local $10 + local.set $10 + local.get $10 i32.const 0 - get_local $0 - get_local $8 - get_local $3 + local.get $0 + local.get $8 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $10 + local.get $10 ) (func $~lib/allocator/arena/__memory_free (; 19 ;) (type $iv) (param $0 i32) nop @@ -3530,18 +3530,18 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 f64.const 0 f64.eq if i32.const 624 return end - get_local $0 + local.get $0 call $~lib/builtins/isFinite i32.eqz if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if i32.const 640 @@ -3549,25 +3549,25 @@ end i32.const 656 i32.const 680 - get_local $0 + local.get $0 f64.const 0 f64.lt select return end - get_global $~lib/internal/number/MAX_DOUBLE_LENGTH + global.get $~lib/internal/number/MAX_DOUBLE_LENGTH call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 call $~lib/internal/number/dtoa_core - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 - get_local $2 + local.get $2 call $~lib/string/String#substring - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.eqz if i32.const 0 @@ -3579,21 +3579,21 @@ end block $~lib/memory/memory.free|inlined.0 block - get_local $1 + local.get $1 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $~lib/number/F64#toString (; 21 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 + local.get $0 call $~lib/internal/number/dtoa ) (func $~lib/number/Bool#toString (; 22 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne if (result i32) @@ -3604,93 +3604,93 @@ ) (func $~lib/number/F32.isSafeInteger (; 23 ;) (type $fi) (param $0 f32) (result i32) (local $1 i32) - get_local $0 + local.get $0 f32.abs - get_global $~lib/builtins/f32.MAX_SAFE_INTEGER + global.get $~lib/builtins/f32.MAX_SAFE_INTEGER f32.le - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 f32.trunc - get_local $0 + local.get $0 f32.eq else - get_local $1 + local.get $1 end ) (func $~lib/number/F32.isInteger (; 24 ;) (type $fi) (param $0 f32) (result i32) (local $1 i32) block $~lib/builtins/isFinite|inlined.0 (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.eq end - tee_local $1 + local.tee $1 i32.const 0 i32.ne if (result i32) - get_local $0 + local.get $0 f32.trunc - get_local $0 + local.get $0 f32.eq else - get_local $1 + local.get $1 end ) (func $~lib/number/F64.isSafeInteger (; 25 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i32) - get_local $0 + local.get $0 f64.abs - get_global $~lib/builtins/f64.MAX_SAFE_INTEGER + global.get $~lib/builtins/f64.MAX_SAFE_INTEGER f64.le - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 f64.trunc - get_local $0 + local.get $0 f64.eq else - get_local $1 + local.get $1 end ) (func $~lib/number/F64.isInteger (; 26 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i32) block $~lib/builtins/isFinite|inlined.0 (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.eq end - tee_local $1 + local.tee $1 i32.const 0 i32.ne if (result i32) - get_local $0 + local.get $0 f64.trunc - get_local $0 + local.get $0 f64.eq else - get_local $1 + local.get $1 end ) (func $start (; 27 ;) (type $v) (local $0 i32) (local $1 f32) (local $2 f64) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $number/a + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $number/a call $~lib/number/I32#toString i32.const 592 call $~lib/string/String.__eq @@ -3756,11 +3756,11 @@ unreachable end block (result i32) - get_global $number/a + global.get $number/a i32.const 1 i32.add - set_global $number/a - get_global $number/a + global.set $number/a + global.get $number/a end call $~lib/number/I32#toString i32.const 2152 @@ -3775,11 +3775,11 @@ unreachable end block (result i32) - get_global $number/a + global.get $number/a i32.const 1 i32.sub - set_global $number/a - get_global $number/a + global.set $number/a + global.get $number/a end call $~lib/number/I32#toString i32.const 592 @@ -3822,12 +3822,12 @@ unreachable end block (result i32) - get_global $number/a - tee_local $0 + global.get $number/a + local.tee $0 i32.const 1 i32.add - set_global $number/a - get_local $0 + global.set $number/a + local.get $0 end call $~lib/number/I32#toString i32.const 592 @@ -3842,12 +3842,12 @@ unreachable end block (result i32) - get_global $number/a - tee_local $0 + global.get $number/a + local.tee $0 i32.const 1 i32.sub - set_global $number/a - get_local $0 + global.set $number/a + local.get $0 end call $~lib/number/I32#toString i32.const 2152 @@ -3862,10 +3862,10 @@ unreachable end block $~lib/builtins/isNaN|inlined.0 (result i32) - get_global $~lib/number/F32.NaN - set_local $1 - get_local $1 - get_local $1 + global.get $~lib/number/F32.NaN + local.set $1 + local.get $1 + local.get $1 f32.ne end i32.const 0 @@ -3879,7 +3879,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MIN_SAFE_INTEGER + global.get $~lib/builtins/f32.MIN_SAFE_INTEGER f32.const 1 f32.sub call $~lib/number/F32.isSafeInteger @@ -3894,7 +3894,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MIN_SAFE_INTEGER + global.get $~lib/builtins/f32.MIN_SAFE_INTEGER call $~lib/number/F32.isSafeInteger i32.const 1 i32.eq @@ -3959,7 +3959,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MAX_SAFE_INTEGER + global.get $~lib/builtins/f32.MAX_SAFE_INTEGER call $~lib/number/F32.isSafeInteger i32.const 1 i32.eq @@ -3972,7 +3972,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MAX_SAFE_INTEGER + global.get $~lib/builtins/f32.MAX_SAFE_INTEGER f32.const 1 f32.add call $~lib/number/F32.isSafeInteger @@ -4060,7 +4060,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.EPSILON + global.get $~lib/builtins/f32.EPSILON call $~lib/number/F32.isInteger i32.const 0 i32.ne @@ -4105,7 +4105,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MIN_SAFE_INTEGER + global.get $~lib/builtins/f32.MIN_SAFE_INTEGER call $~lib/number/F32.isInteger i32.const 0 i32.ne @@ -4120,7 +4120,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MAX_SAFE_INTEGER + global.get $~lib/builtins/f32.MAX_SAFE_INTEGER call $~lib/number/F32.isInteger i32.const 0 i32.ne @@ -4166,10 +4166,10 @@ unreachable end block $~lib/builtins/isNaN|inlined.0 (result i32) - get_global $~lib/number/F64.NaN - set_local $2 - get_local $2 - get_local $2 + global.get $~lib/number/F64.NaN + local.set $2 + local.get $2 + local.get $2 f64.ne end i32.const 0 @@ -4183,7 +4183,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_SAFE_INTEGER + global.get $~lib/builtins/f64.MIN_SAFE_INTEGER f64.const 1 f64.sub call $~lib/number/F64.isSafeInteger @@ -4198,7 +4198,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_SAFE_INTEGER + global.get $~lib/builtins/f64.MIN_SAFE_INTEGER call $~lib/number/F64.isSafeInteger i32.const 1 i32.eq @@ -4263,7 +4263,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_SAFE_INTEGER + global.get $~lib/builtins/f64.MAX_SAFE_INTEGER call $~lib/number/F64.isSafeInteger i32.const 1 i32.eq @@ -4276,7 +4276,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_SAFE_INTEGER + global.get $~lib/builtins/f64.MAX_SAFE_INTEGER f64.const 1 f64.add call $~lib/number/F64.isSafeInteger @@ -4364,7 +4364,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.EPSILON + global.get $~lib/builtins/f64.EPSILON call $~lib/number/F64.isInteger i32.const 0 i32.ne @@ -4409,7 +4409,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_SAFE_INTEGER + global.get $~lib/builtins/f64.MIN_SAFE_INTEGER call $~lib/number/F64.isInteger i32.const 0 i32.ne @@ -4424,7 +4424,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_SAFE_INTEGER + global.get $~lib/builtins/f64.MAX_SAFE_INTEGER call $~lib/number/F64.isInteger i32.const 0 i32.ne diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index d253c75d..ba3b093b 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -9,7 +9,7 @@ (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 anyfunc) + (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)) @@ -20,17 +20,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -39,16 +39,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -56,16 +56,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -74,57 +74,57 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/string/compareUnsafe (; 2 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $0 + local.get $0 i32.load16_u offset=4 - get_local $1 + local.get $1 i32.load16_u offset=4 i32.sub - tee_local $3 + local.tee $3 i32.eqz else - get_local $2 + local.get $2 end if - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 br $continue|0 end end - get_local $3 + local.get $3 ) (func $~lib/string/String.__eq (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 8 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz - tee_local $1 + local.tee $1 if (result i32) - get_local $1 + local.get $1 else i32.const 0 end @@ -132,9 +132,9 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - tee_local $1 + local.tee $1 i32.const 8 i32.load i32.ne @@ -142,14 +142,14 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.const 8 - get_local $1 + local.get $1 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $object-literal/bar (; 4 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.load i32.const 1 i32.ne @@ -161,7 +161,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 call $~lib/string/String.__eq i32.eqz @@ -177,25 +177,25 @@ (func $start (; 5 ;) (type $v) (local $0 i32) i32.const 80 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 - tee_local $0 + local.tee $0 i32.const 1 i32.store - get_local $0 + local.get $0 i32.const 8 i32.store offset=4 - get_local $0 + local.get $0 call $object-literal/bar i32.const 4 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 2 i32.store - get_local $0 + local.get $0 i32.load i32.const 2 i32.ne @@ -209,10 +209,10 @@ end i32.const 4 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 3 i32.store - get_local $0 + local.get $0 i32.load i32.const 3 i32.ne diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat index 762d6c4b..df2a601a 100644 --- a/tests/compiler/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -9,7 +9,7 @@ (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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -29,41 +29,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -73,22 +73,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -97,12 +97,12 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) @@ -111,72 +111,72 @@ (local $6 i32) (local $7 i32) i32.const 0 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_local $3 + local.set $6 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|0 loop $continue|0 - get_local $4 + local.get $4 if (result i32) - get_local $6 + local.get $6 i32.load16_u offset=4 - get_local $7 + local.get $7 i32.load16_u offset=4 i32.sub - tee_local $5 + local.tee $5 i32.eqz else - get_local $4 + local.get $4 end if block - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2 i32.add - set_local $6 - get_local $7 + local.set $6 + local.get $7 i32.const 2 i32.add - set_local $7 + local.set $7 end br $continue|0 end end end - get_local $5 + local.get $5 ) (func $~lib/string/String.__eq (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -184,27 +184,27 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $object-literal/bar (; 5 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.load i32.const 1 i32.eq @@ -217,7 +217,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 i32.const 8 call $~lib/string/String.__eq @@ -232,7 +232,7 @@ end ) (func $object-literal/bar2 (; 6 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.load i32.const 2 i32.eq @@ -247,7 +247,7 @@ end ) (func $object-literal/Foo2#test (; 7 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.load i32.const 3 i32.eq @@ -265,47 +265,47 @@ (local $0 i32) (local $1 i32) (local $2 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset block (result i32) i32.const 8 call $~lib/memory/memory.allocate - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 i32.const 8 i32.store offset=4 - get_local $0 + local.get $0 end call $object-literal/bar block (result i32) i32.const 4 call $~lib/memory/memory.allocate - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 2 i32.store - get_local $1 + local.get $1 end call $object-literal/bar2 block (result i32) i32.const 4 call $~lib/memory/memory.allocate - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 3 i32.store - get_local $2 + local.get $2 end call $object-literal/Foo2#test ) diff --git a/tests/compiler/optional-typeparameters.optimized.wat b/tests/compiler/optional-typeparameters.optimized.wat index a5269c56..3f544ed7 100644 --- a/tests/compiler/optional-typeparameters.optimized.wat +++ b/tests/compiler/optional-typeparameters.optimized.wat @@ -2,7 +2,7 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -15,17 +15,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -34,16 +34,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -51,16 +51,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -69,21 +69,21 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $start (; 1 ;) (type $v) i32.const 8 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 - set_global $optional-typeparameters/tConcrete + global.set $optional-typeparameters/tConcrete i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_global $optional-typeparameters/tDerived + global.set $optional-typeparameters/tDerived ) (func $null (; 2 ;) (type $v) nop diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat index bf14e9fb..1ec1017e 100644 --- a/tests/compiler/optional-typeparameters.untouched.wat +++ b/tests/compiler/optional-typeparameters.untouched.wat @@ -4,7 +4,7 @@ (type $iFFF (func (param i32 f64 f64) (result f64))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -19,10 +19,10 @@ (export "table" (table $0)) (start $start) (func $optional-typeparameters/testConcrete (; 0 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $optional-typeparameters/testDerived (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -31,41 +31,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -75,22 +75,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -99,43 +99,43 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $optional-typeparameters/TestConcrete#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $optional-typeparameters/TestConcrete#test (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add ) (func $optional-typeparameters/TestDerived#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $optional-typeparameters/TestDerived#test (; 7 ;) (type $iFFF) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) - get_local $1 - get_local $2 + local.get $1 + local.get $2 f64.add ) (func $start (; 8 ;) (type $v) @@ -145,28 +145,28 @@ i32.const 2 call $optional-typeparameters/testDerived drop - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 call $optional-typeparameters/TestConcrete#constructor - set_global $optional-typeparameters/tConcrete - get_global $optional-typeparameters/tConcrete + global.set $optional-typeparameters/tConcrete + global.get $optional-typeparameters/tConcrete i32.const 1 i32.const 2 call $optional-typeparameters/TestConcrete#test drop i32.const 0 call $optional-typeparameters/TestDerived#constructor - set_global $optional-typeparameters/tDerived - get_global $optional-typeparameters/tDerived + global.set $optional-typeparameters/tDerived + global.get $optional-typeparameters/tDerived f64.const 1 f64.const 2 call $optional-typeparameters/TestDerived#test diff --git a/tests/compiler/overflow.optimized.wat b/tests/compiler/overflow.optimized.wat index 350d5a5f..e05f5fe1 100644 --- a/tests/compiler/overflow.optimized.wat +++ b/tests/compiler/overflow.optimized.wat @@ -2,7 +2,7 @@ (type $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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/overflow.untouched.wat b/tests/compiler/overflow.untouched.wat index b29d6eae..8a4cfb5f 100644 --- a/tests/compiler/overflow.untouched.wat +++ b/tests/compiler/overflow.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 36)) (export "memory" (memory $0)) @@ -16,12 +16,12 @@ (local $2 i32) block i32.const 127 - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 1 i32.add - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -37,11 +37,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.sub - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -58,15 +58,15 @@ unreachable end block (result i32) - get_local $0 - tee_local $2 + local.get $0 + local.tee $2 i32.const 1 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 end - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -83,15 +83,15 @@ unreachable end block (result i32) - get_local $0 - tee_local $2 + local.get $0 + local.tee $2 i32.const 1 i32.sub - set_local $0 - get_local $2 + local.set $0 + local.get $2 end - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -107,11 +107,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -127,11 +127,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.sub - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -147,12 +147,12 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $0 - set_local $1 - get_local $0 + local.tee $0 + local.set $1 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -168,12 +168,12 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.sub - tee_local $0 - set_local $1 - get_local $0 + local.tee $0 + local.set $1 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -189,7 +189,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 24 @@ -210,12 +210,12 @@ end block i32.const 32767 - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -231,11 +231,11 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -252,15 +252,15 @@ unreachable end block (result i32) - get_local $1 - tee_local $2 + local.get $1 + local.tee $2 i32.const 1 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 end - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -277,15 +277,15 @@ unreachable end block (result i32) - get_local $1 - tee_local $2 + local.get $1 + local.tee $2 i32.const 1 i32.sub - set_local $1 - get_local $2 + local.set $1 + local.get $2 end - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -301,11 +301,11 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -321,11 +321,11 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -341,12 +341,12 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 + local.tee $1 + local.set $0 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -362,12 +362,12 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.sub - tee_local $1 - set_local $0 - get_local $1 + local.tee $1 + local.set $0 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -383,7 +383,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.add i32.const 16 @@ -404,12 +404,12 @@ end block i32.const 0 - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 1 i32.sub - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 255 i32.and i32.const 255 @@ -423,11 +423,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 255 i32.and i32.const 0 @@ -442,15 +442,15 @@ unreachable end block (result i32) - get_local $0 - tee_local $2 + local.get $0 + local.tee $2 i32.const 1 i32.sub - set_local $0 - get_local $2 + local.set $0 + local.get $2 end - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 255 i32.and i32.const 255 @@ -465,15 +465,15 @@ unreachable end block (result i32) - get_local $0 - tee_local $2 + local.get $0 + local.tee $2 i32.const 1 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 end - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 255 i32.and i32.const 0 @@ -487,11 +487,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.sub - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 255 i32.and i32.const 255 @@ -505,11 +505,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 255 i32.and i32.const 0 @@ -523,12 +523,12 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.sub - tee_local $0 - set_local $1 - get_local $0 + local.tee $0 + local.set $1 + local.get $0 i32.const 255 i32.and i32.const 255 @@ -542,12 +542,12 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $0 - set_local $1 - get_local $0 + local.tee $0 + local.set $1 + local.get $0 i32.const 255 i32.and i32.const 0 @@ -561,7 +561,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.sub i32.const 255 @@ -580,12 +580,12 @@ end block i32.const 0 - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 65535 i32.and i32.const 65535 @@ -599,11 +599,11 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 65535 i32.and i32.const 0 @@ -618,15 +618,15 @@ unreachable end block (result i32) - get_local $1 - tee_local $2 + local.get $1 + local.tee $2 i32.const 1 i32.sub - set_local $1 - get_local $2 + local.set $1 + local.get $2 end - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 65535 i32.and i32.const 65535 @@ -641,15 +641,15 @@ unreachable end block (result i32) - get_local $1 - tee_local $2 + local.get $1 + local.tee $2 i32.const 1 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 end - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 65535 i32.and i32.const 0 @@ -663,11 +663,11 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 65535 i32.and i32.const 65535 @@ -681,11 +681,11 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 65535 i32.and i32.const 0 @@ -699,12 +699,12 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.sub - tee_local $1 - set_local $0 - get_local $1 + local.tee $1 + local.set $0 + local.get $1 i32.const 65535 i32.and i32.const 65535 @@ -718,12 +718,12 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 + local.tee $1 + local.set $0 + local.get $1 i32.const 65535 i32.and i32.const 0 @@ -737,7 +737,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.sub i32.const 65535 diff --git a/tests/compiler/portable-conversions.optimized.wat b/tests/compiler/portable-conversions.optimized.wat index 4c0cd84a..7e6db38d 100644 --- a/tests/compiler/portable-conversions.optimized.wat +++ b/tests/compiler/portable-conversions.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -14,7 +14,7 @@ (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $v) - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 255 i32.and i32.eqz @@ -26,8 +26,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 255 i32.and i32.eqz @@ -39,8 +39,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.const 255 i32.and i32.eqz @@ -52,8 +52,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.const 255 i32.and i32.eqz @@ -65,7 +65,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 65535 i32.and i32.eqz @@ -77,8 +77,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 65535 i32.and i32.eqz @@ -90,8 +90,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.const 65535 i32.and i32.eqz @@ -103,8 +103,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.const 65535 i32.and i32.eqz @@ -116,7 +116,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -126,8 +126,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -137,8 +137,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.eqz if i32.const 0 @@ -148,8 +148,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.eqz if i32.const 0 @@ -159,8 +159,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - i64.extend_s/i32 + global.get $portable-conversions/i + i64.extend_i32_s i64.eqz if i32.const 0 @@ -170,7 +170,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I + global.get $portable-conversions/I i64.eqz if i32.const 0 @@ -180,8 +180,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i64.trunc_s/f32 + global.get $portable-conversions/f + i64.trunc_f32_s i64.eqz if i32.const 0 @@ -191,8 +191,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i64.trunc_s/f64 + global.get $portable-conversions/F + i64.trunc_f64_s i64.eqz if i32.const 0 @@ -202,7 +202,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -212,8 +212,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -223,8 +223,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.eqz if i32.const 0 @@ -234,8 +234,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.eqz if i32.const 0 @@ -245,7 +245,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 255 i32.and i32.eqz @@ -257,8 +257,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 255 i32.and i32.eqz @@ -270,8 +270,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.const 255 i32.and i32.eqz @@ -283,8 +283,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.const 255 i32.and i32.eqz @@ -296,7 +296,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 65535 i32.and i32.eqz @@ -308,8 +308,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 65535 i32.and i32.eqz @@ -321,8 +321,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.const 65535 i32.and i32.eqz @@ -334,8 +334,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.const 65535 i32.and i32.eqz @@ -347,7 +347,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -357,8 +357,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -368,8 +368,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.eqz if i32.const 0 @@ -379,8 +379,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.eqz if i32.const 0 @@ -390,8 +390,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - i64.extend_s/i32 + global.get $portable-conversions/i + i64.extend_i32_s i64.eqz if i32.const 0 @@ -401,7 +401,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I + global.get $portable-conversions/I i64.eqz if i32.const 0 @@ -411,8 +411,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i64.trunc_u/f32 + global.get $portable-conversions/f + i64.trunc_f32_u i64.eqz if i32.const 0 @@ -422,8 +422,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i64.trunc_u/f64 + global.get $portable-conversions/F + i64.trunc_f64_u i64.eqz if i32.const 0 @@ -433,7 +433,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -443,8 +443,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -454,8 +454,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.eqz if i32.const 0 @@ -465,8 +465,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.eqz if i32.const 0 @@ -476,7 +476,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -486,7 +486,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I + global.get $portable-conversions/I i64.const 0 i64.eq if @@ -497,7 +497,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f + global.get $portable-conversions/f f32.const 0 f32.eq if @@ -508,7 +508,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F + global.get $portable-conversions/F f64.const 0 f64.eq if @@ -519,8 +519,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - f32.convert_s/i32 + global.get $portable-conversions/i + f32.convert_i32_s f32.const 0 f32.eq if @@ -531,8 +531,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - f32.convert_s/i64 + global.get $portable-conversions/I + f32.convert_i64_s f32.const 0 f32.eq if @@ -543,7 +543,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f + global.get $portable-conversions/f f32.const 0 f32.eq if @@ -554,8 +554,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - f32.demote/f64 + global.get $portable-conversions/F + f32.demote_f64 f32.const 0 f32.eq if @@ -566,8 +566,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - f64.convert_s/i32 + global.get $portable-conversions/i + f64.convert_i32_s f64.const 0 f64.eq if @@ -578,8 +578,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - f64.convert_s/i64 + global.get $portable-conversions/I + f64.convert_i64_s f64.const 0 f64.eq if @@ -590,8 +590,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - f64.promote/f32 + global.get $portable-conversions/f + f64.promote_f32 f64.const 0 f64.eq if @@ -602,7 +602,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F + global.get $portable-conversions/F f64.const 0 f64.eq if diff --git a/tests/compiler/portable-conversions.untouched.wat b/tests/compiler/portable-conversions.untouched.wat index a65a7857..9ed0c58e 100644 --- a/tests/compiler/portable-conversions.untouched.wat +++ b/tests/compiler/portable-conversions.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (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)) @@ -15,7 +15,7 @@ (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $v) - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 24 i32.shl i32.const 24 @@ -29,8 +29,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 24 i32.shl i32.const 24 @@ -44,8 +44,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.const 24 i32.shl i32.const 24 @@ -59,8 +59,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.const 24 i32.shl i32.const 24 @@ -74,7 +74,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 16 i32.shl i32.const 16 @@ -88,8 +88,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 16 i32.shl i32.const 16 @@ -103,8 +103,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.const 16 i32.shl i32.const 16 @@ -118,8 +118,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.const 16 i32.shl i32.const 16 @@ -133,7 +133,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -143,8 +143,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -154,8 +154,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.eqz if i32.const 0 @@ -165,8 +165,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.eqz if i32.const 0 @@ -176,8 +176,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - i64.extend_s/i32 + global.get $portable-conversions/i + i64.extend_i32_s i64.eqz if i32.const 0 @@ -187,7 +187,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I + global.get $portable-conversions/I i64.eqz if i32.const 0 @@ -197,8 +197,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i64.trunc_s/f32 + global.get $portable-conversions/f + i64.trunc_f32_s i64.eqz if i32.const 0 @@ -208,8 +208,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i64.trunc_s/f64 + global.get $portable-conversions/F + i64.trunc_f64_s i64.eqz if i32.const 0 @@ -219,7 +219,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -229,8 +229,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -240,8 +240,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_s/f32 + global.get $portable-conversions/f + i32.trunc_f32_s i32.eqz if i32.const 0 @@ -251,8 +251,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_s/f64 + global.get $portable-conversions/F + i32.trunc_f64_s i32.eqz if i32.const 0 @@ -262,7 +262,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 255 i32.and i32.eqz @@ -274,8 +274,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 255 i32.and i32.eqz @@ -287,8 +287,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.const 255 i32.and i32.eqz @@ -300,8 +300,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.const 255 i32.and i32.eqz @@ -313,7 +313,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 65535 i32.and i32.eqz @@ -325,8 +325,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.const 65535 i32.and i32.eqz @@ -338,8 +338,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.const 65535 i32.and i32.eqz @@ -351,8 +351,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.const 65535 i32.and i32.eqz @@ -364,7 +364,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -374,8 +374,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -385,8 +385,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.eqz if i32.const 0 @@ -396,8 +396,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.eqz if i32.const 0 @@ -407,8 +407,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - i64.extend_s/i32 + global.get $portable-conversions/i + i64.extend_i32_s i64.eqz if i32.const 0 @@ -418,7 +418,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I + global.get $portable-conversions/I i64.eqz if i32.const 0 @@ -428,8 +428,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i64.trunc_u/f32 + global.get $portable-conversions/f + i64.trunc_f32_u i64.eqz if i32.const 0 @@ -439,8 +439,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i64.trunc_u/f64 + global.get $portable-conversions/F + i64.trunc_f64_u i64.eqz if i32.const 0 @@ -450,7 +450,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.eqz if i32.const 0 @@ -460,8 +460,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - i32.wrap/i64 + global.get $portable-conversions/I + i32.wrap_i64 i32.eqz if i32.const 0 @@ -471,8 +471,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - i32.trunc_u/f32 + global.get $portable-conversions/f + i32.trunc_f32_u i32.eqz if i32.const 0 @@ -482,8 +482,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - i32.trunc_u/f64 + global.get $portable-conversions/F + i32.trunc_f64_u i32.eqz if i32.const 0 @@ -493,7 +493,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i + global.get $portable-conversions/i i32.const 0 i32.ne i32.eqz @@ -505,7 +505,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I + global.get $portable-conversions/I i64.const 0 i64.ne i32.eqz @@ -517,7 +517,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f + global.get $portable-conversions/f f32.const 0 f32.ne i32.eqz @@ -529,7 +529,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F + global.get $portable-conversions/F f64.const 0 f64.ne i32.eqz @@ -541,8 +541,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - f32.convert_s/i32 + global.get $portable-conversions/i + f32.convert_i32_s f32.const 0 f32.eq if @@ -553,8 +553,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - f32.convert_s/i64 + global.get $portable-conversions/I + f32.convert_i64_s f32.const 0 f32.eq if @@ -565,7 +565,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f + global.get $portable-conversions/f f32.const 0 f32.eq if @@ -576,8 +576,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F - f32.demote/f64 + global.get $portable-conversions/F + f32.demote_f64 f32.const 0 f32.eq if @@ -588,8 +588,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/i - f64.convert_s/i32 + global.get $portable-conversions/i + f64.convert_i32_s f64.const 0 f64.eq if @@ -600,8 +600,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/I - f64.convert_s/i64 + global.get $portable-conversions/I + f64.convert_i64_s f64.const 0 f64.eq if @@ -612,8 +612,8 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/f - f64.promote/f32 + global.get $portable-conversions/f + f64.promote_f32 f64.const 0 f64.eq if @@ -624,7 +624,7 @@ call $~lib/env/abort unreachable end - get_global $portable-conversions/F + global.get $portable-conversions/F f64.const 0 f64.eq if diff --git a/tests/compiler/recursive.optimized.wat b/tests/compiler/recursive.optimized.wat index bb5cb972..9f16df3c 100644 --- a/tests/compiler/recursive.optimized.wat +++ b/tests/compiler/recursive.optimized.wat @@ -2,24 +2,24 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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 $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 1 i32.le_s if i32.const 1 return end - get_local $0 + local.get $0 i32.const 1 i32.sub call $recursive/fib - get_local $0 + local.get $0 i32.const 2 i32.sub call $recursive/fib diff --git a/tests/compiler/recursive.untouched.wat b/tests/compiler/recursive.untouched.wat index 272b6ce2..fff3e4ae 100644 --- a/tests/compiler/recursive.untouched.wat +++ b/tests/compiler/recursive.untouched.wat @@ -2,25 +2,25 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) (export "table" (table $0)) (export "fib" (func $recursive/fib)) (func $recursive/fib (; 0 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 1 i32.le_s if i32.const 1 return end - get_local $0 + local.get $0 i32.const 1 i32.sub call $recursive/fib - get_local $0 + local.get $0 i32.const 2 i32.sub call $recursive/fib diff --git a/tests/compiler/reexport.optimized.wat b/tests/compiler/reexport.optimized.wat index 4196ca80..b02d8708 100644 --- a/tests/compiler/reexport.optimized.wat +++ b/tests/compiler/reexport.optimized.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $export/ns.two) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -21,18 +21,18 @@ (export "rerenamed_sub" (func $export/mul)) (export "renamed_ns.two" (func $export/ns.two)) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul ) (func $export/ns.two (; 3 ;) (type $v) diff --git a/tests/compiler/reexport.untouched.wat b/tests/compiler/reexport.untouched.wat index eee052d9..13b3a97f 100644 --- a/tests/compiler/reexport.untouched.wat +++ b/tests/compiler/reexport.untouched.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -23,18 +23,18 @@ (export "renamed_ns.two" (func $export/ns.two)) (start $start) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul ) (func $export/ns.two (; 3 ;) (type $v) diff --git a/tests/compiler/rereexport.optimized.wat b/tests/compiler/rereexport.optimized.wat index 7442d4c3..b441dfea 100644 --- a/tests/compiler/rereexport.optimized.wat +++ b/tests/compiler/rereexport.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) diff --git a/tests/compiler/rereexport.untouched.wat b/tests/compiler/rereexport.untouched.wat index a4cbeeec..fa5edfcf 100644 --- a/tests/compiler/rereexport.untouched.wat +++ b/tests/compiler/rereexport.untouched.wat @@ -2,7 +2,7 @@ (type $iii (func (param i32 i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -16,13 +16,13 @@ (export "renamed_renamed_b" (global $export/b)) (start $start) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $export/mul (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul ) (func $start (; 2 ;) (type $v) diff --git a/tests/compiler/retain-i32.optimized.wat b/tests/compiler/retain-i32.optimized.wat index 86a9b35b..f4720bbf 100644 --- a/tests/compiler/retain-i32.optimized.wat +++ b/tests/compiler/retain-i32.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $retain-i32/si (mut i32) (i32.const 0)) (global $retain-i32/ui (mut i32) (i32.const 0)) @@ -14,22 +14,22 @@ (func $start (; 1 ;) (type $v) (local $0 i32) i32.const -128 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 + local.get $0 i32.const 255 i32.le_s if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end i32.const -1 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -1 i32.ne if @@ -41,8 +41,8 @@ unreachable end i32.const -1 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -1 i32.ne if @@ -54,8 +54,8 @@ unreachable end i32.const -2 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -2 i32.ne if @@ -67,8 +67,8 @@ unreachable end i32.const -128 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -128 i32.ne if @@ -80,8 +80,8 @@ unreachable end i32.const -128 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -128 i32.ne if @@ -93,8 +93,8 @@ unreachable end i32.const -127 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -127 i32.ne if @@ -106,8 +106,8 @@ unreachable end i32.const -128 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -128 i32.ne if @@ -119,8 +119,8 @@ unreachable end i32.const 1 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const 1 i32.ne if @@ -132,8 +132,8 @@ unreachable end i32.const 1 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const 1 i32.ne if @@ -145,8 +145,8 @@ unreachable end i32.const 0 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si if i32.const 0 i32.const 8 @@ -156,8 +156,8 @@ unreachable end i32.const 1 - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const 1 i32.ne if @@ -169,8 +169,8 @@ unreachable end i32.const 255 - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 255 i32.ne if @@ -182,8 +182,8 @@ unreachable end i32.const 255 - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 255 i32.ne if @@ -195,8 +195,8 @@ unreachable end i32.const 254 - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 254 i32.ne if @@ -208,8 +208,8 @@ unreachable end i32.const 1 - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 1 i32.ne if @@ -221,8 +221,8 @@ unreachable end i32.const 1 - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 1 i32.ne if @@ -234,8 +234,8 @@ unreachable end i32.const 1 - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 1 i32.ne if @@ -247,8 +247,8 @@ unreachable end i32.const 0 - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui if i32.const 0 i32.const 8 diff --git a/tests/compiler/retain-i32.untouched.wat b/tests/compiler/retain-i32.untouched.wat index 2c1e153d..eb6ae0db 100644 --- a/tests/compiler/retain-i32.untouched.wat +++ b/tests/compiler/retain-i32.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128)) @@ -23,15 +23,15 @@ (export "table" (table $0)) (start $start) (func $retain-i32/test (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 24 i32.shl @@ -47,15 +47,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub i32.const 24 i32.shl @@ -71,15 +71,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul i32.const 24 i32.shl @@ -95,15 +95,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.and i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.and i32.const 24 i32.shl @@ -119,15 +119,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.or i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.or i32.const 24 i32.shl @@ -143,15 +143,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.xor i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.xor i32.const 24 i32.shl @@ -167,15 +167,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.shl i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.shl i32.const 24 i32.shl @@ -191,13 +191,13 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 255 i32.and - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 255 i32.and @@ -211,13 +211,13 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub i32.const 255 i32.and - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub i32.const 255 i32.and @@ -231,13 +231,13 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul i32.const 255 i32.and - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.mul i32.const 255 i32.and @@ -251,13 +251,13 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.and i32.const 255 i32.and - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.and i32.const 255 i32.and @@ -271,13 +271,13 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.or i32.const 255 i32.and - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.or i32.const 255 i32.and @@ -291,13 +291,13 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.xor i32.const 255 i32.and - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.xor i32.const 255 i32.and @@ -311,13 +311,13 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.shl i32.const 255 i32.and - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.shl i32.const 255 i32.and @@ -335,125 +335,125 @@ (func $start (; 2 ;) (type $v) (local $0 i32) i32.const 0 - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE i32.const 0 call $retain-i32/test i32.const 1 - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE i32.const 1 call $retain-i32/test i32.const -1 - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE i32.const -1 call $retain-i32/test i32.const 0 - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE i32.const 0 call $retain-i32/test i32.const 1 - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE i32.const 1 call $retain-i32/test i32.const -1 - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE i32.const -1 call $retain-i32/test - get_global $~lib/builtins/i8.MAX_VALUE - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MAX_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MIN_VALUE - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MIN_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MAX_VALUE - get_global $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MIN_VALUE call $retain-i32/test - get_global $~lib/builtins/i8.MIN_VALUE - get_global $~lib/builtins/i8.MAX_VALUE + global.get $~lib/builtins/i8.MIN_VALUE + global.get $~lib/builtins/i8.MAX_VALUE call $retain-i32/test i32.const 0 - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE call $retain-i32/test - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE i32.const 0 call $retain-i32/test i32.const 1 - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE call $retain-i32/test - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE i32.const 1 call $retain-i32/test i32.const -1 - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE call $retain-i32/test - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE i32.const -1 call $retain-i32/test - get_global $~lib/builtins/u8.MAX_VALUE - get_global $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE + global.get $~lib/builtins/u8.MAX_VALUE call $retain-i32/test block $break|0 - get_global $~lib/builtins/i8.MIN_VALUE - set_local $0 + global.get $~lib/builtins/i8.MIN_VALUE + local.set $0 loop $repeat|0 - get_local $0 - get_global $~lib/builtins/u8.MAX_VALUE + local.get $0 + global.get $~lib/builtins/u8.MAX_VALUE i32.le_s i32.eqz br_if $break|0 block i32.const 0 - get_local $0 + local.get $0 call $retain-i32/test i32.const 1 - get_local $0 + local.get $0 call $retain-i32/test i32.const -1 - get_local $0 + local.get $0 call $retain-i32/test - get_global $~lib/builtins/i8.MIN_VALUE - get_local $0 + global.get $~lib/builtins/i8.MIN_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/i8.MAX_VALUE - get_local $0 + global.get $~lib/builtins/i8.MAX_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/u8.MAX_VALUE - get_local $0 + global.get $~lib/builtins/u8.MAX_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/i16.MIN_VALUE - get_local $0 + global.get $~lib/builtins/i16.MIN_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/i16.MAX_VALUE - get_local $0 + global.get $~lib/builtins/i16.MAX_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/u16.MAX_VALUE - get_local $0 + global.get $~lib/builtins/u16.MAX_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/i32.MAX_VALUE - get_local $0 + global.get $~lib/builtins/i32.MAX_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/i32.MIN_VALUE - get_local $0 + global.get $~lib/builtins/i32.MIN_VALUE + local.get $0 call $retain-i32/test - get_global $~lib/builtins/u32.MAX_VALUE - get_local $0 + global.get $~lib/builtins/u32.MAX_VALUE + local.get $0 call $retain-i32/test end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 unreachable end @@ -468,8 +468,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -1 i32.eq i32.eqz @@ -490,8 +490,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -1 i32.eq i32.eqz @@ -510,8 +510,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -2 i32.eq i32.eqz @@ -530,8 +530,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -128 i32.eq i32.eqz @@ -550,8 +550,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -128 i32.eq i32.eqz @@ -570,8 +570,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -127 i32.eq i32.eqz @@ -590,8 +590,8 @@ i32.shl i32.const 24 i32.shr_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const -128 i32.eq i32.eqz @@ -606,8 +606,8 @@ i32.const 127 i32.const 2 i32.rem_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const 1 i32.eq i32.eqz @@ -622,8 +622,8 @@ i32.const 1 i32.const 127 i32.rem_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const 1 i32.eq i32.eqz @@ -638,8 +638,8 @@ i32.const -128 i32.const 2 i32.rem_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const 0 i32.eq i32.eqz @@ -654,8 +654,8 @@ i32.const 1 i32.const -128 i32.rem_s - set_global $retain-i32/si - get_global $retain-i32/si + global.set $retain-i32/si + global.get $retain-i32/si i32.const 1 i32.eq i32.eqz @@ -674,8 +674,8 @@ i32.add i32.const 255 i32.and - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 255 i32.eq i32.eqz @@ -694,8 +694,8 @@ i32.sub i32.const 255 i32.and - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 255 i32.eq i32.eqz @@ -712,8 +712,8 @@ i32.mul i32.const 255 i32.and - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 254 i32.eq i32.eqz @@ -730,8 +730,8 @@ i32.mul i32.const 255 i32.and - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 1 i32.eq i32.eqz @@ -746,8 +746,8 @@ i32.const 255 i32.const 255 i32.div_u - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 1 i32.eq i32.eqz @@ -762,8 +762,8 @@ i32.const 255 i32.const 2 i32.rem_u - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 1 i32.eq i32.eqz @@ -778,8 +778,8 @@ i32.const 255 i32.const 255 i32.rem_u - set_global $retain-i32/ui - get_global $retain-i32/ui + global.set $retain-i32/ui + global.get $retain-i32/ui i32.const 0 i32.eq i32.eqz diff --git a/tests/compiler/scoped.optimized.wat b/tests/compiler/scoped.optimized.wat index 9f9701c6..e14972b1 100644 --- a/tests/compiler/scoped.optimized.wat +++ b/tests/compiler/scoped.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) @@ -9,28 +9,28 @@ (func $start (; 0 ;) (type $v) (local $0 i32) loop $repeat|0 - get_local $0 + local.get $0 i32.const 1 i32.lt_s if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 1 i32.lt_s if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end end diff --git a/tests/compiler/scoped.untouched.wat b/tests/compiler/scoped.untouched.wat index 39b66b3b..a8125790 100644 --- a/tests/compiler/scoped.untouched.wat +++ b/tests/compiler/scoped.untouched.wat @@ -2,7 +2,7 @@ (type $iv (func (param i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $scoped/aGlobal (mut i32) (i32.const 1)) (global $scoped/aConstant i32 (i32.const 3)) @@ -14,9 +14,9 @@ (func $scoped/fn (; 0 ;) (type $iv) (param $0 i32) (local $1 i32) i32.const 0 - set_local $1 - get_local $0 - set_local $1 + local.set $1 + local.get $0 + local.set $1 ) (func $start (; 1 ;) (type $v) (local $0 i32) @@ -25,18 +25,18 @@ (local $3 f32) block $break|0 i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 + local.get $0 i32.const 1 i32.lt_s i32.eqz br_if $break|0 nop - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 unreachable end @@ -44,19 +44,19 @@ end block $break|1 i32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 1 i32.lt_s i32.eqz br_if $break|1 - get_local $1 + local.get $1 drop - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end @@ -64,9 +64,9 @@ end block i64.const 5 - set_local $2 + local.set $2 f32.const 10 - set_local $3 + local.set $3 end i32.const 42 call $scoped/fn diff --git a/tests/compiler/static-this.optimized.wat b/tests/compiler/static-this.optimized.wat index c620f6b9..021ada54 100644 --- a/tests/compiler/static-this.optimized.wat +++ b/tests/compiler/static-this.optimized.wat @@ -4,14 +4,14 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $static-this/Foo.bar (mut i32) (i32.const 42)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $v) - get_global $static-this/Foo.bar + global.get $static-this/Foo.bar i32.const 42 i32.ne if diff --git a/tests/compiler/static-this.untouched.wat b/tests/compiler/static-this.untouched.wat index c7683ef3..6008b2d1 100644 --- a/tests/compiler/static-this.untouched.wat +++ b/tests/compiler/static-this.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $static-this/Foo.bar (mut i32) (i32.const 42)) (global $HEAP_BASE i32 (i32.const 40)) @@ -13,7 +13,7 @@ (export "table" (table $0)) (start $start) (func $static-this/Foo.getBar (; 1 ;) (type $i) (result i32) - get_global $static-this/Foo.bar + global.get $static-this/Foo.bar ) (func $start (; 2 ;) (type $v) call $static-this/Foo.getBar diff --git a/tests/compiler/std/allocator_arena.optimized.wat b/tests/compiler/std/allocator_arena.optimized.wat index c84661eb..901a027d 100644 --- a/tests/compiler/std/allocator_arena.optimized.wat +++ b/tests/compiler/std/allocator_arena.optimized.wat @@ -9,7 +9,7 @@ (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 anyfunc) + (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)) @@ -24,22 +24,22 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_global $~lib/allocator/arena/offset - tee_local $0 + global.get $~lib/allocator/arena/offset + local.tee $0 i32.const 49 i32.add i32.const -8 i32.and - tee_local $1 + local.tee $1 current_memory - tee_local $2 + local.tee $2 i32.const 16 i32.shl i32.gt_u if - get_local $2 - get_local $1 - get_local $0 + local.get $2 + local.get $1 + local.get $0 i32.sub i32.const 65535 i32.add @@ -47,16 +47,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $3 + local.get $3 grow_memory i32.const 0 i32.lt_s @@ -65,199 +65,199 @@ end end end - get_local $1 - set_global $~lib/allocator/arena/offset - get_local $0 + 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) - get_local $0 + local.get $0 i32.const 18 i32.store8 - get_local $0 + local.get $0 i32.const 42 i32.add - tee_local $1 + local.tee $1 i32.const 1 i32.sub i32.const 18 i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 18 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 18 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.sub i32.const 18 i32.store8 - get_local $1 + local.get $1 i32.const 3 i32.sub i32.const 18 i32.store8 - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 18 i32.store8 - get_local $1 + local.get $1 i32.const 4 i32.sub i32.const 18 i32.store8 i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 303174162 i32.store i32.const 42 - get_local $1 + local.get $1 i32.sub i32.const -4 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add i32.const 4 i32.sub i32.const 303174162 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 303174162 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 303174162 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $1 + local.tee $1 i32.const 12 i32.sub i32.const 303174162 i32.store - get_local $1 + local.get $1 i32.const 8 i32.sub i32.const 303174162 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 303174162 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 303174162 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 303174162 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 303174162 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $1 + local.tee $1 i32.const 28 i32.sub i32.const 303174162 i32.store - get_local $1 + local.get $1 i32.const 24 i32.sub i32.const 303174162 i32.store - get_local $1 + local.get $1 i32.const 20 i32.sub i32.const 303174162 i32.store - get_local $1 + local.get $1 i32.const 16 i32.sub i32.const 303174162 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add - set_local $0 - get_local $2 - get_local $1 + local.set $0 + local.get $2 + local.get $1 i32.sub - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 1302123111085380114 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 1302123111085380114 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 1302123111085380114 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 1302123111085380114 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end @@ -267,894 +267,894 @@ (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -1164,156 +1164,156 @@ (local $3 i32) (local $4 i32) i32.const 42 - set_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 + local.get $1 i32.const 42 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 + local.get $0 i32.const 42 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 42 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1321,18 +1321,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1341,16 +1341,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1363,49 +1363,49 @@ (local $2 i32) (local $3 i32) i32.const 42 - set_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $0 + local.get $1 i32.eq if i32.const 0 return end loop $continue|0 - get_local $2 + local.get $2 i32.const 0 i32.ne - tee_local $3 + local.tee $3 if (result i32) - get_local $0 + local.get $0 i32.load8_u - get_local $1 + local.get $1 i32.load8_u i32.eq else - get_local $3 + local.get $3 end if - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $continue|0 end end - get_local $2 + local.get $2 if (result i32) - get_local $0 + local.get $0 i32.load8_u - get_local $1 + local.get $1 i32.load8_u i32.sub else @@ -1414,15 +1414,15 @@ ) (func $start (; 6 ;) (type $v) i32.const 56 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset call $~lib/allocator/arena/__memory_allocate - set_global $std/allocator_arena/ptr1 + global.set $std/allocator_arena/ptr1 call $~lib/allocator/arena/__memory_allocate - set_global $std/allocator_arena/ptr2 - get_global $std/allocator_arena/ptr1 - get_global $std/allocator_arena/ptr2 + global.set $std/allocator_arena/ptr2 + global.get $std/allocator_arena/ptr1 + global.get $std/allocator_arena/ptr2 i32.eq if i32.const 0 @@ -1432,17 +1432,17 @@ call $~lib/env/abort unreachable end - get_global $std/allocator_arena/ptr1 + global.get $std/allocator_arena/ptr1 call $~lib/internal/memory/memset i32.const 0 - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i loop $repeat|0 - get_global $std/allocator_arena/i + global.get $std/allocator_arena/i i32.const 42 i32.lt_u if - get_global $std/allocator_arena/ptr1 - get_global $std/allocator_arena/i + global.get $std/allocator_arena/ptr1 + global.get $std/allocator_arena/i i32.add i32.load8_u i32.const 18 @@ -1455,27 +1455,27 @@ call $~lib/env/abort unreachable else - get_global $std/allocator_arena/i + global.get $std/allocator_arena/i i32.const 1 i32.add - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i br $repeat|0 end unreachable end end - get_global $std/allocator_arena/ptr2 - get_global $std/allocator_arena/ptr1 + global.get $std/allocator_arena/ptr2 + global.get $std/allocator_arena/ptr1 call $~lib/internal/memory/memmove i32.const 0 - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i loop $repeat|1 - get_global $std/allocator_arena/i + global.get $std/allocator_arena/i i32.const 42 i32.lt_u if - get_global $std/allocator_arena/ptr2 - get_global $std/allocator_arena/i + global.get $std/allocator_arena/ptr2 + global.get $std/allocator_arena/i i32.add i32.load8_u i32.const 18 @@ -1488,17 +1488,17 @@ call $~lib/env/abort unreachable else - get_global $std/allocator_arena/i + global.get $std/allocator_arena/i i32.const 1 i32.add - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i br $repeat|1 end unreachable end end - get_global $std/allocator_arena/ptr1 - get_global $std/allocator_arena/ptr2 + global.get $std/allocator_arena/ptr1 + global.get $std/allocator_arena/ptr2 call $~lib/internal/memory/memcmp if i32.const 0 @@ -1508,11 +1508,11 @@ call $~lib/env/abort unreachable end - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset call $~lib/allocator/arena/__memory_allocate - set_global $std/allocator_arena/ptr1 - get_global $std/allocator_arena/ptr1 + global.set $std/allocator_arena/ptr1 + global.get $std/allocator_arena/ptr1 i32.const 56 i32.ne if diff --git a/tests/compiler/std/allocator_arena.untouched.wat b/tests/compiler/std/allocator_arena.untouched.wat index 8dd74e74..1e006697 100644 --- a/tests/compiler/std/allocator_arena.untouched.wat +++ b/tests/compiler/std/allocator_arena.untouched.wat @@ -8,7 +8,7 @@ (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\00") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -31,41 +31,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -75,22 +75,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -99,258 +99,258 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/memory/memset (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -363,44 +363,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -408,141 +408,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -550,167 +550,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -722,130 +722,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -857,112 +857,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -974,585 +974,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -1560,77 +1560,77 @@ ) (func $~lib/internal/memory/memmove (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -1641,27 +1641,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -1670,67 +1670,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1741,20 +1741,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1766,16 +1766,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1787,8 +1787,8 @@ ) (func $~lib/internal/memory/memcmp (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 0 @@ -1796,43 +1796,43 @@ end block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 0 i32.ne - tee_local $3 + local.tee $3 if (result i32) - get_local $0 + local.get $0 i32.load8_u - get_local $1 + local.get $1 i32.load8_u i32.eq else - get_local $3 + local.get $3 end if block - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 end br $continue|0 end end end - get_local $2 + local.get $2 if (result i32) - get_local $0 + local.get $0 i32.load8_u - get_local $1 + local.get $1 i32.load8_u i32.sub else @@ -1843,41 +1843,41 @@ nop ) (func $~lib/allocator/arena/__memory_reset (; 7 ;) (type $v) - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset ) (func $start (; 8 ;) (type $v) (local $0 i32) (local $1 i32) (local $2 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_global $std/allocator_arena/size - set_local $0 - get_local $0 + 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 - set_global $std/allocator_arena/ptr1 + global.set $std/allocator_arena/ptr1 block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_global $std/allocator_arena/size - set_local $0 - get_local $0 + 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 - set_global $std/allocator_arena/ptr2 - get_global $std/allocator_arena/ptr1 - get_global $std/allocator_arena/ptr2 + global.set $std/allocator_arena/ptr2 + global.get $std/allocator_arena/ptr1 + global.get $std/allocator_arena/ptr2 i32.ne i32.eqz if @@ -1889,28 +1889,28 @@ unreachable end block - get_global $std/allocator_arena/ptr1 - set_local $0 + global.get $std/allocator_arena/ptr1 + local.set $0 i32.const 18 - set_local $1 - get_global $std/allocator_arena/size - set_local $2 - get_local $0 - get_local $1 - get_local $2 + 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 - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i loop $repeat|0 - get_global $std/allocator_arena/i - get_global $std/allocator_arena/size + global.get $std/allocator_arena/i + global.get $std/allocator_arena/size i32.lt_u i32.eqz br_if $break|0 - get_global $std/allocator_arena/ptr1 - get_global $std/allocator_arena/i + global.get $std/allocator_arena/ptr1 + global.get $std/allocator_arena/i i32.add i32.load8_u i32.const 18 @@ -1924,38 +1924,38 @@ call $~lib/env/abort unreachable end - get_global $std/allocator_arena/i + global.get $std/allocator_arena/i i32.const 1 i32.add - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i br $repeat|0 unreachable end unreachable end block - get_global $std/allocator_arena/ptr2 - set_local $2 - get_global $std/allocator_arena/ptr1 - set_local $1 - get_global $std/allocator_arena/size - set_local $0 - get_local $2 - get_local $1 - get_local $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 - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i loop $repeat|1 - get_global $std/allocator_arena/i - get_global $std/allocator_arena/size + global.get $std/allocator_arena/i + global.get $std/allocator_arena/size i32.lt_u i32.eqz br_if $break|1 - get_global $std/allocator_arena/ptr2 - get_global $std/allocator_arena/i + global.get $std/allocator_arena/ptr2 + global.get $std/allocator_arena/i i32.add i32.load8_u i32.const 18 @@ -1969,25 +1969,25 @@ call $~lib/env/abort unreachable end - get_global $std/allocator_arena/i + global.get $std/allocator_arena/i i32.const 1 i32.add - set_global $std/allocator_arena/i + global.set $std/allocator_arena/i br $repeat|1 unreachable end unreachable end block $~lib/memory/memory.compare|inlined.0 (result i32) - get_global $std/allocator_arena/ptr1 - set_local $0 - get_global $std/allocator_arena/ptr2 - set_local $1 - get_global $std/allocator_arena/size - set_local $2 - get_local $0 - get_local $1 - get_local $2 + 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 @@ -2002,10 +2002,10 @@ unreachable end block $~lib/memory/memory.free|inlined.0 - get_global $std/allocator_arena/ptr1 - set_local $2 + global.get $std/allocator_arena/ptr1 + local.set $2 block - get_local $2 + local.get $2 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable @@ -2013,10 +2013,10 @@ unreachable end block $~lib/memory/memory.free|inlined.1 - get_global $std/allocator_arena/ptr2 - set_local $2 + global.get $std/allocator_arena/ptr2 + local.set $2 block - get_local $2 + local.get $2 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.1 unreachable @@ -2032,15 +2032,15 @@ unreachable end block $~lib/memory/memory.allocate|inlined.2 (result i32) - get_global $std/allocator_arena/size - set_local $2 - get_local $2 + 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 - set_global $std/allocator_arena/ptr1 - get_global $std/allocator_arena/ptr1 - get_global $HEAP_BASE + global.set $std/allocator_arena/ptr1 + global.get $std/allocator_arena/ptr1 + global.get $HEAP_BASE i32.const 7 i32.add i32.const 7 diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index 652c534f..bdf47ff0 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -8,7 +8,7 @@ (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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) @@ -20,27 +20,27 @@ (func $std/array-access/i32ArrayArrayElementAccess (; 1 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -50,15 +50,15 @@ ) (func $std/array-access/stringArrayPropertyAccess (; 2 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -67,48 +67,48 @@ ) (func $~lib/internal/string/compareUnsafe (; 3 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $1 + local.set $1 loop $continue|0 - get_local $3 + local.get $3 if (result i32) - get_local $1 + local.get $1 i32.load16_u offset=4 - get_local $2 + local.get $2 i32.load16_u offset=4 i32.sub - tee_local $4 + local.tee $4 i32.eqz else - get_local $3 + local.get $3 end if - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 2 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $4 + local.get $4 ) (func $~lib/string/String#startsWith (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -119,42 +119,42 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $1 + local.tee $1 i32.const 0 - get_local $1 + local.get $1 i32.lt_s select - tee_local $2 + local.tee $2 i32.const 8 i32.load - tee_local $3 + local.tee $3 i32.add - get_local $1 + local.get $1 i32.gt_s if i32.const 0 return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 8 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $std/array-access/stringArrayMethodCall (; 5 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -164,27 +164,27 @@ (func $std/array-access/stringArrayArrayPropertyAccess (; 6 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -196,27 +196,27 @@ (func $std/array-access/stringArrayArrayMethodCall (; 7 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index a6c1ae47..3b3353ad 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -10,7 +10,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -28,24 +28,24 @@ (func $~lib/array/Array>#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -55,24 +55,24 @@ (func $~lib/array/Array#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -80,7 +80,7 @@ end ) (func $std/array-access/i32ArrayArrayElementAccess (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array>#__get i32.const 1 @@ -89,24 +89,24 @@ (func $~lib/array/Array#__get (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -114,7 +114,7 @@ end ) (func $std/array-access/stringArrayPropertyAccess (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.load @@ -124,53 +124,53 @@ (local $6 i32) (local $7 i32) i32.const 0 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_local $3 + local.set $6 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|0 loop $continue|0 - get_local $4 + local.get $4 if (result i32) - get_local $6 + local.get $6 i32.load16_u offset=4 - get_local $7 + local.get $7 i32.load16_u offset=4 i32.sub - tee_local $5 + local.tee $5 i32.eqz else - get_local $4 + local.get $4 end if block - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2 i32.add - set_local $6 - get_local $7 + local.set $6 + local.get $7 i32.const 2 i32.add - set_local $7 + local.set $7 end br $continue|0 end end end - get_local $5 + local.get $5 ) (func $~lib/string/String#startsWith (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -179,7 +179,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -191,56 +191,56 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 48 - set_local $1 + local.set $1 end - get_local $2 - set_local $3 - get_local $0 + local.get $2 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $3 - tee_local $5 + local.set $4 + local.get $3 + local.tee $5 i32.const 0 - tee_local $6 - get_local $5 - get_local $6 + local.tee $6 + local.get $5 + local.get $6 i32.gt_s select - tee_local $5 - get_local $4 - tee_local $6 - get_local $5 - get_local $6 + local.tee $5 + local.get $4 + local.tee $6 + local.get $5 + local.get $6 i32.lt_s select - set_local $7 - get_local $1 + local.set $7 + local.get $1 i32.load - set_local $8 - get_local $8 - get_local $7 + local.set $8 + local.get $8 + local.get $7 i32.add - get_local $4 + local.get $4 i32.gt_s if i32.const 0 return end - get_local $0 - get_local $7 - get_local $1 + local.get $0 + local.get $7 + local.get $1 i32.const 0 - get_local $8 + local.get $8 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $std/array-access/stringArrayMethodCall (; 8 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 8 @@ -250,24 +250,24 @@ (func $~lib/array/Array>#__get (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -275,7 +275,7 @@ end ) (func $std/array-access/stringArrayArrayPropertyAccess (; 10 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array>#__get i32.const 1 @@ -283,7 +283,7 @@ i32.load ) (func $std/array-access/stringArrayArrayMethodCall (; 11 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array>#__get i32.const 1 diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index edd2ce85..ac6a9732 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -16,7 +16,7 @@ (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 anyfunc) + (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)) @@ -33,17 +33,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -52,16 +52,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -69,16 +69,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -87,13 +87,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -106,233 +106,233 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end @@ -342,62 +342,62 @@ (local $1 i32) i32.const 3 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $1 + local.set $1 i32.const 8 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 3 i32.store offset=4 - get_local $1 + local.get $1 i32.const 8 i32.add i32.const 3 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#constructor (; 5 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) i32.const 12 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $1 + local.set $1 i32.const 8 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 3 i32.store offset=4 - get_local $1 + local.get $1 i32.const 8 i32.add i32.const 12 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $start (; 6 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 232 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 28 i32.load i32.const 3 @@ -413,11 +413,11 @@ i32.const 0 i32.const 24 i32.load - tee_local $0 + local.tee $0 i32.load i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load8_s offset=8 else unreachable @@ -435,11 +435,11 @@ i32.const 1 i32.const 24 i32.load - tee_local $0 + local.tee $0 i32.load i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 1 i32.add i32.load8_s offset=8 @@ -461,11 +461,11 @@ i32.const 2 i32.const 24 i32.load - tee_local $0 + local.tee $0 i32.load i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 2 i32.add i32.load8_s offset=8 @@ -499,13 +499,13 @@ i32.const 0 i32.const 112 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -521,13 +521,13 @@ i32.const 1 i32.const 112 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -547,13 +547,13 @@ i32.const 2 i32.const 112 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -570,7 +570,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/emptyArrayI32 + global.get $std/array-literal/emptyArrayI32 i32.load offset=4 if i32.const 0 @@ -581,35 +581,35 @@ unreachable end call $~lib/array/Array#constructor - tee_local $0 + local.tee $0 i32.load - get_global $std/array-literal/i - tee_local $1 + global.get $std/array-literal/i + local.tee $1 i32.store8 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_global $std/array-literal/i - get_local $0 + global.set $std/array-literal/i + local.get $0 i32.load i32.const 1 i32.add - get_global $std/array-literal/i - tee_local $1 + global.get $std/array-literal/i + local.tee $1 i32.store8 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_global $std/array-literal/i - get_local $0 + global.set $std/array-literal/i + local.get $0 i32.load i32.const 2 i32.add - get_global $std/array-literal/i + global.get $std/array-literal/i i32.store8 offset=8 - get_local $0 - set_global $std/array-literal/dynamicArrayI8 - get_global $std/array-literal/dynamicArrayI8 + local.get $0 + global.set $std/array-literal/dynamicArrayI8 + global.get $std/array-literal/dynamicArrayI8 i32.load offset=4 i32.const 3 i32.ne @@ -622,13 +622,13 @@ unreachable end i32.const 0 - get_global $std/array-literal/dynamicArrayI8 + global.get $std/array-literal/dynamicArrayI8 i32.load - tee_local $0 + local.tee $0 i32.load i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load8_s offset=8 else unreachable @@ -644,13 +644,13 @@ unreachable end i32.const 1 - get_global $std/array-literal/dynamicArrayI8 + global.get $std/array-literal/dynamicArrayI8 i32.load - tee_local $0 + local.tee $0 i32.load i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 1 i32.add i32.load8_s offset=8 @@ -670,13 +670,13 @@ unreachable end i32.const 2 - get_global $std/array-literal/dynamicArrayI8 + global.get $std/array-literal/dynamicArrayI8 i32.load - tee_local $0 + local.tee $0 i32.load i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 2 i32.add i32.load8_s offset=8 @@ -696,37 +696,37 @@ unreachable end i32.const 0 - set_global $std/array-literal/i + global.set $std/array-literal/i call $~lib/array/Array#constructor - tee_local $0 + local.tee $0 i32.load - get_global $std/array-literal/i - tee_local $1 + global.get $std/array-literal/i + local.tee $1 i32.store offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_global $std/array-literal/i - get_local $0 + global.set $std/array-literal/i + local.get $0 i32.load i32.const 4 i32.add - get_global $std/array-literal/i - tee_local $1 + global.get $std/array-literal/i + local.tee $1 i32.store offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_global $std/array-literal/i - get_local $0 + global.set $std/array-literal/i + local.get $0 i32.load i32.const 8 i32.add - get_global $std/array-literal/i + global.get $std/array-literal/i i32.store offset=8 - get_local $0 - set_global $std/array-literal/dynamicArrayI32 - get_global $std/array-literal/dynamicArrayI32 + local.get $0 + global.set $std/array-literal/dynamicArrayI32 + global.get $std/array-literal/dynamicArrayI32 i32.load offset=4 i32.const 3 i32.ne @@ -739,15 +739,15 @@ unreachable end i32.const 0 - get_global $std/array-literal/dynamicArrayI32 + global.get $std/array-literal/dynamicArrayI32 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -761,15 +761,15 @@ unreachable end i32.const 1 - get_global $std/array-literal/dynamicArrayI32 + global.get $std/array-literal/dynamicArrayI32 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -787,15 +787,15 @@ unreachable end i32.const 2 - get_global $std/array-literal/dynamicArrayI32 + global.get $std/array-literal/dynamicArrayI32 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -813,35 +813,35 @@ unreachable end call $~lib/array/Array#constructor - set_local $0 + local.set $0 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load - get_local $1 + local.get $1 i32.store offset=8 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load i32.const 4 i32.add - get_local $1 + local.get $1 i32.store offset=8 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load i32.const 8 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $0 - set_global $std/array-literal/dynamicArrayRef - get_global $std/array-literal/dynamicArrayRef + local.get $0 + global.set $std/array-literal/dynamicArrayRef + global.get $std/array-literal/dynamicArrayRef i32.load offset=4 i32.const 3 i32.ne @@ -854,35 +854,35 @@ unreachable end call $~lib/array/Array#constructor - set_local $0 + local.set $0 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load - get_local $1 + local.get $1 i32.store offset=8 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load i32.const 4 i32.add - get_local $1 + local.get $1 i32.store offset=8 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load i32.const 8 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $0 - set_global $std/array-literal/dynamicArrayRefWithCtor - get_global $std/array-literal/dynamicArrayRefWithCtor + local.get $0 + global.set $std/array-literal/dynamicArrayRefWithCtor + global.get $std/array-literal/dynamicArrayRefWithCtor i32.load offset=4 i32.const 3 i32.ne diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 23e0d9f6..071bb5d5 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -15,7 +15,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -40,24 +40,24 @@ (func $~lib/array/Array#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 0 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 0 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load8_s offset=8 else @@ -67,24 +67,24 @@ (func $~lib/array/Array#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -94,8 +94,8 @@ (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -110,41 +110,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -154,22 +154,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -178,15 +178,15 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -198,21 +198,21 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/memory/memory.allocate (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) @@ -220,250 +220,250 @@ (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -475,7 +475,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -486,62 +486,62 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#__unchecked_set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 + local.set $3 i32.const 0 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/array/Array#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -549,7 +549,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -560,80 +560,80 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#__unchecked_set (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 + local.set $3 i32.const 0 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $std/array-literal/Ref#constructor (; 12 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $~lib/array/Array#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -644,80 +644,80 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#__unchecked_set (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 + local.set $3 i32.const 0 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $std/array-literal/RefWithCtor#constructor (; 15 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $~lib/array/Array#constructor (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -728,62 +728,62 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#__unchecked_set (; 17 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 + local.set $3 i32.const 0 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $start (; 18 ;) (type $v) @@ -792,20 +792,20 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/array-literal/staticArrayI8 - set_local $0 - get_local $0 + global.get $std/array-literal/staticArrayI8 + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -819,7 +819,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/staticArrayI8 + global.get $std/array-literal/staticArrayI8 i32.const 0 call $~lib/array/Array#__get i32.const 24 @@ -837,7 +837,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/staticArrayI8 + global.get $std/array-literal/staticArrayI8 i32.const 1 call $~lib/array/Array#__get i32.const 24 @@ -855,7 +855,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/staticArrayI8 + global.get $std/array-literal/staticArrayI8 i32.const 2 call $~lib/array/Array#__get i32.const 24 @@ -874,9 +874,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/array-literal/staticArrayI32 - set_local $0 - get_local $0 + global.get $std/array-literal/staticArrayI32 + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -890,7 +890,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/staticArrayI32 + global.get $std/array-literal/staticArrayI32 i32.const 0 call $~lib/array/Array#__get i32.const 0 @@ -904,7 +904,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/staticArrayI32 + global.get $std/array-literal/staticArrayI32 i32.const 1 call $~lib/array/Array#__get i32.const 1 @@ -918,7 +918,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/staticArrayI32 + global.get $std/array-literal/staticArrayI32 i32.const 2 call $~lib/array/Array#__get i32.const 2 @@ -933,9 +933,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.1 (result i32) - get_global $std/array-literal/emptyArrayI32 - set_local $0 - get_local $0 + global.get $std/array-literal/emptyArrayI32 + local.set $0 + local.get $0 i32.load offset=4 end i32.const 0 @@ -953,38 +953,38 @@ i32.const 0 i32.const 3 call $~lib/array/Array#constructor - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 - get_global $std/array-literal/i + global.get $std/array-literal/i call $~lib/array/Array#__unchecked_set - get_local $1 + local.get $1 i32.const 1 block (result i32) - get_global $std/array-literal/i + global.get $std/array-literal/i i32.const 1 i32.add - set_global $std/array-literal/i - get_global $std/array-literal/i + global.set $std/array-literal/i + global.get $std/array-literal/i end call $~lib/array/Array#__unchecked_set - get_local $1 + local.get $1 i32.const 2 block (result i32) - get_global $std/array-literal/i + global.get $std/array-literal/i i32.const 1 i32.add - set_global $std/array-literal/i - get_global $std/array-literal/i + global.set $std/array-literal/i + global.get $std/array-literal/i end call $~lib/array/Array#__unchecked_set - get_local $1 + local.get $1 end - set_global $std/array-literal/dynamicArrayI8 + global.set $std/array-literal/dynamicArrayI8 block $~lib/array/Array#get:length|inlined.1 (result i32) - get_global $std/array-literal/dynamicArrayI8 - set_local $1 - get_local $1 + global.get $std/array-literal/dynamicArrayI8 + local.set $1 + local.get $1 i32.load offset=4 end i32.const 3 @@ -998,7 +998,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/dynamicArrayI8 + global.get $std/array-literal/dynamicArrayI8 i32.const 0 call $~lib/array/Array#__get i32.const 24 @@ -1016,7 +1016,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/dynamicArrayI8 + global.get $std/array-literal/dynamicArrayI8 i32.const 1 call $~lib/array/Array#__get i32.const 24 @@ -1034,7 +1034,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/dynamicArrayI8 + global.get $std/array-literal/dynamicArrayI8 i32.const 2 call $~lib/array/Array#__get i32.const 24 @@ -1053,43 +1053,43 @@ unreachable end i32.const 0 - set_global $std/array-literal/i + global.set $std/array-literal/i block (result i32) i32.const 0 i32.const 3 call $~lib/array/Array#constructor - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 - get_global $std/array-literal/i + global.get $std/array-literal/i call $~lib/array/Array#__unchecked_set - get_local $2 + local.get $2 i32.const 1 block (result i32) - get_global $std/array-literal/i + global.get $std/array-literal/i i32.const 1 i32.add - set_global $std/array-literal/i - get_global $std/array-literal/i + global.set $std/array-literal/i + global.get $std/array-literal/i end call $~lib/array/Array#__unchecked_set - get_local $2 + local.get $2 i32.const 2 block (result i32) - get_global $std/array-literal/i + global.get $std/array-literal/i i32.const 1 i32.add - set_global $std/array-literal/i - get_global $std/array-literal/i + global.set $std/array-literal/i + global.get $std/array-literal/i end call $~lib/array/Array#__unchecked_set - get_local $2 + local.get $2 end - set_global $std/array-literal/dynamicArrayI32 + global.set $std/array-literal/dynamicArrayI32 block $~lib/array/Array#get:length|inlined.2 (result i32) - get_global $std/array-literal/dynamicArrayI32 - set_local $2 - get_local $2 + global.get $std/array-literal/dynamicArrayI32 + local.set $2 + local.get $2 i32.load offset=4 end i32.const 3 @@ -1103,7 +1103,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/dynamicArrayI32 + global.get $std/array-literal/dynamicArrayI32 i32.const 0 call $~lib/array/Array#__get i32.const 0 @@ -1117,7 +1117,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/dynamicArrayI32 + global.get $std/array-literal/dynamicArrayI32 i32.const 1 call $~lib/array/Array#__get i32.const 1 @@ -1131,7 +1131,7 @@ call $~lib/env/abort unreachable end - get_global $std/array-literal/dynamicArrayI32 + global.get $std/array-literal/dynamicArrayI32 i32.const 2 call $~lib/array/Array#__get i32.const 2 @@ -1149,29 +1149,29 @@ i32.const 0 i32.const 3 call $~lib/array/Array#constructor - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 0 i32.const 0 call $std/array-literal/Ref#constructor call $~lib/array/Array#__unchecked_set - get_local $3 + local.get $3 i32.const 1 i32.const 0 call $std/array-literal/Ref#constructor call $~lib/array/Array#__unchecked_set - get_local $3 + local.get $3 i32.const 2 i32.const 0 call $std/array-literal/Ref#constructor call $~lib/array/Array#__unchecked_set - get_local $3 + local.get $3 end - set_global $std/array-literal/dynamicArrayRef + global.set $std/array-literal/dynamicArrayRef block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/array-literal/dynamicArrayRef - set_local $3 - get_local $3 + global.get $std/array-literal/dynamicArrayRef + local.set $3 + local.get $3 i32.load offset=4 end i32.const 3 @@ -1189,29 +1189,29 @@ i32.const 0 i32.const 3 call $~lib/array/Array#constructor - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 0 i32.const 0 call $std/array-literal/RefWithCtor#constructor call $~lib/array/Array#__unchecked_set - get_local $4 + local.get $4 i32.const 1 i32.const 0 call $std/array-literal/RefWithCtor#constructor call $~lib/array/Array#__unchecked_set - get_local $4 + local.get $4 i32.const 2 i32.const 0 call $std/array-literal/RefWithCtor#constructor call $~lib/array/Array#__unchecked_set - get_local $4 + local.get $4 end - set_global $std/array-literal/dynamicArrayRefWithCtor + global.set $std/array-literal/dynamicArrayRefWithCtor block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/array-literal/dynamicArrayRefWithCtor - set_local $4 - get_local $4 + global.get $std/array-literal/dynamicArrayRefWithCtor + local.set $4 + local.get $4 i32.load offset=4 end i32.const 3 diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 1a31c089..30e59fe5 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -337,7 +337,7 @@ (data (i32.const 8400) "\c0 \00\00\01") (data (i32.const 8408) "\04\00\00\00\00\00\00\00\d0 ") (data (i32.const 8424) "\d8 \00\00\01") - (table $0 57 anyfunc) + (table $0 57 funcref) (elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|4 $start~anonymous|3 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|18 $start~anonymous|17 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|29 $start~anonymous|30 $start~anonymous|30 $start~anonymous|32 $start~anonymous|33 $start~anonymous|34 $start~anonymous|30 $start~anonymous|36 $start~anonymous|30 $start~anonymous|30 $start~anonymous|32 $start~anonymous|33 $start~anonymous|34 $start~anonymous|30 $start~anonymous|36 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $~lib/array/Array#sort|trampoline~anonymous|46 $~lib/array/Array#sort|trampoline~anonymous|47 $~lib/array/Array#sort|trampoline~anonymous|46 $~lib/array/Array#sort|trampoline~anonymous|46 $start~anonymous|50 $~lib/array/Array#sort|trampoline~anonymous|46 $start~anonymous|50 $start~anonymous|53 $start~anonymous|54 $start~anonymous|55 $start~anonymous|55) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) @@ -401,17 +401,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -420,16 +420,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -437,16 +437,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -455,13 +455,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -474,249 +474,249 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $3 + local.tee $3 i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $3 + local.get $3 i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $2 + local.get $2 i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.sub - set_local $2 - get_local $0 - get_local $3 + local.set $2 + local.get $0 + local.get $3 i32.add - tee_local $0 - get_local $1 + local.tee $0 + local.get $1 i32.const 255 i32.and i32.const 16843009 i32.mul - tee_local $1 + local.tee $1 i32.store - get_local $2 + local.get $2 i32.const -4 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $3 + local.tee $3 i32.const 12 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 8 i32.sub - get_local $1 + local.get $1 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $3 + local.tee $3 i32.const 28 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 24 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 20 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 16 i32.sub - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $3 - get_local $0 + local.tee $3 + local.get $0 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $1 - i64.extend_u/i32 - tee_local $4 - get_local $4 + local.set $2 + local.get $1 + i64.extend_i32_u + local.tee $4 + local.get $4 i64.const 32 i64.shl i64.or - set_local $4 + local.set $4 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if - get_local $0 - get_local $4 + local.get $0 + local.get $4 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end @@ -725,7 +725,7 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 268435454 i32.gt_u if @@ -736,37 +736,37 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 i32.shl - tee_local $3 + local.tee $3 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $2 + local.set $2 i32.const 8 call $~lib/allocator/arena/__memory_allocate - tee_local $1 + local.tee $1 i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 0 i32.store offset=4 - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.store offset=4 - get_local $2 + local.get $2 i32.const 8 i32.add i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/memory/memset - get_local $1 + local.get $1 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -777,145 +777,145 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add i32.const 0 - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/array/Array#fill (; 7 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=4 - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $2 - get_local $4 - get_local $2 - get_local $4 + local.get $2 + local.get $4 + local.get $2 + local.get $4 i32.lt_s select end - tee_local $2 - get_local $3 + local.tee $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $3 - get_local $4 - get_local $3 - get_local $4 + local.get $3 + local.get $4 + local.get $3 + local.get $4 i32.lt_s select end - tee_local $3 + local.tee $3 i32.lt_s if - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.add i32.const 8 i32.add - get_local $1 - get_local $3 - get_local $2 + local.get $1 + local.get $3 + local.get $2 i32.sub call $~lib/internal/memory/memset end - get_local $0 + local.get $0 ) (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) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $4 - get_local $1 + local.tee $4 + local.get $1 i32.load offset=4 i32.ne if i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end loop $repeat|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.lt_u if (result i32) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add i32.load8_u offset=8 else @@ -923,15 +923,15 @@ end i32.const 255 i32.and - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.load - tee_local $3 + local.tee $3 i32.load i32.lt_u if (result i32) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add i32.load8_u offset=8 else @@ -944,10 +944,10 @@ i32.const 0 return else - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end unreachable @@ -961,7 +961,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -969,111 +969,111 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end i32.const 2147483647 - set_local $3 + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/array/Array#fill ) (func $~lib/array/Array#fill (; 10 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=4 - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $2 - get_local $4 - get_local $2 - get_local $4 + local.get $2 + local.get $4 + local.get $2 + local.get $4 i32.lt_s select end - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $3 - get_local $4 - get_local $3 - get_local $4 + local.get $3 + local.get $4 + local.get $3 + local.get $4 i32.lt_s select end - set_local $3 + local.set $3 loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s i32.eqz if - get_local $6 - get_local $2 + local.get $6 + local.get $2 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $0 + local.get $0 ) (func $std/array/isArraysEqual (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $2 + local.get $2 i32.eqz if - get_local $0 + local.get $0 i32.load offset=4 - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.load offset=4 i32.ne if i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 @@ -1081,41 +1081,41 @@ end end loop $repeat|0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.lt_s if - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - tee_local $4 + local.tee $4 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 else unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.load - tee_local $4 + local.tee $4 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 else @@ -1126,10 +1126,10 @@ i32.const 0 return else - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end unreachable @@ -1143,7 +1143,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -1151,15 +1151,15 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end i32.const 2147483647 - set_local $3 + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/array/Array#fill ) (func $~lib/internal/memory/memcpy (; 13 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) @@ -1167,894 +1167,894 @@ (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -2062,156 +2062,156 @@ (func $~lib/internal/memory/memmove (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2219,18 +2219,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -2239,16 +2239,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2260,13 +2260,13 @@ (func $~lib/internal/arraybuffer/reallocateUnsafe (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.gt_s if - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_s if @@ -2277,10 +2277,10 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.const 32 - get_local $2 + local.get $2 i32.const 7 i32.add i32.clz @@ -2290,39 +2290,39 @@ i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $3 + local.tee $3 i32.const 8 i32.add - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 call $~lib/internal/memory/memmove - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 i32.add i32.const 0 - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.lt_s if @@ -2333,33 +2333,33 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/array/Array#push (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $2 + local.tee $2 i32.const 1 i32.add - set_local $3 - get_local $2 - get_local $0 + local.set $3 + local.get $2 + local.get $0 i32.load - tee_local $4 + local.tee $4 i32.load i32.const 2 i32.shr_u i32.ge_u if - get_local $2 + local.get $2 i32.const 268435454 i32.ge_u if @@ -2370,33 +2370,33 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $4 - get_local $3 + local.get $0 + local.get $4 + local.get $3 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $4 + local.tee $4 i32.store end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store offset=4 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $3 + local.get $3 ) (func $~lib/array/Array#pop (; 17 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $1 + local.tee $1 i32.const 1 i32.lt_s if @@ -2407,253 +2407,253 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 1 i32.sub - tee_local $1 + local.tee $1 i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $0 + local.get $1 i32.store offset=4 - get_local $2 + local.get $2 ) (func $~lib/array/Array#concat (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.load offset=4 i32.const 0 - get_local $1 + local.get $1 select - tee_local $4 + local.tee $4 i32.add call $~lib/array/Array#constructor - set_local $3 - get_local $2 + local.set $3 + local.get $2 if - get_local $3 + local.get $3 i32.load i32.const 8 i32.add - get_local $0 + local.get $0 i32.load i32.const 8 i32.add - get_local $2 + local.get $2 i32.const 2 i32.shl call $~lib/internal/memory/memmove end - get_local $4 + local.get $4 if - get_local $3 + local.get $3 i32.load i32.const 8 i32.add - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.load i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 2 i32.shl call $~lib/internal/memory/memmove end - get_local $3 + local.get $3 ) (func $~lib/array/Array#copyWithin (; 19 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $6 - get_local $3 - tee_local $4 - get_local $0 + local.set $6 + local.get $3 + local.tee $4 + local.get $0 i32.load offset=4 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $1 - get_local $5 + local.get $1 + local.get $5 i32.add - tee_local $4 + local.tee $4 i32.const 0 - get_local $4 + local.get $4 i32.const 0 i32.gt_s select else - get_local $1 - tee_local $4 - get_local $5 - get_local $4 - get_local $5 + local.get $1 + local.tee $4 + local.get $5 + local.get $4 + local.get $5 i32.lt_s select end - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add - tee_local $4 + local.tee $4 i32.const 0 - get_local $4 + local.get $4 i32.const 0 i32.gt_s select else - get_local $2 - tee_local $4 - get_local $5 - get_local $4 - get_local $5 + local.get $2 + local.tee $4 + local.get $5 + local.get $4 + local.get $5 i32.lt_s select end - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.add - tee_local $4 + local.tee $4 i32.const 0 - get_local $4 + local.get $4 i32.const 0 i32.gt_s select else - get_local $3 - tee_local $4 - get_local $5 - get_local $4 - get_local $5 + local.get $3 + local.tee $4 + local.get $5 + local.get $4 + local.get $5 i32.lt_s select end - get_local $2 + local.get $2 i32.sub - tee_local $4 - get_local $5 - get_local $1 + local.tee $4 + local.get $5 + local.get $1 i32.sub - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.lt_s - tee_local $4 + local.tee $4 if - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 i32.add i32.lt_s - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $3 + local.get $3 i32.const 1 i32.sub - tee_local $4 - get_local $2 + local.tee $4 + local.get $2 i32.add - set_local $2 - get_local $1 - get_local $4 + local.set $2 + local.get $1 + local.get $4 i32.add - set_local $1 + local.set $1 loop $continue|0 - get_local $3 + local.get $3 if - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 2 i32.shl i32.add - get_local $6 - get_local $2 + local.get $6 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.sub - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $continue|0 end end else - get_local $6 + local.get $6 i32.const 8 i32.add - tee_local $4 - get_local $1 + local.tee $4 + local.get $1 i32.const 2 i32.shl i32.add - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $3 + local.get $3 i32.const 2 i32.shl call $~lib/internal/memory/memmove end - get_local $0 + local.get $0 ) (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 - get_global $~argc + global.get $~argc i32.const 2 i32.sub br_table $0of1 $1of1 $outOfRange @@ -2661,12 +2661,12 @@ unreachable end i32.const 2147483647 - set_local $3 + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/array/Array#copyWithin ) (func $~lib/array/Array#unshift (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -2674,23 +2674,23 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $4 - get_local $3 - get_local $0 + local.set $4 + local.get $3 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.load i32.const 2 i32.shr_u - tee_local $5 + local.tee $5 i32.ge_u if - get_local $3 + local.get $3 i32.const 268435454 i32.ge_u if @@ -2701,40 +2701,40 @@ call $~lib/env/abort unreachable end - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $2 + local.tee $2 i32.load i32.const 2 i32.shr_u - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.store end - get_local $2 + local.get $2 i32.const 8 i32.add - tee_local $3 + local.tee $3 i32.const 4 i32.add - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.sub i32.const 2 i32.shl call $~lib/internal/memory/memmove - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=4 - get_local $4 + local.get $4 ) (func $~lib/array/Array#shift (; 22 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -2742,9 +2742,9 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $1 + local.tee $1 i32.const 1 i32.lt_s if @@ -2755,155 +2755,155 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load offset=8 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 8 i32.add - tee_local $5 + local.tee $5 i32.const 4 i32.add - set_local $2 - get_local $5 - get_local $2 - get_local $1 + local.set $2 + local.get $5 + local.get $2 + local.get $1 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.const 2 i32.shl - tee_local $1 + local.tee $1 call $~lib/internal/memory/memmove - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=4 - get_local $4 + local.get $4 ) (func $~lib/array/Array#reverse (; 23 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $repeat|0 block $break|0 - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.ge_s br_if $break|0 - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.store offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $repeat|0 end end - get_local $0 + local.get $0 ) (func $~lib/array/Array#indexOf (; 24 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $4 + local.tee $4 i32.eqz - tee_local $3 + local.tee $3 i32.eqz if - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.ge_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if i32.const -1 return end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - tee_local $3 + local.tee $3 i32.const 0 - get_local $3 + local.get $3 i32.const 0 i32.gt_s select - set_local $2 + local.set $2 end - get_local $0 + local.get $0 i32.load - set_local $0 + local.set $0 loop $continue|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $1 + local.get $1 i32.eq if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $continue|0 end end @@ -2914,100 +2914,100 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $5 - get_local $2 - get_local $0 + local.set $5 + local.get $2 + local.get $0 i32.load offset=4 - tee_local $4 - get_local $1 + local.tee $4 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - tee_local $3 + local.tee $3 i32.const 0 - get_local $3 + local.get $3 i32.const 0 i32.gt_s select else - get_local $1 - get_local $4 - get_local $1 - get_local $4 + local.get $1 + local.get $4 + local.get $1 + local.get $4 i32.lt_s select end - tee_local $1 + local.tee $1 i32.sub - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.lt_s select - tee_local $3 + local.tee $3 i32.const 0 - get_local $3 + local.get $3 i32.const 0 i32.gt_s select - tee_local $2 + local.tee $2 call $~lib/array/Array#constructor - tee_local $6 + local.tee $6 i32.load i32.const 8 i32.add - get_local $5 + local.get $5 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add - tee_local $3 - get_local $2 + local.tee $3 + local.get $2 i32.const 2 i32.shl call $~lib/internal/memory/memmove - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - tee_local $1 - get_local $4 + local.tee $1 + local.get $4 i32.ne if - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 2 i32.shl call $~lib/internal/memory/memmove end - get_local $0 - get_local $4 - get_local $2 + local.get $0 + local.get $4 + local.get $2 i32.sub i32.store offset=4 - get_local $6 + local.get $6 ) (func $~lib/array/Array#splice|trampoline (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -3015,26 +3015,26 @@ unreachable end i32.const 2147483647 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/array/Array#splice ) (func $~lib/array/Array#__set (; 27 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 2 i32.shr_u i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -3045,74 +3045,74 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $3 - get_local $1 + local.get $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $3 + local.tee $3 i32.store - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=4 end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $start~anonymous|1 (; 28 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.eqz ) (func $~lib/array/Array#findIndex (; 29 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 - get_local $0 + local.get $2 + local.get $3 + local.get $0 i32.load offset=4 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.load - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) if - get_local $2 + local.get $2 return else - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end unreachable @@ -3121,34 +3121,34 @@ i32.const -1 ) (func $start~anonymous|2 (; 30 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 1 i32.eq ) (func $start~anonymous|3 (; 31 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 100 i32.eq ) (func $start~anonymous|4 (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_local $0 + local.get $0 i32.const 100 i32.eq ) (func $start~anonymous|6 (; 33 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $0 + local.get $0 i32.const 100 i32.eq ) (func $start~anonymous|7 (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ge_s ) @@ -3156,40 +3156,40 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 - get_local $0 + local.get $2 + local.get $3 + local.get $0 i32.load offset=4 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.load - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) if - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 else i32.const 0 @@ -3201,34 +3201,34 @@ i32.const 1 ) (func $start~anonymous|8 (; 36 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.le_s ) (func $start~anonymous|9 (; 37 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_local $0 + local.get $0 i32.const 10 i32.lt_s ) (func $start~anonymous|10 (; 38 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 10 i32.lt_s ) (func $start~anonymous|11 (; 39 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $0 + local.get $0 i32.const 3 i32.lt_s ) (func $start~anonymous|12 (; 40 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 3 i32.ge_s ) @@ -3236,43 +3236,43 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 - get_local $0 + local.get $2 + local.get $3 + local.get $0 i32.load offset=4 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.load - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) if i32.const 1 return else - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end unreachable @@ -3281,75 +3281,75 @@ i32.const 0 ) (func $start~anonymous|13 (; 42 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const -1 i32.le_s ) (func $start~anonymous|14 (; 43 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_local $0 + local.get $0 i32.const 10 i32.gt_s ) (func $start~anonymous|15 (; 44 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 10 i32.gt_s ) (func $start~anonymous|16 (; 45 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $0 + local.get $0 i32.const 3 i32.gt_s ) (func $start~anonymous|17 (; 46 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i + global.set $std/array/i ) (func $~lib/array/Array#forEach (; 47 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) block $break|0 - get_local $0 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 loop $repeat|0 - get_local $2 - get_local $3 - get_local $0 + local.get $2 + local.get $3 + local.get $0 i32.load offset=4 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.load - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiiv) - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -3357,111 +3357,111 @@ end ) (func $start~anonymous|18 (; 48 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i + global.set $std/array/i ) (func $start~anonymous|20 (; 49 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i + global.set $std/array/i ) (func $start~anonymous|21 (; 50 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $1 + local.get $1 i32.eqz if loop $repeat|0 block $break|0 - get_local $3 + local.get $3 i32.const 4 i32.ge_s br_if $break|0 - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end i32.const 0 - set_local $3 + local.set $3 loop $repeat|1 block $break|1 - get_local $3 + local.get $3 i32.const 100 i32.ge_s br_if $break|1 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.const 100 i32.add call $~lib/array/Array#push drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|1 end end i32.const 0 - set_local $3 + local.set $3 loop $repeat|2 block $break|2 - get_local $3 + local.get $3 i32.const 100 i32.ge_s br_if $break|2 - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|2 end end i32.const 0 - set_local $3 + local.set $3 loop $repeat|3 block $break|3 - get_local $3 + local.get $3 i32.const 100 i32.ge_s br_if $break|3 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.const 200 i32.add call $~lib/array/Array#push drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|3 end end end - get_local $1 + local.get $1 i32.const 2 i32.eq if - get_local $0 + local.get $0 i32.const 202 i32.ne if @@ -3475,8 +3475,8 @@ end ) (func $start~anonymous|22 (; 51 ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) - get_local $0 - f32.convert_s/i32 + local.get $0 + f32.convert_i32_s ) (func $~lib/array/Array#map (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -3484,62 +3484,62 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $3 + local.tee $3 call $~lib/array/Array#constructor - tee_local $4 + local.tee $4 i32.load - set_local $5 + local.set $5 loop $repeat|0 - get_local $1 - get_local $3 - get_local $0 + local.get $1 + local.get $3 + local.get $0 i32.load offset=4 - tee_local $2 - get_local $3 - get_local $2 + local.tee $2 + local.get $3 + local.get $2 i32.lt_s select i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 + global.set $~argc + local.get $1 i32.const 2 i32.shl - tee_local $2 - get_local $5 + local.tee $2 + local.get $5 i32.add - get_local $0 + local.get $0 i32.load - get_local $2 + local.get $2 i32.add i32.load offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 22 call_indirect (type $iiif) f32.store offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $4 + local.get $4 ) (func $start~anonymous|23 (; 53 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 ) (func $~lib/array/Array#map (; 54 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3547,73 +3547,73 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $3 + local.tee $3 call $~lib/array/Array#constructor - tee_local $4 + local.tee $4 i32.load - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 - get_local $0 + local.get $2 + local.get $3 + local.get $0 i32.load offset=4 - tee_local $6 - get_local $3 - get_local $6 + local.tee $6 + local.get $3 + local.get $6 i32.lt_s select i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $5 - get_local $2 + global.set $~argc + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $0 + local.get $0 i32.load - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) i32.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $4 + local.get $4 ) (func $start~anonymous|24 (; 55 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 ) (func $start~anonymous|25 (; 56 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 ) (func $start~anonymous|26 (; 57 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.ge_s ) @@ -3624,241 +3624,241 @@ (local $5 i32) i32.const 0 call $~lib/array/Array#constructor - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $5 - get_local $0 + local.get $2 + local.get $5 + local.get $0 i32.load offset=4 - tee_local $3 - get_local $5 - get_local $3 + local.tee $3 + local.get $5 + local.get $3 i32.lt_s select i32.ge_s br_if $break|0 - get_local $0 + local.get $0 i32.load - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $3 + local.set $3 i32.const 3 - set_global $~argc - get_local $3 - get_local $2 - get_local $0 - get_local $1 + global.set $~argc + local.get $3 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) if - get_local $4 - get_local $3 + local.get $4 + local.get $3 call $~lib/array/Array#push drop end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $4 + local.get $4 ) (func $start~anonymous|27 (; 59 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 i32.const 2 i32.ge_s ) (func $start~anonymous|28 (; 60 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 i32.const 2 i32.ge_s ) (func $start~anonymous|29 (; 61 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 i32.const 2 i32.ge_s ) (func $start~anonymous|30 (; 62 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/array/Array#reduce (; 63 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 loop $repeat|0 block $break|0 - get_local $3 - get_local $4 - get_local $0 + local.get $3 + local.get $4 + local.get $0 i32.load offset=4 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select i32.ge_s br_if $break|0 i32.const 4 - set_global $~argc - get_local $2 - get_local $0 + global.set $~argc + local.get $2 + local.get $0 i32.load - get_local $3 + local.get $3 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $3 - get_local $0 - get_local $1 + local.get $3 + local.get $0 + local.get $1 call_indirect (type $iiiii) - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $start~anonymous|32 (; 64 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.gt_s - get_local $0 + local.get $0 select ) (func $start~anonymous|33 (; 65 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 100 i32.gt_s - get_local $0 + local.get $0 select ) (func $start~anonymous|34 (; 66 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 + local.get $3 i32.const 1 call $~lib/array/Array#push drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|36 (; 67 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 + local.get $3 call $~lib/array/Array#pop drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/array/Array#reduceRight (; 68 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $repeat|0 block $break|0 - get_local $3 + local.get $3 i32.const 0 i32.lt_s br_if $break|0 i32.const 4 - set_global $~argc - get_local $2 - get_local $0 + global.set $~argc + local.get $2 + local.get $0 i32.load - get_local $3 + local.get $3 i32.const 2 i32.shl i32.add i32.load offset=8 - get_local $3 - get_local $0 - get_local $1 + local.get $3 + local.get $0 + local.get $1 call_indirect (type $iiiii) - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $~lib/math/splitMix32 (; 69 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 1831565813 i32.add - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i32.const 15 i32.shr_u i32.xor - get_local $0 + local.get $0 i32.const 1 i32.or i32.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i32.const 61 i32.or - get_local $0 + local.get $0 i32.const 7 i32.shr_u - get_local $0 + local.get $0 i32.xor i32.mul - get_local $0 + local.get $0 i32.add i32.xor - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i32.const 14 i32.shr_u i32.xor ) (func $~lib/math/NativeMath.seedRandom (; 70 ;) (type $Iv) (param $0 i64) (local $1 i64) - get_local $0 + local.get $0 i64.eqz if i32.const 0 @@ -3869,57 +3869,57 @@ unreachable end i32.const 1 - set_global $~lib/math/random_seeded - get_local $0 + global.set $~lib/math/random_seeded + local.get $0 i64.const 33 i64.shr_u - get_local $0 + local.get $0 i64.xor i64.const -49064778989728563 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor i64.const -4265267296055464877 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor - set_global $~lib/math/random_state0_64 - get_global $~lib/math/random_state0_64 + global.set $~lib/math/random_state0_64 + global.get $~lib/math/random_state0_64 i64.const -1 i64.xor - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor i64.const -49064778989728563 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor i64.const -4265267296055464877 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor - set_global $~lib/math/random_state1_64 - get_local $0 - i32.wrap/i64 + global.set $~lib/math/random_state1_64 + local.get $0 + i32.wrap_i64 call $~lib/math/splitMix32 - set_global $~lib/math/random_state0_32 - get_global $~lib/math/random_state0_32 + global.set $~lib/math/random_state0_32 + global.get $~lib/math/random_state0_32 call $~lib/math/splitMix32 - set_global $~lib/math/random_state1_32 + 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) (local $3 i32) @@ -3928,75 +3928,75 @@ (local $6 f32) (local $7 i32) loop $repeat|0 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.ge_s i32.eqz if - get_local $4 + local.get $4 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add f32.load offset=8 - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $continue|1 - get_local $3 + local.get $3 i32.const 0 i32.ge_s if block $break|1 - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add f32.load offset=8 - set_local $6 + local.set $6 i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $2 + global.set $~argc + local.get $5 + local.get $6 + local.get $2 call_indirect (type $ffi) i32.const 0 i32.ge_s br_if $break|1 - get_local $3 - tee_local $7 + local.get $3 + local.tee $7 i32.const 1 i32.sub - set_local $3 - get_local $7 + local.set $3 + local.get $7 i32.const 1 i32.add i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 f32.store offset=8 br $continue|1 end end end - get_local $3 + local.get $3 i32.const 1 i32.add i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $5 + local.get $5 f32.store offset=8 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 end end @@ -4008,43 +4008,43 @@ (local $6 f32) (local $7 f32) (local $8 i32) - get_local $1 + local.get $1 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - tee_local $5 + local.tee $5 call $~lib/allocator/arena/__memory_allocate - tee_local $8 + local.tee $8 i32.const 0 - get_local $5 + local.get $5 call $~lib/internal/memory/memset - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 + local.get $3 i32.const 0 i32.gt_s if - get_local $3 - set_local $5 + local.get $3 + local.set $5 loop $continue|1 - get_local $5 + local.get $5 i32.const 1 i32.and - get_local $5 + local.get $5 i32.const 6 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add i32.load - get_local $5 + local.get $5 i32.const 1 i32.shr_s i32.const 31 @@ -4054,210 +4054,210 @@ i32.and i32.eq if - get_local $5 + local.get $5 i32.const 1 i32.shr_s - set_local $5 + local.set $5 br $continue|1 end end - get_local $5 + local.get $5 i32.const 1 i32.shr_s - tee_local $4 + local.tee $4 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add f32.load offset=8 - set_local $7 - get_local $3 + local.set $7 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add f32.load offset=8 - set_local $6 + local.set $6 i32.const 2 - set_global $~argc - get_local $7 - get_local $6 - get_local $2 + global.set $~argc + local.get $7 + local.get $6 + local.get $2 call_indirect (type $ffi) i32.const 0 i32.lt_s if - get_local $3 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add - tee_local $5 - get_local $5 + local.tee $5 + local.get $5 i32.load i32.const 1 - get_local $3 + local.get $3 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $7 + local.get $7 f32.store offset=8 - get_local $4 + local.get $4 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 f32.store offset=8 end - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $repeat|0 end end - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $repeat|2 - get_local $3 + local.get $3 i32.const 2 i32.ge_s if - get_local $0 + local.get $0 f32.load offset=8 - set_local $6 - get_local $0 - get_local $3 + local.set $6 + local.get $0 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $1 + local.tee $1 f32.load offset=8 f32.store offset=8 - get_local $1 - get_local $6 + local.get $1 + local.get $6 f32.store offset=8 i32.const 1 - set_local $4 + local.set $4 loop $continue|3 - get_local $4 + local.get $4 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add i32.load - get_local $4 + local.get $4 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - get_local $4 + local.get $4 i32.const 1 i32.shl i32.add - tee_local $5 - get_local $3 + local.tee $5 + local.get $3 i32.lt_s if - get_local $5 - set_local $4 + local.get $5 + local.set $4 br $continue|3 end end loop $continue|4 - get_local $4 + local.get $4 i32.const 0 i32.gt_s if - get_local $0 + local.get $0 f32.load offset=8 - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add f32.load offset=8 - set_local $7 + local.set $7 i32.const 2 - set_global $~argc - get_local $6 - get_local $7 - get_local $2 + global.set $~argc + local.get $6 + local.get $7 + local.get $2 call_indirect (type $ffi) i32.const 0 i32.lt_s if - get_local $4 + local.get $4 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i32.load i32.const 1 - get_local $4 + local.get $4 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $4 + local.get $4 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 f32.store offset=8 - get_local $0 - get_local $7 + local.get $0 + local.get $7 f32.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.shr_s - set_local $4 + local.set $4 br $continue|4 end end - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $repeat|2 end end - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $1 + local.tee $1 f32.load offset=8 - set_local $6 - get_local $1 - get_local $0 + local.set $6 + local.get $1 + local.get $0 f32.load offset=8 f32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 f32.store offset=8 ) (func $~lib/array/Array#sort (; 73 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -4265,7 +4265,7 @@ (local $3 i32) (local $4 f32) (local $5 f32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -4275,93 +4275,93 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - tee_local $3 + local.tee $3 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 2 i32.eq if - get_local $2 + local.get $2 i32.const 4 i32.add f32.load offset=8 - set_local $4 - get_local $2 + local.set $4 + local.get $2 f32.load offset=8 - set_local $5 + local.set $5 i32.const 2 - set_global $~argc - get_local $4 - get_local $5 - get_local $1 + global.set $~argc + local.get $4 + local.get $5 + local.get $1 call_indirect (type $ffi) i32.const 0 i32.lt_s if - get_local $2 + local.get $2 i32.const 4 i32.add - get_local $5 + local.get $5 f32.store offset=8 - get_local $2 - get_local $4 + local.get $2 + local.get $4 f32.store offset=8 end - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i32.const 256 i32.lt_s if - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 ) (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 74 ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - i32.reinterpret/f32 - tee_local $2 - get_local $2 + local.get $0 + i32.reinterpret_f32 + local.tee $2 + local.get $2 i32.const 31 i32.shr_s i32.const 1 i32.shr_u i32.xor - tee_local $2 - get_local $1 - i32.reinterpret/f32 - tee_local $3 - get_local $3 + local.tee $2 + local.get $1 + i32.reinterpret_f32 + local.tee $3 + local.get $3 i32.const 31 i32.shr_s i32.const 1 i32.shr_u i32.xor - tee_local $3 + local.tee $3 i32.gt_s - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.sub ) @@ -4371,9 +4371,9 @@ (local $3 i32) (local $4 f32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $5 + local.tee $5 i32.const 3244 i32.load i32.ne @@ -4381,7 +4381,7 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.const 3240 i32.eq if @@ -4389,87 +4389,87 @@ return end loop $repeat|0 - get_local $1 - get_local $5 + local.get $1 + local.get $5 i32.lt_s if - get_local $1 - tee_local $2 - get_local $0 + local.get $1 + local.tee $2 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $3 + local.get $3 i32.add f32.load offset=8 else unreachable end - tee_local $4 - get_local $4 + local.tee $4 + local.get $4 f32.ne - get_local $1 + local.get $1 i32.const 3240 i32.load - tee_local $2 + local.tee $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $1 + local.get $1 i32.const 2 i32.shl - get_local $2 + local.get $2 i32.add f32.load offset=8 else unreachable end - tee_local $4 - get_local $4 + local.tee $4 + local.get $4 f32.ne i32.ne if - get_local $1 - tee_local $2 - get_local $0 + local.get $1 + local.tee $2 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $3 + local.get $3 i32.add f32.load offset=8 else unreachable end - get_local $1 + local.get $1 i32.const 3240 i32.load - tee_local $2 + local.tee $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $1 + local.get $1 i32.const 2 i32.shl - get_local $2 + local.get $2 i32.add f32.load offset=8 else @@ -4481,10 +4481,10 @@ return end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end @@ -4497,75 +4497,75 @@ (local $6 f64) (local $7 i32) loop $repeat|0 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.ge_s i32.eqz if - get_local $4 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add f64.load offset=8 - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $continue|1 - get_local $3 + local.get $3 i32.const 0 i32.ge_s if block $break|1 - get_local $3 + local.get $3 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add f64.load offset=8 - set_local $6 + local.set $6 i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $2 + global.set $~argc + local.get $5 + local.get $6 + local.get $2 call_indirect (type $FFi) i32.const 0 i32.ge_s br_if $break|1 - get_local $3 - tee_local $7 + local.get $3 + local.tee $7 i32.const 1 i32.sub - set_local $3 - get_local $7 + local.set $3 + local.get $7 i32.const 1 i32.add i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 f64.store offset=8 br $continue|1 end end end - get_local $3 + local.get $3 i32.const 1 i32.add i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $5 + local.get $5 f64.store offset=8 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 end end @@ -4577,43 +4577,43 @@ (local $6 f64) (local $7 f64) (local $8 i32) - get_local $1 + local.get $1 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - tee_local $5 + local.tee $5 call $~lib/allocator/arena/__memory_allocate - tee_local $8 + local.tee $8 i32.const 0 - get_local $5 + local.get $5 call $~lib/internal/memory/memset - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 + local.get $3 i32.const 0 i32.gt_s if - get_local $3 - set_local $5 + local.get $3 + local.set $5 loop $continue|1 - get_local $5 + local.get $5 i32.const 1 i32.and - get_local $5 + local.get $5 i32.const 6 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add i32.load - get_local $5 + local.get $5 i32.const 1 i32.shr_s i32.const 31 @@ -4623,210 +4623,210 @@ i32.and i32.eq if - get_local $5 + local.get $5 i32.const 1 i32.shr_s - set_local $5 + local.set $5 br $continue|1 end end - get_local $5 + local.get $5 i32.const 1 i32.shr_s - tee_local $4 + local.tee $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add f64.load offset=8 - set_local $7 - get_local $3 + local.set $7 + local.get $3 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add f64.load offset=8 - set_local $6 + local.set $6 i32.const 2 - set_global $~argc - get_local $7 - get_local $6 - get_local $2 + global.set $~argc + local.get $7 + local.get $6 + local.get $2 call_indirect (type $FFi) i32.const 0 i32.lt_s if - get_local $3 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add - tee_local $5 - get_local $5 + local.tee $5 + local.get $5 i32.load i32.const 1 - get_local $3 + local.get $3 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $3 + local.get $3 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $7 + local.get $7 f64.store offset=8 - get_local $4 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 f64.store offset=8 end - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $repeat|0 end end - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $repeat|2 - get_local $3 + local.get $3 i32.const 2 i32.ge_s if - get_local $0 + local.get $0 f64.load offset=8 - set_local $6 - get_local $0 - get_local $3 + local.set $6 + local.get $0 + local.get $3 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $1 + local.tee $1 f64.load offset=8 f64.store offset=8 - get_local $1 - get_local $6 + local.get $1 + local.get $6 f64.store offset=8 i32.const 1 - set_local $4 + local.set $4 loop $continue|3 - get_local $4 + local.get $4 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add i32.load - get_local $4 + local.get $4 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - get_local $4 + local.get $4 i32.const 1 i32.shl i32.add - tee_local $5 - get_local $3 + local.tee $5 + local.get $3 i32.lt_s if - get_local $5 - set_local $4 + local.get $5 + local.set $4 br $continue|3 end end loop $continue|4 - get_local $4 + local.get $4 i32.const 0 i32.gt_s if - get_local $0 + local.get $0 f64.load offset=8 - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add f64.load offset=8 - set_local $7 + local.set $7 i32.const 2 - set_global $~argc - get_local $6 - get_local $7 - get_local $2 + global.set $~argc + local.get $6 + local.get $7 + local.get $2 call_indirect (type $FFi) i32.const 0 i32.lt_s if - get_local $4 + local.get $4 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $8 + local.get $8 i32.add - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i32.load i32.const 1 - get_local $4 + local.get $4 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $4 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 f64.store offset=8 - get_local $0 - get_local $7 + local.get $0 + local.get $7 f64.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.shr_s - set_local $4 + local.set $4 br $continue|4 end end - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $repeat|2 end end - get_local $0 + local.get $0 i32.const 8 i32.add - tee_local $1 + local.tee $1 f64.load offset=8 - set_local $6 - get_local $1 - get_local $0 + local.set $6 + local.get $1 + local.get $0 f64.load offset=8 f64.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 f64.store offset=8 ) (func $~lib/array/Array#sort (; 78 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -4834,7 +4834,7 @@ (local $3 i32) (local $4 f64) (local $5 f64) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -4844,93 +4844,93 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - tee_local $3 + local.tee $3 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 2 i32.eq if - get_local $2 + local.get $2 i32.const 8 i32.add f64.load offset=8 - set_local $4 - get_local $2 + local.set $4 + local.get $2 f64.load offset=8 - set_local $5 + local.set $5 i32.const 2 - set_global $~argc - get_local $4 - get_local $5 - get_local $1 + global.set $~argc + local.get $4 + local.get $5 + local.get $1 call_indirect (type $FFi) i32.const 0 i32.lt_s if - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $5 + local.get $5 f64.store offset=8 - get_local $2 - get_local $4 + local.get $2 + local.get $4 f64.store offset=8 end - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i32.const 256 i32.lt_s if - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 ) (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 79 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $2 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.tee $2 + local.get $2 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - tee_local $2 - get_local $1 - i64.reinterpret/f64 - tee_local $3 - get_local $3 + local.tee $2 + local.get $1 + i64.reinterpret_f64 + local.tee $3 + local.get $3 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - tee_local $3 + local.tee $3 i64.gt_s - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.lt_s i32.sub ) @@ -4940,9 +4940,9 @@ (local $3 i32) (local $4 f64) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $5 + local.tee $5 i32.const 3516 i32.load i32.ne @@ -4950,7 +4950,7 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.const 3512 i32.eq if @@ -4958,87 +4958,87 @@ return end loop $repeat|0 - get_local $1 - get_local $5 + local.get $1 + local.get $5 i32.lt_s if - get_local $1 - tee_local $2 - get_local $0 + local.get $1 + local.tee $2 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) - get_local $2 + local.get $2 i32.const 3 i32.shl - get_local $3 + local.get $3 i32.add f64.load offset=8 else unreachable end - tee_local $4 - get_local $4 + local.tee $4 + local.get $4 f64.ne - get_local $1 + local.get $1 i32.const 3512 i32.load - tee_local $2 + local.tee $2 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) - get_local $1 + local.get $1 i32.const 3 i32.shl - get_local $2 + local.get $2 i32.add f64.load offset=8 else unreachable end - tee_local $4 - get_local $4 + local.tee $4 + local.get $4 f64.ne i32.ne if - get_local $1 - tee_local $2 - get_local $0 + local.get $1 + local.tee $2 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) - get_local $2 + local.get $2 i32.const 3 i32.shl - get_local $3 + local.get $3 i32.add f64.load offset=8 else unreachable end - get_local $1 + local.get $1 i32.const 3512 i32.load - tee_local $2 + local.tee $2 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) - get_local $1 + local.get $1 i32.const 3 i32.shl - get_local $2 + local.get $2 i32.add f64.load offset=8 else @@ -5050,10 +5050,10 @@ return end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end @@ -5066,77 +5066,77 @@ (local $6 i32) (local $7 i32) loop $repeat|0 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.ge_s i32.eqz if - get_local $4 + local.get $4 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add i32.load offset=8 - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $continue|1 - get_local $3 + local.get $3 i32.const 0 i32.ge_s if block $break|1 - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add i32.load offset=8 - set_local $5 + local.set $5 i32.const 2 - set_global $~argc - get_local $6 - get_local $5 - get_local $2 + global.set $~argc + local.get $6 + local.get $5 + local.get $2 call_indirect (type $iii) i32.const 0 i32.ge_s br_if $break|1 - get_local $5 - set_local $7 - get_local $3 - tee_local $5 + local.get $5 + local.set $7 + local.get $3 + local.tee $5 i32.const 1 i32.sub - set_local $3 - get_local $5 + local.set $3 + local.get $5 i32.const 1 i32.add i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $7 + local.get $7 i32.store offset=8 br $continue|1 end end end - get_local $3 + local.get $3 i32.const 1 i32.add i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 i32.store offset=8 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 end end @@ -5148,43 +5148,43 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - tee_local $6 + local.tee $6 call $~lib/allocator/arena/__memory_allocate - tee_local $7 + local.tee $7 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/memory/memset - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 + local.get $3 i32.const 0 i32.gt_s if - get_local $3 - set_local $4 + local.get $3 + local.set $4 loop $continue|1 - get_local $4 + local.get $4 i32.const 1 i32.and - get_local $4 + local.get $4 i32.const 6 i32.shr_s i32.const 2 i32.shl - get_local $7 + local.get $7 i32.add i32.load - get_local $4 + local.get $4 i32.const 1 i32.shr_s i32.const 31 @@ -5194,217 +5194,217 @@ i32.and i32.eq if - get_local $4 + local.get $4 i32.const 1 i32.shr_s - set_local $4 + local.set $4 br $continue|1 end end - get_local $4 + local.get $4 i32.const 1 i32.shr_s - tee_local $5 + local.tee $5 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add i32.load offset=8 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add i32.load offset=8 - set_local $6 + local.set $6 i32.const 2 - set_global $~argc - get_local $4 - get_local $6 - get_local $2 + global.set $~argc + local.get $4 + local.get $6 + local.get $2 call_indirect (type $iii) i32.const 0 i32.lt_s if - get_local $3 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $7 + local.get $7 i32.add - tee_local $8 - get_local $8 + local.tee $8 + local.get $8 i32.load i32.const 1 - get_local $3 + local.get $3 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $4 + local.get $4 i32.store offset=8 - get_local $5 + local.get $5 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 i32.store offset=8 end - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $repeat|0 end end - get_local $1 + local.get $1 i32.const 1 i32.sub - set_local $3 + local.set $3 loop $repeat|2 - get_local $3 + local.get $3 i32.const 2 i32.ge_s if - get_local $0 + local.get $0 i32.load offset=8 - set_local $6 - get_local $0 - get_local $3 + local.set $6 + local.get $0 + local.get $3 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $1 + local.tee $1 i32.load offset=8 i32.store offset=8 - get_local $1 - get_local $6 + local.get $1 + local.get $6 i32.store offset=8 i32.const 1 - set_local $5 + local.set $5 loop $continue|3 - get_local $5 + local.get $5 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $7 + local.get $7 i32.add i32.load - get_local $5 + local.get $5 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - get_local $5 + local.get $5 i32.const 1 i32.shl i32.add - tee_local $4 - get_local $3 + local.tee $4 + local.get $3 i32.lt_s if - get_local $4 - set_local $5 + local.get $4 + local.set $5 br $continue|3 end end loop $continue|4 - get_local $5 + local.get $5 i32.const 0 i32.gt_s if - get_local $0 + local.get $0 i32.load offset=8 - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add i32.load offset=8 - set_local $4 + local.set $4 i32.const 2 - set_global $~argc - get_local $6 - get_local $4 - get_local $2 + global.set $~argc + local.get $6 + local.get $4 + local.get $2 call_indirect (type $iii) i32.const 0 i32.lt_s if - get_local $5 + local.get $5 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $7 + local.get $7 i32.add - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i32.load i32.const 1 - get_local $5 + local.get $5 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $5 + local.get $5 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $6 + local.get $6 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=8 end - get_local $5 + local.get $5 i32.const 1 i32.shr_s - set_local $5 + local.set $5 br $continue|4 end end - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $repeat|2 end end - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $2 + local.tee $2 i32.load offset=8 - set_local $1 - get_local $2 - get_local $0 + local.set $1 + local.get $2 + local.get $0 i32.load offset=8 i32.store offset=8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 ) (func $~lib/array/Array#sort (; 83 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -5414,117 +5414,117 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - tee_local $2 + local.tee $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if - get_local $3 + local.get $3 i32.const 4 i32.add i32.load offset=8 - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.load offset=8 - set_local $4 + local.set $4 i32.const 2 - set_global $~argc - get_local $2 - get_local $4 - get_local $1 + global.set $~argc + local.get $2 + local.get $4 + local.get $1 call_indirect (type $iii) i32.const 0 i32.lt_s if - get_local $3 + local.get $3 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store offset=8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 i32.const 256 i32.lt_s if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 ) (func $~lib/array/Array#sort|trampoline~anonymous|46 (; 84 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $~lib/array/Array#sort|trampoline~anonymous|47 (; 85 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.gt_u - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u i32.sub ) (func $std/array/createReverseOrderedArray (; 86 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 call $~lib/array/Array#constructor - set_local $1 + local.set $1 i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 block $break|0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=4 i32.ge_s br_if $break|0 - get_local $1 - get_local $0 - get_local $1 + local.get $1 + local.get $0 + local.get $1 i32.load offset=4 i32.const 1 i32.sub - get_local $0 + local.get $0 i32.sub call $~lib/array/Array#__set - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $1 + local.get $1 ) (func $~lib/math/NativeMath.random (; 87 ;) (type $F) (result f64) (local $0 i64) (local $1 i64) - get_global $~lib/math/random_seeded + global.get $~lib/math/random_seeded i32.eqz if i32.const 0 @@ -5534,69 +5534,69 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/random_state0_64 - set_local $0 - get_global $~lib/math/random_state1_64 - tee_local $1 - set_global $~lib/math/random_state0_64 - get_local $1 - get_local $0 + 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 $1 + local.get $0 i64.const 23 i64.shl - get_local $0 + local.get $0 i64.xor - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i64.const 17 i64.shr_u i64.xor i64.xor - get_local $1 + local.get $1 i64.const 26 i64.shr_u i64.xor - tee_local $0 - set_global $~lib/math/random_state1_64 - get_local $0 - get_local $1 + 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.reinterpret_i64 f64.const 1 f64.sub ) (func $std/array/createRandomOrderedArray (; 88 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 call $~lib/array/Array#constructor - set_local $0 + local.set $0 loop $repeat|0 block $break|0 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=4 i32.ge_s br_if $break|0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.random - get_local $0 + local.get $0 i32.load offset=4 - f64.convert_s/i32 + f64.convert_i32_s f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s call $~lib/array/Array#__set - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $0 + local.get $0 ) (func $std/array/isSorted (; 89 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -5604,57 +5604,57 @@ (local $4 i32) (local $5 i32) i32.const 1 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 loop $repeat|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if i32.const 2 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 1 i32.sub - tee_local $3 - get_local $0 + local.tee $3 + local.get $0 i32.load - tee_local $5 + local.tee $5 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add i32.load offset=8 else unreachable end - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $3 + local.get $3 i32.add i32.load offset=8 else unreachable end - get_local $1 + local.get $1 call_indirect (type $iii) i32.const 0 i32.gt_s @@ -5662,10 +5662,10 @@ i32.const 0 return else - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end unreachable @@ -5674,10 +5674,10 @@ i32.const 1 ) (func $std/array/assertSorted (; 90 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort - get_local $1 + local.get $1 call $std/array/isSorted i32.eqz if @@ -5690,13 +5690,13 @@ end ) (func $std/array/assertSortedDefault (; 91 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 48 call $std/array/assertSorted ) (func $start~anonymous|50 (; 92 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.sub ) (func $std/array/createReverseOrderedNestedArray (; 93 ;) (type $FUNCSIG$i) (result i32) @@ -5705,78 +5705,78 @@ (local $2 i32) i32.const 512 call $~lib/array/Array#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=4 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 1 call $~lib/array/Array#constructor call $~lib/array/Array#__set - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load - tee_local $2 + local.tee $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 2 i32.shl - get_local $2 + local.get $2 i32.add i32.load offset=8 else unreachable end i32.const 0 - get_local $1 + local.get $1 i32.load offset=4 i32.const 1 i32.sub - get_local $0 + local.get $0 i32.sub call $~lib/array/Array#__set - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $1 + local.get $1 ) (func $start~anonymous|53 (; 94 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 0 - get_local $1 + local.get $1 i32.load - tee_local $1 + local.tee $1 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $1 + local.get $1 i32.load offset=8 else unreachable @@ -5787,7 +5787,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -5797,62 +5797,62 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - tee_local $2 + local.tee $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if - get_local $3 + local.get $3 i32.const 4 i32.add i32.load offset=8 - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.load offset=8 - set_local $4 + local.set $4 i32.const 2 - set_global $~argc - get_local $2 - get_local $4 - get_local $1 + global.set $~argc + local.get $2 + local.get $4 + local.get $1 call_indirect (type $iii) i32.const 0 i32.lt_s if - get_local $3 + local.get $3 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store offset=8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end - get_local $0 + local.get $0 return end - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort - get_local $0 + local.get $0 ) (func $std/array/assertSorted> (; 96 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array>#sort - get_local $1 + local.get $1 call $std/array/isSorted i32.eqz if @@ -5871,126 +5871,126 @@ (local $3 i32) i32.const 512 call $~lib/array/Array#constructor - set_local $0 + local.set $0 loop $repeat|0 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=4 i32.lt_s if - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - get_local $1 + local.get $1 i32.sub - set_local $2 + local.set $2 i32.const 4 call $~lib/allocator/arena/__memory_allocate - tee_local $3 - get_local $2 + local.tee $3 + local.get $2 i32.store - get_local $0 - get_local $1 - get_local $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/array/Array#__set - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $0 + local.get $0 ) (func $start~anonymous|54 (; 98 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.sub ) (func $~lib/internal/string/compareUnsafe (; 99 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $0 + local.get $0 i32.load16_u offset=4 - get_local $1 + local.get $1 i32.load16_u offset=4 i32.sub - tee_local $3 + local.tee $3 i32.eqz else - get_local $2 + local.get $2 end if - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 br $continue|0 end end - get_local $3 + local.get $3 ) (func $~lib/string/String.__gt (; 100 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 i32.eqz if - get_local $0 + local.get $0 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $1 + local.get $1 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $3 + local.get $3 i32.eqz if i32.const 1 return end - get_local $0 - get_local $1 - get_local $2 - get_local $3 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 i32.lt_s select call $~lib/internal/string/compareUnsafe @@ -6000,51 +6000,51 @@ (func $~lib/string/String.__lt (; 101 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 i32.eqz if - get_local $0 + local.get $0 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.load - tee_local $3 + local.tee $3 i32.eqz if i32.const 0 return end - get_local $2 + local.get $2 i32.eqz if i32.const 1 return end - get_local $0 - get_local $1 - get_local $2 - get_local $3 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 i32.lt_s select call $~lib/internal/string/compareUnsafe @@ -6052,50 +6052,50 @@ i32.lt_s ) (func $start~anonymous|55 (; 102 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__gt - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__lt i32.sub ) (func $~lib/string/String.__eq (; 103 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $0 + local.get $0 i32.load - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/string/compareUnsafe i32.eqz ) @@ -6103,59 +6103,59 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $4 - get_local $1 + local.tee $4 + local.get $1 i32.load offset=4 i32.ne if i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end loop $repeat|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $3 + local.get $3 i32.add i32.load offset=8 else unreachable end - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -6163,10 +6163,10 @@ end call $~lib/string/String.__eq if - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 else i32.const 0 @@ -6179,17 +6179,17 @@ ) (func $~lib/internal/string/allocateUnsafe (; 105 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if - get_local $0 + local.get $0 i32.const 536870910 i32.le_s - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -6199,20 +6199,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.shl i32.const 4 i32.add call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/string/String#charAt (; 106 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 2928 i32.load i32.ge_u @@ -6222,32 +6222,32 @@ end i32.const 1 call $~lib/internal/string/allocateUnsafe - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.const 1 i32.shl i32.const 2928 i32.add i32.load16_u offset=4 i32.store16 offset=4 - get_local $1 + local.get $1 ) (func $~lib/internal/string/copyUnsafe (; 107 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 4 i32.add - get_local $3 + local.get $3 i32.const 1 i32.shl - get_local $2 + local.get $2 i32.add i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 1 i32.shl call $~lib/internal/memory/memmove @@ -6256,7 +6256,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -6266,112 +6266,112 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.const 4144 - get_local $1 + local.get $1 select - tee_local $1 + local.tee $1 i32.load - tee_local $4 + local.tee $4 i32.add - tee_local $2 + local.tee $2 i32.eqz if i32.const 3904 return end - get_local $2 + local.get $2 call $~lib/internal/string/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 i32.const 0 - get_local $4 + local.get $4 call $~lib/internal/string/copyUnsafe - get_local $2 + local.get $2 ) (func $~lib/string/String.__concat (; 109 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.const 4144 - get_local $0 + local.get $0 select - get_local $1 + local.get $1 call $~lib/string/String#concat ) (func $std/array/createRandomString (; 110 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) i32.const 3904 - set_local $1 + local.set $1 loop $repeat|0 block $break|0 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.ge_s br_if $break|0 - get_local $1 + local.get $1 call $~lib/math/NativeMath.random i32.const 2928 i32.load - f64.convert_s/i32 + f64.convert_i32_s f64.mul f64.floor - i32.trunc_s/f64 + i32.trunc_f64_s call $~lib/string/String#charAt call $~lib/string/String.__concat - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $1 + local.get $1 ) (func $std/array/createRandomStringArray (; 111 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) i32.const 400 call $~lib/array/Array#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=4 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/math/NativeMath.random f64.const 32 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s call $std/array/createRandomString call $~lib/array/Array#__set - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $1 + local.get $1 ) (func $~lib/string/String#substring (; 112 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -6381,73 +6381,73 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 - get_local $1 + local.get $1 i32.const 0 i32.gt_s select - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.lt_s select - set_local $1 + local.set $1 i32.const 0 - get_local $3 + local.get $3 i32.const 0 - get_local $3 + local.get $3 i32.lt_s select - tee_local $2 - get_local $1 - get_local $2 - get_local $1 + local.tee $2 + local.get $1 + local.get $2 + local.get $1 i32.lt_s select - set_local $4 - get_local $2 - get_local $1 - get_local $2 - get_local $1 + local.set $4 + local.get $2 + local.get $1 + local.get $2 + local.get $1 i32.gt_s select - tee_local $1 - get_local $4 + local.tee $1 + local.get $4 i32.sub - tee_local $3 + local.tee $3 i32.eqz if i32.const 3904 return end - get_local $4 + local.get $4 i32.eqz - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.eq else - get_local $2 + local.get $2 end if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 0 - get_local $0 - get_local $4 - get_local $3 + local.get $0 + local.get $4 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $2 + local.get $2 ) (func $~lib/array/Array#join (; 113 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) @@ -6464,7 +6464,7 @@ i32.load i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s if @@ -6473,116 +6473,116 @@ end i32.const 4240 i32.load - set_local $5 + local.set $5 i32.const 4216 i32.load - tee_local $6 + local.tee $6 i32.const 0 i32.ne - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.eqz if i32.const 4184 i32.const 4200 - get_local $5 + local.get $5 i32.load8_u offset=8 select return end - get_local $6 + local.get $6 i32.const 5 i32.add - get_local $4 + local.get $4 i32.mul i32.const 5 i32.add - tee_local $8 + local.tee $8 call $~lib/internal/string/allocateUnsafe - set_local $2 + local.set $2 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if - get_local $1 - get_local $5 + local.get $1 + local.get $5 i32.add i32.load8_u offset=8 i32.const 0 i32.ne - tee_local $9 + local.tee $9 i32.eqz i32.const 4 i32.add - set_local $3 - get_local $2 - get_local $0 + local.set $3 + local.get $2 + local.get $0 i32.const 4184 i32.const 4200 - get_local $9 + local.get $9 select i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $7 + local.set $0 + local.get $7 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.const 4216 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.add - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.add i32.load8_u offset=8 i32.const 0 i32.ne - tee_local $1 + local.tee $1 i32.eqz i32.const 4 i32.add - set_local $3 - get_local $2 - get_local $0 + local.set $3 + local.get $2 + local.get $0 i32.const 4184 i32.const 4200 - get_local $1 + local.get $1 select i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $2 - set_local $1 - get_local $8 - get_local $0 - get_local $3 + local.get $2 + local.set $1 + local.get $8 + local.get $0 + local.get $3 i32.add - tee_local $0 + local.tee $0 i32.gt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -6593,20 +6593,20 @@ unreachable end end - get_local $1 + local.get $1 ) (func $~lib/internal/number/decimalCount32 (; 114 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 100000 i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 100 i32.lt_u if (result i32) i32.const 1 i32.const 2 - get_local $0 + local.get $0 i32.const 10 i32.lt_u select @@ -6614,23 +6614,23 @@ i32.const 3 i32.const 4 i32.const 5 - get_local $0 + local.get $0 i32.const 10000 i32.lt_u select - get_local $0 + local.get $0 i32.const 1000 i32.lt_u select end else - get_local $0 + local.get $0 i32.const 10000000 i32.lt_u if (result i32) i32.const 6 i32.const 7 - get_local $0 + local.get $0 i32.const 1000000 i32.lt_u select @@ -6638,11 +6638,11 @@ i32.const 8 i32.const 9 i32.const 10 - get_local $0 + local.get $0 i32.const 1000000000 i32.lt_u select - get_local $0 + local.get $0 i32.const 100000000 i32.lt_u select @@ -6654,38 +6654,38 @@ (local $4 i32) i32.const 4832 i32.load - set_local $3 + local.set $3 loop $continue|0 - get_local $1 + local.get $1 i32.const 10000 i32.ge_u if - get_local $1 + local.get $1 i32.const 10000 i32.rem_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 10000 i32.div_u - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 4 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.div_u i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.rem_u i32.const 2 @@ -6699,61 +6699,61 @@ br $continue|0 end end - get_local $1 + local.get $1 i32.const 100 i32.ge_u if - get_local $1 + local.get $1 i32.const 100 i32.rem_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 100 i32.div_u - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 2 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=4 end - get_local $1 + local.get $1 i32.const 10 i32.ge_u if - get_local $2 + local.get $2 i32.const 2 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=4 else - get_local $2 + local.get $2 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.const 48 i32.add i32.store16 offset=4 @@ -6763,83 +6763,83 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4312 return end - get_local $0 + local.get $0 i32.const 0 i32.lt_s - tee_local $1 + local.tee $1 if i32.const 0 - get_local $0 + local.get $0 i32.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - tee_local $3 + local.tee $3 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 - get_local $3 + local.tee $2 + local.get $0 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 if - get_local $2 + local.get $2 i32.const 45 i32.store16 offset=4 end - get_local $2 + local.get $2 ) (func $~lib/internal/number/itoa_stream (; 117 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 i32.const 1 return end - get_local $0 + local.get $0 block (result i32) - get_local $2 + local.get $2 i32.const 0 i32.lt_s - tee_local $1 + local.tee $1 if i32.const 0 - get_local $2 + local.get $2 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 end - get_local $2 + local.get $2 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - tee_local $2 + local.tee $2 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 if - get_local $0 + local.get $0 i32.const 45 i32.store16 offset=4 end - get_local $2 + local.get $2 ) (func $~lib/array/Array#join (; 118 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -6849,103 +6849,103 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s if i32.const 3904 return end - get_local $0 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - tee_local $6 + local.tee $6 i32.const 0 i32.ne - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.eqz if - get_local $5 + local.get $5 i32.load offset=8 call $~lib/internal/number/itoa32 return end - get_local $6 + local.get $6 i32.const 11 i32.add - get_local $4 + local.get $4 i32.mul i32.const 11 i32.add - tee_local $8 + local.tee $8 call $~lib/internal/string/allocateUnsafe - set_local $0 + local.set $0 loop $repeat|0 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.lt_s if - get_local $0 - get_local $2 - get_local $3 + local.get $0 + local.get $2 + local.get $3 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream - get_local $2 + local.get $2 i32.add - set_local $2 - get_local $7 + local.set $2 + local.get $7 if - get_local $0 - get_local $2 - get_local $1 + local.get $0 + local.get $2 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.add - set_local $2 + local.set $2 end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end - get_local $0 - set_local $3 - get_local $8 - get_local $0 - get_local $2 - get_local $4 + local.get $0 + local.set $3 + local.get $8 + local.get $0 + local.get $2 + local.get $4 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream - get_local $2 + local.get $2 i32.add - tee_local $2 + local.tee $2 i32.gt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/string/String#substring - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.eqz if i32.const 0 @@ -6956,51 +6956,51 @@ unreachable end end - get_local $3 + local.get $3 ) (func $~lib/internal/number/utoa32 (; 119 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4312 return end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - tee_local $1 + local.tee $1 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 - get_local $1 + local.tee $2 + local.get $0 + local.get $1 call $~lib/internal/number/utoa32_lut - get_local $2 + local.get $2 ) (func $~lib/internal/number/itoa_stream (; 120 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 i32.const 1 return end - get_local $0 - get_local $2 - get_local $2 + local.get $0 + local.get $2 + local.get $2 call $~lib/internal/number/decimalCount32 - tee_local $3 + local.tee $3 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 121 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -7010,103 +7010,103 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s if i32.const 3904 return end - get_local $0 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - tee_local $6 + local.tee $6 i32.const 0 i32.ne - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.eqz if - get_local $5 + local.get $5 i32.load offset=8 call $~lib/internal/number/utoa32 return end - get_local $6 + local.get $6 i32.const 10 i32.add - get_local $4 + local.get $4 i32.mul i32.const 10 i32.add - tee_local $8 + local.tee $8 call $~lib/internal/string/allocateUnsafe - set_local $0 + local.set $0 loop $repeat|0 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.lt_s if - get_local $0 - get_local $2 - get_local $3 + local.get $0 + local.get $2 + local.get $3 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream - get_local $2 + local.get $2 i32.add - set_local $2 - get_local $7 + local.set $2 + local.get $7 if - get_local $0 - get_local $2 - get_local $1 + local.get $0 + local.get $2 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.add - set_local $2 + local.set $2 end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end - get_local $0 - set_local $3 - get_local $8 - get_local $0 - get_local $2 - get_local $4 + local.get $0 + local.set $3 + local.get $8 + local.get $0 + local.get $2 + local.get $4 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add i32.load offset=8 call $~lib/internal/number/itoa_stream - get_local $2 + local.get $2 i32.add - tee_local $2 + local.tee $2 i32.gt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/string/String#substring - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.eqz if i32.const 0 @@ -7117,7 +7117,7 @@ unreachable end end - get_local $3 + local.get $3 ) (func $~lib/internal/number/genDigits (; 122 ;) (type $iIiIiIii) (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) @@ -7128,37 +7128,37 @@ (local $12 i32) (local $13 i64) (local $14 i64) - get_local $3 - get_local $1 + local.get $3 + local.get $1 i64.sub - set_local $8 + local.set $8 i64.const 1 i32.const 0 - get_local $4 + local.get $4 i32.sub - tee_local $11 - i64.extend_s/i32 - tee_local $13 + local.tee $11 + i64.extend_i32_s + local.tee $13 i64.shl - tee_local $10 + local.tee $10 i64.const 1 i64.sub - tee_local $14 - get_local $3 + local.tee $14 + local.get $3 i64.and - set_local $1 - get_local $3 - get_local $13 + local.set $1 + local.get $3 + local.get $13 i64.shr_u - i32.wrap/i64 - tee_local $7 + i32.wrap_i64 + local.tee $7 call $~lib/internal/number/decimalCount32 - set_local $9 + local.set $9 i32.const 6616 i32.load - set_local $12 + local.set $12 loop $continue|0 - get_local $9 + local.get $9 i32.const 0 i32.gt_s if @@ -7173,622 +7173,622 @@ block $case3|1 block $case2|1 block $case1|1 - get_local $9 - tee_local $2 + local.get $9 + local.tee $2 i32.const 10 i32.ne if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case9|1 $case8|1 $case7|1 $case6|1 $case5|1 $case4|1 $case3|1 $case2|1 $case1|1 $case10|1 end - get_local $7 + local.get $7 i32.const 1000000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 1000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 1000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 - set_local $4 + local.get $7 + local.set $4 i32.const 0 - set_local $7 + local.set $7 br $break|1 end i32.const 0 - set_local $4 + local.set $4 end - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.or if - get_local $6 - tee_local $2 + local.get $6 + local.tee $2 i32.const 1 i32.add - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $4 + local.get $4 i32.const 65535 i32.and i32.const 48 i32.add i32.store16 offset=4 end - get_local $9 + local.get $9 i32.const 1 i32.sub - set_local $9 - get_local $7 - i64.extend_u/i32 - get_local $11 - i64.extend_s/i32 + local.set $9 + local.get $7 + i64.extend_i32_u + local.get $11 + i64.extend_i32_s i64.shl - get_local $1 + local.get $1 i64.add - tee_local $3 - get_local $5 + local.tee $3 + local.get $5 i64.le_u if - get_global $~lib/internal/number/_K - get_local $9 + global.get $~lib/internal/number/_K + local.get $9 i32.add - set_global $~lib/internal/number/_K - get_local $12 - get_local $9 + global.set $~lib/internal/number/_K + local.get $12 + local.get $9 i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $11 - i64.extend_s/i32 + local.get $11 + i64.extend_i32_s i64.shl - set_local $1 - get_local $6 + local.set $1 + local.get $6 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $2 + local.tee $2 i32.load16_u offset=4 - set_local $7 + local.set $7 loop $continue|2 - get_local $3 - get_local $8 + local.get $3 + local.get $8 i64.lt_u - tee_local $0 + local.tee $0 if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.sub - get_local $1 + local.get $1 i64.ge_u - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $1 - get_local $3 + local.get $1 + local.get $3 i64.add - get_local $8 + local.get $8 i64.lt_u - tee_local $0 + local.tee $0 i32.eqz if - get_local $8 - get_local $3 + local.get $8 + local.get $3 i64.sub - get_local $1 - get_local $3 + local.get $1 + local.get $3 i64.add - get_local $8 + local.get $8 i64.sub i64.gt_u - set_local $0 + local.set $0 end end - get_local $0 + local.get $0 if - get_local $7 + local.get $7 i32.const 1 i32.sub - set_local $7 - get_local $1 - get_local $3 + local.set $7 + local.get $1 + local.get $3 i64.add - set_local $3 + local.set $3 br $continue|2 end end - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.store16 offset=4 - get_local $6 + local.get $6 return end br $continue|0 end end loop $continue|3 (result i32) - get_local $5 + local.get $5 i64.const 10 i64.mul - set_local $5 - get_local $1 + local.set $5 + local.get $1 i64.const 10 i64.mul - tee_local $1 - get_local $11 - i64.extend_s/i32 + local.tee $1 + local.get $11 + i64.extend_i32_s i64.shr_u - tee_local $3 - get_local $6 - i64.extend_s/i32 + local.tee $3 + local.get $6 + i64.extend_i32_s i64.or i64.const 0 i64.ne if - get_local $6 - tee_local $4 + local.get $6 + local.tee $4 i32.const 1 i32.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - i32.wrap/i64 + local.get $3 + i32.wrap_i64 i32.const 65535 i32.and i32.const 48 i32.add i32.store16 offset=4 end - get_local $9 + local.get $9 i32.const 1 i32.sub - set_local $9 - get_local $1 - get_local $14 + local.set $9 + local.get $1 + local.get $14 i64.and - tee_local $1 - get_local $5 + local.tee $1 + local.get $5 i64.ge_u br_if $continue|3 - get_global $~lib/internal/number/_K - get_local $9 + global.get $~lib/internal/number/_K + local.get $9 i32.add - set_global $~lib/internal/number/_K - get_local $12 + global.set $~lib/internal/number/_K + local.get $12 i32.const 0 - get_local $9 + local.get $9 i32.sub i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $8 + local.get $8 i64.mul - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $7 + local.tee $7 i32.load16_u offset=4 - set_local $4 + local.set $4 loop $continue|4 - get_local $1 - get_local $8 + local.get $1 + local.get $8 i64.lt_u - tee_local $2 + local.tee $2 if - get_local $5 - get_local $1 + local.get $5 + local.get $1 i64.sub - get_local $10 + local.get $10 i64.ge_u - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $1 - get_local $10 + local.get $1 + local.get $10 i64.add - get_local $8 + local.get $8 i64.lt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $8 - get_local $1 + local.get $8 + local.get $1 i64.sub - get_local $1 - get_local $10 + local.get $1 + local.get $10 i64.add - get_local $8 + local.get $8 i64.sub i64.gt_u - set_local $2 + local.set $2 end end - get_local $2 + local.get $2 if - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $1 - get_local $10 + local.set $4 + local.get $1 + local.get $10 i64.add - set_local $1 + local.set $1 br $continue|4 end end - get_local $7 - get_local $4 + local.get $7 + local.get $4 i32.store16 offset=4 - get_local $6 + local.get $6 end ) (func $~lib/internal/number/prettify (; 123 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $2 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 3145774 i32.store offset=4 - get_local $1 + local.get $1 i32.const 2 i32.add return end - get_local $1 - get_local $1 - get_local $2 + local.get $1 + local.get $1 + local.get $2 i32.add - tee_local $5 + local.tee $5 i32.le_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 21 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $1 - set_local $3 + local.get $1 + local.set $3 loop $repeat|0 block $break|0 - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.ge_s br_if $break|0 - get_local $3 + local.get $3 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 48 i32.store16 offset=4 - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end - get_local $5 + local.get $5 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 3145774 i32.store offset=4 - get_local $5 + local.get $5 i32.const 2 i32.add else - get_local $5 + local.get $5 i32.const 0 i32.gt_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 21 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $5 + local.get $5 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $3 + local.tee $3 i32.const 4 i32.add - tee_local $0 + local.tee $0 i32.const 2 i32.add - get_local $0 + local.get $0 i32.const 0 - get_local $2 + local.get $2 i32.sub i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $3 + local.get $3 i32.const 46 i32.store16 offset=4 - get_local $1 + local.get $1 i32.const 1 i32.add else i32.const -6 - get_local $5 + local.get $5 i32.lt_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 0 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $2 + local.tee $2 i32.const 2 - get_local $5 + local.get $5 i32.sub - tee_local $3 + local.tee $3 i32.const 1 i32.shl i32.add - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $0 + local.get $0 i32.const 3014704 i32.store offset=4 i32.const 2 - set_local $4 + local.set $4 loop $repeat|1 block $break|1 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.ge_s br_if $break|1 - get_local $4 + local.get $4 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 48 i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|1 end end - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add else - get_local $1 + local.get $1 i32.const 1 i32.eq if (result i32) - get_local $0 + local.get $0 i32.const 101 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 block (result i32) - get_local $5 + local.get $5 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s - tee_local $2 + local.tee $2 if i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $4 + local.set $4 end - get_local $4 + local.get $4 end - get_local $4 + local.get $4 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - tee_local $4 + local.tee $4 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 i32.const 45 i32.const 43 - get_local $2 + local.get $2 select i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 2 i32.add else - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 i32.const 4 i32.add - get_local $3 + local.get $3 i32.const 2 i32.add - get_local $1 + local.get $1 i32.const 1 i32.shl - tee_local $4 + local.tee $4 i32.const 2 i32.sub call $~lib/internal/memory/memmove - get_local $0 + local.get $0 i32.const 46 i32.store16 offset=6 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.add - tee_local $0 + local.tee $0 i32.const 101 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 block (result i32) - get_local $5 + local.get $5 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s - tee_local $2 + local.tee $2 if i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $4 + local.set $4 end - get_local $4 + local.get $4 end - get_local $4 + local.get $4 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - tee_local $0 + local.tee $0 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 i32.const 45 i32.const 43 - get_local $2 + local.get $2 select i32.store16 offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 2 i32.add @@ -7812,166 +7812,166 @@ (local $13 i32) (local $14 i32) (local $15 i64) - get_local $1 + local.get $1 f64.const 0 f64.lt - tee_local $13 + local.tee $13 if (result f64) - get_local $0 + local.get $0 i32.const 45 i32.store16 offset=4 - get_local $1 + local.get $1 f64.neg else - get_local $1 + local.get $1 end - i64.reinterpret/f64 - tee_local $2 + i64.reinterpret_f64 + local.tee $2 i64.const 9218868437227405312 i64.and i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $8 - get_local $2 + i32.wrap_i64 + local.set $8 + local.get $2 i64.const 4503599627370495 i64.and - get_local $8 + local.get $8 i32.const 0 i32.ne - tee_local $6 - i64.extend_u/i32 + local.tee $6 + i64.extend_i32_u i64.const 52 i64.shl i64.add - set_local $2 - get_local $8 + local.set $2 + local.get $8 i32.const 1 - get_local $6 + local.get $6 select i32.const 1075 i32.sub - tee_local $8 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $2 + local.set $6 + local.get $2 i64.const 1 i64.shl i64.const 1 i64.add - tee_local $5 + local.tee $5 i64.clz - i32.wrap/i64 - set_local $4 - get_local $5 - get_local $4 - i64.extend_s/i32 + i32.wrap_i64 + local.set $4 + local.get $5 + local.get $4 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_plus - get_local $2 - get_local $2 + global.set $~lib/internal/number/_frc_plus + local.get $2 + local.get $2 i64.const 4503599627370496 i64.eq i32.const 1 i32.add - tee_local $14 - i64.extend_s/i32 + local.tee $14 + i64.extend_i32_s i64.shl i64.const 1 i64.sub - get_local $8 - get_local $14 + local.get $8 + local.get $14 i32.sub - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.sub - tee_local $6 + local.tee $6 i32.sub - i64.extend_s/i32 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_minus - get_local $6 - set_global $~lib/internal/number/_exp + global.set $~lib/internal/number/_frc_minus + local.get $6 + global.set $~lib/internal/number/_exp i32.const 348 i32.const -61 - get_global $~lib/internal/number/_exp + global.get $~lib/internal/number/_exp i32.sub - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.30102999566398114 f64.mul f64.const 347 f64.add - tee_local $1 - i32.trunc_s/f64 - tee_local $4 - get_local $4 - f64.convert_s/i32 - get_local $1 + local.tee $1 + i32.trunc_f64_s + local.tee $4 + local.get $4 + f64.convert_i32_s + local.get $1 f64.ne i32.add i32.const 3 i32.shr_s i32.const 1 i32.add - tee_local $6 + local.tee $6 i32.const 3 i32.shl i32.sub - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K i32.const 6544 i32.load - set_local $4 + local.set $4 i32.const 6280 i32.load - get_local $6 + local.get $6 i32.const 3 i32.shl i32.add i64.load offset=8 - set_global $~lib/internal/number/_frc_pow - get_local $4 - get_local $6 + global.set $~lib/internal/number/_frc_pow + local.get $4 + local.get $6 i32.const 1 i32.shl i32.add i32.load16_s offset=8 - set_global $~lib/internal/number/_exp_pow - get_local $2 - get_local $2 + global.set $~lib/internal/number/_exp_pow + local.get $2 + local.get $2 i64.clz - i32.wrap/i64 - tee_local $4 - i64.extend_s/i32 + i32.wrap_i64 + local.tee $4 + i64.extend_i32_s i64.shl - tee_local $2 + local.tee $2 i64.const 4294967295 i64.and - tee_local $7 - get_global $~lib/internal/number/_frc_pow - tee_local $5 + local.tee $7 + global.get $~lib/internal/number/_frc_pow + local.tee $5 i64.const 4294967295 i64.and - tee_local $9 + local.tee $9 i64.mul - set_local $10 - get_local $5 + local.set $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $11 - get_local $7 + local.tee $11 + local.get $7 i64.mul - get_local $2 + local.get $2 i64.const 32 i64.shr_u - tee_local $12 - get_local $9 + local.tee $12 + local.get $9 i64.mul - get_local $10 + local.get $10 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add @@ -7979,43 +7979,43 @@ i64.add i64.const 32 i64.shr_u - get_local $11 - get_local $12 + local.get $11 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add i64.add - set_local $2 - get_local $5 + local.set $2 + local.get $5 i64.const 4294967295 i64.and - tee_local $11 - get_global $~lib/internal/number/_frc_plus - tee_local $3 + local.tee $11 + global.get $~lib/internal/number/_frc_plus + local.tee $3 i64.const 4294967295 i64.and - tee_local $10 + local.tee $10 i64.mul - set_local $7 - get_local $10 - get_local $5 + local.set $7 + local.get $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $9 + local.tee $9 i64.mul - get_local $11 - get_local $3 + local.get $11 + local.get $3 i64.const 32 i64.shr_u - tee_local $12 + local.tee $12 i64.mul - get_local $7 + local.get $7 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add @@ -8023,59 +8023,59 @@ i64.add i64.const 32 i64.shr_u - get_local $9 - get_local $12 + local.get $9 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add i64.add - set_local $15 - get_global $~lib/internal/number/_frc_minus - tee_local $3 + local.set $15 + global.get $~lib/internal/number/_frc_minus + local.tee $3 i64.const 4294967295 i64.and - tee_local $7 - get_local $5 + local.tee $7 + local.get $5 i64.const 4294967295 i64.and - tee_local $9 + local.tee $9 i64.mul - set_local $10 - get_local $5 + local.set $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $11 - get_local $7 + local.tee $11 + local.get $7 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u - tee_local $12 - get_local $9 + local.tee $12 + local.get $9 i64.mul - get_local $10 + local.get $10 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add - set_local $5 - get_local $15 + local.set $5 + local.get $15 i64.const 1 i64.sub - tee_local $7 - get_local $11 - get_local $12 + local.tee $7 + local.get $11 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add - get_local $5 + local.get $5 i64.const 2147483647 i64.add i64.const 32 @@ -8084,56 +8084,56 @@ i64.const 1 i64.add i64.sub - set_local $3 - get_local $13 + local.set $3 + local.get $13 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $0 - get_local $2 - get_local $8 - get_local $4 + local.get $0 + local.get $2 + local.get $8 + local.get $4 i32.sub - get_global $~lib/internal/number/_exp_pow - tee_local $4 + global.get $~lib/internal/number/_exp_pow + local.tee $4 i32.add i32.const -64 i32.sub - get_local $7 - get_local $4 - get_global $~lib/internal/number/_exp + local.get $7 + local.get $4 + global.get $~lib/internal/number/_exp i32.add i32.const -64 i32.sub - get_local $3 - get_local $13 + local.get $3 + local.get $13 call $~lib/internal/number/genDigits - get_local $13 + local.get $13 i32.sub - get_global $~lib/internal/number/_K + global.get $~lib/internal/number/_K call $~lib/internal/number/prettify - get_local $13 + local.get $13 i32.add ) (func $~lib/internal/number/dtoa (; 125 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 f64.const 0 f64.eq if i32.const 5176 return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.ne if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if i32.const 5192 @@ -8141,7 +8141,7 @@ end i32.const 5208 i32.const 5232 - get_local $0 + local.get $0 f64.const 0 f64.lt select @@ -8149,15 +8149,15 @@ end i32.const 28 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 call $~lib/internal/number/dtoa_core - set_local $1 - get_local $2 - get_local $1 + local.set $1 + local.get $2 + local.get $1 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -8167,79 +8167,79 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 ) (func $~lib/internal/number/dtoa_stream (; 126 ;) (type $iiFi) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 f64.const 0 f64.eq if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 - get_local $0 + local.get $0 i32.const 46 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=8 i32.const 3 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 f64.sub f64.const 0 f64.ne if - get_local $2 - get_local $2 + local.get $2 + local.get $2 f64.ne if - get_local $0 + local.get $0 i32.const 78 i32.store16 offset=4 - get_local $0 + local.get $0 i32.const 97 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 78 i32.store16 offset=8 i32.const 3 return else - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 5208 i32.const 5232 - get_local $2 + local.get $2 f64.const 0 f64.lt - tee_local $0 + local.tee $0 select i32.const 4 i32.add - get_local $0 + local.get $0 i32.const 8 i32.add - tee_local $0 + local.tee $0 i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $0 + local.get $0 return end unreachable end - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/internal/number/dtoa_core ) (func $~lib/array/Array#join (; 127 ;) (type $FUNCSIG$i) (result i32) @@ -8255,7 +8255,7 @@ i32.load i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -8264,89 +8264,89 @@ end i32.const 6688 i32.load - set_local $4 + local.set $4 i32.const 5168 i32.load - tee_local $5 + local.tee $5 i32.const 0 i32.ne - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.eqz if - get_local $4 + local.get $4 f64.load offset=8 call $~lib/internal/number/dtoa return end - get_local $5 + local.get $5 i32.const 28 i32.add - get_local $3 + local.get $3 i32.mul i32.const 28 i32.add - tee_local $7 + local.tee $7 call $~lib/internal/string/allocateUnsafe - set_local $2 + local.set $2 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add f64.load offset=8 call $~lib/internal/number/dtoa_stream - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.const 5168 i32.const 0 - get_local $5 + local.get $5 call $~lib/internal/string/copyUnsafe - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.add - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $7 - get_local $2 - tee_local $1 - get_local $0 - get_local $3 + local.get $7 + local.get $2 + local.tee $1 + local.get $0 + local.get $3 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add f64.load offset=8 call $~lib/internal/number/dtoa_stream - get_local $0 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.gt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -8357,7 +8357,7 @@ unreachable end end - get_local $1 + local.get $1 ) (func $~lib/array/Array#join (; 128 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -8367,137 +8367,137 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $5 + local.tee $5 i32.const 0 i32.lt_s if i32.const 3904 return end - get_local $0 + local.get $0 i32.load - set_local $6 - get_local $1 + local.set $6 + local.get $1 i32.load - tee_local $7 + local.tee $7 i32.const 0 i32.ne - set_local $8 - get_local $5 + local.set $8 + local.get $5 i32.eqz if - get_local $6 + local.get $6 i32.load offset=8 return end i32.const 0 - set_local $0 - get_local $5 + local.set $0 + local.get $5 i32.const 1 i32.add - set_local $2 + local.set $2 loop $repeat|0 block $break|0 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.ge_s br_if $break|0 - get_local $6 - get_local $0 + local.get $6 + local.get $0 i32.const 2 i32.shl i32.add i32.load offset=8 i32.load - get_local $3 + local.get $3 i32.add - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end i32.const 0 - set_local $2 - get_local $5 - get_local $7 + local.set $2 + local.get $5 + local.get $7 i32.mul - get_local $3 + local.get $3 i32.add call $~lib/internal/string/allocateUnsafe - set_local $0 + local.set $0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|1 block $break|1 - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.ge_s br_if $break|1 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.const 2 i32.shl i32.add i32.load offset=8 - tee_local $4 + local.tee $4 if - get_local $0 - get_local $2 - get_local $4 + local.get $0 + local.get $2 + local.get $4 i32.const 0 - get_local $4 + local.get $4 i32.load - tee_local $4 + local.tee $4 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - set_local $2 + local.set $2 end - get_local $8 + local.get $8 if - get_local $0 - get_local $2 - get_local $1 + local.get $0 + local.get $2 + local.get $1 i32.const 0 - get_local $7 + local.get $7 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.add - set_local $2 + local.set $2 end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|1 end end - get_local $6 - get_local $5 + local.get $6 + local.get $5 i32.const 2 i32.shl i32.add i32.load offset=8 - tee_local $4 + local.tee $4 if - get_local $0 - get_local $2 - get_local $4 + local.get $0 + local.get $2 + local.get $4 i32.const 0 - get_local $4 + local.get $4 i32.load call $~lib/internal/string/copyUnsafe end - get_local $0 + local.get $0 ) (func $~lib/array/Array#join (; 129 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -8507,118 +8507,118 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if i32.const 3904 return end - get_local $0 + local.get $0 i32.load - set_local $5 + local.set $5 i32.const 4216 i32.load - tee_local $4 + local.tee $4 i32.const 0 i32.ne - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.eqz if i32.const 6872 return end - get_local $4 + local.get $4 i32.const 15 i32.add - get_local $3 + local.get $3 i32.mul i32.const 15 i32.add - tee_local $7 + local.tee $7 call $~lib/internal/string/allocateUnsafe - set_local $2 + local.set $2 i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.lt_s if - get_local $0 + local.get $0 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add i32.load offset=8 if - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 6872 i32.const 0 i32.const 15 call $~lib/internal/string/copyUnsafe - get_local $1 + local.get $1 i32.const 15 i32.add - set_local $1 + local.set $1 end - get_local $6 + local.get $6 if - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 4216 i32.const 0 - get_local $4 + local.get $4 call $~lib/internal/string/copyUnsafe - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $2 - set_local $0 + local.get $2 + local.set $0 block (result i32) - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add i32.load offset=8 if - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 6872 i32.const 0 i32.const 15 call $~lib/internal/string/copyUnsafe - get_local $1 + local.get $1 i32.const 15 i32.add - set_local $1 + local.set $1 end - get_local $7 - get_local $1 + local.get $7 + local.get $1 i32.gt_s end if - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/string/String#substring - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if i32.const 0 @@ -8629,62 +8629,62 @@ unreachable end end - get_local $0 + local.get $0 ) (func $~lib/internal/number/itoa_stream (; 130 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 255 i32.and i32.eqz if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 i32.const 1 return end - get_local $2 + local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.const 0 i32.lt_s - tee_local $3 + local.tee $3 if i32.const 0 - get_local $2 + local.get $2 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - tee_local $2 + local.tee $2 call $~lib/internal/number/decimalCount32 - get_local $3 + local.get $3 i32.add - set_local $1 - get_local $0 - get_local $2 - get_local $1 + local.set $1 + local.get $0 + local.get $2 + local.get $1 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 if - get_local $0 + local.get $0 i32.const 45 i32.store16 offset=4 end - get_local $1 + local.get $1 ) (func $~lib/array/Array#join (; 131 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) @@ -8699,7 +8699,7 @@ i32.load i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -8708,85 +8708,85 @@ end i32.const 7064 i32.load - set_local $4 + local.set $4 i32.const 4216 i32.load - tee_local $5 + local.tee $5 i32.const 0 i32.ne - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i32.load8_s offset=8 call $~lib/internal/number/itoa32 return end - get_local $5 + local.get $5 i32.const 11 i32.add - get_local $3 + local.get $3 i32.mul i32.const 11 i32.add - tee_local $7 + local.tee $7 call $~lib/internal/string/allocateUnsafe - set_local $2 + local.set $2 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if - get_local $2 - get_local $0 - get_local $1 - get_local $4 + local.get $2 + local.get $0 + local.get $1 + local.get $4 i32.add i32.load8_s offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.const 4216 i32.const 0 - get_local $5 + local.get $5 call $~lib/internal/string/copyUnsafe - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.add - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $7 - get_local $2 - tee_local $1 - get_local $0 - get_local $3 - get_local $4 + local.get $7 + local.get $2 + local.tee $1 + local.get $0 + local.get $3 + local.get $4 i32.add i32.load8_s offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.gt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -8797,37 +8797,37 @@ unreachable end end - get_local $1 + local.get $1 ) (func $~lib/internal/number/itoa_stream (; 132 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 65535 i32.and i32.eqz if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 i32.const 1 return end - get_local $2 + local.get $2 i32.const 65535 i32.and - tee_local $2 + local.tee $2 call $~lib/internal/number/decimalCount32 - set_local $1 - get_local $0 - get_local $2 - get_local $1 + local.set $1 + local.get $0 + local.get $2 + local.get $1 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 ) (func $~lib/array/Array#join (; 133 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) @@ -8842,7 +8842,7 @@ i32.load i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -8851,89 +8851,89 @@ end i32.const 7128 i32.load - set_local $4 + local.set $4 i32.const 4216 i32.load - tee_local $5 + local.tee $5 i32.const 0 i32.ne - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i32.load16_u offset=8 call $~lib/internal/number/utoa32 return end - get_local $5 + local.get $5 i32.const 10 i32.add - get_local $3 + local.get $3 i32.mul i32.const 10 i32.add - tee_local $7 + local.tee $7 call $~lib/internal/string/allocateUnsafe - set_local $2 + local.set $2 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.const 4216 i32.const 0 - get_local $5 + local.get $5 call $~lib/internal/string/copyUnsafe - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.add - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $7 - get_local $2 - tee_local $1 - get_local $0 - get_local $3 + local.get $7 + local.get $2 + local.tee $1 + local.get $0 + local.get $3 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.gt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -8944,20 +8944,20 @@ unreachable end end - get_local $1 + local.get $1 ) (func $~lib/internal/number/decimalCount64 (; 134 ;) (type $Ii) (param $0 i64) (result i32) - get_local $0 + local.get $0 i64.const 1000000000000000 i64.lt_u if (result i32) - get_local $0 + local.get $0 i64.const 1000000000000 i64.lt_u if (result i32) i32.const 11 i32.const 12 - get_local $0 + local.get $0 i64.const 100000000000 i64.lt_u select @@ -8965,23 +8965,23 @@ i32.const 13 i32.const 14 i32.const 15 - get_local $0 + local.get $0 i64.const 100000000000000 i64.lt_u select - get_local $0 + local.get $0 i64.const 10000000000000 i64.lt_u select end else - get_local $0 + local.get $0 i64.const 100000000000000000 i64.lt_u if (result i32) i32.const 16 i32.const 17 - get_local $0 + local.get $0 i64.const 10000000000000000 i64.lt_u select @@ -8989,11 +8989,11 @@ i32.const 18 i32.const 19 i32.const 20 - get_local $0 + local.get $0 i64.const -8446744073709551616 i64.lt_u select - get_local $0 + local.get $0 i64.const 1000000000000000000 i64.lt_u select @@ -9007,53 +9007,53 @@ (local $6 i32) i32.const 7712 i32.load - set_local $3 + local.set $3 loop $continue|0 - get_local $1 + local.get $1 i64.const 100000000 i64.ge_u if - get_local $1 - get_local $1 + local.get $1 + local.get $1 i64.const 100000000 i64.div_u - tee_local $1 + local.tee $1 i64.const 100000000 i64.mul i64.sub - i32.wrap/i64 - tee_local $4 + i32.wrap_i64 + local.tee $4 i32.const 10000 i32.div_u - tee_local $5 + local.tee $5 i32.const 100 i32.div_u - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 100 i32.rem_u - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 4 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 10000 i32.rem_u - tee_local $4 + local.tee $4 i32.const 100 i32.div_u i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.rem_u i32.const 2 @@ -9064,22 +9064,22 @@ i64.shl i64.or i64.store offset=4 - get_local $2 + local.get $2 i32.const 4 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $6 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add @@ -9091,87 +9091,87 @@ br $continue|0 end end - get_local $0 - get_local $1 - i32.wrap/i64 - get_local $2 + local.get $0 + local.get $1 + i32.wrap_i64 + local.get $2 call $~lib/internal/number/utoa32_lut ) (func $~lib/internal/number/utoa64 (; 136 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 4312 return end - get_local $0 + local.get $0 i64.const 4294967295 i64.le_u if - get_local $0 - i32.wrap/i64 - tee_local $3 + local.get $0 + i32.wrap_i64 + local.tee $3 call $~lib/internal/number/decimalCount32 - tee_local $1 + local.tee $1 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $3 - get_local $1 + local.tee $2 + local.get $3 + local.get $1 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - tee_local $1 + local.tee $1 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 - get_local $1 + local.tee $2 + local.get $0 + local.get $1 call $~lib/internal/number/utoa64_lut end - get_local $2 + local.get $2 ) (func $~lib/internal/number/itoa_stream (; 137 ;) (type $iiIi) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i64.eqz if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 i32.const 1 return end - get_local $2 + local.get $2 i64.const 4294967295 i64.le_u if - get_local $2 - i32.wrap/i64 - tee_local $3 + local.get $2 + i32.wrap_i64 + local.tee $3 call $~lib/internal/number/decimalCount32 - set_local $1 - get_local $0 - get_local $3 - get_local $1 + local.set $1 + local.get $0 + local.get $3 + local.get $1 call $~lib/internal/number/utoa32_lut else - get_local $0 - get_local $2 - get_local $2 + local.get $0 + local.get $2 + local.get $2 call $~lib/internal/number/decimalCount64 - tee_local $1 + local.tee $1 call $~lib/internal/number/utoa64_lut end - get_local $1 + local.get $1 ) (func $~lib/array/Array#join (; 138 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) @@ -9186,7 +9186,7 @@ i32.load i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -9195,89 +9195,89 @@ end i32.const 7752 i32.load - set_local $4 + local.set $4 i32.const 4216 i32.load - tee_local $5 + local.tee $5 i32.const 0 i32.ne - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i64.load offset=8 call $~lib/internal/number/utoa64 return end - get_local $5 + local.get $5 i32.const 20 i32.add - get_local $3 + local.get $3 i32.mul i32.const 20 i32.add - tee_local $7 + local.tee $7 call $~lib/internal/string/allocateUnsafe - set_local $2 + local.set $2 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.const 4216 i32.const 0 - get_local $5 + local.get $5 call $~lib/internal/string/copyUnsafe - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.add - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $7 - get_local $2 - tee_local $1 - get_local $0 - get_local $3 + local.get $7 + local.get $2 + local.tee $1 + local.get $0 + local.get $3 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.gt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -9288,129 +9288,129 @@ unreachable end end - get_local $1 + local.get $1 ) (func $~lib/internal/number/itoa64 (; 139 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 4312 return end block (result i32) - get_local $0 + local.get $0 i64.const 0 i64.lt_s - tee_local $1 + local.tee $1 if i64.const 0 - get_local $0 + local.get $0 i64.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i64.const 4294967295 i64.le_u end if - get_local $0 - i32.wrap/i64 - tee_local $4 + local.get $0 + i32.wrap_i64 + local.tee $4 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - tee_local $2 + local.tee $2 call $~lib/internal/string/allocateUnsafe - tee_local $3 - get_local $4 - get_local $2 + local.tee $3 + local.get $4 + local.get $2 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - get_local $1 + local.get $1 i32.add - tee_local $2 + local.tee $2 call $~lib/internal/string/allocateUnsafe - tee_local $3 - get_local $0 - get_local $2 + local.tee $3 + local.get $0 + local.get $2 call $~lib/internal/number/utoa64_lut end - get_local $1 + local.get $1 if - get_local $3 + local.get $3 i32.const 45 i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/internal/number/itoa_stream (; 140 ;) (type $iiIi) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i64.eqz if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 i32.const 1 return end block (result i32) - get_local $2 + local.get $2 i64.const 0 i64.lt_s - tee_local $3 + local.tee $3 if i64.const 0 - get_local $2 + local.get $2 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 4294967295 i64.le_u end if - get_local $2 - i32.wrap/i64 - tee_local $4 + local.get $2 + i32.wrap_i64 + local.tee $4 call $~lib/internal/number/decimalCount32 - get_local $3 + local.get $3 i32.add - set_local $1 - get_local $0 - get_local $4 - get_local $1 + local.set $1 + local.get $0 + local.get $4 + local.get $1 call $~lib/internal/number/utoa32_lut else - get_local $0 - get_local $2 - get_local $2 + local.get $0 + local.get $2 + local.get $2 call $~lib/internal/number/decimalCount64 - get_local $3 + local.get $3 i32.add - tee_local $1 + local.tee $1 call $~lib/internal/number/utoa64_lut end - get_local $3 + local.get $3 if - get_local $0 + local.get $0 i32.const 45 i32.store16 offset=4 end - get_local $1 + local.get $1 ) (func $~lib/array/Array#join (; 141 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) @@ -9425,7 +9425,7 @@ i32.load i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -9434,89 +9434,89 @@ end i32.const 7952 i32.load - set_local $4 + local.set $4 i32.const 4216 i32.load - tee_local $5 + local.tee $5 i32.const 0 i32.ne - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i64.load offset=8 call $~lib/internal/number/itoa64 return end - get_local $5 + local.get $5 i32.const 21 i32.add - get_local $3 + local.get $3 i32.mul i32.const 21 i32.add - tee_local $7 + local.tee $7 call $~lib/internal/string/allocateUnsafe - set_local $2 + local.set $2 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $6 + local.set $0 + local.get $6 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.const 4216 i32.const 0 - get_local $5 + local.get $5 call $~lib/internal/string/copyUnsafe - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.add - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $7 - get_local $2 - tee_local $1 - get_local $0 - get_local $3 + local.get $7 + local.get $2 + local.tee $1 + local.get $0 + local.get $3 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add i64.load offset=8 call $~lib/internal/number/itoa_stream - get_local $0 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.gt_s if - get_local $2 - get_local $0 + local.get $2 + local.get $0 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -9527,7 +9527,7 @@ unreachable end end - get_local $1 + local.get $1 ) (func $~lib/array/Array>#join (; 142 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -9535,11 +9535,11 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -9547,23 +9547,23 @@ return end i32.const 3904 - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load - set_local $4 + local.set $4 i32.const 4216 i32.load i32.const 0 i32.ne - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i32.load offset=8 - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 i32.const 4216 call $~lib/array/Array#join else @@ -9572,87 +9572,87 @@ return end i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.lt_s if - get_local $0 + local.get $0 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 - tee_local $2 + local.tee $2 if - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 4216 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $5 + local.get $5 if - get_local $1 + local.get $1 i32.const 4216 call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 - tee_local $2 + local.tee $2 if - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 4216 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $1 + local.get $1 ) (func $~lib/internal/number/itoa_stream (; 143 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 255 i32.and i32.eqz if - get_local $0 + local.get $0 i32.const 48 i32.store16 offset=4 i32.const 1 return end - get_local $2 + local.get $2 i32.const 255 i32.and - tee_local $2 + local.tee $2 call $~lib/internal/number/decimalCount32 - set_local $1 - get_local $0 - get_local $2 - get_local $1 + local.set $1 + local.get $0 + local.get $2 + local.get $1 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 ) (func $~lib/array/Array#join (; 144 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9662,99 +9662,99 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s if i32.const 3904 return end - get_local $0 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - tee_local $6 + local.tee $6 i32.const 0 i32.ne - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.eqz if - get_local $5 + local.get $5 i32.load8_u offset=8 call $~lib/internal/number/utoa32 return end - get_local $6 + local.get $6 i32.const 10 i32.add - get_local $4 + local.get $4 i32.mul i32.const 10 i32.add - tee_local $8 + local.tee $8 call $~lib/internal/string/allocateUnsafe - set_local $0 + local.set $0 loop $repeat|0 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.lt_s if - get_local $0 - get_local $2 - get_local $3 - get_local $5 + local.get $0 + local.get $2 + local.get $3 + local.get $5 i32.add i32.load8_u offset=8 call $~lib/internal/number/itoa_stream - get_local $2 + local.get $2 i32.add - set_local $2 - get_local $7 + local.set $2 + local.get $7 if - get_local $0 - get_local $2 - get_local $1 + local.get $0 + local.get $2 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.add - set_local $2 + local.set $2 end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end - get_local $0 - set_local $3 - get_local $8 - get_local $0 - get_local $2 - get_local $4 - get_local $5 + local.get $0 + local.set $3 + local.get $8 + local.get $0 + local.get $2 + local.get $4 + local.get $5 i32.add i32.load8_u offset=8 call $~lib/internal/number/itoa_stream - get_local $2 + local.get $2 i32.add - tee_local $2 + local.tee $2 i32.gt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/string/String#substring - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.eqz if i32.const 0 @@ -9765,7 +9765,7 @@ unreachable end end - get_local $3 + local.get $3 ) (func $~lib/array/Array>#join (; 145 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -9773,11 +9773,11 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -9785,23 +9785,23 @@ return end i32.const 3904 - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load - set_local $4 + local.set $4 i32.const 4216 i32.load i32.const 0 i32.ne - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i32.load offset=8 - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 i32.const 4216 call $~lib/array/Array#join else @@ -9810,57 +9810,57 @@ return end i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.lt_s if - get_local $0 + local.get $0 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 - tee_local $2 + local.tee $2 if - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 4216 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $5 + local.get $5 if - get_local $1 + local.get $1 i32.const 4216 call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 - tee_local $2 + local.tee $2 if - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 4216 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $1 + local.get $1 ) (func $~lib/array/Array>#join (; 146 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9868,11 +9868,11 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s if @@ -9880,24 +9880,24 @@ return end i32.const 3904 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load i32.const 0 i32.ne - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.eqz if - get_local $5 + local.get $5 i32.load offset=8 - tee_local $3 + local.tee $3 if (result i32) - get_local $3 - get_local $1 + local.get $3 + local.get $1 call $~lib/array/Array#join else i32.const 3904 @@ -9905,57 +9905,57 @@ return end i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 block $break|0 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 - get_local $5 - get_local $0 + local.get $5 + local.get $0 i32.const 2 i32.shl i32.add i32.load offset=8 - tee_local $3 + local.tee $3 if - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $2 + local.set $2 end - get_local $6 + local.get $6 if - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/string/String.__concat - set_local $2 + local.set $2 end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $5 - get_local $4 + local.get $5 + local.get $4 i32.const 2 i32.shl i32.add i32.load offset=8 - tee_local $3 + local.tee $3 if (result i32) - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat else - get_local $2 + local.get $2 end ) (func $~lib/array/Array>>#join (; 147 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -9964,11 +9964,11 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if @@ -9976,23 +9976,23 @@ return end i32.const 3904 - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load - set_local $4 + local.set $4 i32.const 4216 i32.load i32.const 0 i32.ne - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i32.load offset=8 - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 i32.const 4216 call $~lib/array/Array>#join else @@ -10001,69 +10001,69 @@ return end i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.lt_s if - get_local $0 + local.get $0 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 - tee_local $2 + local.tee $2 if - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 4216 call $~lib/array/Array>#join call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $5 + local.get $5 if - get_local $1 + local.get $1 i32.const 4216 call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end end - get_local $3 + local.get $3 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 - tee_local $2 + local.tee $2 if - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 4216 call $~lib/array/Array>#join call $~lib/string/String.__concat - set_local $1 + local.set $1 end - get_local $1 + local.get $1 ) (func $start (; 148 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 8432 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 call $~lib/array/Array#constructor - set_global $std/array/arr - get_global $std/array/Null + global.set $std/array/arr + global.get $std/array/Null if i32.const 0 i32.const 120 @@ -10072,7 +10072,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 i32.ne i32.const 1 @@ -10093,13 +10093,13 @@ i32.const 1 call $~lib/internal/typedarray/TypedArray#constructor drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 1 i32.const 1 i32.const 3 call $~lib/array/Array#fill drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 256 call $std/array/isArraysEqual i32.eqz @@ -10112,13 +10112,13 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/array/arr8 + global.set $~argc + global.get $std/array/arr8 i32.const 0 i32.const 0 call $~lib/array/Array#fill|trampoline drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 280 call $std/array/isArraysEqual i32.eqz @@ -10130,13 +10130,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 1 i32.const 0 i32.const -3 call $~lib/array/Array#fill drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 304 call $std/array/isArraysEqual i32.eqz @@ -10149,13 +10149,13 @@ unreachable end i32.const 2 - set_global $~argc - get_global $std/array/arr8 + global.set $~argc + global.get $std/array/arr8 i32.const 2 i32.const -2 call $~lib/array/Array#fill|trampoline drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 328 call $std/array/isArraysEqual i32.eqz @@ -10167,13 +10167,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 0 i32.const 1 i32.const 0 call $~lib/array/Array#fill drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 352 call $std/array/isArraysEqual i32.eqz @@ -10185,13 +10185,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 1 i32.const 1 i32.const 3 call $~lib/array/Array#fill drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 432 i32.const 0 call $std/array/isArraysEqual @@ -10205,13 +10205,13 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/array/arr32 + global.set $~argc + global.get $std/array/arr32 i32.const 0 i32.const 0 call $~lib/array/Array#fill|trampoline drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 472 i32.const 0 call $std/array/isArraysEqual @@ -10224,13 +10224,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 1 i32.const 0 i32.const -3 call $~lib/array/Array#fill drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 512 i32.const 0 call $std/array/isArraysEqual @@ -10244,13 +10244,13 @@ unreachable end i32.const 2 - set_global $~argc - get_global $std/array/arr32 + global.set $~argc + global.get $std/array/arr32 i32.const 2 i32.const -2 call $~lib/array/Array#fill|trampoline drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 552 i32.const 0 call $std/array/isArraysEqual @@ -10263,13 +10263,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 0 i32.const 1 i32.const 0 call $~lib/array/Array#fill drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 592 i32.const 0 call $std/array/isArraysEqual @@ -10282,7 +10282,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 if i32.const 0 @@ -10292,7 +10292,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10305,20 +10305,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 call $~lib/array/Array#push drop i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -10333,7 +10333,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 1 i32.ne @@ -10345,7 +10345,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10360,10 +10360,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 42 i32.ne if @@ -10374,7 +10374,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 if i32.const 0 @@ -10384,7 +10384,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10399,11 +10399,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 1 i32.ne @@ -10415,7 +10415,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10431,15 +10431,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -10454,11 +10454,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 44 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -10470,7 +10470,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10486,15 +10486,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -10510,15 +10510,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -10535,11 +10535,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 45 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 3 i32.ne @@ -10551,7 +10551,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10567,15 +10567,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -10591,15 +10591,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -10617,15 +10617,15 @@ unreachable end i32.const 2 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -10644,12 +10644,12 @@ end i32.const 0 call $~lib/array/Array#constructor - set_global $std/array/other - get_global $std/array/arr - get_global $std/array/other + global.set $std/array/other + global.get $std/array/arr + global.get $std/array/other call $~lib/array/Array#concat - set_global $std/array/out - get_global $std/array/arr + global.set $std/array/out + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10664,7 +10664,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 3 i32.ne @@ -10676,7 +10676,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.load offset=4 i32.const 3 i32.ne @@ -10688,11 +10688,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 608 call $~lib/array/Array#concat drop - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10708,15 +10708,15 @@ unreachable end i32.const 0 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -10732,15 +10732,15 @@ unreachable end i32.const 1 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -10758,15 +10758,15 @@ unreachable end i32.const 2 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -10783,19 +10783,19 @@ call $~lib/env/abort unreachable end - get_global $std/array/other + global.get $std/array/other i32.const 46 call $~lib/array/Array#push drop - get_global $std/array/other + global.get $std/array/other i32.const 47 call $~lib/array/Array#push drop - get_global $std/array/arr - get_global $std/array/other + global.get $std/array/arr + global.get $std/array/other call $~lib/array/Array#concat - set_global $std/array/out - get_global $std/array/arr + global.set $std/array/out + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -10810,7 +10810,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/other + global.get $std/array/other i32.load offset=4 i32.const 2 i32.ne @@ -10822,7 +10822,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.load offset=4 i32.const 5 i32.ne @@ -10835,15 +10835,15 @@ unreachable end i32.const 0 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -10859,15 +10859,15 @@ unreachable end i32.const 1 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -10885,15 +10885,15 @@ unreachable end i32.const 2 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -10911,15 +10911,15 @@ unreachable end i32.const 3 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 12 i32.add i32.load offset=8 @@ -10937,15 +10937,15 @@ unreachable end i32.const 4 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 16 i32.add i32.load offset=8 @@ -10962,10 +10962,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out call $~lib/array/Array#pop drop - get_global $std/array/out + global.get $std/array/out i32.load offset=4 i32.const 4 i32.ne @@ -10977,11 +10977,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#concat - set_global $std/array/out - get_global $std/array/out + global.set $std/array/out + global.get $std/array/out i32.load offset=4 i32.const 3 i32.ne @@ -10994,15 +10994,15 @@ unreachable end i32.const 2 - get_global $std/array/out + global.get $std/array/out i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -11019,7 +11019,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/source + global.get $std/array/source i32.load offset=4 if i32.const 0 @@ -11029,11 +11029,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/source - get_global $std/array/arr + global.get $std/array/source + global.get $std/array/arr call $~lib/array/Array#concat - set_global $std/array/out - get_global $std/array/out + global.set $std/array/out + global.get $std/array/out i32.load offset=4 i32.const 3 i32.ne @@ -11045,7 +11045,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/source + global.get $std/array/source i32.load offset=4 if i32.const 0 @@ -11056,10 +11056,10 @@ unreachable end i32.const 664 - set_global $std/array/cwArr + global.set $std/array/cwArr i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 0 i32.const 3 call $~lib/array/Array#copyWithin|trampoline @@ -11076,10 +11076,10 @@ unreachable end i32.const 744 - set_global $std/array/cwArr + global.set $std/array/cwArr i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 1 i32.const 3 call $~lib/array/Array#copyWithin|trampoline @@ -11096,10 +11096,10 @@ unreachable end i32.const 824 - set_global $std/array/cwArr + global.set $std/array/cwArr i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 1 i32.const 2 call $~lib/array/Array#copyWithin|trampoline @@ -11116,10 +11116,10 @@ unreachable end i32.const 904 - set_global $std/array/cwArr + global.set $std/array/cwArr i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 2 i32.const 2 call $~lib/array/Array#copyWithin|trampoline @@ -11136,8 +11136,8 @@ unreachable end i32.const 984 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 0 i32.const 3 i32.const 4 @@ -11155,8 +11155,8 @@ unreachable end i32.const 1064 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 1 i32.const 3 i32.const 4 @@ -11174,8 +11174,8 @@ unreachable end i32.const 1144 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 1 i32.const 2 i32.const 4 @@ -11193,10 +11193,10 @@ unreachable end i32.const 1224 - set_global $std/array/cwArr + global.set $std/array/cwArr i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 0 i32.const -2 call $~lib/array/Array#copyWithin|trampoline @@ -11213,8 +11213,8 @@ unreachable end i32.const 1304 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 0 i32.const -2 i32.const -1 @@ -11232,8 +11232,8 @@ unreachable end i32.const 1384 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const -4 i32.const -3 i32.const -2 @@ -11251,8 +11251,8 @@ unreachable end i32.const 1464 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const -4 i32.const -3 i32.const -1 @@ -11270,10 +11270,10 @@ unreachable end i32.const 1544 - set_global $std/array/cwArr + global.set $std/array/cwArr i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const -4 i32.const -3 call $~lib/array/Array#copyWithin|trampoline @@ -11289,11 +11289,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 call $~lib/array/Array#unshift drop - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 4 i32.ne @@ -11305,7 +11305,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -11321,15 +11321,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -11345,15 +11345,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -11371,15 +11371,15 @@ unreachable end i32.const 2 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -11397,15 +11397,15 @@ unreachable end i32.const 3 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 12 i32.add i32.load offset=8 @@ -11422,11 +11422,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 41 call $~lib/array/Array#unshift drop - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 5 i32.ne @@ -11438,7 +11438,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -11454,15 +11454,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -11478,15 +11478,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -11504,15 +11504,15 @@ unreachable end i32.const 2 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -11530,15 +11530,15 @@ unreachable end i32.const 3 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 12 i32.add i32.load offset=8 @@ -11556,15 +11556,15 @@ unreachable end i32.const 4 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 16 i32.add i32.load offset=8 @@ -11581,10 +11581,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#shift - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 41 i32.ne if @@ -11595,7 +11595,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 4 i32.ne @@ -11607,7 +11607,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -11623,15 +11623,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -11647,15 +11647,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -11673,15 +11673,15 @@ unreachable end i32.const 2 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -11699,15 +11699,15 @@ unreachable end i32.const 3 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 12 i32.add i32.load offset=8 @@ -11724,10 +11724,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 45 i32.ne if @@ -11738,7 +11738,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 3 i32.ne @@ -11750,7 +11750,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -11766,15 +11766,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -11790,15 +11790,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -11816,15 +11816,15 @@ unreachable end i32.const 2 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -11841,10 +11841,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#reverse drop - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 3 i32.ne @@ -11856,7 +11856,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -11872,15 +11872,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -11896,15 +11896,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -11922,15 +11922,15 @@ unreachable end i32.const 2 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -11947,20 +11947,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 44 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 44 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i if i32.const 0 i32.const 120 @@ -11969,12 +11969,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 2 i32.ne if @@ -11985,12 +11985,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 45 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.ne if @@ -12001,12 +12001,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 100 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.ne if @@ -12017,12 +12017,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -100 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -12033,12 +12033,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -2 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 3 i32.ne if @@ -12049,12 +12049,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -4 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -12065,12 +12065,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -12081,12 +12081,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 1 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -12097,12 +12097,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 2 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 3 i32.ne if @@ -12113,7 +12113,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 44 i32.const 0 call $~lib/array/Array#indexOf @@ -12121,8 +12121,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12133,7 +12133,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 i32.const 0 call $~lib/array/Array#indexOf @@ -12141,8 +12141,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12153,7 +12153,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 45 i32.const 0 call $~lib/array/Array#indexOf @@ -12161,8 +12161,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes if i32.const 0 i32.const 120 @@ -12171,7 +12171,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 100 call $~lib/array/Array#indexOf @@ -12179,8 +12179,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes if i32.const 0 i32.const 120 @@ -12189,7 +12189,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -100 call $~lib/array/Array#indexOf @@ -12197,8 +12197,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12209,7 +12209,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -2 call $~lib/array/Array#indexOf @@ -12217,8 +12217,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12229,7 +12229,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -4 call $~lib/array/Array#indexOf @@ -12237,8 +12237,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12249,7 +12249,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 0 call $~lib/array/Array#indexOf @@ -12257,8 +12257,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12269,7 +12269,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 1 call $~lib/array/Array#indexOf @@ -12277,8 +12277,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12289,7 +12289,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 2 call $~lib/array/Array#indexOf @@ -12297,8 +12297,8 @@ i32.ge_s i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.ne if @@ -12309,12 +12309,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 i32.const 1 call $~lib/array/Array#splice drop - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 4 i32.ne @@ -12326,7 +12326,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load i32.load i32.const 2 @@ -12342,15 +12342,15 @@ unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -12366,15 +12366,15 @@ unreachable end i32.const 1 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -12392,8 +12392,8 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const 0 call $~lib/array/Array#splice|trampoline i32.const 1664 @@ -12408,7 +12408,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1680 i32.const 0 call $std/array/isArraysEqual @@ -12422,10 +12422,10 @@ unreachable end i32.const 1720 - set_global $std/array/sarr + global.set $std/array/sarr i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const 2 call $~lib/array/Array#splice|trampoline i32.const 1760 @@ -12440,7 +12440,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1784 i32.const 0 call $std/array/isArraysEqual @@ -12454,8 +12454,8 @@ unreachable end i32.const 1824 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 2 i32.const 2 call $~lib/array/Array#splice @@ -12471,7 +12471,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1888 i32.const 0 call $std/array/isArraysEqual @@ -12485,8 +12485,8 @@ unreachable end i32.const 1928 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 0 i32.const 1 call $~lib/array/Array#splice @@ -12502,7 +12502,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1992 i32.const 0 call $std/array/isArraysEqual @@ -12516,10 +12516,10 @@ unreachable end i32.const 2032 - set_global $std/array/sarr + global.set $std/array/sarr i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const -1 call $~lib/array/Array#splice|trampoline i32.const 2056 @@ -12534,7 +12534,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2096 i32.const 0 call $std/array/isArraysEqual @@ -12548,10 +12548,10 @@ unreachable end i32.const 2136 - set_global $std/array/sarr + global.set $std/array/sarr i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const -2 call $~lib/array/Array#splice|trampoline i32.const 2160 @@ -12566,7 +12566,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2200 i32.const 0 call $std/array/isArraysEqual @@ -12580,8 +12580,8 @@ unreachable end i32.const 2240 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const -2 i32.const 1 call $~lib/array/Array#splice @@ -12597,7 +12597,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2304 i32.const 0 call $std/array/isArraysEqual @@ -12611,8 +12611,8 @@ unreachable end i32.const 2344 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const -7 i32.const 1 call $~lib/array/Array#splice @@ -12628,7 +12628,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2408 i32.const 0 call $std/array/isArraysEqual @@ -12642,8 +12642,8 @@ unreachable end i32.const 2448 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const -2 i32.const -1 call $~lib/array/Array#splice @@ -12659,7 +12659,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2504 i32.const 0 call $std/array/isArraysEqual @@ -12673,8 +12673,8 @@ unreachable end i32.const 2544 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 1 i32.const -2 call $~lib/array/Array#splice @@ -12690,7 +12690,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2600 i32.const 0 call $std/array/isArraysEqual @@ -12704,8 +12704,8 @@ unreachable end i32.const 2640 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 4 i32.const 0 call $~lib/array/Array#splice @@ -12721,7 +12721,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2696 i32.const 0 call $std/array/isArraysEqual @@ -12735,8 +12735,8 @@ unreachable end i32.const 2736 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 7 i32.const 0 call $~lib/array/Array#splice @@ -12752,7 +12752,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2792 i32.const 0 call $std/array/isArraysEqual @@ -12766,8 +12766,8 @@ unreachable end i32.const 2832 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 7 i32.const 5 call $~lib/array/Array#splice @@ -12783,7 +12783,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2888 i32.const 0 call $std/array/isArraysEqual @@ -12796,27 +12796,27 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 i32.const 0 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 1 i32.const 1 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 2 i32.const 2 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 3 i32.const 3 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i if i32.const 0 i32.const 120 @@ -12825,11 +12825,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -12840,11 +12840,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.ne if @@ -12855,11 +12855,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 4 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.ne if @@ -12870,7 +12870,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -12882,11 +12882,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 5 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.eq if @@ -12897,23 +12897,23 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 6 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.ne if @@ -12924,7 +12924,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -12936,19 +12936,19 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 7 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 1 i32.ne if @@ -12959,11 +12959,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 8 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every if i32.const 0 i32.const 120 @@ -12972,11 +12972,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 9 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 1 i32.ne if @@ -12987,7 +12987,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -12999,11 +12999,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 10 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every if i32.const 0 i32.const 120 @@ -13012,23 +13012,23 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 11 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 1 i32.ne if @@ -13039,7 +13039,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -13051,19 +13051,19 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 12 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some i32.const 1 i32.ne if @@ -13074,11 +13074,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 13 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some if i32.const 0 i32.const 120 @@ -13087,11 +13087,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 14 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some if i32.const 0 i32.const 120 @@ -13100,7 +13100,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -13112,11 +13112,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 15 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some i32.const 1 i32.ne if @@ -13127,23 +13127,23 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 16 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some if i32.const 0 i32.const 120 @@ -13152,7 +13152,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -13164,20 +13164,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 17 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13189,11 +13189,11 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 18 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13204,7 +13204,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -13217,11 +13217,11 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 19 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 406 i32.ne if @@ -13232,24 +13232,24 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 20 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -13260,7 +13260,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -13272,18 +13272,18 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 21 call $~lib/array/Array#forEach - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 100 i32.ne @@ -13296,40 +13296,40 @@ unreachable end loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_s if - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#map - set_global $std/array/newArr - get_global $std/array/newArr + global.set $std/array/newArr + global.get $std/array/newArr i32.load offset=4 i32.const 4 i32.ne @@ -13342,34 +13342,34 @@ unreachable end i32.const 0 - get_global $std/array/newArr + global.get $std/array/newArr i32.load - tee_local $1 + local.tee $1 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $1 + local.get $1 f32.load offset=8 else unreachable end i32.const 0 - get_global $std/array/arr + global.get $std/array/arr i32.load - tee_local $1 + local.tee $1 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $1 + local.get $1 i32.load offset=8 else unreachable end - f32.convert_s/i32 + f32.convert_i32_s f32.ne if i32.const 0 @@ -13380,12 +13380,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 23 call $~lib/array/Array#map drop - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13396,7 +13396,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -13409,12 +13409,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 24 call $~lib/array/Array#map drop - get_global $std/array/i + global.get $std/array/i i32.const 406 i32.ne if @@ -13425,25 +13425,25 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 25 call $~lib/array/Array#map drop - get_global $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -13454,7 +13454,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -13466,19 +13466,19 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 26 call $~lib/array/Array#filter - set_global $std/array/filteredArr - get_global $std/array/filteredArr + global.set $std/array/filteredArr + global.get $std/array/filteredArr i32.load offset=4 i32.const 2 i32.ne @@ -13491,12 +13491,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 27 call $~lib/array/Array#filter drop - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13507,7 +13507,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -13520,12 +13520,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 28 call $~lib/array/Array#filter drop - get_global $std/array/i + global.get $std/array/i i32.const 406 i32.ne if @@ -13536,25 +13536,25 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 29 call $~lib/array/Array#filter drop - get_global $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -13565,7 +13565,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -13577,20 +13577,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 30 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13601,12 +13601,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 31 i32.const 4 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.ne if @@ -13617,14 +13617,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 32 i32.const 0 call $~lib/array/Array#reduce i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal i32.const 1 i32.ne if @@ -13635,14 +13635,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 33 i32.const 0 call $~lib/array/Array#reduce i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal if i32.const 0 i32.const 120 @@ -13651,12 +13651,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 34 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13667,7 +13667,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -13679,12 +13679,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 35 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.ne if @@ -13695,24 +13695,24 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 36 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.ne if @@ -13723,7 +13723,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 2 i32.ne @@ -13735,20 +13735,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 37 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13759,12 +13759,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 38 i32.const 4 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.ne if @@ -13775,14 +13775,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 39 i32.const 0 call $~lib/array/Array#reduceRight i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal i32.const 1 i32.ne if @@ -13793,14 +13793,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 40 i32.const 0 call $~lib/array/Array#reduceRight i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal if i32.const 0 i32.const 120 @@ -13809,12 +13809,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 41 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13825,7 +13825,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 i32.const 8 i32.ne @@ -13837,12 +13837,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.ne if @@ -13853,24 +13853,24 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.ne if @@ -13881,7 +13881,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.load offset=4 if i32.const 0 @@ -13891,47 +13891,47 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop call $~lib/bindings/Math/random - i64.reinterpret/f64 + i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom i32.const 0 - set_global $~argc - get_global $std/array/f32ArrayTyped - set_local $0 + global.set $~argc + global.get $std/array/f32ArrayTyped + local.set $0 i32.const 0 - set_local $1 + local.set $1 block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable end i32.const 44 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort drop - get_global $std/array/f32ArrayTyped + global.get $std/array/f32ArrayTyped call $std/array/isArraysEqual i32.eqz if @@ -13943,27 +13943,27 @@ unreachable end i32.const 0 - set_global $~argc - get_global $std/array/f64ArrayTyped - set_local $0 + global.set $~argc + global.get $std/array/f64ArrayTyped + local.set $0 i32.const 0 - set_local $1 + local.set $1 block $1of155 block $0of156 block $outOfRange57 - get_global $~argc + global.get $~argc br_table $0of156 $1of155 $outOfRange57 end unreachable end i32.const 45 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort drop - get_global $std/array/f64ArrayTyped + global.get $std/array/f64ArrayTyped call $std/array/isArraysEqual i32.eqz if @@ -13975,27 +13975,27 @@ unreachable end i32.const 0 - set_global $~argc - get_global $std/array/i32ArrayTyped - set_local $0 + global.set $~argc + global.get $std/array/i32ArrayTyped + local.set $0 i32.const 0 - set_local $1 + local.set $1 block $1of158 block $0of159 block $outOfRange60 - get_global $~argc + global.get $~argc br_table $0of159 $1of158 $outOfRange60 end unreachable end i32.const 46 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort drop - get_global $std/array/i32ArrayTyped + global.get $std/array/i32ArrayTyped i32.const 3592 i32.const 0 call $std/array/isArraysEqual @@ -14009,27 +14009,27 @@ unreachable end i32.const 0 - set_global $~argc - get_global $std/array/u32ArrayTyped - set_local $0 + global.set $~argc + global.get $std/array/u32ArrayTyped + local.set $0 i32.const 0 - set_local $1 + local.set $1 block $1of161 block $0of162 block $outOfRange63 - get_global $~argc + global.get $~argc br_table $0of162 $1of161 $outOfRange63 end unreachable end i32.const 47 - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort drop - get_global $std/array/u32ArrayTyped + global.get $std/array/u32ArrayTyped i32.const 3672 i32.const 0 call $std/array/isArraysEqual @@ -14044,24 +14044,24 @@ end i32.const 64 call $std/array/createReverseOrderedArray - set_global $std/array/reversed64 + global.set $std/array/reversed64 i32.const 128 call $std/array/createReverseOrderedArray - set_global $std/array/reversed128 + global.set $std/array/reversed128 i32.const 1024 call $std/array/createReverseOrderedArray - set_global $std/array/reversed1024 + global.set $std/array/reversed1024 i32.const 10000 call $std/array/createReverseOrderedArray - set_global $std/array/reversed10000 + global.set $std/array/reversed10000 i32.const 512 call $std/array/createRandomOrderedArray - set_global $std/array/randomized512 - get_global $std/array/reversed0 + global.set $std/array/randomized512 + global.get $std/array/reversed0 call $std/array/assertSortedDefault - get_global $std/array/reversed1 + global.get $std/array/reversed1 call $std/array/assertSortedDefault - get_global $std/array/reversed1 + global.get $std/array/reversed1 i32.const 3840 i32.const 0 call $std/array/isArraysEqual @@ -14074,9 +14074,9 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed2 + global.get $std/array/reversed2 call $std/array/assertSortedDefault - get_global $std/array/reversed2 + global.get $std/array/reversed2 i32.const 3864 i32.const 0 call $std/array/isArraysEqual @@ -14089,10 +14089,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed4 + global.get $std/array/reversed4 call $std/array/assertSortedDefault - get_global $std/array/reversed4 - get_global $std/array/expected4 + global.get $std/array/reversed4 + global.get $std/array/expected4 i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14104,10 +14104,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed64 + global.get $std/array/reversed64 call $std/array/assertSortedDefault - get_global $std/array/reversed64 - get_global $std/array/expected4 + global.get $std/array/reversed64 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -14119,10 +14119,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed128 + global.get $std/array/reversed128 call $std/array/assertSortedDefault - get_global $std/array/reversed128 - get_global $std/array/expected4 + global.get $std/array/reversed128 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -14134,10 +14134,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed1024 + global.get $std/array/reversed1024 call $std/array/assertSortedDefault - get_global $std/array/reversed1024 - get_global $std/array/expected4 + global.get $std/array/reversed1024 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -14149,10 +14149,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed10000 + global.get $std/array/reversed10000 call $std/array/assertSortedDefault - get_global $std/array/reversed10000 - get_global $std/array/expected4 + global.get $std/array/reversed10000 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -14164,41 +14164,41 @@ call $~lib/env/abort unreachable end - get_global $std/array/randomized512 + global.get $std/array/randomized512 call $std/array/assertSortedDefault i32.const 64 call $std/array/createRandomOrderedArray - set_global $std/array/randomized64 + global.set $std/array/randomized64 i32.const 257 call $std/array/createRandomOrderedArray - set_global $std/array/randomized257 - get_global $std/array/randomized64 + global.set $std/array/randomized257 + global.get $std/array/randomized64 i32.const 49 call $std/array/assertSorted - get_global $std/array/randomized64 + global.get $std/array/randomized64 i32.const 50 call $std/array/assertSorted - get_global $std/array/randomized257 + global.get $std/array/randomized257 i32.const 51 call $std/array/assertSorted - get_global $std/array/randomized257 + global.get $std/array/randomized257 i32.const 52 call $std/array/assertSorted call $std/array/createReverseOrderedNestedArray - set_global $std/array/reversedNested512 - get_global $std/array/reversedNested512 + global.set $std/array/reversedNested512 + global.get $std/array/reversedNested512 i32.const 53 call $std/array/assertSorted> call $std/array/createReverseOrderedElementsArray - set_global $std/array/reversedElements512 - get_global $std/array/reversedElements512 + global.set $std/array/reversedElements512 + global.get $std/array/reversedElements512 i32.const 54 call $std/array/assertSorted> - get_global $std/array/randomStringsActual + global.get $std/array/randomStringsActual i32.const 55 call $std/array/assertSorted> - get_global $std/array/randomStringsActual - get_global $std/array/randomStringsExpected + global.get $std/array/randomStringsActual + global.get $std/array/randomStringsExpected call $std/array/isArraysEqual i32.eqz if @@ -14210,8 +14210,8 @@ unreachable end call $std/array/createRandomStringArray - set_global $std/array/randomStrings400 - get_global $std/array/randomStrings400 + global.set $std/array/randomStrings400 + global.get $std/array/randomStrings400 i32.const 56 call $std/array/assertSorted> call $~lib/array/Array#join @@ -14296,15 +14296,15 @@ end i32.const 3 call $~lib/array/Array#constructor - set_local $1 + local.set $1 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.load - get_local $0 + local.get $0 i32.store offset=8 - get_local $1 + local.get $1 i32.load i32.const 4 i32.add @@ -14312,16 +14312,16 @@ i32.store offset=8 i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.load i32.const 8 i32.add - get_local $0 + local.get $0 i32.store offset=8 - get_local $1 - set_global $std/array/refArr - get_global $std/array/refArr + local.get $1 + global.set $std/array/refArr + global.get $std/array/refArr call $~lib/array/Array#join i32.const 6912 call $~lib/string/String.__eq @@ -14334,7 +14334,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed0 + global.get $std/array/reversed0 i32.const 4216 call $~lib/array/Array#join i32.const 3904 @@ -14348,7 +14348,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed1 + global.get $std/array/reversed1 i32.const 4216 call $~lib/array/Array#join i32.const 6784 @@ -14362,7 +14362,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed2 + global.get $std/array/reversed2 i32.const 4216 call $~lib/array/Array#join i32.const 6984 @@ -14376,7 +14376,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed4 + global.get $std/array/reversed4 i32.const 4216 call $~lib/array/Array#join i32.const 7000 @@ -14438,7 +14438,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/randomStringsExpected + global.get $std/array/randomStringsExpected i32.const 4216 call $~lib/array/Array#join i32.const 8048 @@ -14466,7 +14466,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/subarr32 + global.get $std/array/subarr32 call $~lib/array/Array>#join i32.const 8264 call $~lib/string/String.__eq @@ -14479,7 +14479,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/subarr8 + global.get $std/array/subarr8 call $~lib/array/Array>#join i32.const 8264 call $~lib/string/String.__eq @@ -14492,7 +14492,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/subarrU32 + global.get $std/array/subarrU32 call $~lib/array/Array>>#join i32.const 6784 call $~lib/string/String.__eq diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index f06a0af2..ed5c4f22 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -333,7 +333,7 @@ (data (i32.const 8400) "\c0 \00\00\01\00\00\00") (data (i32.const 8408) "\04\00\00\00\00\00\00\00\d0 \00\00\00\00\00\00") (data (i32.const 8424) "\d8 \00\00\01\00\00\00") - (table $0 57 anyfunc) + (table $0 57 funcref) (elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|4 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|18 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|29 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|33 $start~anonymous|34 $start~anonymous|35 $start~anonymous|36 $start~anonymous|37 $start~anonymous|38 $start~anonymous|39 $start~anonymous|40 $start~anonymous|41 $start~anonymous|42 $start~anonymous|43 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $~lib/array/Array#sort|trampoline~anonymous|46 $~lib/array/Array#sort|trampoline~anonymous|47 $std/array/assertSortedDefault~anonymous|48 $start~anonymous|49 $start~anonymous|50 $start~anonymous|51 $start~anonymous|52 $start~anonymous|53 $start~anonymous|54 $start~anonymous|55 $start~anonymous|56) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -444,8 +444,8 @@ (func $~lib/internal/arraybuffer/computeSize (; 2 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -460,41 +460,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -504,22 +504,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -528,15 +528,15 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -548,21 +548,21 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) @@ -570,250 +570,250 @@ (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -825,7 +825,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -836,50 +836,50 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array.isArray | null> (; 8 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 if (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne else @@ -889,7 +889,7 @@ (func $~lib/array/Array.isArray> (; 9 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 if (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne else @@ -897,19 +897,19 @@ end ) (func $std/array/P#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $~lib/array/Array.isArray

(; 11 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 if (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne else @@ -921,7 +921,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -932,70 +932,70 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Uint8Array#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/array/Array.isArray (; 14 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 if (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne else @@ -1005,7 +1005,7 @@ (func $~lib/array/Array.isArray (; 15 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 if (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne else @@ -1015,7 +1015,7 @@ (func $~lib/array/Array.isArray (; 16 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 if (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne else @@ -1027,104 +1027,104 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.add - tee_local $6 + local.tee $6 i32.const 0 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else - get_local $2 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.add - tee_local $6 + local.tee $6 i32.const 0 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else - get_local $3 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.lt_s if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.add - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $3 - get_local $2 + local.set $6 + local.get $3 + local.get $2 i32.sub - set_local $7 - get_local $6 - get_local $1 - get_local $7 + local.set $7 + local.get $6 + local.get $1 + local.get $7 call $~lib/internal/memory/memset end - get_local $0 + local.get $0 ) (func $~lib/array/Array#__get (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 0 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 0 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load8_u offset=8 else @@ -1133,17 +1133,17 @@ ) (func $std/array/isArraysEqual (; 19 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $2 + local.get $2 i32.eqz if block $~lib/array/Array#get:length|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 block $~lib/array/Array#get:length|inlined.2 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -1151,8 +1151,8 @@ i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 @@ -1161,20 +1161,20 @@ end block $break|0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get i32.const 255 i32.and - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get i32.const 255 i32.and @@ -1183,10 +1183,10 @@ i32.const 0 return end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end @@ -1199,7 +1199,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -1207,15 +1207,15 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $3 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/array/Array#fill ) (func $~lib/array/Array#fill (; 21 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) @@ -1223,114 +1223,114 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.add - tee_local $6 + local.tee $6 i32.const 0 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else - get_local $2 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.add - tee_local $6 + local.tee $6 i32.const 0 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else - get_local $3 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - set_local $3 + local.set $3 block $break|0 loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block i32.const 0 - set_local $6 - get_local $4 - get_local $2 + local.set $6 + local.get $4 + local.get $2 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add - get_local $1 + local.get $1 i32.store offset=8 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 ) (func $~lib/array/Array#__get (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -1339,17 +1339,17 @@ ) (func $std/array/isArraysEqual (; 23 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $2 + local.get $2 i32.eqz if block $~lib/array/Array#get:length|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 block $~lib/array/Array#get:length|inlined.2 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -1357,8 +1357,8 @@ i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 @@ -1367,28 +1367,28 @@ end block $break|0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get i32.ne if i32.const 0 return end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end @@ -1401,7 +1401,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -1409,23 +1409,23 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $3 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/array/Array#fill ) (func $std/array/internalCapacity (; 25 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.load - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.load i32.const 2 i32.shr_s @@ -1436,44 +1436,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -1481,141 +1481,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -1623,167 +1623,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -1795,130 +1795,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -1930,112 +1930,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -2047,585 +2047,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -2633,77 +2633,77 @@ ) (func $~lib/internal/memory/memmove (; 27 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -2714,27 +2714,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -2743,67 +2743,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2814,20 +2814,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -2839,16 +2839,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2866,15 +2866,15 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.gt_s if - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_s i32.eqz if @@ -2885,66 +2885,66 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/internal/arraybuffer/computeSize - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memmove block $~lib/memory/memory.free|inlined.0 block - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable end unreachable end - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $2 + local.get $2 i32.add - set_local $3 + local.set $3 i32.const 0 - set_local $5 - get_local $1 - get_local $2 + local.set $5 + local.get $1 + local.get $2 i32.sub - set_local $4 - get_local $3 - get_local $5 - get_local $4 + local.set $4 + local.get $3 + local.get $5 + local.get $4 call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.ge_s i32.eqz @@ -2956,12 +2956,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/array/Array#push (; 30 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -2969,26 +2969,26 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 1 i32.add - set_local $5 - get_local $2 - get_local $4 + local.set $5 + local.get $2 + local.get $4 i32.ge_u if - get_local $2 + local.get $2 i32.const 268435454 i32.ge_u if @@ -2999,53 +2999,53 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store end - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=4 i32.const 0 - set_local $6 - get_local $3 - get_local $2 + local.set $6 + local.get $3 + local.get $2 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $5 + local.get $5 ) (func $~lib/array/Array#__get (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -3058,10 +3058,10 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.lt_s if @@ -3073,30 +3073,30 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.sub - tee_local $1 - set_local $3 + local.tee $1 + local.set $3 i32.const 0 - set_local $4 - get_local $2 - get_local $3 + local.set $4 + local.get $2 + local.get $3 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.store offset=4 - get_local $5 + local.get $5 ) (func $~lib/array/Array#concat (; 33 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3106,72 +3106,72 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 + local.set $2 i32.const 0 - get_local $1 + local.get $1 i32.load offset=4 - get_local $1 + local.get $1 i32.const 0 i32.eq select - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.add - set_local $4 + local.set $4 i32.const 0 - get_local $4 + local.get $4 call $~lib/array/Array#constructor - set_local $5 - get_local $2 + local.set $5 + local.get $2 if - get_local $5 + local.get $5 i32.load - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.const 2 i32.shl - set_local $8 - get_local $6 - get_local $7 - get_local $8 + local.set $8 + local.get $6 + local.get $7 + local.get $8 call $~lib/internal/memory/memmove end - get_local $3 + local.get $3 if - get_local $5 + local.get $5 i32.load - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $2 + local.get $2 i32.const 2 i32.shl i32.add - set_local $8 - get_local $1 + local.set $8 + local.get $1 i32.load - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $7 - get_local $3 + local.set $7 + local.get $3 i32.const 2 i32.shl - set_local $6 - get_local $8 - get_local $7 - get_local $6 + local.set $6 + local.get $8 + local.get $7 + local.get $6 call $~lib/internal/memory/memmove end - get_local $5 + local.get $5 ) (func $~lib/array/Array#copyWithin (; 34 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) @@ -3183,242 +3183,242 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 - get_local $3 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + 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 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $5 - get_local $1 + local.get $5 + local.get $1 i32.add - tee_local $6 + local.tee $6 i32.const 0 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else - get_local $1 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + local.get $1 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - set_local $8 - get_local $2 + local.set $8 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.add - tee_local $6 + local.tee $6 i32.const 0 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else - get_local $2 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - set_local $9 - get_local $3 + local.set $9 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.add - tee_local $6 + local.tee $6 i32.const 0 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.gt_s select else - get_local $3 - tee_local $6 - get_local $5 - tee_local $7 - get_local $6 - get_local $7 + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select end - set_local $10 - get_local $10 - get_local $9 + local.set $10 + local.get $10 + local.get $9 i32.sub - tee_local $6 - get_local $5 - get_local $8 + local.tee $6 + local.get $5 + local.get $8 i32.sub - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select - set_local $11 - get_local $9 - get_local $8 + local.set $11 + local.get $9 + local.get $8 i32.lt_s - tee_local $6 + local.tee $6 if (result i32) - get_local $8 - get_local $9 - get_local $11 + local.get $8 + local.get $9 + local.get $11 i32.add i32.lt_s else - get_local $6 + local.get $6 end if - get_local $9 - get_local $11 + local.get $9 + local.get $11 i32.const 1 i32.sub i32.add - set_local $9 - get_local $8 - get_local $11 + local.set $9 + local.get $8 + local.get $11 i32.const 1 i32.sub i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $11 + local.get $11 if block block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) i32.const 0 - set_local $6 - get_local $4 - get_local $9 + local.set $6 + local.get $4 + local.get $9 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - set_local $6 + local.set $6 i32.const 0 - set_local $7 - get_local $4 - get_local $8 + local.set $7 + local.get $4 + local.get $8 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $6 + local.get $6 i32.store offset=8 - get_local $9 + local.get $9 i32.const 1 i32.sub - set_local $9 - get_local $8 + local.set $9 + local.get $8 i32.const 1 i32.sub - set_local $8 - get_local $11 + local.set $8 + local.get $11 i32.const 1 i32.sub - set_local $11 + local.set $11 end br $continue|0 end end end else - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $8 + local.get $8 i32.const 2 i32.shl i32.add - set_local $7 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $9 + local.get $9 i32.const 2 i32.shl i32.add - set_local $6 - get_local $11 + local.set $6 + local.get $11 i32.const 2 i32.shl - set_local $12 - get_local $7 - get_local $6 - get_local $12 + local.set $12 + local.get $7 + local.get $6 + local.get $12 call $~lib/internal/memory/memmove end - get_local $0 + local.get $0 ) (func $~lib/array/Array#copyWithin|trampoline (; 35 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 2 i32.sub br_table $0of1 $1of1 $outOfRange end unreachable end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $3 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/array/Array#copyWithin ) (func $std/array/isArraysEqual (; 36 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $2 + local.get $2 i32.eqz if block $~lib/array/Array#get:length|inlined.15 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 block $~lib/array/Array#get:length|inlined.17 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -3426,8 +3426,8 @@ i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 @@ -3436,28 +3436,28 @@ end block $break|0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get i32.ne if i32.const 0 return end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end @@ -3473,26 +3473,26 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.load i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 1 i32.add - set_local $5 - get_local $4 - get_local $3 + local.set $5 + local.get $4 + local.get $3 i32.ge_u if - get_local $4 + local.get $4 i32.const 268435454 i32.ge_u if @@ -3503,58 +3503,58 @@ call $~lib/env/abort unreachable end - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.load i32.const 2 i32.shr_u - set_local $3 - get_local $0 - get_local $2 + local.set $3 + local.get $0 + local.get $2 i32.store end - get_local $2 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $2 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 4 i32.add - set_local $6 - get_local $2 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $6 + local.get $2 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $7 - get_local $3 + local.set $7 + local.get $3 i32.const 1 i32.sub i32.const 2 i32.shl - set_local $8 - get_local $6 - get_local $7 - get_local $8 + local.set $8 + local.get $6 + local.get $7 + local.get $8 call $~lib/internal/memory/memmove i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $7 - get_local $2 - get_local $8 + local.set $7 + local.get $2 + local.get $8 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=4 - get_local $5 + local.get $5 ) (func $~lib/array/Array#shift (; 38 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -3564,10 +3564,10 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.lt_s if @@ -3578,63 +3578,63 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $2 + local.set $2 block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) i32.const 0 - set_local $3 + local.set $3 i32.const 0 - set_local $4 - get_local $2 - get_local $3 + local.set $4 + local.get $2 + local.get $3 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.const 1 i32.sub - set_local $6 - get_local $2 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $6 + local.get $2 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 - get_local $2 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $2 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 4 i32.add - set_local $3 - get_local $6 + local.set $3 + local.get $6 i32.const 2 i32.shl - set_local $7 - get_local $4 - get_local $3 - get_local $7 + local.set $7 + local.get $4 + local.get $3 + local.get $7 call $~lib/internal/memory/memmove i32.const 0 - set_local $7 + local.set $7 i32.const 0 - set_local $3 - get_local $2 - get_local $6 + local.set $3 + local.get $2 + local.get $6 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add - get_local $7 + local.get $7 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=4 - get_local $5 + local.get $5 ) (func $~lib/array/Array#reverse (; 39 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -3643,163 +3643,163 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $1 + local.set $1 block $break|0 block i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + 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) i32.const 0 - set_local $4 - get_local $1 - get_local $2 + local.set $4 + local.get $1 + local.get $2 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - set_local $4 + local.set $4 block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) i32.const 0 - set_local $5 - get_local $1 - get_local $3 + local.set $5 + local.get $1 + local.get $3 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $1 - get_local $2 + local.set $6 + local.get $1 + local.get $2 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add - get_local $5 + local.get $5 i32.store offset=8 i32.const 0 - set_local $6 - get_local $1 - get_local $3 + local.set $6 + local.get $1 + local.get $3 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add - get_local $4 + local.get $4 i32.store offset=8 end block - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 end br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 ) (func $~lib/array/Array#indexOf (; 40 ;) (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) - get_local $0 + local.get $0 i32.load offset=4 - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 0 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s end if i32.const -1 return end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 end - get_local $0 + local.get $0 i32.load - set_local $6 + local.set $6 block $break|0 loop $continue|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s if block block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) i32.const 0 - set_local $4 - get_local $6 - get_local $2 + local.set $4 + local.get $6 + local.get $2 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $1 + local.get $1 i32.eq if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 end br $continue|0 end @@ -3815,150 +3815,150 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select else - get_local $1 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select end - set_local $1 - get_local $2 - tee_local $4 - get_local $3 - get_local $1 + local.set $1 + local.get $2 + local.tee $4 + local.get $3 + local.get $1 i32.sub - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $6 + local.set $6 i32.const 0 - get_local $2 + local.get $2 call $~lib/array/Array#constructor - set_local $7 - get_local $6 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $6 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add - set_local $8 - get_local $7 + local.set $8 + local.get $7 i32.load - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 2 i32.shl - set_local $5 - get_local $4 - get_local $8 - get_local $5 + local.set $5 + local.get $4 + local.get $8 + local.get $5 call $~lib/internal/memory/memmove - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - set_local $9 - get_local $3 - get_local $9 + local.set $9 + local.get $3 + local.get $9 i32.ne if - get_local $6 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $6 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $9 + local.get $9 i32.const 2 i32.shl i32.add - set_local $5 - get_local $3 - get_local $9 + local.set $5 + local.get $3 + local.get $9 i32.sub i32.const 2 i32.shl - set_local $4 - get_local $8 - get_local $5 - get_local $4 + local.set $4 + local.get $8 + local.get $5 + local.get $4 call $~lib/internal/memory/memmove end - get_local $0 - get_local $3 - get_local $2 + local.get $0 + local.get $3 + local.get $2 i32.sub i32.store offset=4 - get_local $7 + local.get $7 ) (func $~lib/array/Array#splice|trampoline (; 42 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange end unreachable end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $2 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/array/Array#splice ) (func $~lib/array/Array#__set (; 43 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -3969,37 +3969,37 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $start~anonymous|1 (; 44 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq ) @@ -4011,20 +4011,20 @@ block $break|0 block i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 - tee_local $4 - get_local $0 + local.get $2 + local.get $3 + local.tee $4 + local.get $0 i32.load offset=4 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select i32.lt_s @@ -4032,37 +4032,37 @@ br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - get_local $0 + local.get $0 i32.load - set_local $5 + local.set $5 i32.const 0 - set_local $4 - get_local $5 - get_local $2 + local.set $4 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -4071,39 +4071,39 @@ i32.const -1 ) (func $start~anonymous|2 (; 46 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 1 i32.eq ) (func $start~anonymous|3 (; 47 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 100 i32.eq ) (func $start~anonymous|4 (; 48 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_local $0 + local.get $0 i32.const 100 i32.eq ) (func $start~anonymous|5 (; 49 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 100 i32.eq ) (func $start~anonymous|6 (; 50 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $0 + local.get $0 i32.const 100 i32.eq ) (func $start~anonymous|7 (; 51 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ge_s ) @@ -4115,20 +4115,20 @@ block $break|0 block i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 - tee_local $4 - get_local $0 + local.get $2 + local.get $3 + local.tee $4 + local.get $0 i32.load offset=4 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select i32.lt_s @@ -4136,25 +4136,25 @@ br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) - get_local $0 + local.get $0 i32.load - set_local $5 + local.set $5 i32.const 0 - set_local $4 - get_local $5 - get_local $2 + local.set $4 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -4164,10 +4164,10 @@ i32.const 0 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -4176,34 +4176,34 @@ i32.const 1 ) (func $start~anonymous|8 (; 53 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.le_s ) (func $start~anonymous|9 (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_local $0 + local.get $0 i32.const 10 i32.lt_s ) (func $start~anonymous|10 (; 55 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 10 i32.lt_s ) (func $start~anonymous|11 (; 56 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $0 + local.get $0 i32.const 3 i32.lt_s ) (func $start~anonymous|12 (; 57 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 3 i32.ge_s ) @@ -4215,20 +4215,20 @@ block $break|0 block i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 - tee_local $4 - get_local $0 + local.get $2 + local.get $3 + local.tee $4 + local.get $0 i32.load offset=4 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select i32.lt_s @@ -4236,25 +4236,25 @@ br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) - get_local $0 + local.get $0 i32.load - set_local $5 + local.set $5 i32.const 0 - set_local $4 - get_local $5 - get_local $2 + local.set $4 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -4263,10 +4263,10 @@ i32.const 1 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -4275,37 +4275,37 @@ i32.const 0 ) (func $start~anonymous|13 (; 59 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const -1 i32.le_s ) (func $start~anonymous|14 (; 60 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_local $0 + local.get $0 i32.const 10 i32.gt_s ) (func $start~anonymous|15 (; 61 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 10 i32.gt_s ) (func $start~anonymous|16 (; 62 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $0 + local.get $0 i32.const 3 i32.gt_s ) (func $start~anonymous|17 (; 63 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i + global.set $std/array/i ) (func $~lib/array/Array#forEach (; 64 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) @@ -4315,20 +4315,20 @@ block $break|0 block i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 - tee_local $4 - get_local $0 + local.get $2 + local.get $3 + local.tee $4 + local.get $0 i32.load offset=4 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select i32.lt_s @@ -4336,31 +4336,31 @@ br_if $break|0 block i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) - get_local $0 + local.get $0 i32.load - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $2 + local.set $5 + local.get $4 + local.get $2 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiiv) end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -4368,52 +4368,52 @@ end ) (func $start~anonymous|18 (; 65 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i + global.set $std/array/i ) (func $start~anonymous|19 (; 66 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i + global.set $std/array/i ) (func $start~anonymous|20 (; 67 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i + global.set $std/array/i ) (func $start~anonymous|21 (; 68 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $1 + local.get $1 i32.const 0 i32.eq if block $break|0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 + local.get $3 i32.const 4 i32.lt_s i32.eqz br_if $break|0 - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end @@ -4421,23 +4421,23 @@ end block $break|1 i32.const 0 - set_local $3 + local.set $3 loop $repeat|1 - get_local $3 + local.get $3 i32.const 100 i32.lt_s i32.eqz br_if $break|1 - get_local $2 + local.get $2 i32.const 100 - get_local $3 + local.get $3 i32.add call $~lib/array/Array#push drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|1 unreachable end @@ -4445,20 +4445,20 @@ end block $break|2 i32.const 0 - set_local $3 + local.set $3 loop $repeat|2 - get_local $3 + local.get $3 i32.const 100 i32.lt_s i32.eqz br_if $break|2 - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|2 unreachable end @@ -4466,34 +4466,34 @@ end block $break|3 i32.const 0 - set_local $3 + local.set $3 loop $repeat|3 - get_local $3 + local.get $3 i32.const 100 i32.lt_s i32.eqz br_if $break|3 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.const 200 i32.add call $~lib/array/Array#push drop - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|3 unreachable end unreachable end end - get_local $1 + local.get $1 i32.const 2 i32.eq if - get_local $0 + local.get $0 i32.const 202 i32.eq i32.eqz @@ -4508,15 +4508,15 @@ end ) (func $start~anonymous|22 (; 69 ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) - get_local $0 - f32.convert_s/i32 + local.get $0 + f32.convert_i32_s ) (func $~lib/array/Array#constructor (; 70 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -4527,45 +4527,45 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#map (; 71 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -4575,28 +4575,28 @@ (local $6 i32) (local $7 i32) (local $8 f32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 + local.set $2 i32.const 0 - get_local $2 + local.get $2 call $~lib/array/Array#constructor - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 - tee_local $6 - get_local $0 + local.get $5 + local.get $2 + local.tee $6 + local.get $0 i32.load offset=4 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select i32.lt_s @@ -4605,72 +4605,72 @@ block block (result f32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.15 (result i32) - get_local $0 + local.get $0 i32.load - set_local $6 + local.set $6 i32.const 0 - set_local $7 - get_local $6 - get_local $5 + local.set $7 + local.get $6 + local.get $5 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiif) end - set_local $8 + local.set $8 i32.const 0 - set_local $7 - get_local $4 - get_local $5 + local.set $7 + local.get $4 + local.get $5 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $8 + local.get $8 f32.store offset=8 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $~lib/array/Array#__get (; 72 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add f32.load offset=8 else @@ -4678,15 +4678,15 @@ end ) (func $start~anonymous|23 (; 73 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 ) (func $~lib/array/Array#map (; 74 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -4695,28 +4695,28 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 + local.set $2 i32.const 0 - get_local $2 + local.get $2 call $~lib/array/Array#constructor - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 - tee_local $6 - get_local $0 + local.get $5 + local.get $2 + local.tee $6 + local.get $0 i32.load offset=4 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select i32.lt_s @@ -4725,70 +4725,70 @@ block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) - get_local $0 + local.get $0 i32.load - set_local $6 + local.set $6 i32.const 0 - set_local $7 - get_local $6 - get_local $5 + local.set $7 + local.get $6 + local.get $5 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end - set_local $7 + local.set $7 i32.const 0 - set_local $6 - get_local $4 - get_local $5 + local.set $6 + local.get $4 + local.get $5 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add - get_local $7 + local.get $7 i32.store offset=8 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $start~anonymous|24 (; 75 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 ) (func $start~anonymous|25 (; 76 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 ) (func $start~anonymous|26 (; 77 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.ge_s ) @@ -4801,24 +4801,24 @@ i32.const 0 i32.const 0 call $~lib/array/Array#constructor - set_local $2 + local.set $2 block $break|0 block i32.const 0 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 end loop $repeat|0 - get_local $3 - get_local $4 - tee_local $5 - get_local $0 + local.get $3 + local.get $4 + local.tee $5 + local.get $0 i32.load offset=4 - tee_local $6 - get_local $5 - get_local $6 + local.tee $6 + local.get $5 + local.get $6 i32.lt_s select i32.lt_s @@ -4826,87 +4826,87 @@ br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.17 (result i32) - get_local $0 + local.get $0 i32.load - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $3 + local.set $6 + local.get $5 + local.get $3 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - set_local $6 + local.set $6 block (result i32) i32.const 3 - set_global $~argc - get_local $6 - get_local $3 - get_local $0 - get_local $1 + global.set $~argc + local.get $6 + local.get $3 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $2 - get_local $6 + local.get $2 + local.get $6 call $~lib/array/Array#push drop end end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $start~anonymous|27 (; 79 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 i32.const 100 call $~lib/array/Array#push drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 i32.const 2 i32.ge_s ) (func $start~anonymous|28 (; 80 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 i32.const 2 i32.ge_s ) (func $start~anonymous|29 (; 81 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $2 + local.get $2 call $~lib/array/Array#pop drop - get_global $std/array/i - get_local $0 + global.get $std/array/i + local.get $0 i32.add - set_global $std/array/i - get_local $0 + global.set $std/array/i + local.get $0 i32.const 2 i32.ge_s ) (func $start~anonymous|30 (; 82 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/array/Array#reduce (; 83 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -4915,25 +4915,25 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $2 - set_local $3 + local.get $2 + local.set $3 block $break|0 block i32.const 0 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 end loop $repeat|0 - get_local $4 - get_local $5 - tee_local $6 - get_local $0 + local.get $4 + local.get $5 + local.tee $6 + local.get $0 i32.load offset=4 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select i32.lt_s @@ -4941,53 +4941,53 @@ br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $3 + global.set $~argc + local.get $3 block $~lib/internal/arraybuffer/LOAD|inlined.18 (result i32) - get_local $0 + local.get $0 i32.load - set_local $6 + local.set $6 i32.const 0 - set_local $7 - get_local $6 - get_local $4 + local.set $7 + local.get $6 + local.get $4 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add i32.load offset=8 end - get_local $4 - get_local $0 - get_local $1 + local.get $4 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $start~anonymous|31 (; 84 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|32 (; 85 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne if (result i32) - get_local $0 + local.get $0 else - get_local $1 + local.get $1 i32.const 2 i32.gt_s end @@ -4998,25 +4998,25 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $2 - set_local $3 + local.get $2 + local.set $3 block $break|0 block i32.const 0 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 end loop $repeat|0 - get_local $4 - get_local $5 - tee_local $6 - get_local $0 + local.get $4 + local.get $5 + local.tee $6 + local.get $0 i32.load offset=4 - tee_local $7 - get_local $6 - get_local $7 + local.tee $7 + local.get $6 + local.get $7 i32.lt_s select i32.lt_s @@ -5024,77 +5024,77 @@ br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $3 + global.set $~argc + local.get $3 block $~lib/internal/arraybuffer/LOAD|inlined.19 (result i32) - get_local $0 + local.get $0 i32.load - set_local $6 + local.set $6 i32.const 0 - set_local $7 - get_local $6 - get_local $4 + local.set $7 + local.get $6 + local.get $4 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add i32.load offset=8 end - get_local $4 - get_local $0 - get_local $1 + local.get $4 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $start~anonymous|33 (; 87 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne if (result i32) - get_local $0 + local.get $0 else - get_local $1 + local.get $1 i32.const 100 i32.gt_s end ) (func $start~anonymous|34 (; 88 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 + local.get $3 i32.const 1 call $~lib/array/Array#push drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|35 (; 89 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|36 (; 90 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 + local.get $3 call $~lib/array/Array#pop drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|37 (; 91 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/array/Array#reduceRight (; 92 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -5102,69 +5102,69 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $2 - set_local $3 + local.get $2 + local.set $3 block $break|0 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 + local.get $4 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $3 + global.set $~argc + local.get $3 block $~lib/internal/arraybuffer/LOAD|inlined.20 (result i32) - get_local $0 + local.get $0 i32.load - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $4 + local.set $6 + local.get $5 + local.get $4 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - get_local $4 - get_local $0 - get_local $1 + local.get $4 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 br $repeat|0 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $start~anonymous|38 (; 93 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|39 (; 94 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne if (result i32) - get_local $0 + local.get $0 else - get_local $1 + local.get $1 i32.const 2 i32.gt_s end @@ -5174,156 +5174,156 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $2 - set_local $3 + local.get $2 + local.set $3 block $break|0 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 + local.get $4 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $3 + global.set $~argc + local.get $3 block $~lib/internal/arraybuffer/LOAD|inlined.21 (result i32) - get_local $0 + local.get $0 i32.load - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $4 + local.set $6 + local.get $5 + local.get $4 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - get_local $4 - get_local $0 - get_local $1 + local.get $4 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 br $repeat|0 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $start~anonymous|40 (; 96 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne if (result i32) - get_local $0 + local.get $0 else - get_local $1 + local.get $1 i32.const 100 i32.gt_s end ) (func $start~anonymous|41 (; 97 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 + local.get $3 i32.const 1 call $~lib/array/Array#push drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|42 (; 98 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $start~anonymous|43 (; 99 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 + local.get $3 call $~lib/array/Array#pop drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/math/murmurHash3 (; 100 ;) (type $II) (param $0 i64) (result i64) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i64.const 33 i64.shr_u i64.xor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i64.const -49064778989728563 i64.mul - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i64.const 33 i64.shr_u i64.xor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i64.const -4265267296055464877 i64.mul - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i64.const 33 i64.shr_u i64.xor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/math/splitMix32 (; 101 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 1831565813 i32.add - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i32.const 15 i32.shr_u i32.xor - get_local $0 + local.get $0 i32.const 1 i32.or i32.mul - set_local $0 - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 i32.const 7 i32.shr_u i32.xor - get_local $0 + local.get $0 i32.const 61 i32.or i32.mul i32.add i32.xor - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i32.const 14 i32.shr_u i32.xor ) (func $~lib/math/NativeMath.seedRandom (; 102 ;) (type $Iv) (param $0 i64) - get_local $0 + local.get $0 i64.eqz if i32.const 0 @@ -5334,22 +5334,22 @@ unreachable end i32.const 1 - set_global $~lib/math/random_seeded - get_local $0 + global.set $~lib/math/random_seeded + local.get $0 call $~lib/math/murmurHash3 - set_global $~lib/math/random_state0_64 - get_global $~lib/math/random_state0_64 + global.set $~lib/math/random_state0_64 + global.get $~lib/math/random_state0_64 i64.const -1 i64.xor call $~lib/math/murmurHash3 - set_global $~lib/math/random_state1_64 - get_local $0 - i32.wrap/i64 + global.set $~lib/math/random_state1_64 + local.get $0 + i32.wrap_i64 call $~lib/math/splitMix32 - set_global $~lib/math/random_state0_32 - get_global $~lib/math/random_state0_32 + global.set $~lib/math/random_state0_32 + global.get $~lib/math/random_state0_32 call $~lib/math/splitMix32 - set_global $~lib/math/random_state1_32 + global.set $~lib/math/random_state1_32 ) (func $~lib/internal/sort/insertionSort (; 103 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) @@ -5359,77 +5359,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f32) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $ffi) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 f32.store offset=8 else br $break|1 @@ -5439,24 +5439,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 f32.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -5473,54 +5473,54 @@ (local $10 f32) (local $11 i32) (local $12 f32) - get_local $2 + local.get $2 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - set_local $4 + local.set $4 block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_local $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $6 - get_local $4 + local.set $6 + local.get $5 + local.get $6 + local.get $4 call $~lib/internal/memory/memset block $break|0 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 + local.get $6 i32.const 0 i32.gt_s i32.eqz br_if $break|0 block - get_local $6 - set_local $7 + local.get $6 + local.set $7 block $break|1 loop $continue|1 - get_local $7 + local.get $7 i32.const 1 i32.and - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $7 + local.get $7 i32.const 1 i32.shr_s i32.const 31 @@ -5530,60 +5530,60 @@ i32.and i32.eq if - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $7 + local.set $7 br $continue|1 end end end - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f32) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $10 + local.set $10 block (result i32) i32.const 2 - set_global $~argc - get_local $9 - get_local $10 - get_local $3 + global.set $~argc + local.get $9 + local.get $10 + local.get $3 call_indirect (type $ffi) end i32.const 0 i32.lt_s if - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 @@ -5591,48 +5591,48 @@ i32.add i32.load i32.const 1 - get_local $6 + local.get $6 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f32.store offset=8 - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f32.store offset=8 end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end block $break|2 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|2 - get_local $6 + local.get $6 i32.const 2 i32.ge_s i32.eqz @@ -5640,131 +5640,131 @@ block block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f32) i32.const 0 - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $10 + local.set $10 i32.const 0 - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $9 - get_local $0 - get_local $8 + local.set $9 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f32.store offset=8 i32.const 1 - set_local $8 + local.set $8 block $break|3 loop $continue|3 - get_local $8 + local.get $8 i32.const 1 i32.shl - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $8 + local.get $8 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and i32.add - tee_local $7 - get_local $6 + local.tee $7 + local.get $6 i32.lt_s if - get_local $7 - set_local $8 + local.get $7 + local.set $8 br $continue|3 end end end block $break|4 loop $continue|4 - get_local $8 + local.get $8 i32.const 0 i32.gt_s if block block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f32) i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $10 + local.set $10 block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f32) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $9 + local.set $9 block (result i32) i32.const 2 - set_global $~argc - get_local $10 - get_local $9 - get_local $3 + global.set $~argc + local.get $10 + local.get $9 + local.get $3 call_indirect (type $ffi) end i32.const 0 i32.lt_s if - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 @@ -5772,47 +5772,47 @@ i32.add i32.load i32.const 1 - get_local $8 + local.get $8 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f32.store offset=8 i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f32.store offset=8 end - get_local $8 + local.get $8 i32.const 1 i32.shr_s - set_local $8 + local.set $8 end br $continue|4 end end end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|2 unreachable end @@ -5820,7 +5820,7 @@ end block $~lib/memory/memory.free|inlined.1 block - get_local $5 + local.get $5 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.1 unreachable @@ -5829,51 +5829,51 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f32) i32.const 1 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $12 + local.set $12 i32.const 1 - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f32) i32.const 0 - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 end - set_local $10 - get_local $0 - get_local $6 + local.set $10 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f32.store offset=8 i32.const 0 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $12 + local.get $12 f32.store offset=8 ) (func $~lib/array/Array#sort (; 105 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -5883,7 +5883,7 @@ (local $5 i32) (local $6 f32) (local $7 f32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -5893,144 +5893,144 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f32) i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add f32.load offset=8 end - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f32) i32.const 0 - set_local $5 + local.set $5 i32.const 0 - set_local $4 - get_local $3 - get_local $5 + local.set $4 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add f32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $6 - get_local $7 - get_local $1 + global.set $~argc + local.get $6 + local.get $7 + local.get $1 call_indirect (type $ffi) end i32.const 0 i32.lt_s if i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $7 + local.get $7 f32.store offset=8 i32.const 0 - set_local $5 + local.set $5 i32.const 0 - set_local $4 - get_local $3 - get_local $5 + local.set $4 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $6 + local.get $6 f32.store offset=8 end - get_local $0 + local.get $0 return end i32.const 0 - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 256 i32.lt_s if - get_local $3 - get_local $4 - get_local $2 - get_local $1 + local.get $3 + local.get $4 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $3 - get_local $4 - get_local $2 - get_local $1 + local.get $3 + local.get $4 + local.get $2 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 ) (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 106 ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 - get_local $2 + 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 - set_local $2 - get_local $3 - get_local $3 + local.set $2 + local.get $3 + local.get $3 i32.const 31 i32.shr_s i32.const 1 i32.shr_u i32.xor - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.gt_s - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.sub ) @@ -6038,7 +6038,7 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable @@ -6047,30 +6047,30 @@ i32.const 44 br $~lib/internal/sort/COMPARATOR|inlined.0 end - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort ) (func $~lib/builtins/isNaN (; 108 ;) (type $fi) (param $0 f32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne ) (func $std/array/isArraysEqual (; 109 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $2 + local.get $2 i32.eqz if block $~lib/array/Array#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 block $~lib/array/Array#get:length|inlined.3 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -6078,8 +6078,8 @@ i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 @@ -6088,32 +6088,32 @@ end block $break|0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|0 block $continue|0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get call $~lib/builtins/isNaN - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get call $~lib/builtins/isNaN i32.eq if br $continue|0 end - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get f32.ne if @@ -6122,10 +6122,10 @@ end end end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end @@ -6141,77 +6141,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + 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) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f64) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $FFi) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 f64.store offset=8 else br $break|1 @@ -6221,24 +6221,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 f64.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -6255,54 +6255,54 @@ (local $10 f64) (local $11 i32) (local $12 f64) - get_local $2 + local.get $2 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - set_local $4 + local.set $4 block $~lib/memory/memory.allocate|inlined.2 (result i32) - get_local $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.2 end - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $6 - get_local $4 + local.set $6 + local.get $5 + local.get $6 + local.get $4 call $~lib/internal/memory/memset block $break|0 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 + local.get $6 i32.const 0 i32.gt_s i32.eqz br_if $break|0 block - get_local $6 - set_local $7 + local.get $6 + local.set $7 block $break|1 loop $continue|1 - get_local $7 + local.get $7 i32.const 1 i32.and - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $7 + local.get $7 i32.const 1 i32.shr_s i32.const 31 @@ -6312,60 +6312,60 @@ i32.and i32.eq if - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $7 + local.set $7 br $continue|1 end end end - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f64) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f64) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 + local.set $10 block (result i32) i32.const 2 - set_global $~argc - get_local $9 - get_local $10 - get_local $3 + global.set $~argc + local.get $9 + local.get $10 + local.get $3 call_indirect (type $FFi) end i32.const 0 i32.lt_s if - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 @@ -6373,48 +6373,48 @@ i32.add i32.load i32.const 1 - get_local $6 + local.get $6 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f64.store offset=8 - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end block $break|2 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|2 - get_local $6 + local.get $6 i32.const 2 i32.ge_s i32.eqz @@ -6422,131 +6422,131 @@ block block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f64) i32.const 0 - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 + local.set $10 i32.const 0 - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f64) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $9 - get_local $0 - get_local $8 + local.set $9 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f64.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 i32.const 1 - set_local $8 + local.set $8 block $break|3 loop $continue|3 - get_local $8 + local.get $8 i32.const 1 i32.shl - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $8 + local.get $8 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and i32.add - tee_local $7 - get_local $6 + local.tee $7 + local.get $6 i32.lt_s if - get_local $7 - set_local $8 + local.get $7 + local.set $8 br $continue|3 end end end block $break|4 loop $continue|4 - get_local $8 + local.get $8 i32.const 0 i32.gt_s if block block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f64) i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 + local.set $10 block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f64) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $9 + local.set $9 block (result i32) i32.const 2 - set_global $~argc - get_local $10 - get_local $9 - get_local $3 + global.set $~argc + local.get $10 + local.get $9 + local.get $3 call_indirect (type $FFi) end i32.const 0 i32.lt_s if - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 @@ -6554,47 +6554,47 @@ i32.add i32.load i32.const 1 - get_local $8 + local.get $8 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f64.store offset=8 end - get_local $8 + local.get $8 i32.const 1 i32.shr_s - set_local $8 + local.set $8 end br $continue|4 end end end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|2 unreachable end @@ -6602,7 +6602,7 @@ end block $~lib/memory/memory.free|inlined.2 block - get_local $5 + local.get $5 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.2 unreachable @@ -6611,51 +6611,51 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f64) i32.const 1 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $12 + local.set $12 i32.const 1 - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f64) i32.const 0 - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 - get_local $0 - get_local $6 + local.set $10 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 i32.const 0 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $12 + local.get $12 f64.store offset=8 ) (func $~lib/array/Array#sort (; 112 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -6665,7 +6665,7 @@ (local $5 i32) (local $6 f64) (local $7 f64) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -6675,144 +6675,144 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f64) i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 3 i32.shl i32.add - get_local $5 + local.get $5 i32.add f64.load offset=8 end - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f64) i32.const 0 - set_local $5 + local.set $5 i32.const 0 - set_local $4 - get_local $3 - get_local $5 + local.set $4 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add f64.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $6 - get_local $7 - get_local $1 + global.set $~argc + local.get $6 + local.get $7 + local.get $1 call_indirect (type $FFi) end i32.const 0 i32.lt_s if i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 3 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $7 + local.get $7 f64.store offset=8 i32.const 0 - set_local $5 + local.set $5 i32.const 0 - set_local $4 - get_local $3 - get_local $5 + local.set $4 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $6 + local.get $6 f64.store offset=8 end - get_local $0 + local.get $0 return end i32.const 0 - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 256 i32.lt_s if - get_local $3 - get_local $4 - get_local $2 - get_local $1 + local.get $3 + local.get $4 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $3 - get_local $4 - get_local $2 - get_local $1 + local.get $3 + local.get $4 + local.get $2 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 ) (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 113 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 - get_local $2 + 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 - set_local $2 - get_local $3 - get_local $3 + local.set $2 + local.get $3 + local.get $3 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i64.gt_s - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.lt_s i32.sub ) @@ -6820,7 +6820,7 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable @@ -6829,33 +6829,33 @@ i32.const 45 br $~lib/internal/sort/COMPARATOR|inlined.0 end - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort ) (func $~lib/array/Array#__get (; 115 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 3 i32.shl i32.add - get_local $3 + local.get $3 i32.add f64.load offset=8 else @@ -6863,23 +6863,23 @@ end ) (func $~lib/builtins/isNaN (; 116 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne ) (func $std/array/isArraysEqual (; 117 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $2 + local.get $2 i32.eqz if block $~lib/array/Array#get:length|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 block $~lib/array/Array#get:length|inlined.2 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -6887,8 +6887,8 @@ i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 @@ -6897,32 +6897,32 @@ end block $break|0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|0 block $continue|0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get call $~lib/builtins/isNaN - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get call $~lib/builtins/isNaN i32.eq if br $continue|0 end - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get f64.ne if @@ -6931,10 +6931,10 @@ end end end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end @@ -6950,77 +6950,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + 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) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD|inlined.25 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 i32.store offset=8 else br $break|1 @@ -7030,24 +7030,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -7064,54 +7064,54 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $2 + local.get $2 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - set_local $4 + local.set $4 block $~lib/memory/memory.allocate|inlined.3 (result i32) - get_local $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.3 end - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $6 - get_local $4 + local.set $6 + local.get $5 + local.get $6 + local.get $4 call $~lib/internal/memory/memset block $break|0 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 + local.get $6 i32.const 0 i32.gt_s i32.eqz br_if $break|0 block - get_local $6 - set_local $7 + local.get $6 + local.set $7 block $break|1 loop $continue|1 - get_local $7 + local.get $7 i32.const 1 i32.and - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $7 + local.get $7 i32.const 1 i32.shr_s i32.const 31 @@ -7121,60 +7121,60 @@ i32.and i32.eq if - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $7 + local.set $7 br $continue|1 end end end - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.26 (result i32) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.27 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $10 + local.set $10 block (result i32) i32.const 2 - set_global $~argc - get_local $9 - get_local $10 - get_local $3 + global.set $~argc + local.get $9 + local.get $10 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 @@ -7182,48 +7182,48 @@ i32.add i32.load i32.const 1 - get_local $6 + local.get $6 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 i32.store offset=8 - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 i32.store offset=8 end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end block $break|2 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|2 - get_local $6 + local.get $6 i32.const 2 i32.ge_s i32.eqz @@ -7231,131 +7231,131 @@ block block $~lib/internal/arraybuffer/LOAD|inlined.28 (result i32) i32.const 0 - set_local $10 - get_local $0 - get_local $10 + local.set $10 + local.get $0 + local.get $10 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $10 + local.set $10 i32.const 0 - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.29 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $8 - get_local $0 - get_local $9 + local.set $8 + local.get $0 + local.get $9 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $8 + local.get $8 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 i32.store offset=8 i32.const 1 - set_local $8 + local.set $8 block $break|3 loop $continue|3 - get_local $8 + local.get $8 i32.const 1 i32.shl - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $8 + local.get $8 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and i32.add - tee_local $9 - get_local $6 + local.tee $9 + local.get $6 i32.lt_s if - get_local $9 - set_local $8 + local.get $9 + local.set $8 br $continue|3 end end end block $break|4 loop $continue|4 - get_local $8 + local.get $8 i32.const 0 i32.gt_s if block block $~lib/internal/arraybuffer/LOAD|inlined.30 (result i32) i32.const 0 - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $10 + local.set $10 block $~lib/internal/arraybuffer/LOAD|inlined.31 (result i32) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $10 - get_local $7 - get_local $3 + global.set $~argc + local.get $10 + local.get $7 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 @@ -7363,47 +7363,47 @@ i32.add i32.load i32.const 1 - get_local $8 + local.get $8 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 i32.store offset=8 i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 i32.store offset=8 end - get_local $8 + local.get $8 i32.const 1 i32.shr_s - set_local $8 + local.set $8 end br $continue|4 end end end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|2 unreachable end @@ -7411,7 +7411,7 @@ end block $~lib/memory/memory.free|inlined.3 block - get_local $5 + local.get $5 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.3 unreachable @@ -7420,51 +7420,51 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.32 (result i32) i32.const 1 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $12 + local.set $12 i32.const 1 - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.33 (result i32) i32.const 0 - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $9 - get_local $0 - get_local $6 + local.set $9 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 i32.store offset=8 i32.const 0 - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $12 + local.get $12 i32.store offset=8 ) (func $~lib/array/Array#sort (; 120 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -7474,7 +7474,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -7484,124 +7484,124 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD|inlined.22 (result i32) i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 + local.set $5 block $~lib/internal/arraybuffer/LOAD|inlined.23 (result i32) i32.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $6 - get_local $3 - get_local $4 + local.set $6 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - set_local $6 + local.set $6 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $1 + global.set $~argc + local.get $5 + local.get $6 + local.get $1 call_indirect (type $iii) end i32.const 0 i32.lt_s if i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $7 - get_local $3 - get_local $4 + local.set $7 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $6 + local.get $6 i32.store offset=8 i32.const 0 - set_local $7 + local.set $7 i32.const 0 - set_local $4 - get_local $3 - get_local $7 + local.set $4 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $0 + local.get $0 return end i32.const 0 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 256 i32.lt_s if - get_local $3 - get_local $6 - get_local $2 - get_local $1 + local.get $3 + local.get $6 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $3 - get_local $6 - get_local $2 - get_local $1 + local.get $3 + local.get $6 + local.get $2 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 ) (func $~lib/array/Array#sort|trampoline~anonymous|46 (; 121 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $~lib/array/Array#sort|trampoline (; 122 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable @@ -7610,10 +7610,10 @@ i32.const 46 br $~lib/internal/sort/COMPARATOR|inlined.0 end - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort ) (func $~lib/internal/sort/insertionSort (; 123 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) @@ -7624,77 +7624,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + 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) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 i32.store offset=8 else br $break|1 @@ -7704,24 +7704,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -7738,54 +7738,54 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $2 + local.get $2 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - set_local $4 + local.set $4 block $~lib/memory/memory.allocate|inlined.4 (result i32) - get_local $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.4 end - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $6 - get_local $4 + local.set $6 + local.get $5 + local.get $6 + local.get $4 call $~lib/internal/memory/memset block $break|0 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 + local.get $6 i32.const 0 i32.gt_s i32.eqz br_if $break|0 block - get_local $6 - set_local $7 + local.get $6 + local.set $7 block $break|1 loop $continue|1 - get_local $7 + local.get $7 i32.const 1 i32.and - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $7 + local.get $7 i32.const 1 i32.shr_s i32.const 31 @@ -7795,60 +7795,60 @@ i32.and i32.eq if - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $7 + local.set $7 br $continue|1 end end end - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $10 + local.set $10 block (result i32) i32.const 2 - set_global $~argc - get_local $9 - get_local $10 - get_local $3 + global.set $~argc + local.get $9 + local.get $10 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 @@ -7856,48 +7856,48 @@ i32.add i32.load i32.const 1 - get_local $6 + local.get $6 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 i32.store offset=8 - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 i32.store offset=8 end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end block $break|2 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|2 - get_local $6 + local.get $6 i32.const 2 i32.ge_s i32.eqz @@ -7905,131 +7905,131 @@ block block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) i32.const 0 - set_local $10 - get_local $0 - get_local $10 + local.set $10 + local.get $0 + local.get $10 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $10 + local.set $10 i32.const 0 - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $8 - get_local $0 - get_local $9 + local.set $8 + local.get $0 + local.get $9 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $8 + local.get $8 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 i32.store offset=8 i32.const 1 - set_local $8 + local.set $8 block $break|3 loop $continue|3 - get_local $8 + local.get $8 i32.const 1 i32.shl - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $8 + local.get $8 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and i32.add - tee_local $9 - get_local $6 + local.tee $9 + local.get $6 i32.lt_s if - get_local $9 - set_local $8 + local.get $9 + local.set $8 br $continue|3 end end end block $break|4 loop $continue|4 - get_local $8 + local.get $8 i32.const 0 i32.gt_s if block block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) i32.const 0 - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $10 + local.set $10 block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $10 - get_local $7 - get_local $3 + global.set $~argc + local.get $10 + local.get $7 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 @@ -8037,47 +8037,47 @@ i32.add i32.load i32.const 1 - get_local $8 + local.get $8 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 i32.store offset=8 i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 i32.store offset=8 end - get_local $8 + local.get $8 i32.const 1 i32.shr_s - set_local $8 + local.set $8 end br $continue|4 end end end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|2 unreachable end @@ -8085,7 +8085,7 @@ end block $~lib/memory/memory.free|inlined.4 block - get_local $5 + local.get $5 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.4 unreachable @@ -8094,51 +8094,51 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) i32.const 1 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $12 + local.set $12 i32.const 1 - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) i32.const 0 - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $9 - get_local $0 - get_local $6 + local.set $9 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 i32.store offset=8 i32.const 0 - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $12 + local.get $12 i32.store offset=8 ) (func $~lib/array/Array#sort (; 125 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -8148,7 +8148,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -8158,120 +8158,120 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 + local.set $5 block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) i32.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $6 - get_local $3 - get_local $4 + local.set $6 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - set_local $6 + local.set $6 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $1 + global.set $~argc + local.get $5 + local.get $6 + local.get $1 call_indirect (type $iii) end i32.const 0 i32.lt_s if i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $7 - get_local $3 - get_local $4 + local.set $7 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $6 + local.get $6 i32.store offset=8 i32.const 0 - set_local $7 + local.set $7 i32.const 0 - set_local $4 - get_local $3 - get_local $7 + local.set $4 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $0 + local.get $0 return end i32.const 0 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 256 i32.lt_s if - get_local $3 - get_local $6 - get_local $2 - get_local $1 + local.get $3 + local.get $6 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $3 - get_local $6 - get_local $2 - get_local $1 + local.get $3 + local.get $6 + local.get $2 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 ) (func $~lib/array/Array#sort|trampoline~anonymous|47 (; 126 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.gt_u - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u i32.sub ) @@ -8279,7 +8279,7 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable @@ -8288,58 +8288,58 @@ i32.const 47 br $~lib/internal/sort/COMPARATOR|inlined.0 end - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort ) (func $std/array/createReverseOrderedArray (; 128 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) i32.const 0 - get_local $0 + local.get $0 call $~lib/array/Array#constructor - set_local $1 + local.set $1 block $break|0 i32.const 0 - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 block $~lib/array/Array#get:length|inlined.43 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.lt_s i32.eqz br_if $break|0 - get_local $1 - get_local $2 + local.get $1 + local.get $2 block $~lib/array/Array#get:length|inlined.44 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.const 1 i32.sub - get_local $2 + local.get $2 i32.sub call $~lib/array/Array#__set - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $~lib/math/NativeMath.random (; 129 ;) (type $F) (result f64) (local $0 i64) (local $1 i64) (local $2 i64) - get_global $~lib/math/random_seeded + global.get $~lib/math/random_seeded i32.eqz if i32.const 0 @@ -8349,46 +8349,46 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/random_state0_64 - set_local $0 - get_global $~lib/math/random_state1_64 - set_local $1 - get_local $1 - set_global $~lib/math/random_state0_64 - get_local $0 - get_local $0 + 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 - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i64.const 17 i64.shr_u i64.xor - set_local $0 - get_local $0 - get_local $1 + local.set $0 + local.get $0 + local.get $1 i64.xor - set_local $0 - get_local $0 - get_local $1 + local.set $0 + local.get $0 + local.get $1 i64.const 26 i64.shr_u i64.xor - set_local $0 - get_local $0 - set_global $~lib/math/random_state1_64 - get_local $1 - get_local $0 + 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 - set_local $2 - get_local $2 - f64.reinterpret/i64 + local.set $2 + local.get $2 + f64.reinterpret_i64 f64.const 1 f64.sub ) @@ -8396,46 +8396,46 @@ (local $1 i32) (local $2 i32) i32.const 0 - get_local $0 + local.get $0 call $~lib/array/Array#constructor - set_local $1 + local.set $1 block $break|0 i32.const 0 - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 block $~lib/array/Array#get:length|inlined.46 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.lt_s i32.eqz br_if $break|0 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/math/NativeMath.random block $~lib/array/Array#get:length|inlined.47 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end - f64.convert_s/i32 + f64.convert_i32_s f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s call $~lib/array/Array#__set - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $std/array/assertSortedDefault~anonymous|48 (; 131 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $std/array/isSorted (; 132 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -8444,31 +8444,31 @@ block $break|0 block i32.const 1 - set_local $2 + local.set $2 block $~lib/array/Array#get:length|inlined.48 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 2 - set_global $~argc - get_local $0 - get_local $2 + global.set $~argc + local.get $0 + local.get $2 i32.const 1 i32.sub call $~lib/array/Array#__get - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/array/Array#__get - get_local $1 + local.get $1 call_indirect (type $iii) end i32.const 0 @@ -8477,10 +8477,10 @@ i32.const 0 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -8489,10 +8489,10 @@ i32.const 1 ) (func $std/array/assertSorted (; 133 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort - get_local $1 + local.get $1 call $std/array/isSorted i32.eqz if @@ -8505,7 +8505,7 @@ end ) (func $std/array/assertSortedDefault (; 134 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 block $~lib/internal/sort/COMPARATOR|inlined.1 (result i32) i32.const 48 br $~lib/internal/sort/COMPARATOR|inlined.1 @@ -8513,23 +8513,23 @@ call $std/array/assertSorted ) (func $start~anonymous|49 (; 135 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $start~anonymous|50 (; 136 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.sub ) (func $start~anonymous|51 (; 137 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.sub ) (func $start~anonymous|52 (; 138 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.sub ) (func $~lib/array/Array>#constructor (; 139 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -8537,7 +8537,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -8548,63 +8548,63 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array>#__set (; 140 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -8615,56 +8615,56 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $~lib/array/Array>#__get (; 141 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -8675,58 +8675,58 @@ (local $1 i32) (local $2 i32) i32.const 0 - get_local $0 + local.get $0 call $~lib/array/Array>#constructor - set_local $1 + local.set $1 block $break|0 i32.const 0 - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 block $~lib/array/Array>#get:length|inlined.1 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.lt_s i32.eqz br_if $break|0 block - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 0 i32.const 1 call $~lib/array/Array#constructor call $~lib/array/Array>#__set - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/array/Array>#__get i32.const 0 block $~lib/array/Array>#get:length|inlined.2 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.const 1 i32.sub - get_local $2 + local.get $2 i32.sub call $~lib/array/Array#__set end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $start~anonymous|53 (; 143 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 call $~lib/array/Array#__get - get_local $1 + local.get $1 i32.const 0 call $~lib/array/Array#__get i32.sub @@ -8739,77 +8739,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD,Array>|inlined.3 (result i32) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD,Array>|inlined.4 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 i32.store offset=8 else br $break|1 @@ -8819,24 +8819,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -8850,7 +8850,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -8860,102 +8860,102 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD,Array>|inlined.1 (result i32) i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 + local.set $5 block $~lib/internal/arraybuffer/LOAD,Array>|inlined.2 (result i32) i32.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $6 - get_local $3 - get_local $4 + local.set $6 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - set_local $6 + local.set $6 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $1 + global.set $~argc + local.get $5 + local.get $6 + local.get $1 call_indirect (type $iii) end i32.const 0 i32.lt_s if i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $7 - get_local $3 - get_local $4 + local.set $7 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $6 + local.get $6 i32.store offset=8 i32.const 0 - set_local $7 + local.set $7 i32.const 0 - set_local $4 - get_local $3 - get_local $7 + local.set $4 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $0 + local.get $0 return end i32.const 0 - set_local $6 - get_local $3 - get_local $6 - get_local $2 - get_local $1 + local.set $6 + local.get $3 + local.get $6 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort> - get_local $0 + local.get $0 ) (func $std/array/isSorted> (; 146 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -8963,31 +8963,31 @@ block $break|0 block i32.const 1 - set_local $2 + local.set $2 block $~lib/array/Array>#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 2 - set_global $~argc - get_local $0 - get_local $2 + global.set $~argc + local.get $0 + local.get $2 i32.const 1 i32.sub call $~lib/array/Array>#__get - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/array/Array>#__get - get_local $1 + local.get $1 call_indirect (type $iii) end i32.const 0 @@ -8996,10 +8996,10 @@ i32.const 0 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -9008,10 +9008,10 @@ i32.const 1 ) (func $std/array/assertSorted> (; 147 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array>#sort - get_local $1 + local.get $1 call $std/array/isSorted> i32.eqz if @@ -9028,7 +9028,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -9039,76 +9039,76 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $std/array/Proxy#constructor (; 149 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 + local.get $0 ) (func $~lib/array/Array>#__set (; 150 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -9119,82 +9119,82 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $std/array/createReverseOrderedElementsArray (; 151 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) i32.const 0 - get_local $0 + local.get $0 call $~lib/array/Array>#constructor - set_local $1 + local.set $1 block $break|0 i32.const 0 - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 block $~lib/array/Array>#get:length|inlined.1 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.lt_s i32.eqz br_if $break|0 - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.const 0 block $~lib/array/Array>#get:length|inlined.2 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.const 1 i32.sub - get_local $2 + local.get $2 i32.sub call $std/array/Proxy#constructor call $~lib/array/Array>#__set - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $start~anonymous|54 (; 152 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.sub ) @@ -9206,77 +9206,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.2 (result i32) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.3 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 i32.store offset=8 else br $break|1 @@ -9286,24 +9286,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -9317,7 +9317,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -9327,124 +9327,124 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.0 (result i32) i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 + local.set $5 block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.1 (result i32) i32.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $6 - get_local $3 - get_local $4 + local.set $6 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - set_local $6 + local.set $6 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $1 + global.set $~argc + local.get $5 + local.get $6 + local.get $1 call_indirect (type $iii) end i32.const 0 i32.lt_s if i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $7 - get_local $3 - get_local $4 + local.set $7 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $6 + local.get $6 i32.store offset=8 i32.const 0 - set_local $7 + local.set $7 i32.const 0 - set_local $4 - get_local $3 - get_local $7 + local.set $4 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $0 + local.get $0 return end i32.const 0 - set_local $6 - get_local $3 - get_local $6 - get_local $2 - get_local $1 + local.set $6 + local.get $3 + local.get $6 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort> - get_local $0 + local.get $0 ) (func $~lib/array/Array>#__get (; 155 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -9457,31 +9457,31 @@ block $break|0 block i32.const 1 - set_local $2 + local.set $2 block $~lib/array/Array>#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 2 - set_global $~argc - get_local $0 - get_local $2 + global.set $~argc + local.get $0 + local.get $2 i32.const 1 i32.sub call $~lib/array/Array>#__get - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/array/Array>#__get - get_local $1 + local.get $1 call_indirect (type $iii) end i32.const 0 @@ -9490,10 +9490,10 @@ i32.const 0 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -9502,10 +9502,10 @@ i32.const 1 ) (func $std/array/assertSorted> (; 157 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array>#sort - get_local $1 + local.get $1 call $std/array/isSorted> i32.eqz if @@ -9522,53 +9522,53 @@ (local $6 i32) (local $7 i32) i32.const 0 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_local $3 + local.set $6 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|0 loop $continue|0 - get_local $4 + local.get $4 if (result i32) - get_local $6 + local.get $6 i32.load16_u offset=4 - get_local $7 + local.get $7 i32.load16_u offset=4 i32.sub - tee_local $5 + local.tee $5 i32.eqz else - get_local $4 + local.get $4 end if block - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2 i32.add - set_local $6 - get_local $7 + local.set $6 + local.get $7 i32.const 2 i32.add - set_local $7 + local.set $7 end br $continue|0 end end end - get_local $5 + local.get $5 ) (func $~lib/string/String.__gt (; 159 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9576,22 +9576,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 + local.get $0 i32.const 0 i32.eq end - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -9599,38 +9599,38 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.load - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.eqz if i32.const 0 return end - get_local $4 + local.get $4 i32.eqz if i32.const 1 return end - get_local $3 - tee_local $2 - get_local $4 - tee_local $5 - get_local $2 - get_local $5 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 i32.lt_s select - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/compareUnsafe i32.const 0 i32.gt_s @@ -9641,22 +9641,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 + local.get $0 i32.const 0 i32.eq end - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -9664,48 +9664,48 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.load - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.eqz if i32.const 0 return end - get_local $3 + local.get $3 i32.eqz if i32.const 1 return end - get_local $3 - tee_local $2 - get_local $4 - tee_local $5 - get_local $2 - get_local $5 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 i32.lt_s select - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/compareUnsafe i32.const 0 i32.lt_s ) (func $start~anonymous|55 (; 161 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__gt - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__lt i32.sub ) @@ -9717,77 +9717,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $iii) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 i32.store offset=8 else br $break|1 @@ -9797,24 +9797,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -9828,7 +9828,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -9838,124 +9838,124 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.le_s if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $3 - get_local $4 + local.set $5 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 + local.set $5 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $6 - get_local $3 - get_local $4 + local.set $6 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 end - set_local $6 + local.set $6 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $1 + global.set $~argc + local.get $5 + local.get $6 + local.get $1 call_indirect (type $iii) end i32.const 0 i32.lt_s if i32.const 1 - set_local $4 + local.set $4 i32.const 0 - set_local $7 - get_local $3 - get_local $4 + local.set $7 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add - get_local $7 + local.get $7 i32.add - get_local $6 + local.get $6 i32.store offset=8 i32.const 0 - set_local $7 + local.set $7 i32.const 0 - set_local $4 - get_local $3 - get_local $7 + local.set $4 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.store offset=8 end - get_local $0 + local.get $0 return end i32.const 0 - set_local $6 - get_local $3 - get_local $6 - get_local $2 - get_local $1 + local.set $6 + local.get $3 + local.get $6 + local.get $2 + local.get $1 call $~lib/internal/sort/insertionSort - get_local $0 + local.get $0 ) (func $~lib/array/Array#__get (; 164 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -9968,31 +9968,31 @@ block $break|0 block i32.const 1 - set_local $2 + local.set $2 block $~lib/array/Array#get:length|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 2 - set_global $~argc - get_local $0 - get_local $2 + global.set $~argc + local.get $0 + local.get $2 i32.const 1 i32.sub call $~lib/array/Array#__get - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/array/Array#__get - get_local $1 + local.get $1 call_indirect (type $iii) end i32.const 0 @@ -10001,10 +10001,10 @@ i32.const 0 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -10013,10 +10013,10 @@ i32.const 1 ) (func $std/array/assertSorted (; 166 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/array/Array#sort - get_local $1 + local.get $1 call $std/array/isSorted i32.eqz if @@ -10031,21 +10031,21 @@ (func $~lib/string/String.__eq (; 167 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -10053,44 +10053,44 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $~lib/string/String.__ne (; 168 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__eq i32.eqz ) (func $std/array/isArraysEqual (; 169 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $2 + local.get $2 i32.eqz if block $~lib/array/Array#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=4 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 block $~lib/array/Array#get:length|inlined.3 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -10098,8 +10098,8 @@ i32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 @@ -10108,28 +10108,28 @@ end block $break|0 i32.const 0 - set_local $3 + local.set $3 loop $repeat|0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/array/Array#__get - get_local $1 - get_local $3 + local.get $1 + local.get $3 call $~lib/array/Array#__get call $~lib/string/String.__ne if i32.const 0 return end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 unreachable end @@ -10142,7 +10142,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -10153,59 +10153,59 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/internal/string/allocateUnsafe (; 171 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if (result i32) - get_local $0 - get_global $~lib/internal/string/MAX_LENGTH + local.get $0 + global.get $~lib/internal/string/MAX_LENGTH i32.le_s else - get_local $1 + local.get $1 end i32.eqz if @@ -10217,25 +10217,25 @@ unreachable end block $~lib/memory/memory.allocate|inlined.5 (result i32) - get_global $~lib/internal/string/HEADER_SIZE - get_local $0 + global.get $~lib/internal/string/HEADER_SIZE + local.get $0 i32.const 1 i32.shl i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.5 end - set_local $2 - get_local $2 - get_local $0 + local.set $2 + local.get $2 + local.get $0 i32.store - get_local $2 + local.get $2 ) (func $~lib/string/String#charAt (; 172 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -10247,8 +10247,8 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load i32.ge_u if @@ -10257,44 +10257,44 @@ end i32.const 1 call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $2 - get_local $0 - get_local $1 + 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 - get_local $2 + local.get $2 ) (func $~lib/internal/string/copyUnsafe (; 173 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $5 - get_local $2 - get_local $3 + local.set $5 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.shl - set_local $7 - get_local $5 - get_local $6 - get_local $7 + local.set $7 + local.get $5 + local.get $6 + local.get $7 call $~lib/internal/memory/memmove ) (func $~lib/string/String#concat (; 174 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -10302,7 +10302,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -10314,56 +10314,56 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 4144 - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.load - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.add - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 0 i32.eq if i32.const 3904 return end - get_local $4 + local.get $4 call $~lib/internal/string/allocateUnsafe - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $2 + local.get $2 call $~lib/internal/string/copyUnsafe - get_local $5 - get_local $2 - get_local $1 + local.get $5 + local.get $2 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $5 + local.get $5 ) (func $~lib/string/String.__concat (; 175 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4144 - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String#concat ) (func $std/array/createRandomString (; 176 ;) (type $ii) (param $0 i32) (result i32) @@ -10371,60 +10371,60 @@ (local $2 i32) (local $3 f64) i32.const 3904 - set_local $1 + local.set $1 block $break|0 i32.const 0 - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.lt_s i32.eqz br_if $break|0 - get_local $1 - get_global $std/array/charset + local.get $1 + global.get $std/array/charset block $~lib/math/NativeMath.floor|inlined.0 (result f64) call $~lib/math/NativeMath.random - get_global $std/array/charset + global.get $std/array/charset i32.load - f64.convert_s/i32 + f64.convert_i32_s f64.mul - set_local $3 - get_local $3 + local.set $3 + local.get $3 f64.floor end - i32.trunc_s/f64 + i32.trunc_f64_s call $~lib/string/String#charAt call $~lib/string/String.__concat - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $~lib/array/Array#__set (; 177 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -10435,79 +10435,79 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $std/array/createRandomStringArray (; 178 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) i32.const 0 - get_local $0 + local.get $0 call $~lib/array/Array#constructor - set_local $1 + local.set $1 block $break|0 i32.const 0 - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 block $~lib/array/Array#get:length|inlined.5 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.lt_s i32.eqz br_if $break|0 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/math/NativeMath.random f64.const 32 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s call $std/array/createRandomString call $~lib/array/Array#__set - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $start~anonymous|56 (; 179 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__gt - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__lt i32.sub ) @@ -10520,7 +10520,7 @@ (local $8 i32) (local $9 i32) (local $10 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -10532,94 +10532,94 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 - tee_local $4 + local.set $3 + local.get $1 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $6 - get_local $2 - tee_local $4 + local.set $6 + local.get $2 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $7 - get_local $6 - tee_local $4 - get_local $7 - tee_local $5 - get_local $4 - get_local $5 + 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 - set_local $8 - get_local $6 - tee_local $4 - get_local $7 - tee_local $5 - get_local $4 - get_local $5 + 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 - set_local $9 - get_local $9 - get_local $8 + local.set $9 + local.get $9 + local.get $8 i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if i32.const 3904 return end - get_local $8 + local.get $8 i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $9 - get_local $0 + local.get $9 + local.get $0 i32.load i32.eq else - get_local $4 + local.get $4 end if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - set_local $10 - get_local $10 + local.set $10 + local.get $10 i32.const 0 - get_local $0 - get_local $8 - get_local $3 + local.get $0 + local.get $8 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $10 + local.get $10 ) (func $~lib/array/Array#join (; 181 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -10634,12 +10634,12 @@ (local $11 i32) (local $12 i32) (local $13 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -10647,33 +10647,33 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if i32.const 4184 i32.const 4200 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 0 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load8_u offset=8 end @@ -10683,83 +10683,83 @@ return end i32.const 5 - set_local $9 - get_local $9 - get_local $6 + local.set $9 + local.get $9 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul - get_local $9 + local.get $9 i32.add - set_local $8 - get_local $8 + local.set $8 + local.get $8 call $~lib/internal/string/allocateUnsafe - set_local $10 + local.set $10 i32.const 0 - set_local $11 + local.set $11 block $break|0 i32.const 0 - set_local $12 + local.set $12 loop $repeat|0 - get_local $12 - get_local $2 + 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) i32.const 0 - set_local $13 - get_local $5 - get_local $12 + local.set $13 + local.get $5 + local.get $12 i32.const 0 i32.shl i32.add - get_local $13 + local.get $13 i32.add i32.load8_u offset=8 end - set_local $4 + local.set $4 i32.const 4 - get_local $4 + local.get $4 i32.const 0 i32.ne i32.eqz i32.add - set_local $9 - get_local $10 - get_local $11 + local.set $9 + local.get $10 + local.get $11 i32.const 4184 i32.const 4200 - get_local $4 + local.get $4 i32.const 0 i32.ne select i32.const 0 - get_local $9 + local.get $9 call $~lib/internal/string/copyUnsafe - get_local $11 - get_local $9 + local.get $11 + local.get $9 i32.add - set_local $11 - get_local $7 + local.set $11 + local.get $7 if - get_local $10 - get_local $11 - get_local $1 + local.get $10 + local.get $11 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $11 - get_local $6 + local.get $11 + local.get $6 i32.add - set_local $11 + local.set $11 end end - get_local $12 + local.get $12 i32.const 1 i32.add - set_local $12 + local.set $12 br $repeat|0 unreachable end @@ -10767,51 +10767,51 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $2 + local.set $12 + local.get $5 + local.get $2 i32.const 0 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load8_u offset=8 end - set_local $4 + local.set $4 i32.const 4 - get_local $4 + local.get $4 i32.const 0 i32.ne i32.eqz i32.add - set_local $9 - get_local $10 - get_local $11 + local.set $9 + local.get $10 + local.get $11 i32.const 4184 i32.const 4200 - get_local $4 + local.get $4 i32.const 0 i32.ne select i32.const 0 - get_local $9 + local.get $9 call $~lib/internal/string/copyUnsafe - get_local $11 - get_local $9 + local.get $11 + local.get $9 i32.add - set_local $11 - get_local $10 - set_local $12 - get_local $8 - get_local $11 + local.set $11 + local.get $10 + local.set $12 + local.get $8 + local.get $11 i32.gt_s if - get_local $10 + local.get $10 i32.const 0 - get_local $11 + local.get $11 call $~lib/string/String#substring - set_local $12 - get_local $10 + local.set $12 + local.get $10 i32.eqz if i32.const 0 @@ -10823,7 +10823,7 @@ end block $~lib/memory/memory.free|inlined.5 block - get_local $10 + local.get $10 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.5 unreachable @@ -10831,22 +10831,22 @@ unreachable end end - get_local $12 + local.get $12 return ) (func $~lib/internal/number/decimalCount32 (; 182 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 100000 i32.lt_u if - get_local $0 + local.get $0 i32.const 100 i32.lt_u if i32.const 1 i32.const 2 - get_local $0 + local.get $0 i32.const 10 i32.lt_u select @@ -10854,14 +10854,14 @@ else i32.const 4 i32.const 5 - get_local $0 + local.get $0 i32.const 10000 i32.lt_u select - set_local $1 + local.set $1 i32.const 3 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 1000 i32.lt_u select @@ -10870,13 +10870,13 @@ unreachable unreachable else - get_local $0 + local.get $0 i32.const 10000000 i32.lt_u if i32.const 6 i32.const 7 - get_local $0 + local.get $0 i32.const 1000000 i32.lt_u select @@ -10884,14 +10884,14 @@ else i32.const 9 i32.const 10 - get_local $0 + local.get $0 i32.const 1000000000 i32.lt_u select - set_local $1 + local.set $1 i32.const 8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 100000000 i32.lt_u select @@ -10916,69 +10916,69 @@ i32.const 4832 end i32.load - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $1 + local.get $1 i32.const 10000 i32.ge_u if block - get_local $1 + local.get $1 i32.const 10000 i32.div_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 10000 i32.rem_u - set_local $5 - get_local $4 - set_local $1 - get_local $5 + local.set $5 + local.get $4 + local.set $1 + local.get $5 i32.const 100 i32.div_u - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 100 i32.rem_u - set_local $7 + local.set $7 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 - set_local $8 - get_local $3 - get_local $6 + local.set $8 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i64.load32_u offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) i32.const 0 - set_local $8 - get_local $3 - get_local $7 + local.set $8 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i64.load32_u offset=8 end - set_local $10 - get_local $2 + local.set $10 + local.get $2 i32.const 4 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $9 - get_local $10 + local.get $9 + local.get $10 i64.const 32 i64.shl i64.or @@ -10988,88 +10988,88 @@ end end end - get_local $1 + local.get $1 i32.const 100 i32.ge_u if - get_local $1 + local.get $1 i32.const 100 i32.div_u - set_local $7 - get_local $1 + local.set $7 + local.get $1 i32.const 100 i32.rem_u - set_local $6 - get_local $7 - set_local $1 - get_local $2 + local.set $6 + local.get $7 + local.set $1 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) i32.const 0 - set_local $5 - get_local $3 - get_local $6 + local.set $5 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store offset=4 end - get_local $1 + local.get $1 i32.const 10 i32.ge_u if - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store offset=4 else - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_global $~lib/internal/string/CharCode._0 - get_local $1 + local.set $2 + global.get $~lib/internal/string/CharCode._0 + local.get $1 i32.add - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store16 offset=4 end ) @@ -11077,95 +11077,95 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4312 return end - get_local $0 + local.get $0 i32.const 0 i32.lt_s - set_local $1 - get_local $1 + local.set $1 + local.get $1 if i32.const 0 - get_local $0 + local.get $0 i32.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/string/allocateUnsafe - set_local $3 - get_local $3 - get_local $0 - get_local $2 + local.set $3 + local.get $3 + local.get $0 + local.get $2 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 if - get_local $3 - get_global $~lib/internal/string/CharCode.MINUS + local.get $3 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/internal/number/itoa (; 185 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/internal/number/itoa32 return ) (func $~lib/internal/number/itoa_stream (; 186 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 i32.const 1 return end i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 0 i32.lt_s - set_local $4 - get_local $4 + local.set $4 + local.get $4 if i32.const 0 - get_local $2 + local.get $2 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 call $~lib/internal/number/decimalCount32 - get_local $4 + local.get $4 i32.add - set_local $3 - get_local $0 - get_local $2 - get_local $3 + local.set $3 + local.get $0 + local.get $2 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $4 + local.get $4 if - get_local $0 - get_global $~lib/internal/string/CharCode.MINUS + local.get $0 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 187 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -11179,12 +11179,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -11192,31 +11192,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.34 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end @@ -11224,66 +11224,66 @@ return end i32.const 11 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 11 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + local.get $11 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.35 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -11291,36 +11291,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.36 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -11332,7 +11332,7 @@ end block $~lib/memory/memory.free|inlined.6 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.6 unreachable @@ -11340,62 +11340,62 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/internal/number/utoa32 (; 188 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4312 return end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $2 + local.get $0 + local.get $1 call $~lib/internal/number/utoa32_lut - get_local $2 + local.get $2 ) (func $~lib/internal/number/itoa (; 189 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/internal/number/utoa32 return ) (func $~lib/internal/number/itoa_stream (; 190 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 i32.const 1 return end i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 call $~lib/internal/number/decimalCount32 - set_local $3 - get_local $0 - get_local $2 - get_local $3 + local.set $3 + local.get $0 + local.get $2 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 191 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -11409,12 +11409,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -11422,31 +11422,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.15 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end @@ -11454,66 +11454,66 @@ return end i32.const 10 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 10 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + local.get $11 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -11521,36 +11521,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.17 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -11562,7 +11562,7 @@ end block $~lib/memory/memory.free|inlined.7 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.7 unreachable @@ -11570,12 +11570,12 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/builtins/isFinite (; 192 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.eq @@ -11598,47 +11598,47 @@ (local $21 i32) (local $22 i32) i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $7 + local.set $7 i64.const 1 - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.shl - set_local $8 - get_local $8 + local.set $8 + local.get $8 i64.const 1 i64.sub - set_local $9 - get_local $3 - get_local $1 + local.set $9 + local.get $3 + local.get $1 i64.sub - set_local $10 - get_local $4 - set_local $11 - get_local $3 - get_local $7 - i64.extend_s/i32 + 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 - set_local $12 - get_local $3 - get_local $9 + i32.wrap_i64 + local.set $12 + local.get $3 + local.get $9 i64.and - set_local $13 - get_local $12 + local.set $13 + local.get $12 call $~lib/internal/number/decimalCount32 - set_local $14 - get_local $6 - set_local $15 + local.set $14 + local.get $6 + local.set $15 block $~lib/internal/number/POWERS10|inlined.0 (result i32) i32.const 6616 end i32.load - set_local $16 + local.set $16 block $break|0 loop $continue|0 - get_local $14 + local.get $14 i32.const 0 i32.gt_s if @@ -11655,181 +11655,181 @@ block $case2|1 block $case1|1 block $case0|1 - get_local $14 - set_local $18 - get_local $18 + local.get $14 + local.set $18 + local.get $18 i32.const 10 i32.eq br_if $case0|1 - get_local $18 + local.get $18 i32.const 9 i32.eq br_if $case1|1 - get_local $18 + local.get $18 i32.const 8 i32.eq br_if $case2|1 - get_local $18 + local.get $18 i32.const 7 i32.eq br_if $case3|1 - get_local $18 + local.get $18 i32.const 6 i32.eq br_if $case4|1 - get_local $18 + local.get $18 i32.const 5 i32.eq br_if $case5|1 - get_local $18 + local.get $18 i32.const 4 i32.eq br_if $case6|1 - get_local $18 + local.get $18 i32.const 3 i32.eq br_if $case7|1 - get_local $18 + local.get $18 i32.const 2 i32.eq br_if $case8|1 - get_local $18 + local.get $18 i32.const 1 i32.eq br_if $case9|1 br $case10|1 end block - get_local $12 + local.get $12 i32.const 1000000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 1000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 1000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 - set_local $17 + local.get $12 + local.set $17 i32.const 0 - set_local $12 + local.set $12 br $break|1 unreachable end @@ -11837,140 +11837,140 @@ end block i32.const 0 - set_local $17 + local.set $17 br $break|1 unreachable end unreachable end - get_local $17 - get_local $15 + local.get $17 + local.get $15 i32.or if - get_local $0 + local.get $0 block (result i32) - get_local $15 - tee_local $18 + local.get $15 + local.tee $18 i32.const 1 i32.add - set_local $15 - get_local $18 + local.set $15 + local.get $18 end i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 - get_local $17 + global.get $~lib/internal/string/CharCode._0 + local.get $17 i32.const 65535 i32.and i32.add i32.store16 offset=4 end - get_local $14 + local.get $14 i32.const 1 i32.sub - set_local $14 - get_local $12 - i64.extend_u/i32 - get_local $7 - i64.extend_s/i32 + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s i64.shl - get_local $13 + local.get $13 i64.add - set_local $19 - get_local $19 - get_local $5 + local.set $19 + local.get $19 + local.get $5 i64.le_u if - get_global $~lib/internal/number/_K - get_local $14 + global.get $~lib/internal/number/_K + local.get $14 i32.add - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) i32.const 0 - set_local $18 - get_local $16 - get_local $14 + local.set $18 + local.get $16 + local.get $14 i32.const 2 i32.shl i32.add - get_local $18 + local.get $18 i32.add i64.load32_u offset=8 end - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.shl - set_local $20 - get_local $0 - get_local $15 + local.set $20 + local.get $0 + local.get $15 i32.const 1 i32.sub i32.const 1 i32.shl i32.add - set_local $18 - get_local $18 + local.set $18 + local.get $18 i32.load16_u offset=4 - set_local $21 + local.set $21 block $break|2 loop $continue|2 - get_local $19 - get_local $10 + local.get $19 + local.get $10 i64.lt_u - tee_local $22 + local.tee $22 if (result i32) - get_local $5 - get_local $19 + local.get $5 + local.get $19 i64.sub - get_local $20 + local.get $20 i64.ge_u else - get_local $22 + local.get $22 end - tee_local $22 + local.tee $22 if (result i32) - get_local $19 - get_local $20 + local.get $19 + local.get $20 i64.add - get_local $10 + local.get $10 i64.lt_u - tee_local $22 + local.tee $22 if (result i32) - get_local $22 + local.get $22 else - get_local $10 - get_local $19 + local.get $10 + local.get $19 i64.sub - get_local $19 - get_local $20 + local.get $19 + local.get $20 i64.add - get_local $10 + local.get $10 i64.sub i64.gt_u end else - get_local $22 + local.get $22 end if block - get_local $21 + local.get $21 i32.const 1 i32.sub - set_local $21 - get_local $19 - get_local $20 + local.set $21 + local.get $19 + local.get $20 i64.add - set_local $19 + local.set $19 end br $continue|2 end end end - get_local $18 - get_local $21 + local.get $18 + local.get $21 i32.store16 offset=4 - get_local $15 + local.get $15 return end end @@ -11983,150 +11983,150 @@ i32.const 1 if block - get_local $13 + local.get $13 i64.const 10 i64.mul - set_local $13 - get_local $5 + local.set $13 + local.get $5 i64.const 10 i64.mul - set_local $5 - get_local $13 - get_local $7 - i64.extend_s/i32 + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s i64.shr_u - set_local $19 - get_local $19 - get_local $15 - i64.extend_s/i32 + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s i64.or i64.const 0 i64.ne if - get_local $0 + local.get $0 block (result i32) - get_local $15 - tee_local $17 + local.get $15 + local.tee $17 i32.const 1 i32.add - set_local $15 - get_local $17 + local.set $15 + local.get $17 end i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 - get_local $19 - i32.wrap/i64 + global.get $~lib/internal/string/CharCode._0 + local.get $19 + i32.wrap_i64 i32.const 65535 i32.and i32.add i32.store16 offset=4 end - get_local $13 - get_local $9 + local.get $13 + local.get $9 i64.and - set_local $13 - get_local $14 + local.set $13 + local.get $14 i32.const 1 i32.sub - set_local $14 - get_local $13 - get_local $5 + local.set $14 + local.get $13 + local.get $5 i64.lt_u if - get_global $~lib/internal/number/_K - get_local $14 + global.get $~lib/internal/number/_K + local.get $14 i32.add - set_global $~lib/internal/number/_K - get_local $10 + global.set $~lib/internal/number/_K + local.get $10 block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) i32.const 0 - get_local $14 + local.get $14 i32.sub - set_local $17 + local.set $17 i32.const 0 - set_local $21 - get_local $16 - get_local $17 + local.set $21 + local.get $16 + local.get $17 i32.const 2 i32.shl i32.add - get_local $21 + local.get $21 i32.add i64.load32_u offset=8 end i64.mul - set_local $10 - get_local $0 - get_local $15 + local.set $10 + local.get $0 + local.get $15 i32.const 1 i32.sub i32.const 1 i32.shl i32.add - set_local $21 - get_local $21 + local.set $21 + local.get $21 i32.load16_u offset=4 - set_local $17 + local.set $17 block $break|4 loop $continue|4 - get_local $13 - get_local $10 + local.get $13 + local.get $10 i64.lt_u - tee_local $18 + local.tee $18 if (result i32) - get_local $5 - get_local $13 + local.get $5 + local.get $13 i64.sub - get_local $8 + local.get $8 i64.ge_u else - get_local $18 + local.get $18 end - tee_local $18 + local.tee $18 if (result i32) - get_local $13 - get_local $8 + local.get $13 + local.get $8 i64.add - get_local $10 + local.get $10 i64.lt_u - tee_local $18 + local.tee $18 if (result i32) - get_local $18 + local.get $18 else - get_local $10 - get_local $13 + local.get $10 + local.get $13 i64.sub - get_local $13 - get_local $8 + local.get $13 + local.get $8 i64.add - get_local $10 + local.get $10 i64.sub i64.gt_u end else - get_local $18 + local.get $18 end if block - get_local $17 + local.get $17 i32.const 1 i32.sub - set_local $17 - get_local $13 - get_local $8 + local.set $17 + local.get $13 + local.get $8 i64.add - set_local $13 + local.set $13 end br $continue|4 end end end - get_local $21 - get_local $17 + local.get $21 + local.get $17 i32.store16 offset=4 - get_local $15 + local.get $15 return end end @@ -12134,7 +12134,7 @@ end end end - get_local $15 + local.get $15 ) (func $~lib/internal/number/prettify (; 194 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -12143,330 +12143,330 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $2 + local.get $2 i32.eqz if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode._0 i32.const 16 i32.shl i32.or i32.store offset=4 - get_local $1 + local.get $1 i32.const 2 i32.add return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - set_local $3 - get_local $1 - get_local $3 + local.set $3 + local.get $1 + local.get $3 i32.le_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 21 i32.le_s else - get_local $4 + local.get $4 end if block $break|0 - get_local $1 - set_local $4 + local.get $1 + local.set $4 loop $repeat|0 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end unreachable end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode._0 i32.const 16 i32.shl i32.or i32.store offset=4 - get_local $3 + local.get $3 i32.const 2 i32.add return else - get_local $3 + local.get $3 i32.const 0 i32.gt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 21 i32.le_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - set_local $4 - get_local $4 - get_global $~lib/internal/string/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 2 i32.add - set_local $5 - get_local $4 - get_global $~lib/internal/string/HEADER_SIZE + local.set $5 + local.get $4 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 + local.set $6 i32.const 0 - get_local $2 + local.get $2 i32.sub i32.const 1 i32.shl - set_local $7 - get_local $5 - get_local $6 - get_local $7 + local.set $7 + local.get $5 + local.get $6 + local.get $7 call $~lib/internal/memory/memmove - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode.DOT i32.store16 offset=4 - get_local $1 + local.get $1 i32.const 1 i32.add return else i32.const -6 - get_local $3 + local.get $3 i32.lt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 0 i32.le_s else - get_local $4 + local.get $4 end if i32.const 2 - get_local $3 + local.get $3 i32.sub - set_local $4 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - get_local $4 + local.get $4 i32.const 1 i32.shl i32.add - set_local $7 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $1 + local.set $6 + local.get $1 i32.const 1 i32.shl - set_local $5 - get_local $7 - get_local $6 - get_local $5 + local.set $5 + local.get $7 + local.get $6 + local.get $5 call $~lib/internal/memory/memmove - get_local $0 - get_global $~lib/internal/string/CharCode._0 - get_global $~lib/internal/string/CharCode.DOT + local.get $0 + global.get $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT i32.const 16 i32.shl i32.or i32.store offset=4 block $break|1 i32.const 2 - set_local $5 + local.set $5 loop $repeat|1 - get_local $5 - get_local $4 + local.get $5 + local.get $4 i32.lt_s i32.eqz br_if $break|1 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|1 unreachable end unreachable end - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add return else - get_local $1 + local.get $1 i32.const 1 i32.eq if - get_local $0 - get_global $~lib/internal/string/CharCode.e + local.get $0 + global.get $~lib/internal/string/CharCode.e i32.store16 offset=6 block $~lib/internal/number/genExponent|inlined.0 (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1 i32.sub - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.lt_s - set_local $6 - get_local $6 + local.set $6 + local.get $6 if i32.const 0 - get_local $5 + local.get $5 i32.sub - set_local $5 + local.set $5 end - get_local $5 + local.get $5 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - set_local $7 - get_local $4 - get_local $5 - get_local $7 + local.set $7 + local.get $4 + local.get $5 + local.get $7 call $~lib/internal/number/utoa32_lut - get_local $4 - get_global $~lib/internal/string/CharCode.MINUS - get_global $~lib/internal/string/CharCode.PLUS - get_local $6 + local.get $4 + global.get $~lib/internal/string/CharCode.MINUS + global.get $~lib/internal/string/CharCode.PLUS + local.get $6 select i32.store16 offset=4 - get_local $7 + local.get $7 end - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 2 i32.add return else - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $7 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 4 i32.add - set_local $6 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $6 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 2 i32.add - set_local $5 - get_local $7 + local.set $5 + local.get $7 i32.const 2 i32.sub - set_local $4 - get_local $6 - get_local $5 - get_local $4 + local.set $4 + local.get $6 + local.get $5 + local.get $4 call $~lib/internal/memory/memmove - get_local $0 - get_global $~lib/internal/string/CharCode.DOT + local.get $0 + global.get $~lib/internal/string/CharCode.DOT i32.store16 offset=6 - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.add - get_global $~lib/internal/string/CharCode.e + global.get $~lib/internal/string/CharCode.e i32.store16 offset=6 - get_local $1 + local.get $1 block $~lib/internal/number/genExponent|inlined.1 (result i32) - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.add i32.const 4 i32.add - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1 i32.sub - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.lt_s - set_local $6 - get_local $6 + local.set $6 + local.get $6 if i32.const 0 - get_local $5 + local.get $5 i32.sub - set_local $5 + local.set $5 end - get_local $5 + local.get $5 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - set_local $8 - get_local $4 - get_local $5 - get_local $8 + local.set $8 + local.get $4 + local.get $5 + local.get $8 call $~lib/internal/number/utoa32_lut - get_local $4 - get_global $~lib/internal/string/CharCode.MINUS - get_global $~lib/internal/string/CharCode.PLUS - get_local $6 + local.get $4 + global.get $~lib/internal/string/CharCode.MINUS + global.get $~lib/internal/string/CharCode.PLUS + local.get $6 select i32.store16 offset=4 - get_local $8 + local.get $8 end i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 2 i32.add return @@ -12505,46 +12505,46 @@ (local $23 i64) (local $24 i64) (local $25 i32) - get_local $1 + local.get $1 f64.const 0 f64.lt - set_local $2 - get_local $2 + local.set $2 + local.get $2 if - get_local $1 + local.get $1 f64.neg - set_local $1 - get_local $0 - get_global $~lib/internal/string/CharCode.MINUS + local.set $1 + local.get $0 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end block $~lib/internal/number/grisu2|inlined.0 (result i32) - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $3 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $3 i64.const 9218868437227405312 i64.and i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $3 + i32.wrap_i64 + local.set $4 + local.get $3 i64.const 4503599627370495 i64.and - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 0 i32.ne - i64.extend_u/i32 + i64.extend_i32_u i64.const 52 i64.shl - get_local $5 + local.get $5 i64.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 - get_local $4 + local.get $4 i32.const 0 i32.ne select @@ -12552,389 +12552,389 @@ i32.const 52 i32.add i32.sub - set_local $4 + local.set $4 block - get_local $6 + local.get $6 i64.const 1 i64.shl i64.const 1 i64.add - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.const 1 i32.sub - set_local $8 - get_local $7 + local.set $8 + local.get $7 i64.clz - i32.wrap/i64 - set_local $9 - get_local $7 - get_local $9 - i64.extend_s/i32 + i32.wrap_i64 + local.set $9 + local.get $7 + local.get $9 + i64.extend_i32_s i64.shl - set_local $7 - get_local $8 - get_local $9 + local.set $7 + local.get $8 + local.get $9 i32.sub - set_local $8 + local.set $8 i32.const 1 - get_local $6 + local.get $6 i64.const 4503599627370496 i64.eq i32.add - set_local $10 - get_local $7 - set_global $~lib/internal/number/_frc_plus - get_local $6 - get_local $10 - i64.extend_s/i32 + local.set $10 + local.get $7 + global.set $~lib/internal/number/_frc_plus + local.get $6 + local.get $10 + i64.extend_i32_s i64.shl i64.const 1 i64.sub - get_local $4 - get_local $10 + local.get $4 + local.get $10 i32.sub - get_local $8 + local.get $8 i32.sub - i64.extend_s/i32 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_minus - get_local $8 - set_global $~lib/internal/number/_exp + global.set $~lib/internal/number/_frc_minus + local.get $8 + global.set $~lib/internal/number/_exp end block - get_global $~lib/internal/number/_exp - set_local $10 + global.get $~lib/internal/number/_exp + local.set $10 i32.const -61 - get_local $10 + local.get $10 i32.sub - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.30102999566398114 f64.mul f64.const 347 f64.add - set_local $11 - get_local $11 - i32.trunc_s/f64 - set_local $9 - get_local $9 - get_local $9 - f64.convert_s/i32 - get_local $11 + local.set $11 + local.get $11 + i32.trunc_f64_s + local.set $9 + local.get $9 + local.get $9 + f64.convert_i32_s + local.get $11 f64.ne i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 i32.const 3 i32.shr_s i32.const 1 i32.add - set_local $8 + local.set $8 i32.const 348 - get_local $8 + local.get $8 i32.const 3 i32.shl i32.sub - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K block $~lib/internal/number/FRC_POWERS|inlined.0 (result i32) i32.const 6280 end i32.load - set_local $12 + local.set $12 block $~lib/internal/number/EXP_POWERS|inlined.0 (result i32) i32.const 6544 end i32.load - set_local $13 + local.set $13 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 - set_local $14 - get_local $12 - get_local $8 + local.set $14 + local.get $12 + local.get $8 i32.const 3 i32.shl i32.add - get_local $14 + local.get $14 i32.add i64.load offset=8 end - set_global $~lib/internal/number/_frc_pow + global.set $~lib/internal/number/_frc_pow block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $14 - get_local $13 - get_local $8 + local.set $14 + local.get $13 + local.get $8 i32.const 1 i32.shl i32.add - get_local $14 + local.get $14 i32.add i32.load16_s offset=8 end - set_global $~lib/internal/number/_exp_pow + global.set $~lib/internal/number/_exp_pow end - get_local $6 + local.get $6 i64.clz - i32.wrap/i64 - set_local $13 - get_local $6 - get_local $13 - i64.extend_s/i32 + i32.wrap_i64 + local.set $13 + local.get $6 + local.get $13 + i64.extend_i32_s i64.shl - set_local $6 - get_local $4 - get_local $13 + local.set $6 + local.get $4 + local.get $13 i32.sub - set_local $4 - get_global $~lib/internal/number/_frc_pow - set_local $7 - get_global $~lib/internal/number/_exp_pow - set_local $12 + local.set $4 + global.get $~lib/internal/number/_frc_pow + local.set $7 + global.get $~lib/internal/number/_exp_pow + local.set $12 block $~lib/internal/number/umul64f|inlined.0 (result i64) - get_local $6 + local.get $6 i64.const 4294967295 i64.and - set_local $15 - get_local $7 + local.set $15 + local.get $7 i64.const 4294967295 i64.and - set_local $16 - get_local $6 + local.set $16 + local.get $6 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $18 - get_local $15 - get_local $16 + local.set $18 + local.get $15 + local.get $16 i64.mul - set_local $19 - get_local $17 - get_local $16 + local.set $19 + local.get $17 + local.get $16 i64.mul - get_local $19 + local.get $19 i64.const 32 i64.shr_u i64.add - set_local $20 - get_local $15 - get_local $18 + local.set $20 + local.get $15 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.const 4294967295 i64.and i64.add - set_local $21 - get_local $21 + local.set $21 + local.get $21 i64.const 2147483647 i64.add - set_local $21 - get_local $20 + local.set $21 + local.get $20 i64.const 32 i64.shr_u - set_local $20 - get_local $21 + local.set $20 + local.get $21 i64.const 32 i64.shr_u - set_local $21 - get_local $17 - get_local $18 + local.set $21 + local.get $17 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.add - get_local $21 + local.get $21 i64.add end - set_local $21 + local.set $21 block $~lib/internal/number/umul64e|inlined.0 (result i32) - get_local $4 - get_local $12 + local.get $4 + local.get $12 i32.add i32.const 64 i32.add end - set_local $8 + local.set $8 block $~lib/internal/number/umul64f|inlined.1 (result i64) - get_global $~lib/internal/number/_frc_plus - set_local $20 - get_local $20 + global.get $~lib/internal/number/_frc_plus + local.set $20 + local.get $20 i64.const 4294967295 i64.and - set_local $19 - get_local $7 + local.set $19 + local.get $7 i64.const 4294967295 i64.and - set_local $18 - get_local $20 + local.set $18 + local.get $20 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $16 - get_local $19 - get_local $18 + local.set $16 + local.get $19 + local.get $18 i64.mul - set_local $15 - get_local $17 - get_local $18 + local.set $15 + local.get $17 + local.get $18 i64.mul - get_local $15 + local.get $15 i64.const 32 i64.shr_u i64.add - set_local $22 - get_local $19 - get_local $16 + local.set $22 + local.get $19 + local.get $16 i64.mul - get_local $22 + local.get $22 i64.const 4294967295 i64.and i64.add - set_local $23 - get_local $23 + local.set $23 + local.get $23 i64.const 2147483647 i64.add - set_local $23 - get_local $22 + local.set $23 + local.get $22 i64.const 32 i64.shr_u - set_local $22 - get_local $23 + local.set $22 + local.get $23 i64.const 32 i64.shr_u - set_local $23 - get_local $17 - get_local $16 + local.set $23 + local.get $17 + local.get $16 i64.mul - get_local $22 + local.get $22 i64.add - get_local $23 + local.get $23 i64.add end i64.const 1 i64.sub - set_local $23 + local.set $23 block $~lib/internal/number/umul64e|inlined.1 (result i32) - get_global $~lib/internal/number/_exp - set_local $9 - get_local $9 - get_local $12 + global.get $~lib/internal/number/_exp + local.set $9 + local.get $9 + local.get $12 i32.add i32.const 64 i32.add end - set_local $9 + local.set $9 block $~lib/internal/number/umul64f|inlined.2 (result i64) - get_global $~lib/internal/number/_frc_minus - set_local $22 - get_local $22 + global.get $~lib/internal/number/_frc_minus + local.set $22 + local.get $22 i64.const 4294967295 i64.and - set_local $15 - get_local $7 + local.set $15 + local.get $7 i64.const 4294967295 i64.and - set_local $16 - get_local $22 + local.set $16 + local.get $22 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $18 - get_local $15 - get_local $16 + local.set $18 + local.get $15 + local.get $16 i64.mul - set_local $19 - get_local $17 - get_local $16 + local.set $19 + local.get $17 + local.get $16 i64.mul - get_local $19 + local.get $19 i64.const 32 i64.shr_u i64.add - set_local $20 - get_local $15 - get_local $18 + local.set $20 + local.get $15 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.const 4294967295 i64.and i64.add - set_local $24 - get_local $24 + local.set $24 + local.get $24 i64.const 2147483647 i64.add - set_local $24 - get_local $20 + local.set $24 + local.get $20 i64.const 32 i64.shr_u - set_local $20 - get_local $24 + local.set $20 + local.get $24 i64.const 32 i64.shr_u - set_local $24 - get_local $17 - get_local $18 + local.set $24 + local.get $17 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.add - get_local $24 + local.get $24 i64.add end i64.const 1 i64.add - set_local $24 - get_local $23 - get_local $24 + local.set $24 + local.get $23 + local.get $24 i64.sub - set_local $20 - get_local $0 - get_local $21 - get_local $8 - get_local $23 - get_local $9 - get_local $20 - get_local $2 + local.set $20 + local.get $0 + local.get $21 + local.get $8 + local.get $23 + local.get $9 + local.get $20 + local.get $2 call $~lib/internal/number/genDigits end - set_local $25 - get_local $0 - get_local $2 + local.set $25 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $25 - get_local $2 + local.get $25 + local.get $2 i32.sub - get_global $~lib/internal/number/_K + global.get $~lib/internal/number/_K call $~lib/internal/number/prettify - set_local $25 - get_local $25 - get_local $2 + local.set $25 + local.get $25 + local.get $2 i32.add ) (func $~lib/internal/number/dtoa (; 196 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 f64.const 0 f64.eq if i32.const 5176 return end - get_local $0 + local.get $0 call $~lib/builtins/isFinite i32.eqz if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if i32.const 5192 @@ -12942,25 +12942,25 @@ end i32.const 5208 i32.const 5232 - get_local $0 + local.get $0 f64.const 0 f64.lt select return end - get_global $~lib/internal/number/MAX_DOUBLE_LENGTH + global.get $~lib/internal/number/MAX_DOUBLE_LENGTH call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 call $~lib/internal/number/dtoa_core - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 - get_local $2 + local.get $2 call $~lib/string/String#substring - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.eqz if i32.const 0 @@ -12972,14 +12972,14 @@ end block $~lib/memory/memory.free|inlined.8 block - get_local $1 + local.get $1 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.8 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $~lib/internal/number/dtoa_stream (; 197 ;) (type $iiFi) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) @@ -12988,84 +12988,84 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 f64.const 0 f64.eq if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 - get_local $0 - get_global $~lib/internal/string/CharCode.DOT + local.get $0 + global.get $~lib/internal/string/CharCode.DOT i32.store16 offset=6 - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=8 i32.const 3 return end - get_local $2 + local.get $2 call $~lib/builtins/isFinite i32.eqz if - get_local $2 + local.get $2 call $~lib/builtins/isNaN if - get_local $0 - get_global $~lib/internal/string/CharCode.N + local.get $0 + global.get $~lib/internal/string/CharCode.N i32.store16 offset=4 - get_local $0 - get_global $~lib/internal/string/CharCode.a + local.get $0 + global.get $~lib/internal/string/CharCode.a i32.store16 offset=6 - get_local $0 - get_global $~lib/internal/string/CharCode.N + local.get $0 + global.get $~lib/internal/string/CharCode.N i32.store16 offset=8 i32.const 3 return else - get_local $2 + local.get $2 f64.const 0 f64.lt - set_local $3 + local.set $3 i32.const 8 - get_local $3 + local.get $3 i32.add - set_local $4 + local.set $4 i32.const 5208 i32.const 5232 - get_local $3 + local.get $3 select - set_local $5 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $5 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $5 - get_global $~lib/internal/string/HEADER_SIZE + local.set $6 + local.get $5 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.const 1 i32.shl - set_local $8 - get_local $6 - get_local $7 - get_local $8 + local.set $8 + local.get $6 + local.get $7 + local.get $8 call $~lib/internal/memory/memmove - get_local $4 + local.get $4 return end unreachable unreachable end - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/internal/number/dtoa_core ) (func $~lib/array/Array#join (; 198 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -13080,12 +13080,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -13093,31 +13093,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.13 (result f64) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 3 i32.shl i32.add - get_local $9 + local.get $9 i32.add f64.load offset=8 end @@ -13125,66 +13125,66 @@ return end i32.const 28 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 28 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + 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) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 3 i32.shl i32.add - get_local $12 + local.get $12 i32.add f64.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/dtoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -13192,36 +13192,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.15 (result f64) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 3 i32.shl i32.add - get_local $11 + local.get $11 i32.add f64.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/dtoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -13233,7 +13233,7 @@ end block $~lib/memory/memory.free|inlined.9 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.9 unreachable @@ -13241,7 +13241,7 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/array/Array#join (; 199 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -13256,12 +13256,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -13269,144 +13269,144 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end return end i32.const 0 - set_local $9 + local.set $9 block $break|0 block i32.const 0 - set_local $8 - get_local $2 + local.set $8 + local.get $2 i32.const 1 i32.add - set_local $10 + local.set $10 end loop $repeat|0 - get_local $8 - get_local $10 + local.get $8 + local.get $10 i32.lt_s i32.eqz br_if $break|0 - get_local $9 + local.get $9 block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $8 + local.set $11 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load offset=8 end i32.load i32.add - set_local $9 - get_local $8 + local.set $9 + local.get $8 i32.const 1 i32.add - set_local $8 + local.set $8 br $repeat|0 unreachable end unreachable end i32.const 0 - set_local $10 - get_local $9 - get_local $6 - get_local $2 + local.set $10 + local.get $9 + local.get $6 + local.get $2 i32.mul i32.add call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 block $break|1 i32.const 0 - set_local $11 + local.set $11 loop $repeat|1 - get_local $11 - get_local $2 + local.get $11 + local.get $2 i32.lt_s i32.eqz br_if $break|1 block block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 + local.get $4 i32.load - set_local $12 - get_local $8 - get_local $10 - get_local $4 + local.set $12 + local.get $8 + local.get $10 + local.get $4 i32.const 0 - get_local $12 + local.get $12 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $12 + local.get $10 + local.get $12 i32.add - set_local $10 + local.set $10 end - get_local $7 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|1 unreachable end @@ -13414,48 +13414,48 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 + local.get $4 i32.load - set_local $11 - get_local $8 - get_local $10 - get_local $4 + local.set $11 + local.get $8 + local.get $10 + local.get $4 i32.const 0 - get_local $11 + local.get $11 call $~lib/internal/string/copyUnsafe end - get_local $8 + local.get $8 return ) (func $std/array/Ref#constructor (; 200 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $~lib/array/Array#constructor (; 201 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -13466,62 +13466,62 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#__unchecked_set (; 202 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 + local.set $3 i32.const 0 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $~lib/array/Array#join (; 203 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -13536,12 +13536,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -13549,90 +13549,90 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if i32.const 6872 return end i32.const 15 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 15 i32.add - set_local $8 - get_local $8 + local.set $8 + local.get $8 call $~lib/internal/string/allocateUnsafe - set_local $9 + local.set $9 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + local.get $11 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $9 - get_local $10 + local.get $9 + local.get $10 i32.const 6872 i32.const 0 i32.const 15 call $~lib/internal/string/copyUnsafe - get_local $10 + local.get $10 i32.const 15 i32.add - set_local $10 + local.set $10 end - get_local $7 + local.get $7 if - get_local $9 - get_local $10 - get_local $1 + local.get $9 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -13640,40 +13640,40 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load offset=8 end if - get_local $9 - get_local $10 + local.get $9 + local.get $10 i32.const 6872 i32.const 0 i32.const 15 call $~lib/internal/string/copyUnsafe - get_local $10 + local.get $10 i32.const 15 i32.add - set_local $10 + local.set $10 end - get_local $9 - set_local $11 - get_local $8 - get_local $10 + local.get $9 + local.set $11 + local.get $8 + local.get $10 i32.gt_s if - get_local $9 + local.get $9 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $9 + local.set $11 + local.get $9 i32.eqz if i32.const 0 @@ -13685,7 +13685,7 @@ end block $~lib/memory/memory.free|inlined.10 block - get_local $9 + local.get $9 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.10 unreachable @@ -13693,11 +13693,11 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/internal/number/itoa (; 204 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -13709,68 +13709,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.eqz if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 i32.const 1 return end i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.const 0 i32.lt_s - set_local $4 - get_local $4 + local.set $4 + local.get $4 if i32.const 0 - get_local $2 + local.get $2 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s call $~lib/internal/number/decimalCount32 - get_local $4 + local.get $4 i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - set_local $5 - get_local $0 - get_local $5 - get_local $3 + local.set $5 + local.get $0 + local.get $5 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $4 + local.get $4 if - get_local $0 - get_global $~lib/internal/string/CharCode.MINUS + local.get $0 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 206 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -13784,12 +13784,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -13797,31 +13797,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 0 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load8_s offset=8 end @@ -13829,66 +13829,66 @@ return end i32.const 11 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 11 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + local.get $11 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 0 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load8_s offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -13896,36 +13896,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 0 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load8_s offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -13937,7 +13937,7 @@ end block $~lib/memory/memory.free|inlined.11 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.11 unreachable @@ -13945,11 +13945,11 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/internal/number/itoa (; 207 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and call $~lib/internal/number/utoa32 @@ -13958,39 +13958,39 @@ (func $~lib/internal/number/itoa_stream (; 208 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 65535 i32.and i32.eqz if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 i32.const 1 return end i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 65535 i32.and call $~lib/internal/number/decimalCount32 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 65535 i32.and - set_local $4 - get_local $0 - get_local $4 - get_local $3 + local.set $4 + local.get $0 + local.get $4 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 209 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -14004,12 +14004,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -14017,31 +14017,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 1 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load16_u offset=8 end @@ -14049,66 +14049,66 @@ return end i32.const 10 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 10 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + local.get $11 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 1 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load16_u offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -14116,36 +14116,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 1 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load16_u offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -14157,7 +14157,7 @@ end block $~lib/memory/memory.free|inlined.12 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.12 unreachable @@ -14165,22 +14165,22 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/internal/number/decimalCount64 (; 210 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) - get_local $0 + local.get $0 i64.const 1000000000000000 i64.lt_u if - get_local $0 + local.get $0 i64.const 1000000000000 i64.lt_u if i32.const 11 i32.const 12 - get_local $0 + local.get $0 i64.const 100000000000 i64.lt_u select @@ -14188,14 +14188,14 @@ else i32.const 14 i32.const 15 - get_local $0 + local.get $0 i64.const 100000000000000 i64.lt_u select - set_local $1 + local.set $1 i32.const 13 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i64.const 10000000000000 i64.lt_u select @@ -14204,13 +14204,13 @@ unreachable unreachable else - get_local $0 + local.get $0 i64.const 100000000000000000 i64.lt_u if i32.const 16 i32.const 17 - get_local $0 + local.get $0 i64.const 10000000000000000 i64.lt_u select @@ -14218,14 +14218,14 @@ else i32.const 19 i32.const 20 - get_local $0 + local.get $0 i64.const -8446744073709551616 i64.lt_u select - set_local $1 + local.set $1 i32.const 18 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i64.const 1000000000000000000 i64.lt_u select @@ -14254,129 +14254,129 @@ i32.const 7712 end i32.load - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $1 + local.get $1 i64.const 100000000 i64.ge_u if block - get_local $1 + local.get $1 i64.const 100000000 i64.div_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i64.const 100000000 i64.mul i64.sub - i32.wrap/i64 - set_local $5 - get_local $4 - set_local $1 - get_local $5 + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 i32.const 10000 i32.div_u - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 10000 i32.rem_u - set_local $7 - get_local $6 + local.set $7 + local.get $6 i32.const 100 i32.div_u - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 100 i32.rem_u - set_local $9 - get_local $7 + local.set $9 + local.get $7 i32.const 100 i32.div_u - set_local $10 - get_local $7 + local.set $10 + local.get $7 i32.const 100 i32.rem_u - set_local $11 + local.set $11 block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $10 + local.set $12 + local.get $3 + local.get $10 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $13 + local.set $13 block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $11 + local.set $12 + local.get $3 + local.get $11 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $14 - get_local $2 + local.set $14 + local.get $2 i32.const 4 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $13 - get_local $14 + local.get $13 + local.get $14 i64.const 32 i64.shl i64.or i64.store offset=4 block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $8 + local.set $12 + local.get $3 + local.get $8 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $13 + local.set $13 block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $9 + local.set $12 + local.get $3 + local.get $9 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $14 - get_local $2 + local.set $14 + local.get $2 i32.const 4 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $13 - get_local $14 + local.get $13 + local.get $14 i64.const 32 i64.shl i64.or @@ -14386,104 +14386,104 @@ end end end - get_local $0 - get_local $1 - i32.wrap/i64 - get_local $2 + local.get $0 + local.get $1 + i32.wrap_i64 + local.get $2 call $~lib/internal/number/utoa32_lut ) (func $~lib/internal/number/utoa64 (; 212 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 4312 return end - get_local $0 - get_global $~lib/builtins/u32.MAX_VALUE - i64.extend_u/i32 + local.get $0 + global.get $~lib/builtins/u32.MAX_VALUE + i64.extend_i32_u i64.le_u if - get_local $0 - i32.wrap/i64 - set_local $2 - get_local $2 + local.get $0 + i32.wrap_i64 + local.set $2 + local.get $2 call $~lib/internal/number/decimalCount32 - set_local $3 - get_local $3 + local.set $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $2 - get_local $3 + local.set $1 + local.get $1 + local.get $2 + local.get $3 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - set_local $3 - get_local $3 + local.set $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $0 - get_local $3 + local.set $1 + local.get $1 + local.get $0 + local.get $3 call $~lib/internal/number/utoa64_lut end - get_local $1 + local.get $1 ) (func $~lib/internal/number/itoa (; 213 ;) (type $Ii) (param $0 i64) (result i32) - get_local $0 + local.get $0 call $~lib/internal/number/utoa64 return ) (func $~lib/internal/number/itoa_stream (; 214 ;) (type $iiIi) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i64.eqz if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 i32.const 1 return end i32.const 0 - set_local $3 - get_local $2 - get_global $~lib/builtins/u32.MAX_VALUE - i64.extend_u/i32 + local.set $3 + local.get $2 + global.get $~lib/builtins/u32.MAX_VALUE + i64.extend_i32_u i64.le_u if - get_local $2 - i32.wrap/i64 - set_local $4 - get_local $4 + local.get $2 + i32.wrap_i64 + local.set $4 + local.get $4 call $~lib/internal/number/decimalCount32 - set_local $3 - get_local $0 - get_local $4 - get_local $3 + local.set $3 + local.get $0 + local.get $4 + local.get $3 call $~lib/internal/number/utoa32_lut else - get_local $2 + local.get $2 call $~lib/internal/number/decimalCount64 - set_local $3 - get_local $0 - get_local $2 - get_local $3 + local.set $3 + local.get $0 + local.get $2 + local.get $3 call $~lib/internal/number/utoa64_lut end - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 215 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -14497,12 +14497,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -14510,31 +14510,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 3 i32.shl i32.add - get_local $9 + local.get $9 i32.add i64.load offset=8 end @@ -14542,66 +14542,66 @@ return end i32.const 20 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 20 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + 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) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 3 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -14609,36 +14609,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 3 i32.shl i32.add - get_local $11 + local.get $11 i32.add i64.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -14650,7 +14650,7 @@ end block $~lib/memory/memory.free|inlined.13 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.13 unreachable @@ -14658,7 +14658,7 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/internal/number/itoa64 (; 216 ;) (type $Ii) (param $0 i64) (result i32) @@ -14666,67 +14666,67 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 4312 return end - get_local $0 + local.get $0 i64.const 0 i64.lt_s - set_local $1 - get_local $1 + local.set $1 + local.get $1 if i64.const 0 - get_local $0 + local.get $0 i64.sub - set_local $0 + local.set $0 end - get_local $0 - get_global $~lib/builtins/u32.MAX_VALUE - i64.extend_u/i32 + local.get $0 + global.get $~lib/builtins/u32.MAX_VALUE + i64.extend_i32_u i64.le_u if - get_local $0 - i32.wrap/i64 - set_local $3 - get_local $3 + local.get $0 + i32.wrap_i64 + local.set $3 + local.get $3 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - set_local $4 - get_local $4 + local.set $4 + local.get $4 call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $2 - get_local $3 - get_local $4 + local.set $2 + local.get $2 + local.get $3 + local.get $4 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - get_local $1 + local.get $1 i32.add - set_local $4 - get_local $4 + local.set $4 + local.get $4 call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $2 - get_local $0 - get_local $4 + local.set $2 + local.get $2 + local.get $0 + local.get $4 call $~lib/internal/number/utoa64_lut end - get_local $1 + local.get $1 if - get_local $2 - get_global $~lib/internal/string/CharCode.MINUS + local.get $2 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $2 + local.get $2 ) (func $~lib/internal/number/itoa (; 217 ;) (type $Ii) (param $0 i64) (result i32) - get_local $0 + local.get $0 call $~lib/internal/number/itoa64 return ) @@ -14734,69 +14734,69 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i64.eqz if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 i32.const 1 return end i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i64.const 0 i64.lt_s - set_local $4 - get_local $4 + local.set $4 + local.get $4 if i64.const 0 - get_local $2 + local.get $2 i64.sub - set_local $2 + local.set $2 end - get_local $2 - get_global $~lib/builtins/u32.MAX_VALUE - i64.extend_u/i32 + local.get $2 + global.get $~lib/builtins/u32.MAX_VALUE + i64.extend_i32_u i64.le_u if - get_local $2 - i32.wrap/i64 - set_local $5 - get_local $5 + local.get $2 + i32.wrap_i64 + local.set $5 + local.get $5 call $~lib/internal/number/decimalCount32 - get_local $4 + local.get $4 i32.add - set_local $3 - get_local $0 - get_local $5 - get_local $3 + local.set $3 + local.get $0 + local.get $5 + local.get $3 call $~lib/internal/number/utoa32_lut else - get_local $2 + local.get $2 call $~lib/internal/number/decimalCount64 - get_local $4 + local.get $4 i32.add - set_local $3 - get_local $0 - get_local $2 - get_local $3 + local.set $3 + local.get $0 + local.get $2 + local.get $3 call $~lib/internal/number/utoa64_lut end - get_local $4 + local.get $4 if - get_local $0 - get_global $~lib/internal/string/CharCode.MINUS + local.get $0 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 219 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -14810,12 +14810,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -14823,31 +14823,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 3 i32.shl i32.add - get_local $9 + local.get $9 i32.add i64.load offset=8 end @@ -14855,66 +14855,66 @@ return end i32.const 21 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 21 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + 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) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 3 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -14922,36 +14922,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 3 i32.shl i32.add - get_local $11 + local.get $11 i32.add i64.load offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -14963,7 +14963,7 @@ end block $~lib/memory/memory.free|inlined.14 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.14 unreachable @@ -14971,7 +14971,7 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/array/Array>#join (; 220 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -14983,12 +14983,12 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -14996,39 +14996,39 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD,Array>|inlined.5 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if (result i32) - get_local $4 - get_local $1 + local.get $4 + local.get $1 call $~lib/array/Array#join else i32.const 3904 @@ -15037,48 +15037,48 @@ end block $break|0 i32.const 0 - set_local $9 + local.set $9 loop $repeat|0 - get_local $9 - get_local $2 + local.get $9 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD,Array>|inlined.6 (result i32) i32.const 0 - set_local $8 - get_local $5 - get_local $9 + local.set $8 + local.get $5 + local.get $9 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $7 + local.get $7 if - get_local $3 - get_local $1 + local.get $3 + local.get $1 call $~lib/string/String.__concat - set_local $3 + local.set $3 end end - get_local $9 + local.get $9 i32.const 1 i32.add - set_local $9 + local.set $9 br $repeat|0 unreachable end @@ -15086,31 +15086,31 @@ end block $~lib/internal/arraybuffer/LOAD,Array>|inlined.7 (result i32) i32.const 0 - set_local $9 - get_local $5 - get_local $2 + local.set $9 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $3 + local.get $3 return ) (func $~lib/internal/number/itoa (; 221 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and call $~lib/internal/number/utoa32 @@ -15119,39 +15119,39 @@ (func $~lib/internal/number/itoa_stream (; 222 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 255 i32.and i32.eqz if - get_local $0 - get_global $~lib/internal/string/CharCode._0 + local.get $0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 i32.const 1 return end i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 255 i32.and call $~lib/internal/number/decimalCount32 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 255 i32.and - set_local $4 - get_local $0 - get_local $4 - get_local $3 + local.set $4 + local.get $0 + local.get $4 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 ) (func $~lib/array/Array#join (; 223 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -15165,12 +15165,12 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -15178,31 +15178,31 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 0 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load8_u offset=8 end @@ -15210,66 +15210,66 @@ return end i32.const 10 - get_local $6 + local.get $6 i32.add - get_local $2 + local.get $2 i32.mul i32.const 10 i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 call $~lib/internal/string/allocateUnsafe - set_local $8 + local.set $8 i32.const 0 - set_local $10 + local.set $10 block $break|0 i32.const 0 - set_local $11 + local.set $11 loop $repeat|0 - get_local $11 - get_local $2 + local.get $11 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) i32.const 0 - set_local $12 - get_local $5 - get_local $11 + local.set $12 + local.get $5 + local.get $11 i32.const 0 i32.shl i32.add - get_local $12 + local.get $12 i32.add i32.load8_u offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $7 + local.set $10 + local.get $7 if - get_local $8 - get_local $10 - get_local $1 + local.get $8 + local.get $10 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 i32.add - set_local $10 + local.set $10 end end - get_local $11 + local.get $11 i32.const 1 i32.add - set_local $11 + local.set $11 br $repeat|0 unreachable end @@ -15277,36 +15277,36 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) i32.const 0 - set_local $11 - get_local $5 - get_local $2 + local.set $11 + local.get $5 + local.get $2 i32.const 0 i32.shl i32.add - get_local $11 + local.get $11 i32.add i32.load8_u offset=8 end - set_local $4 - get_local $10 - get_local $8 - get_local $10 - get_local $4 + local.set $4 + local.get $10 + local.get $8 + local.get $10 + local.get $4 call $~lib/internal/number/itoa_stream i32.add - set_local $10 - get_local $8 - set_local $11 - get_local $9 - get_local $10 + local.set $10 + local.get $8 + local.set $11 + local.get $9 + local.get $10 i32.gt_s if - get_local $8 + local.get $8 i32.const 0 - get_local $10 + local.get $10 call $~lib/string/String#substring - set_local $11 - get_local $8 + local.set $11 + local.get $8 i32.eqz if i32.const 0 @@ -15318,7 +15318,7 @@ end block $~lib/memory/memory.free|inlined.15 block - get_local $8 + local.get $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.15 unreachable @@ -15326,7 +15326,7 @@ unreachable end end - get_local $11 + local.get $11 return ) (func $~lib/array/Array>#join (; 224 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -15338,12 +15338,12 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -15351,39 +15351,39 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD,Array>|inlined.0 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if (result i32) - get_local $4 - get_local $1 + local.get $4 + local.get $1 call $~lib/array/Array#join else i32.const 3904 @@ -15392,48 +15392,48 @@ end block $break|0 i32.const 0 - set_local $9 + local.set $9 loop $repeat|0 - get_local $9 - get_local $2 + local.get $9 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD,Array>|inlined.1 (result i32) i32.const 0 - set_local $8 - get_local $5 - get_local $9 + local.set $8 + local.get $5 + local.get $9 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $7 + local.get $7 if - get_local $3 - get_local $1 + local.get $3 + local.get $1 call $~lib/string/String.__concat - set_local $3 + local.set $3 end end - get_local $9 + local.get $9 i32.const 1 i32.add - set_local $9 + local.set $9 br $repeat|0 unreachable end @@ -15441,27 +15441,27 @@ end block $~lib/internal/arraybuffer/LOAD,Array>|inlined.2 (result i32) i32.const 0 - set_local $9 - get_local $5 - get_local $2 + local.set $9 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $3 + local.get $3 return ) (func $~lib/array/Array>#join (; 225 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -15473,12 +15473,12 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -15486,39 +15486,39 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD,Array>|inlined.0 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if (result i32) - get_local $4 - get_local $1 + local.get $4 + local.get $1 call $~lib/array/Array#join else i32.const 3904 @@ -15527,48 +15527,48 @@ end block $break|0 i32.const 0 - set_local $9 + local.set $9 loop $repeat|0 - get_local $9 - get_local $2 + local.get $9 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD,Array>|inlined.1 (result i32) i32.const 0 - set_local $8 - get_local $5 - get_local $9 + local.set $8 + local.get $5 + local.get $9 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $7 + local.get $7 if - get_local $3 - get_local $1 + local.get $3 + local.get $1 call $~lib/string/String.__concat - set_local $3 + local.set $3 end end - get_local $9 + local.get $9 i32.const 1 i32.add - set_local $9 + local.set $9 br $repeat|0 unreachable end @@ -15576,27 +15576,27 @@ end block $~lib/internal/arraybuffer/LOAD,Array>|inlined.2 (result i32) i32.const 0 - set_local $9 - get_local $5 - get_local $2 + local.set $9 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $3 + local.get $3 return ) (func $~lib/array/Array>>#join (; 226 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -15608,12 +15608,12 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.lt_s if @@ -15621,39 +15621,39 @@ return end i32.const 3904 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.ne - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.eqz if block $~lib/internal/arraybuffer/LOAD>,Array>>|inlined.0 (result i32) i32.const 0 - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $5 - get_local $8 + local.set $9 + local.get $5 + local.get $8 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if (result i32) - get_local $4 - get_local $1 + local.get $4 + local.get $1 call $~lib/array/Array>#join else i32.const 3904 @@ -15662,48 +15662,48 @@ end block $break|0 i32.const 0 - set_local $9 + local.set $9 loop $repeat|0 - get_local $9 - get_local $2 + local.get $9 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block $~lib/internal/arraybuffer/LOAD>,Array>>|inlined.1 (result i32) i32.const 0 - set_local $8 - get_local $5 - get_local $9 + local.set $8 + local.get $5 + local.get $9 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array>#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $7 + local.get $7 if - get_local $3 - get_local $1 + local.get $3 + local.get $1 call $~lib/string/String.__concat - set_local $3 + local.set $3 end end - get_local $9 + local.get $9 i32.const 1 i32.add - set_local $9 + local.set $9 br $repeat|0 unreachable end @@ -15711,27 +15711,27 @@ end block $~lib/internal/arraybuffer/LOAD>,Array>>|inlined.2 (result i32) i32.const 0 - set_local $9 - get_local $5 - get_local $2 + local.set $9 + local.get $5 + local.get $2 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add i32.load offset=8 end - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $3 - get_local $4 - get_local $1 + local.get $3 + local.get $4 + local.get $1 call $~lib/array/Array>#join call $~lib/string/String.__concat - set_local $3 + local.set $3 end - get_local $3 + local.get $3 return ) (func $start (; 227 ;) (type $v) @@ -15739,21 +15739,21 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 i32.const 0 call $~lib/array/Array#constructor - set_global $std/array/arr - get_global $std/array/Null + global.set $std/array/arr + global.get $std/array/Null call $~lib/array/Array.isArray | null> i32.const 0 i32.eq @@ -15766,7 +15766,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array.isArray> i32.const 1 i32.eq @@ -15808,7 +15808,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/num + global.get $std/array/num call $~lib/array/Array.isArray i32.const 0 i32.eq @@ -15821,7 +15821,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/str + global.get $std/array/str call $~lib/array/Array.isArray i32.const 0 i32.eq @@ -15834,13 +15834,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 1 i32.const 1 i32.const 3 call $~lib/array/Array#fill drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 256 i32.const 0 call $std/array/isArraysEqual @@ -15855,15 +15855,15 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/array/arr8 + global.set $~argc + global.get $std/array/arr8 i32.const 0 i32.const 0 i32.const 0 call $~lib/array/Array#fill|trampoline end drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 280 i32.const 0 call $std/array/isArraysEqual @@ -15876,13 +15876,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 1 i32.const 0 i32.const -3 call $~lib/array/Array#fill drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 304 i32.const 0 call $std/array/isArraysEqual @@ -15897,15 +15897,15 @@ end block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/arr8 + global.set $~argc + global.get $std/array/arr8 i32.const 2 i32.const -2 i32.const 0 call $~lib/array/Array#fill|trampoline end drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 328 i32.const 0 call $std/array/isArraysEqual @@ -15918,13 +15918,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 0 i32.const 1 i32.const 0 call $~lib/array/Array#fill drop - get_global $std/array/arr8 + global.get $std/array/arr8 i32.const 352 i32.const 0 call $std/array/isArraysEqual @@ -15937,13 +15937,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 1 i32.const 1 i32.const 3 call $~lib/array/Array#fill drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 432 i32.const 0 call $std/array/isArraysEqual @@ -15958,15 +15958,15 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/array/arr32 + global.set $~argc + global.get $std/array/arr32 i32.const 0 i32.const 0 i32.const 0 call $~lib/array/Array#fill|trampoline end drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 472 i32.const 0 call $std/array/isArraysEqual @@ -15979,13 +15979,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 1 i32.const 0 i32.const -3 call $~lib/array/Array#fill drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 512 i32.const 0 call $std/array/isArraysEqual @@ -16000,15 +16000,15 @@ end block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/arr32 + global.set $~argc + global.get $std/array/arr32 i32.const 2 i32.const -2 i32.const 0 call $~lib/array/Array#fill|trampoline end drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 552 i32.const 0 call $std/array/isArraysEqual @@ -16021,13 +16021,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 0 i32.const 1 i32.const 0 call $~lib/array/Array#fill drop - get_global $std/array/arr32 + global.get $std/array/arr32 i32.const 592 i32.const 0 call $std/array/isArraysEqual @@ -16041,9 +16041,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 0 @@ -16057,7 +16057,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 0 i32.eq @@ -16070,11 +16070,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -16089,9 +16089,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.1 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 1 @@ -16105,7 +16105,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 1 i32.eq @@ -16118,10 +16118,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 42 i32.eq i32.eqz @@ -16134,9 +16134,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.2 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 0 @@ -16150,7 +16150,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 1 i32.eq @@ -16163,14 +16163,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 call $~lib/array/Array#push drop block $~lib/array/Array#get:length|inlined.3 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 1 @@ -16184,7 +16184,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 1 i32.eq @@ -16197,7 +16197,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -16211,14 +16211,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 44 call $~lib/array/Array#push drop block $~lib/array/Array#get:length|inlined.4 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -16232,7 +16232,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 2 i32.eq @@ -16245,7 +16245,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -16259,7 +16259,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 44 @@ -16273,14 +16273,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 45 call $~lib/array/Array#push drop block $~lib/array/Array#get:length|inlined.5 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -16294,7 +16294,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 3 i32.eq @@ -16307,7 +16307,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -16321,7 +16321,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 44 @@ -16335,7 +16335,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#__get i32.const 45 @@ -16352,12 +16352,12 @@ i32.const 0 i32.const 0 call $~lib/array/Array#constructor - set_global $std/array/other - get_global $std/array/arr - get_global $std/array/other + global.set $std/array/other + global.get $std/array/arr + global.get $std/array/other call $~lib/array/Array#concat - set_global $std/array/out - get_global $std/array/arr + global.set $std/array/out + global.get $std/array/arr call $std/array/internalCapacity i32.const 3 i32.eq @@ -16371,9 +16371,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.6 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -16388,9 +16388,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.7 (result i32) - get_global $std/array/out - set_local $0 - get_local $0 + global.get $std/array/out + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -16404,11 +16404,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 608 call $~lib/array/Array#concat drop - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 3 i32.eq @@ -16421,7 +16421,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -16435,7 +16435,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 1 call $~lib/array/Array#__get i32.const 44 @@ -16449,7 +16449,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 2 call $~lib/array/Array#__get i32.const 45 @@ -16463,19 +16463,19 @@ call $~lib/env/abort unreachable end - get_global $std/array/other + global.get $std/array/other i32.const 46 call $~lib/array/Array#push drop - get_global $std/array/other + global.get $std/array/other i32.const 47 call $~lib/array/Array#push drop - get_global $std/array/arr - get_global $std/array/other + global.get $std/array/arr + global.get $std/array/other call $~lib/array/Array#concat - set_global $std/array/out - get_global $std/array/arr + global.set $std/array/out + global.get $std/array/arr call $std/array/internalCapacity i32.const 3 i32.eq @@ -16489,9 +16489,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.8 (result i32) - get_global $std/array/other - set_local $0 - get_local $0 + global.get $std/array/other + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -16506,9 +16506,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.9 (result i32) - get_global $std/array/out - set_local $0 - get_local $0 + global.get $std/array/out + local.set $0 + local.get $0 i32.load offset=4 end i32.const 5 @@ -16522,7 +16522,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -16536,7 +16536,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 1 call $~lib/array/Array#__get i32.const 44 @@ -16550,7 +16550,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 2 call $~lib/array/Array#__get i32.const 45 @@ -16564,7 +16564,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 3 call $~lib/array/Array#__get i32.const 46 @@ -16578,7 +16578,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 4 call $~lib/array/Array#__get i32.const 47 @@ -16592,13 +16592,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out call $~lib/array/Array#pop drop block $~lib/array/Array#get:length|inlined.10 (result i32) - get_global $std/array/out - set_local $0 - get_local $0 + global.get $std/array/out + local.set $0 + local.get $0 i32.load offset=4 end i32.const 4 @@ -16612,14 +16612,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#concat - set_global $std/array/out + global.set $std/array/out block $~lib/array/Array#get:length|inlined.11 (result i32) - get_global $std/array/out - set_local $0 - get_local $0 + global.get $std/array/out + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -16633,7 +16633,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/out + global.get $std/array/out i32.const 2 call $~lib/array/Array#__get i32.const 45 @@ -16648,9 +16648,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.12 (result i32) - get_global $std/array/source - set_local $0 - get_local $0 + global.get $std/array/source + local.set $0 + local.get $0 i32.load offset=4 end i32.const 0 @@ -16664,14 +16664,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/source - get_global $std/array/arr + global.get $std/array/source + global.get $std/array/arr call $~lib/array/Array#concat - set_global $std/array/out + global.set $std/array/out block $~lib/array/Array#get:length|inlined.13 (result i32) - get_global $std/array/out - set_local $0 - get_local $0 + global.get $std/array/out + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -16686,9 +16686,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.14 (result i32) - get_global $std/array/source - set_local $0 - get_local $0 + global.get $std/array/source + local.set $0 + local.get $0 i32.load offset=4 end i32.const 0 @@ -16703,11 +16703,11 @@ unreachable end i32.const 664 - set_global $std/array/cwArr + global.set $std/array/cwArr block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 0 i32.const 3 i32.const 0 @@ -16726,11 +16726,11 @@ unreachable end i32.const 744 - set_global $std/array/cwArr + global.set $std/array/cwArr block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 1 i32.const 3 i32.const 0 @@ -16749,11 +16749,11 @@ unreachable end i32.const 824 - set_global $std/array/cwArr + global.set $std/array/cwArr block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 1 i32.const 2 i32.const 0 @@ -16772,11 +16772,11 @@ unreachable end i32.const 904 - set_global $std/array/cwArr + global.set $std/array/cwArr block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 2 i32.const 2 i32.const 0 @@ -16795,8 +16795,8 @@ unreachable end i32.const 984 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 0 i32.const 3 i32.const 4 @@ -16814,8 +16814,8 @@ unreachable end i32.const 1064 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 1 i32.const 3 i32.const 4 @@ -16833,8 +16833,8 @@ unreachable end i32.const 1144 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 1 i32.const 2 i32.const 4 @@ -16852,11 +16852,11 @@ unreachable end i32.const 1224 - set_global $std/array/cwArr + global.set $std/array/cwArr block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const 0 i32.const -2 i32.const 0 @@ -16875,8 +16875,8 @@ unreachable end i32.const 1304 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const 0 i32.const -2 i32.const -1 @@ -16894,8 +16894,8 @@ unreachable end i32.const 1384 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const -4 i32.const -3 i32.const -2 @@ -16913,8 +16913,8 @@ unreachable end i32.const 1464 - set_global $std/array/cwArr - get_global $std/array/cwArr + global.set $std/array/cwArr + global.get $std/array/cwArr i32.const -4 i32.const -3 i32.const -1 @@ -16932,11 +16932,11 @@ unreachable end i32.const 1544 - set_global $std/array/cwArr + global.set $std/array/cwArr block (result i32) i32.const 2 - set_global $~argc - get_global $std/array/cwArr + global.set $~argc + global.get $std/array/cwArr i32.const -4 i32.const -3 i32.const 0 @@ -16954,14 +16954,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 call $~lib/array/Array#unshift drop block $~lib/array/Array#get:length|inlined.18 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 4 @@ -16975,7 +16975,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 4 i32.eq @@ -16988,7 +16988,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -17002,7 +17002,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 43 @@ -17016,7 +17016,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#__get i32.const 44 @@ -17030,7 +17030,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#__get i32.const 45 @@ -17044,14 +17044,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 41 call $~lib/array/Array#unshift drop block $~lib/array/Array#get:length|inlined.19 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 5 @@ -17065,7 +17065,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 5 i32.eq @@ -17078,7 +17078,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 41 @@ -17092,7 +17092,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 42 @@ -17106,7 +17106,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#__get i32.const 43 @@ -17120,7 +17120,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#__get i32.const 44 @@ -17134,7 +17134,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 4 call $~lib/array/Array#__get i32.const 45 @@ -17148,10 +17148,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#shift - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 41 i32.eq i32.eqz @@ -17164,9 +17164,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.20 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 4 @@ -17180,7 +17180,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 5 i32.eq @@ -17193,7 +17193,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -17207,7 +17207,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 43 @@ -17221,7 +17221,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#__get i32.const 44 @@ -17235,7 +17235,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#__get i32.const 45 @@ -17249,10 +17249,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 45 i32.eq i32.eqz @@ -17265,9 +17265,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.21 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -17281,7 +17281,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 5 i32.eq @@ -17294,7 +17294,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -17308,7 +17308,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 43 @@ -17322,7 +17322,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#__get i32.const 44 @@ -17336,13 +17336,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#reverse drop block $~lib/array/Array#get:length|inlined.22 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 3 @@ -17356,7 +17356,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 5 i32.eq @@ -17369,7 +17369,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 44 @@ -17383,7 +17383,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 43 @@ -17397,7 +17397,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#__get i32.const 42 @@ -17411,20 +17411,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 44 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 44 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 0 i32.eq i32.eqz @@ -17436,12 +17436,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 2 i32.eq i32.eqz @@ -17453,12 +17453,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 45 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.eq i32.eqz @@ -17470,12 +17470,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 100 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.eq i32.eqz @@ -17487,12 +17487,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -100 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -17504,12 +17504,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -2 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 3 i32.eq i32.eqz @@ -17521,12 +17521,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const -4 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -17538,12 +17538,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 0 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -17555,12 +17555,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 1 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -17572,12 +17572,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 2 call $~lib/array/Array#indexOf - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 3 i32.eq i32.eqz @@ -17590,23 +17590,23 @@ unreachable end block $~lib/array/Array#includes|inlined.0 (result i32) - get_global $std/array/arr - set_local $0 + global.get $std/array/arr + local.set $0 i32.const 44 - set_local $1 + local.set $1 i32.const 0 - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/array/Array#indexOf i32.const 0 i32.ge_s end i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17619,23 +17619,23 @@ unreachable end block $~lib/array/Array#includes|inlined.1 (result i32) - get_global $std/array/arr - set_local $2 + global.get $std/array/arr + local.set $2 i32.const 42 - set_local $1 + local.set $1 i32.const 0 - set_local $0 - get_local $2 - get_local $1 - get_local $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 i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17648,23 +17648,23 @@ unreachable end block $~lib/array/Array#includes|inlined.2 (result i32) - get_global $std/array/arr - set_local $0 + global.get $std/array/arr + local.set $0 i32.const 45 - set_local $1 + local.set $1 i32.const 0 - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/array/Array#indexOf i32.const 0 i32.ge_s end i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 0 i32.eq i32.eqz @@ -17677,23 +17677,23 @@ unreachable end block $~lib/array/Array#includes|inlined.3 (result i32) - get_global $std/array/arr - set_local $2 + global.get $std/array/arr + local.set $2 i32.const 43 - set_local $1 + local.set $1 i32.const 100 - set_local $0 - get_local $2 - get_local $1 - get_local $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 i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 0 i32.eq i32.eqz @@ -17706,23 +17706,23 @@ unreachable end block $~lib/array/Array#includes|inlined.4 (result i32) - get_global $std/array/arr - set_local $0 + global.get $std/array/arr + local.set $0 i32.const 43 - set_local $1 + local.set $1 i32.const -100 - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/array/Array#indexOf i32.const 0 i32.ge_s end i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17735,23 +17735,23 @@ unreachable end block $~lib/array/Array#includes|inlined.5 (result i32) - get_global $std/array/arr - set_local $2 + global.get $std/array/arr + local.set $2 i32.const 43 - set_local $1 + local.set $1 i32.const -2 - set_local $0 - get_local $2 - get_local $1 - get_local $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 i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17764,23 +17764,23 @@ unreachable end block $~lib/array/Array#includes|inlined.6 (result i32) - get_global $std/array/arr - set_local $0 + global.get $std/array/arr + local.set $0 i32.const 43 - set_local $1 + local.set $1 i32.const -4 - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/array/Array#indexOf i32.const 0 i32.ge_s end i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17793,23 +17793,23 @@ unreachable end block $~lib/array/Array#includes|inlined.7 (result i32) - get_global $std/array/arr - set_local $2 + global.get $std/array/arr + local.set $2 i32.const 43 - set_local $1 + local.set $1 i32.const 0 - set_local $0 - get_local $2 - get_local $1 - get_local $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 i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17822,23 +17822,23 @@ unreachable end block $~lib/array/Array#includes|inlined.8 (result i32) - get_global $std/array/arr - set_local $0 + global.get $std/array/arr + local.set $0 i32.const 43 - set_local $1 + local.set $1 i32.const 1 - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/array/Array#indexOf i32.const 0 i32.ge_s end i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17851,23 +17851,23 @@ unreachable end block $~lib/array/Array#includes|inlined.9 (result i32) - get_global $std/array/arr - set_local $2 + global.get $std/array/arr + local.set $2 i32.const 43 - set_local $1 + local.set $1 i32.const 2 - set_local $0 - get_local $2 - get_local $1 - get_local $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 i32.const 0 i32.ne - set_global $std/array/includes - get_global $std/array/includes + global.set $std/array/includes + global.get $std/array/includes i32.const 1 i32.eq i32.eqz @@ -17879,15 +17879,15 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 i32.const 1 call $~lib/array/Array#splice drop block $~lib/array/Array#get:length|inlined.23 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 4 @@ -17901,7 +17901,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $std/array/internalCapacity i32.const 5 i32.eq @@ -17914,7 +17914,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get i32.const 44 @@ -17928,7 +17928,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#__get i32.const 42 @@ -17944,8 +17944,8 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const 0 i32.const 0 call $~lib/array/Array#splice|trampoline @@ -17962,7 +17962,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1680 i32.const 0 call $std/array/isArraysEqual @@ -17976,11 +17976,11 @@ unreachable end i32.const 1720 - set_global $std/array/sarr + global.set $std/array/sarr block (result i32) i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const 2 i32.const 0 call $~lib/array/Array#splice|trampoline @@ -17997,7 +17997,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1784 i32.const 0 call $std/array/isArraysEqual @@ -18011,8 +18011,8 @@ unreachable end i32.const 1824 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 2 i32.const 2 call $~lib/array/Array#splice @@ -18028,7 +18028,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1888 i32.const 0 call $std/array/isArraysEqual @@ -18042,8 +18042,8 @@ unreachable end i32.const 1928 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 0 i32.const 1 call $~lib/array/Array#splice @@ -18059,7 +18059,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 1992 i32.const 0 call $std/array/isArraysEqual @@ -18073,11 +18073,11 @@ unreachable end i32.const 2032 - set_global $std/array/sarr + global.set $std/array/sarr block (result i32) i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const -1 i32.const 0 call $~lib/array/Array#splice|trampoline @@ -18094,7 +18094,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2096 i32.const 0 call $std/array/isArraysEqual @@ -18108,11 +18108,11 @@ unreachable end i32.const 2136 - set_global $std/array/sarr + global.set $std/array/sarr block (result i32) i32.const 1 - set_global $~argc - get_global $std/array/sarr + global.set $~argc + global.get $std/array/sarr i32.const -2 i32.const 0 call $~lib/array/Array#splice|trampoline @@ -18129,7 +18129,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2200 i32.const 0 call $std/array/isArraysEqual @@ -18143,8 +18143,8 @@ unreachable end i32.const 2240 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const -2 i32.const 1 call $~lib/array/Array#splice @@ -18160,7 +18160,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2304 i32.const 0 call $std/array/isArraysEqual @@ -18174,8 +18174,8 @@ unreachable end i32.const 2344 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const -7 i32.const 1 call $~lib/array/Array#splice @@ -18191,7 +18191,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2408 i32.const 0 call $std/array/isArraysEqual @@ -18205,8 +18205,8 @@ unreachable end i32.const 2448 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const -2 i32.const -1 call $~lib/array/Array#splice @@ -18222,7 +18222,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2504 i32.const 0 call $std/array/isArraysEqual @@ -18236,8 +18236,8 @@ unreachable end i32.const 2544 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 1 i32.const -2 call $~lib/array/Array#splice @@ -18253,7 +18253,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2600 i32.const 0 call $std/array/isArraysEqual @@ -18267,8 +18267,8 @@ unreachable end i32.const 2640 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 4 i32.const 0 call $~lib/array/Array#splice @@ -18284,7 +18284,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2696 i32.const 0 call $std/array/isArraysEqual @@ -18298,8 +18298,8 @@ unreachable end i32.const 2736 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 7 i32.const 0 call $~lib/array/Array#splice @@ -18315,7 +18315,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2792 i32.const 0 call $std/array/isArraysEqual @@ -18329,8 +18329,8 @@ unreachable end i32.const 2832 - set_global $std/array/sarr - get_global $std/array/sarr + global.set $std/array/sarr + global.get $std/array/sarr i32.const 7 i32.const 5 call $~lib/array/Array#splice @@ -18346,7 +18346,7 @@ call $~lib/env/abort unreachable end - get_global $std/array/sarr + global.get $std/array/sarr i32.const 2888 i32.const 0 call $std/array/isArraysEqual @@ -18359,27 +18359,27 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 i32.const 0 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 1 i32.const 1 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 2 i32.const 2 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 3 i32.const 3 call $~lib/array/Array#__set - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 0 i32.eq i32.eqz @@ -18391,11 +18391,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -18407,11 +18407,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.eq i32.eqz @@ -18423,11 +18423,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 4 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.eq i32.eqz @@ -18440,9 +18440,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.24 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -18456,11 +18456,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 5 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.ne i32.eqz @@ -18472,23 +18472,23 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 6 call $~lib/array/Array#findIndex - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const -1 i32.eq i32.eqz @@ -18501,9 +18501,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.25 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -18517,19 +18517,19 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 7 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 1 i32.eq i32.eqz @@ -18541,11 +18541,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 8 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 0 i32.eq i32.eqz @@ -18557,11 +18557,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 9 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 1 i32.eq i32.eqz @@ -18574,9 +18574,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.26 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -18590,11 +18590,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 10 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 0 i32.eq i32.eqz @@ -18606,23 +18606,23 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 11 call $~lib/array/Array#every - set_global $std/array/every - get_global $std/array/every + global.set $std/array/every + global.get $std/array/every i32.const 1 i32.eq i32.eqz @@ -18635,9 +18635,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.27 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -18651,19 +18651,19 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 12 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some i32.const 1 i32.eq i32.eqz @@ -18675,11 +18675,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 13 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some i32.const 0 i32.eq i32.eqz @@ -18691,11 +18691,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 14 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some i32.const 0 i32.eq i32.eqz @@ -18708,9 +18708,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.28 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -18724,11 +18724,11 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 15 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some i32.const 1 i32.eq i32.eqz @@ -18740,23 +18740,23 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 16 call $~lib/array/Array#some - set_global $std/array/some - get_global $std/array/some + global.set $std/array/some + global.get $std/array/some i32.const 0 i32.eq i32.eqz @@ -18769,9 +18769,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.29 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -18785,20 +18785,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 17 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -18811,11 +18811,11 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 18 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -18828,9 +18828,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.30 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -18845,11 +18845,11 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 19 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 406 i32.eq i32.eqz @@ -18861,24 +18861,24 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 20 call $~lib/array/Array#forEach - get_global $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -18891,9 +18891,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.31 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -18907,21 +18907,21 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 21 call $~lib/array/Array#forEach block $~lib/array/Array#get:length|inlined.32 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 100 @@ -18937,49 +18937,49 @@ end block $break|0 i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_s i32.eqz br_if $break|0 - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 unreachable end unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 22 call $~lib/array/Array#map - set_global $std/array/newArr + global.set $std/array/newArr block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/array/newArr - set_local $0 - get_local $0 + global.get $std/array/newArr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 4 @@ -18993,13 +18993,13 @@ call $~lib/env/abort unreachable end - get_global $std/array/newArr + global.get $std/array/newArr i32.const 0 call $~lib/array/Array#__get - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#__get - f32.convert_s/i32 + f32.convert_i32_s f32.eq i32.eqz if @@ -19011,12 +19011,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 23 call $~lib/array/Array#map drop - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -19029,9 +19029,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.33 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -19046,12 +19046,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 24 call $~lib/array/Array#map drop - get_global $std/array/i + global.get $std/array/i i32.const 406 i32.eq i32.eqz @@ -19063,25 +19063,25 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 25 call $~lib/array/Array#map drop - get_global $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -19094,9 +19094,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.34 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -19110,22 +19110,22 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 26 call $~lib/array/Array#filter - set_global $std/array/filteredArr + global.set $std/array/filteredArr block $~lib/array/Array#get:length|inlined.35 (result i32) - get_global $std/array/filteredArr - set_local $0 - get_local $0 + global.get $std/array/filteredArr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -19140,12 +19140,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 27 call $~lib/array/Array#filter drop - get_global $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -19158,9 +19158,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.36 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -19175,12 +19175,12 @@ unreachable end i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 28 call $~lib/array/Array#filter drop - get_global $std/array/i + global.get $std/array/i i32.const 406 i32.eq i32.eqz @@ -19192,25 +19192,25 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop i32.const 0 - set_global $std/array/i - get_global $std/array/arr + global.set $std/array/i + global.get $std/array/arr i32.const 29 call $~lib/array/Array#filter drop - get_global $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -19223,9 +19223,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.37 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -19239,20 +19239,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 30 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -19264,12 +19264,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 31 i32.const 4 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.eq i32.eqz @@ -19281,14 +19281,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 32 i32.const 0 call $~lib/array/Array#reduce i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal i32.const 1 i32.eq i32.eqz @@ -19300,14 +19300,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 33 i32.const 0 call $~lib/array/Array#reduce i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal i32.const 0 i32.eq i32.eqz @@ -19319,12 +19319,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 34 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -19337,9 +19337,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.38 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -19353,12 +19353,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 35 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.eq i32.eqz @@ -19370,24 +19370,24 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 36 i32.const 0 call $~lib/array/Array#reduce - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 1 i32.eq i32.eqz @@ -19400,9 +19400,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.39 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -19416,20 +19416,20 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 37 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -19441,12 +19441,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 38 i32.const 4 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.eq i32.eqz @@ -19458,14 +19458,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 39 i32.const 0 call $~lib/array/Array#reduceRight i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal i32.const 1 i32.eq i32.eqz @@ -19477,14 +19477,14 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 40 i32.const 0 call $~lib/array/Array#reduceRight i32.const 0 i32.ne - set_global $std/array/boolVal - get_global $std/array/boolVal + global.set $std/array/boolVal + global.get $std/array/boolVal i32.const 0 i32.eq i32.eqz @@ -19496,12 +19496,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 41 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -19514,9 +19514,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.40 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 8 @@ -19530,12 +19530,12 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 42 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 10 i32.eq i32.eqz @@ -19547,24 +19547,24 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr call $~lib/array/Array#pop drop - get_global $std/array/arr + global.get $std/array/arr i32.const 43 i32.const 0 call $~lib/array/Array#reduceRight - set_global $std/array/i - get_global $std/array/i + global.set $std/array/i + global.get $std/array/i i32.const 6 i32.eq i32.eqz @@ -19577,9 +19577,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.41 (result i32) - get_global $std/array/arr - set_local $0 - get_local $0 + global.get $std/array/arr + local.set $0 + local.get $0 i32.load offset=4 end i32.const 0 @@ -19593,34 +19593,34 @@ call $~lib/env/abort unreachable end - get_global $std/array/arr + global.get $std/array/arr i32.const 0 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 1 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 2 call $~lib/array/Array#push drop - get_global $std/array/arr + global.get $std/array/arr i32.const 3 call $~lib/array/Array#push drop call $~lib/bindings/Math/random - i64.reinterpret/f64 + i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom block (result i32) i32.const 0 - set_global $~argc - get_global $std/array/f32ArrayTyped + global.set $~argc + global.get $std/array/f32ArrayTyped i32.const 0 call $~lib/array/Array#sort|trampoline end drop - get_global $std/array/f32ArrayTyped + global.get $std/array/f32ArrayTyped i32.const 3240 i32.const 0 call $std/array/isArraysEqual @@ -19635,13 +19635,13 @@ end block (result i32) i32.const 0 - set_global $~argc - get_global $std/array/f64ArrayTyped + global.set $~argc + global.get $std/array/f64ArrayTyped i32.const 0 call $~lib/array/Array#sort|trampoline end drop - get_global $std/array/f64ArrayTyped + global.get $std/array/f64ArrayTyped i32.const 3512 i32.const 0 call $std/array/isArraysEqual @@ -19656,13 +19656,13 @@ end block (result i32) i32.const 0 - set_global $~argc - get_global $std/array/i32ArrayTyped + global.set $~argc + global.get $std/array/i32ArrayTyped i32.const 0 call $~lib/array/Array#sort|trampoline end drop - get_global $std/array/i32ArrayTyped + global.get $std/array/i32ArrayTyped i32.const 3592 i32.const 0 call $std/array/isArraysEqual @@ -19677,13 +19677,13 @@ end block (result i32) i32.const 0 - set_global $~argc - get_global $std/array/u32ArrayTyped + global.set $~argc + global.get $std/array/u32ArrayTyped i32.const 0 call $~lib/array/Array#sort|trampoline end drop - get_global $std/array/u32ArrayTyped + global.get $std/array/u32ArrayTyped i32.const 3672 i32.const 0 call $std/array/isArraysEqual @@ -19698,24 +19698,24 @@ end i32.const 64 call $std/array/createReverseOrderedArray - set_global $std/array/reversed64 + global.set $std/array/reversed64 i32.const 128 call $std/array/createReverseOrderedArray - set_global $std/array/reversed128 + global.set $std/array/reversed128 i32.const 1024 call $std/array/createReverseOrderedArray - set_global $std/array/reversed1024 + global.set $std/array/reversed1024 i32.const 10000 call $std/array/createReverseOrderedArray - set_global $std/array/reversed10000 + global.set $std/array/reversed10000 i32.const 512 call $std/array/createRandomOrderedArray - set_global $std/array/randomized512 - get_global $std/array/reversed0 + global.set $std/array/randomized512 + global.get $std/array/reversed0 call $std/array/assertSortedDefault - get_global $std/array/reversed1 + global.get $std/array/reversed1 call $std/array/assertSortedDefault - get_global $std/array/reversed1 + global.get $std/array/reversed1 i32.const 3840 i32.const 0 call $std/array/isArraysEqual @@ -19728,9 +19728,9 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed2 + global.get $std/array/reversed2 call $std/array/assertSortedDefault - get_global $std/array/reversed2 + global.get $std/array/reversed2 i32.const 3864 i32.const 0 call $std/array/isArraysEqual @@ -19743,10 +19743,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed4 + global.get $std/array/reversed4 call $std/array/assertSortedDefault - get_global $std/array/reversed4 - get_global $std/array/expected4 + global.get $std/array/reversed4 + global.get $std/array/expected4 i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19758,10 +19758,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed64 + global.get $std/array/reversed64 call $std/array/assertSortedDefault - get_global $std/array/reversed64 - get_global $std/array/expected4 + global.get $std/array/reversed64 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -19773,10 +19773,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed128 + global.get $std/array/reversed128 call $std/array/assertSortedDefault - get_global $std/array/reversed128 - get_global $std/array/expected4 + global.get $std/array/reversed128 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -19788,10 +19788,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed1024 + global.get $std/array/reversed1024 call $std/array/assertSortedDefault - get_global $std/array/reversed1024 - get_global $std/array/expected4 + global.get $std/array/reversed1024 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -19803,10 +19803,10 @@ call $~lib/env/abort unreachable end - get_global $std/array/reversed10000 + global.get $std/array/reversed10000 call $std/array/assertSortedDefault - get_global $std/array/reversed10000 - get_global $std/array/expected4 + global.get $std/array/reversed10000 + global.get $std/array/expected4 i32.const 4 call $std/array/isArraysEqual i32.eqz @@ -19818,43 +19818,43 @@ call $~lib/env/abort unreachable end - get_global $std/array/randomized512 + global.get $std/array/randomized512 call $std/array/assertSortedDefault i32.const 64 call $std/array/createRandomOrderedArray - set_global $std/array/randomized64 + global.set $std/array/randomized64 i32.const 257 call $std/array/createRandomOrderedArray - set_global $std/array/randomized257 - get_global $std/array/randomized64 + global.set $std/array/randomized257 + global.get $std/array/randomized64 i32.const 49 call $std/array/assertSorted - get_global $std/array/randomized64 + global.get $std/array/randomized64 i32.const 50 call $std/array/assertSorted - get_global $std/array/randomized257 + global.get $std/array/randomized257 i32.const 51 call $std/array/assertSorted - get_global $std/array/randomized257 + global.get $std/array/randomized257 i32.const 52 call $std/array/assertSorted i32.const 512 call $std/array/createReverseOrderedNestedArray - set_global $std/array/reversedNested512 - get_global $std/array/reversedNested512 + global.set $std/array/reversedNested512 + global.get $std/array/reversedNested512 i32.const 53 call $std/array/assertSorted> i32.const 512 call $std/array/createReverseOrderedElementsArray - set_global $std/array/reversedElements512 - get_global $std/array/reversedElements512 + global.set $std/array/reversedElements512 + global.get $std/array/reversedElements512 i32.const 54 call $std/array/assertSorted> - get_global $std/array/randomStringsActual + global.get $std/array/randomStringsActual i32.const 55 call $std/array/assertSorted - get_global $std/array/randomStringsActual - get_global $std/array/randomStringsExpected + global.get $std/array/randomStringsActual + global.get $std/array/randomStringsExpected i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19868,8 +19868,8 @@ end i32.const 400 call $std/array/createRandomStringArray - set_global $std/array/randomStrings400 - get_global $std/array/randomStrings400 + global.set $std/array/randomStrings400 + global.get $std/array/randomStrings400 i32.const 56 call $std/array/assertSorted i32.const 4240 @@ -19960,25 +19960,25 @@ i32.const 0 i32.const 3 call $~lib/array/Array#constructor - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 0 i32.const 0 call $std/array/Ref#constructor call $~lib/array/Array#__unchecked_set - get_local $3 + local.get $3 i32.const 1 i32.const 0 call $~lib/array/Array#__unchecked_set - get_local $3 + local.get $3 i32.const 2 i32.const 0 call $std/array/Ref#constructor call $~lib/array/Array#__unchecked_set - get_local $3 + local.get $3 end - set_global $std/array/refArr - get_global $std/array/refArr + global.set $std/array/refArr + global.get $std/array/refArr i32.const 4216 call $~lib/array/Array#join i32.const 6912 @@ -19993,9 +19993,9 @@ unreachable end block $~lib/array/Array#toString|inlined.1 (result i32) - get_global $std/array/reversed0 - set_local $3 - get_local $3 + global.get $std/array/reversed0 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20011,9 +20011,9 @@ unreachable end block $~lib/array/Array#toString|inlined.3 (result i32) - get_global $std/array/reversed1 - set_local $3 - get_local $3 + global.get $std/array/reversed1 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20029,9 +20029,9 @@ unreachable end block $~lib/array/Array#toString|inlined.5 (result i32) - get_global $std/array/reversed2 - set_local $3 - get_local $3 + global.get $std/array/reversed2 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20047,9 +20047,9 @@ unreachable end block $~lib/array/Array#toString|inlined.7 (result i32) - get_global $std/array/reversed4 - set_local $3 - get_local $3 + global.get $std/array/reversed4 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20066,8 +20066,8 @@ end block $~lib/array/Array#toString|inlined.1 (result i32) i32.const 7064 - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20084,8 +20084,8 @@ end block $~lib/array/Array#toString|inlined.1 (result i32) i32.const 7128 - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20102,8 +20102,8 @@ end block $~lib/array/Array#toString|inlined.1 (result i32) i32.const 7752 - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20120,8 +20120,8 @@ end block $~lib/array/Array#toString|inlined.1 (result i32) i32.const 7952 - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20137,9 +20137,9 @@ unreachable end block $~lib/array/Array#toString|inlined.1 (result i32) - get_global $std/array/randomStringsExpected - set_local $3 - get_local $3 + global.get $std/array/randomStringsExpected + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20156,8 +20156,8 @@ end block $~lib/array/Array#toString|inlined.3 (result i32) i32.const 8168 - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array#join end @@ -20173,9 +20173,9 @@ unreachable end block $~lib/array/Array>#toString|inlined.1 (result i32) - get_global $std/array/subarr32 - set_local $3 - get_local $3 + global.get $std/array/subarr32 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array>#join end @@ -20191,9 +20191,9 @@ unreachable end block $~lib/array/Array>#toString|inlined.1 (result i32) - get_global $std/array/subarr8 - set_local $3 - get_local $3 + global.get $std/array/subarr8 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array>#join end @@ -20209,9 +20209,9 @@ unreachable end block $~lib/array/Array>>#toString|inlined.1 (result i32) - get_global $std/array/subarrU32 - set_local $3 - get_local $3 + global.get $std/array/subarrU32 + local.set $3 + local.get $3 i32.const 4216 call $~lib/array/Array>>#join end diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 630d0b16..d9f921a2 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -18,7 +18,7 @@ (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 anyfunc) + (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)) @@ -33,17 +33,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -52,16 +52,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -69,16 +69,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -87,13 +87,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -106,233 +106,233 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end @@ -342,894 +342,894 @@ (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -1237,156 +1237,156 @@ (func $~lib/internal/memory/memmove (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1394,18 +1394,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1414,16 +1414,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1435,73 +1435,73 @@ (func $~lib/arraybuffer/ArrayBuffer#slice (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - tee_local $4 + local.tee $4 i32.const 0 - get_local $4 + local.get $4 i32.const 0 i32.gt_s select else - get_local $1 - get_local $3 - get_local $1 - get_local $3 + local.get $1 + local.get $3 + local.get $1 + local.get $3 i32.lt_s select end - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - tee_local $4 + local.tee $4 i32.const 0 - get_local $4 + local.get $4 i32.const 0 i32.gt_s select else - get_local $2 - get_local $3 - get_local $2 - get_local $3 + local.get $2 + local.get $3 + local.get $2 + local.get $3 i32.lt_s select end - get_local $1 + local.get $1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 - get_local $4 + local.get $4 i32.const 0 i32.gt_s select - tee_local $2 + local.tee $2 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $3 + local.tee $3 i32.const 8 i32.add - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.add - get_local $2 + local.get $2 call $~lib/internal/memory/memmove - get_local $3 + local.get $3 ) (func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -1509,25 +1509,25 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of2 $1of2 $2of2 $outOfRange end unreachable end i32.const 0 - set_local $1 + local.set $1 end i32.const 1073741816 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/arraybuffer/ArrayBuffer#slice ) (func $~lib/internal/typedarray/TypedArray#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -1538,43 +1538,43 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -1585,55 +1585,55 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - tee_local $1 + local.tee $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/dataview/DataView#constructor (; 10 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 + local.get $3 i32.const -2147483648 i32.eq if - get_local $1 + local.get $1 i32.load - get_local $2 + local.get $2 i32.sub - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 1073741816 i32.gt_u if @@ -1644,7 +1644,7 @@ call $~lib/env/abort unreachable end - get_local $3 + local.get $3 i32.const 1073741816 i32.gt_u if @@ -1655,10 +1655,10 @@ call $~lib/env/abort unreachable end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - get_local $1 + local.get $1 i32.load i32.gt_s if @@ -1669,30 +1669,30 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=4 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/dataview/DataView#constructor|trampoline (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block $2of2 block $1of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $1of2 $1of2 $2of2 $outOfRange @@ -1700,30 +1700,30 @@ unreachable end i32.const -2147483648 - set_local $1 + local.set $1 end i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $1 + local.get $1 call $~lib/dataview/DataView#constructor ) (func $start (; 12 ;) (type $v) (local $0 i32) i32.const 288 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 8 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $0 + local.tee $0 i32.const 8 i32.add i32.const 8 call $~lib/internal/memory/memset - get_local $0 - set_global $std/arraybuffer/buffer - get_global $std/arraybuffer/buffer + local.get $0 + global.set $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.load i32.const 8 i32.ne @@ -1736,12 +1736,12 @@ unreachable end i32.const 0 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const 0 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 8 i32.ne @@ -1753,8 +1753,8 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/sliced - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/sliced + global.get $std/arraybuffer/buffer i32.eq if i32.const 0 @@ -1764,8 +1764,8 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/sliced - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/sliced + global.get $std/arraybuffer/buffer i32.eq if i32.const 0 @@ -1776,12 +1776,12 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const 1 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 7 i32.ne @@ -1794,12 +1794,12 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const -1 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 1 i32.ne @@ -1811,12 +1811,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const 1 i32.const 3 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 2 i32.ne @@ -1828,12 +1828,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const 1 i32.const -1 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 6 i32.ne @@ -1845,12 +1845,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const -3 i32.const -1 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 2 i32.ne @@ -1862,12 +1862,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const -4 i32.const 42 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 4 i32.ne @@ -1880,12 +1880,12 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const 42 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load if i32.const 0 @@ -1895,7 +1895,7 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.eqz if i32.const 0 @@ -1909,10 +1909,10 @@ call $~lib/allocator/arena/__memory_allocate i32.const 1 call $~lib/internal/typedarray/TypedArray#constructor - set_global $std/arraybuffer/arr8 + global.set $std/arraybuffer/arr8 i32.const 1 i32.const 0 - get_global $std/arraybuffer/arr8 + global.get $std/arraybuffer/arr8 select i32.eqz if @@ -1944,10 +1944,10 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc block $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView6 (result i32) i32.const 0 - get_global $std/arraybuffer/arr8 + global.get $std/arraybuffer/arr8 i32.load call $~lib/dataview/DataView#constructor|trampoline i32.eqz diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 5e14b034..cb0e49cb 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -15,7 +15,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -37,8 +37,8 @@ (func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -53,41 +53,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -97,22 +97,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -121,15 +121,15 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -141,267 +141,267 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -412,8 +412,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -423,26 +423,26 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 0 i32.ne i32.eqz if - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $1 + local.set $5 + local.get $4 + local.get $5 + local.get $1 call $~lib/internal/memory/memset end - get_local $3 + local.get $3 ) (func $~lib/internal/memory/memcpy (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -450,44 +450,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -495,141 +495,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -637,167 +637,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -809,130 +809,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -944,112 +944,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -1061,585 +1061,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -1647,77 +1647,77 @@ ) (func $~lib/internal/memory/memmove (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -1728,27 +1728,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -1757,67 +1757,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1828,20 +1828,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1853,16 +1853,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1878,114 +1878,114 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $1 + local.set $1 else - get_local $1 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 else - get_local $2 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $2 + local.set $2 end - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $6 - get_local $6 + local.set $6 + local.get $6 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $7 - get_local $7 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $7 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $1 + local.get $1 i32.add - set_local $5 - get_local $4 - get_local $5 - get_local $6 + local.set $5 + local.get $4 + local.get $5 + local.get $6 call $~lib/internal/memory/memmove - get_local $7 + local.get $7 ) (func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $2of2 block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of2 $1of2 $2of2 $outOfRange end unreachable end i32.const 0 - set_local $1 + local.set $1 end - get_global $~lib/internal/arraybuffer/MAX_BLENGTH - set_local $2 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/arraybuffer/ArrayBuffer#slice ) (func $~lib/arraybuffer/ArrayBuffer.isView> (; 10 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq if @@ -1995,7 +1995,7 @@ i32.const 0 ) (func $~lib/arraybuffer/ArrayBuffer.isView (; 11 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq if @@ -2005,7 +2005,7 @@ i32.const 0 ) (func $~lib/arraybuffer/ArrayBuffer.isView (; 12 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq if @@ -2016,7 +2016,7 @@ return ) (func $~lib/arraybuffer/ArrayBuffer.isView (; 13 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq if @@ -2027,7 +2027,7 @@ return ) (func $~lib/arraybuffer/ArrayBuffer.isView (; 14 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq if @@ -2038,7 +2038,7 @@ return ) (func $~lib/memory/memory.allocate (; 15 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) @@ -2047,7 +2047,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -2058,72 +2058,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Uint8Array#constructor (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -2134,79 +2134,79 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int32Array#constructor (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/dataview/DataView#constructor (; 20 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 - get_global $~lib/builtins/i32.MIN_VALUE + local.get $3 + global.get $~lib/builtins/i32.MIN_VALUE i32.eq if - get_local $1 + local.get $1 i32.load - get_local $2 + local.get $2 i32.sub - set_local $3 + local.set $3 end - get_local $2 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $2 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -2216,8 +2216,8 @@ call $~lib/env/abort unreachable end - get_local $3 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $3 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -2227,10 +2227,10 @@ call $~lib/env/abort unreachable end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - get_local $1 + local.get $1 i32.load i32.gt_s if @@ -2241,30 +2241,30 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=4 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/dataview/DataView#constructor|trampoline (; 21 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) block $2of2 block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -2272,35 +2272,35 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end - get_global $~lib/builtins/i32.MIN_VALUE - set_local $3 + global.get $~lib/builtins/i32.MIN_VALUE + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/dataview/DataView#constructor ) (func $start (; 22 ;) (type $v) (local $0 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 i32.const 8 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_global $std/arraybuffer/buffer - get_global $std/arraybuffer/buffer + global.set $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.load i32.const 8 i32.eq @@ -2315,14 +2315,14 @@ end block (result i32) i32.const 0 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const 0 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline end - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 8 i32.eq @@ -2336,17 +2336,17 @@ unreachable end block $~lib/arraybuffer/ArrayBuffer#get:data|inlined.0 (result i32) - get_global $std/arraybuffer/sliced - set_local $0 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $std/arraybuffer/sliced + local.set $0 + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add end block $~lib/arraybuffer/ArrayBuffer#get:data|inlined.1 (result i32) - get_global $std/arraybuffer/buffer - set_local $0 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $std/arraybuffer/buffer + local.set $0 + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add end i32.ne @@ -2359,8 +2359,8 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/sliced - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/sliced + global.get $std/arraybuffer/buffer i32.ne i32.eqz if @@ -2373,14 +2373,14 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const 1 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline end - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 7 i32.eq @@ -2395,14 +2395,14 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const -1 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline end - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 1 i32.eq @@ -2415,12 +2415,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const 1 i32.const 3 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 2 i32.eq @@ -2433,12 +2433,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const 1 i32.const -1 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 6 i32.eq @@ -2451,12 +2451,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const -3 i32.const -1 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 2 i32.eq @@ -2469,12 +2469,12 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/buffer + global.get $std/arraybuffer/buffer i32.const -4 i32.const 42 call $~lib/arraybuffer/ArrayBuffer#slice - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 4 i32.eq @@ -2489,14 +2489,14 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/arraybuffer/buffer + global.set $~argc + global.get $std/arraybuffer/buffer i32.const 42 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#slice|trampoline end - set_global $std/arraybuffer/sliced - get_global $std/arraybuffer/sliced + global.set $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.load i32.const 0 i32.eq @@ -2509,7 +2509,7 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/sliced + global.get $std/arraybuffer/sliced i32.const 0 i32.ne i32.eqz @@ -2584,7 +2584,7 @@ i32.const 0 i32.const 1 call $~lib/typedarray/Uint8Array#constructor - set_global $std/arraybuffer/arr8 + global.set $std/arraybuffer/arr8 i32.const 240 call $~lib/arraybuffer/ArrayBuffer.isView> i32.eqz @@ -2597,7 +2597,7 @@ call $~lib/env/abort unreachable end - get_global $std/arraybuffer/arr8 + global.get $std/arraybuffer/arr8 call $~lib/arraybuffer/ArrayBuffer.isView i32.eqz if @@ -2623,9 +2623,9 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 0 - get_global $std/arraybuffer/arr8 + global.get $std/arraybuffer/arr8 i32.load i32.const 0 i32.const 0 diff --git a/tests/compiler/std/constructor.optimized.wat b/tests/compiler/std/constructor.optimized.wat index 3bb76fbb..2821cdfa 100644 --- a/tests/compiler/std/constructor.optimized.wat +++ b/tests/compiler/std/constructor.optimized.wat @@ -3,7 +3,7 @@ (type $v (func)) (type $FUNCSIG$i (func (result i32))) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -25,17 +25,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -44,16 +44,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -61,16 +61,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -79,53 +79,53 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $std/constructor/EmptyCtorWithFieldInit#constructor (; 1 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 4 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 1 i32.store - get_local $0 + local.get $0 ) (func $std/constructor/EmptyCtorWithFieldNoInit#constructor (; 2 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 4 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 ) (func $start (; 3 ;) (type $v) (local $0 i32) i32.const 8 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 - set_global $std/constructor/emptyCtor + global.set $std/constructor/emptyCtor call $std/constructor/EmptyCtorWithFieldInit#constructor - set_global $std/constructor/emptyCtorWithFieldInit + global.set $std/constructor/emptyCtorWithFieldInit call $std/constructor/EmptyCtorWithFieldNoInit#constructor - set_global $std/constructor/emptyCtorWithFieldNoInit + global.set $std/constructor/emptyCtorWithFieldNoInit i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_global $std/constructor/none + global.set $std/constructor/none call $std/constructor/EmptyCtorWithFieldInit#constructor - set_global $std/constructor/justFieldInit + global.set $std/constructor/justFieldInit call $std/constructor/EmptyCtorWithFieldNoInit#constructor - set_global $std/constructor/justFieldNoInit + global.set $std/constructor/justFieldNoInit i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_global $std/constructor/ctorReturns + global.set $std/constructor/ctorReturns block $__inlined_func$std/constructor/CtorConditionallyReturns#constructor (result i32) - get_global $std/constructor/b + global.get $std/constructor/b if i32.const 0 call $~lib/allocator/arena/__memory_allocate @@ -134,27 +134,27 @@ i32.const 0 call $~lib/allocator/arena/__memory_allocate end - set_global $std/constructor/ctorConditionallyReturns + global.set $std/constructor/ctorConditionallyReturns i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_global $std/constructor/ctorAllocates + global.set $std/constructor/ctorAllocates block (result i32) - get_global $std/constructor/b + global.get $std/constructor/b if i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.eqz end if i32.const 0 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 - set_global $std/constructor/ctorConditionallyAllocates + local.get $0 + global.set $std/constructor/ctorConditionallyAllocates ) (func $null (; 4 ;) (type $v) nop diff --git a/tests/compiler/std/constructor.untouched.wat b/tests/compiler/std/constructor.untouched.wat index 84d9cff5..200a9b1d 100644 --- a/tests/compiler/std/constructor.untouched.wat +++ b/tests/compiler/std/constructor.untouched.wat @@ -2,7 +2,7 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -32,41 +32,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -76,22 +76,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -100,198 +100,198 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $std/constructor/EmptyCtor#constructor (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $std/constructor/EmptyCtorWithFieldInit#constructor (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 ) (func $std/constructor/EmptyCtorWithFieldNoInit#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 ) (func $std/constructor/None#constructor (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $std/constructor/JustFieldInit#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 ) (func $std/constructor/JustFieldNoInit#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 4 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 ) (func $std/constructor/CtorReturns#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) block $~lib/memory/memory.allocate|inlined.0 (result i32) i32.const 0 - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end ) (func $std/constructor/CtorConditionallyReturns#constructor (; 9 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $std/constructor/b + global.get $std/constructor/b if block $~lib/memory/memory.allocate|inlined.1 (result i32) i32.const 0 - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end return end - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $std/constructor/CtorAllocates#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end drop - get_local $0 + local.get $0 ) (func $std/constructor/CtorConditionallyAllocates#constructor (; 11 ;) (type $ii) (param $0 i32) (result i32) - get_global $std/constructor/b + global.get $std/constructor/b if block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end drop end - get_local $0 + local.get $0 i32.eqz if i32.const 0 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $start (; 12 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 call $std/constructor/EmptyCtor#constructor - set_global $std/constructor/emptyCtor + global.set $std/constructor/emptyCtor i32.const 0 call $std/constructor/EmptyCtorWithFieldInit#constructor - set_global $std/constructor/emptyCtorWithFieldInit + global.set $std/constructor/emptyCtorWithFieldInit i32.const 0 call $std/constructor/EmptyCtorWithFieldNoInit#constructor - set_global $std/constructor/emptyCtorWithFieldNoInit + global.set $std/constructor/emptyCtorWithFieldNoInit i32.const 0 call $std/constructor/None#constructor - set_global $std/constructor/none + global.set $std/constructor/none i32.const 0 call $std/constructor/JustFieldInit#constructor - set_global $std/constructor/justFieldInit + global.set $std/constructor/justFieldInit i32.const 0 call $std/constructor/JustFieldNoInit#constructor - set_global $std/constructor/justFieldNoInit + global.set $std/constructor/justFieldNoInit i32.const 0 call $std/constructor/CtorReturns#constructor - set_global $std/constructor/ctorReturns + global.set $std/constructor/ctorReturns i32.const 0 call $std/constructor/CtorConditionallyReturns#constructor - set_global $std/constructor/ctorConditionallyReturns + global.set $std/constructor/ctorConditionallyReturns i32.const 0 call $std/constructor/CtorAllocates#constructor - set_global $std/constructor/ctorAllocates + global.set $std/constructor/ctorAllocates i32.const 0 call $std/constructor/CtorConditionallyAllocates#constructor - set_global $std/constructor/ctorConditionallyAllocates + global.set $std/constructor/ctorConditionallyAllocates ) (func $null (; 13 ;) (type $v) ) diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index f9268ecc..3992cc7e 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -21,7 +21,7 @@ (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 anyfunc) + (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)) @@ -34,17 +34,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -53,16 +53,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -70,16 +70,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -88,13 +88,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -107,240 +107,240 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end ) (func $~lib/internal/typedarray/TypedArray#constructor (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -351,43 +351,43 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#__set (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.ge_u if @@ -398,29 +398,29 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load i32.add i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/dataview/DataView#constructor (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $2 + local.get $2 i32.const -2147483648 i32.eq if - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.sub - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -431,7 +431,7 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.const 1073741816 i32.gt_u if @@ -442,10 +442,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.load i32.gt_s if @@ -458,34 +458,34 @@ end i32.const 12 call $~lib/allocator/arena/__memory_allocate - tee_local $3 - get_local $0 + local.tee $3 + local.get $0 i32.store - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 - get_local $3 + local.get $3 ) (func $~lib/dataview/DataView#getFloat32 (; 7 ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1073741816 i32.gt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $1 + local.get $1 i32.const 4 i32.add - get_local $3 + local.get $3 i32.gt_s end if @@ -496,58 +496,58 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 if (result f32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 - tee_local $0 + local.tee $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 i32.rotr i32.or - f32.reinterpret/i32 + f32.reinterpret_i32 end ) (func $~lib/polyfills/bswap (; 8 ;) (type $II) (param $0 i64) (result i64) (local $1 i64) - get_local $0 + local.get $0 i64.const 8 i64.shr_u i64.const 71777214294589695 i64.and - get_local $0 + local.get $0 i64.const 71777214294589695 i64.and i64.const 8 i64.shl i64.or - tee_local $1 + local.tee $1 i64.const 16 i64.shr_u i64.const 281470681808895 i64.and - get_local $1 + local.get $1 i64.const 281470681808895 i64.and i64.const 16 @@ -558,7 +558,7 @@ ) (func $~lib/dataview/DataView#getFloat64 (; 9 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) i32.const 8 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -569,45 +569,45 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 if (result f64) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add f64.load offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add i64.load offset=8 call $~lib/polyfills/bswap - f64.reinterpret/i64 + f64.reinterpret_i64 end ) (func $~lib/dataview/DataView#getInt8 (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1073741816 i32.gt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.const 1 i32.add - get_local $3 + local.get $3 i32.gt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 i32.const 136 @@ -616,32 +616,32 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load8_s offset=8 ) (func $~lib/dataview/DataView#getInt16 (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1073741816 i32.gt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $1 + local.get $1 i32.const 2 i32.add - get_local $3 + local.get $3 i32.gt_s end if @@ -652,27 +652,27 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load16_s offset=8 - set_local $0 - get_local $2 + local.set $0 + local.get $2 if (result i32) - get_local $0 + local.get $0 else - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 24 i32.shr_s i32.const 255 i32.and - get_local $0 + local.get $0 i32.const 8 i32.shl i32.or @@ -681,20 +681,20 @@ (func $~lib/dataview/DataView#getInt32 (; 12 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1073741816 i32.gt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $1 + local.get $1 i32.const 4 i32.add - get_local $3 + local.get $3 i32.gt_s end if @@ -705,25 +705,25 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 - set_local $0 - get_local $2 + local.set $0 + local.get $2 if (result i32) - get_local $0 + local.get $0 else - get_local $0 + local.get $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 @@ -734,7 +734,7 @@ (func $~lib/dataview/DataView#getInt64 (; 13 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) (local $2 i64) i32.const 8 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -745,41 +745,41 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add i64.load offset=8 - set_local $2 - get_local $1 + local.set $2 + local.get $1 if (result i64) - get_local $2 + local.get $2 else - get_local $2 + local.get $2 call $~lib/polyfills/bswap end ) (func $~lib/dataview/DataView#getUint8 (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1073741816 i32.gt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.const 1 i32.add - get_local $3 + local.get $3 i32.gt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 i32.const 136 @@ -788,32 +788,32 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load8_u offset=8 ) (func $~lib/dataview/DataView#getUint16 (; 15 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1073741816 i32.gt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $1 + local.get $1 i32.const 2 i32.add - get_local $3 + local.get $3 i32.gt_s end if @@ -824,23 +824,23 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load16_u offset=8 - set_local $0 - get_local $2 + local.set $0 + local.get $2 if (result i32) - get_local $0 + local.get $0 else - get_local $0 + local.get $0 i32.const 8 i32.shl - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 8 @@ -851,7 +851,7 @@ (func $~lib/dataview/DataView#setFloat32 (; 16 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) (local $3 i32) i32.const 4 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -862,29 +862,29 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 if - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 f32.store offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 - i32.reinterpret/f32 - tee_local $3 + local.get $1 + i32.reinterpret_f32 + local.tee $3 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $3 + local.get $3 i32.const 16711935 i32.and i32.const 8 @@ -895,7 +895,7 @@ ) (func $~lib/dataview/DataView#setFloat64 (; 17 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) i32.const 8 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -906,30 +906,30 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 if - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 f64.store offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 call $~lib/polyfills/bswap i64.store offset=8 end ) (func $~lib/dataview/DataView#setInt8 (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) i32.const 1 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -940,17 +940,17 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.store8 offset=8 ) (func $~lib/dataview/DataView#setInt16 (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 2 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -961,35 +961,35 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 24 i32.shr_s i32.const 255 i32.and - get_local $1 + local.get $1 i32.const 8 i32.shl i32.or - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store16 offset=8 ) (func $~lib/dataview/DataView#setInt32 (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 4 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -1000,35 +1000,35 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $1 + local.get $1 i32.const 16711935 i32.and i32.const 8 i32.rotr i32.or - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 ) (func $~lib/dataview/DataView#setInt64 (; 21 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) i32.const 8 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -1039,23 +1039,23 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $2 + local.get $2 if (result i64) - get_local $1 + local.get $1 else - get_local $1 + local.get $1 call $~lib/polyfills/bswap end i64.store offset=8 ) (func $~lib/dataview/DataView#setUint16 (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 2 - get_local $0 + local.get $0 i32.load offset=8 i32.gt_s if @@ -1066,83 +1066,83 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.const 8 i32.shl - get_local $1 + local.get $1 i32.const 65535 i32.and i32.const 8 i32.shr_u i32.or - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store16 offset=8 ) (func $start (; 23 ;) (type $v) (local $0 i32) i32.const 216 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 12 call $~lib/allocator/arena/__memory_allocate i32.const 8 call $~lib/internal/typedarray/TypedArray#constructor - set_global $std/dataview/array - get_global $std/dataview/array + global.set $std/dataview/array + global.get $std/dataview/array i32.const 0 i32.const 246 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 1 i32.const 224 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 2 i32.const 88 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 3 i32.const 159 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 4 i32.const 130 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 5 i32.const 101 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 6 i32.const 67 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 7 i32.const 95 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array - tee_local $0 + global.get $std/dataview/array + local.tee $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load offset=8 call $~lib/dataview/DataView#constructor - set_global $std/dataview/view - get_global $std/dataview/view + global.set $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1156,7 +1156,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1170,7 +1170,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1184,7 +1184,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1198,7 +1198,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1212,7 +1212,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1226,7 +1226,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1240,7 +1240,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1254,7 +1254,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1268,7 +1268,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1282,7 +1282,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getFloat64 f64.const 7936550095674706383278551e126 @@ -1295,7 +1295,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getFloat64 f64.const -411777475818852546741639e241 @@ -1308,7 +1308,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const -10 @@ -1321,7 +1321,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getInt8 i32.const -32 @@ -1334,7 +1334,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 call $~lib/dataview/DataView#getInt8 i32.const 88 @@ -1347,7 +1347,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 call $~lib/dataview/DataView#getInt8 i32.const -97 @@ -1360,7 +1360,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 call $~lib/dataview/DataView#getInt8 i32.const -126 @@ -1373,7 +1373,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 call $~lib/dataview/DataView#getInt8 i32.const 101 @@ -1386,7 +1386,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 call $~lib/dataview/DataView#getInt8 i32.const 67 @@ -1399,7 +1399,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 7 call $~lib/dataview/DataView#getInt8 i32.const 95 @@ -1412,7 +1412,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1428,7 +1428,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1444,7 +1444,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1460,7 +1460,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1476,7 +1476,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1492,7 +1492,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1508,7 +1508,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1524,7 +1524,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1540,7 +1540,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1556,7 +1556,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1572,7 +1572,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1588,7 +1588,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1604,7 +1604,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1620,7 +1620,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1636,7 +1636,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1650,7 +1650,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1664,7 +1664,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1678,7 +1678,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1692,7 +1692,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1706,7 +1706,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1720,7 +1720,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1734,7 +1734,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1748,7 +1748,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1762,7 +1762,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1776,7 +1776,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getInt64 i64.const 6864441868736323830 @@ -1789,7 +1789,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt64 i64.const -657428103485373601 @@ -1802,7 +1802,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 246 @@ -1815,7 +1815,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getUint8 i32.const 224 @@ -1828,7 +1828,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 call $~lib/dataview/DataView#getUint8 i32.const 88 @@ -1841,7 +1841,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 call $~lib/dataview/DataView#getUint8 i32.const 159 @@ -1854,7 +1854,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 call $~lib/dataview/DataView#getUint8 i32.const 130 @@ -1867,7 +1867,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 call $~lib/dataview/DataView#getUint8 i32.const 101 @@ -1880,7 +1880,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 call $~lib/dataview/DataView#getUint8 i32.const 67 @@ -1893,7 +1893,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 7 call $~lib/dataview/DataView#getUint8 i32.const 95 @@ -1906,7 +1906,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1922,7 +1922,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1938,7 +1938,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1954,7 +1954,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1970,7 +1970,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1986,7 +1986,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2002,7 +2002,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2018,7 +2018,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2034,7 +2034,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2050,7 +2050,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2066,7 +2066,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2082,7 +2082,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2098,7 +2098,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2114,7 +2114,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2130,7 +2130,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2144,7 +2144,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2158,7 +2158,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2172,7 +2172,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2186,7 +2186,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2200,7 +2200,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2214,7 +2214,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2228,7 +2228,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2242,7 +2242,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2256,7 +2256,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2270,7 +2270,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getInt64 i64.const 6864441868736323830 @@ -2283,7 +2283,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt64 i64.const -657428103485373601 @@ -2296,11 +2296,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view f32.const 1.5976661625240943e-18 i32.const 1 call $~lib/dataview/DataView#setFloat32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -2314,11 +2314,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view f32.const 1976281973381696323584 i32.const 0 call $~lib/dataview/DataView#setFloat32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -2332,11 +2332,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view f64.const -1094252199637739024055454e124 i32.const 1 call $~lib/dataview/DataView#setFloat64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getFloat64 f64.const -1094252199637739024055454e124 @@ -2349,11 +2349,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view f64.const 6.022586634778589e-103 i32.const 0 call $~lib/dataview/DataView#setFloat64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getFloat64 f64.const 6.022586634778589e-103 @@ -2366,10 +2366,10 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 108 call $~lib/dataview/DataView#setInt8 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const 108 @@ -2382,11 +2382,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const -13360 i32.const 1 call $~lib/dataview/DataView#setInt16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2402,11 +2402,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 14689 i32.const 0 call $~lib/dataview/DataView#setInt16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2422,11 +2422,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1204680201 i32.const 1 call $~lib/dataview/DataView#setInt32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2440,11 +2440,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 660673230 i32.const 0 call $~lib/dataview/DataView#setInt32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2458,11 +2458,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i64.const -3290739641816099749 i32.const 1 call $~lib/dataview/DataView#setInt64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getInt64 i64.const -3290739641816099749 @@ -2475,11 +2475,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i64.const 8178932412950708047 i32.const 0 call $~lib/dataview/DataView#setInt64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt64 i64.const 8178932412950708047 @@ -2492,10 +2492,10 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 238 call $~lib/dataview/DataView#setInt8 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 238 @@ -2508,11 +2508,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 58856 i32.const 1 call $~lib/dataview/DataView#setUint16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2528,11 +2528,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 60400 i32.const 0 call $~lib/dataview/DataView#setUint16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2548,11 +2548,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const -846805744 i32.const 1 call $~lib/dataview/DataView#setInt32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2566,11 +2566,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const -1510791631 i32.const 0 call $~lib/dataview/DataView#setInt32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2584,11 +2584,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i64.const 2334704782995986958 i32.const 1 call $~lib/dataview/DataView#setInt64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getInt64 i64.const 2334704782995986958 @@ -2601,11 +2601,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i64.const -7123186897289856329 i32.const 0 call $~lib/dataview/DataView#setInt64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt64 i64.const -7123186897289856329 diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index 140472af..2553cf44 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -19,7 +19,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -39,8 +39,8 @@ (func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -55,41 +55,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -99,22 +99,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -123,15 +123,15 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -143,267 +143,267 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -411,7 +411,7 @@ end ) (func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) @@ -420,7 +420,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -431,71 +431,71 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Uint8Array#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#__set (; 8 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -508,35 +508,35 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/dataview/DataView#constructor (; 9 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $3 - get_global $~lib/builtins/i32.MIN_VALUE + local.get $3 + global.get $~lib/builtins/i32.MIN_VALUE i32.eq if - get_local $1 + local.get $1 i32.load - get_local $2 + local.get $2 i32.sub - set_local $3 + local.set $3 end - get_local $2 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $2 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -546,8 +546,8 @@ call $~lib/env/abort unreachable end - get_local $3 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $3 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -557,10 +557,10 @@ call $~lib/env/abort unreachable end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - get_local $1 + local.get $1 i32.load i32.gt_s if @@ -571,31 +571,31 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=4 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/polyfills/bswap (; 10 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 @@ -608,21 +608,21 @@ (local $4 i32) (local $5 i32) i32.const 4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -633,65 +633,65 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.const 0 i32.ne if (result f32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add f32.load offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 call $~lib/polyfills/bswap - f32.reinterpret/i32 + f32.reinterpret_i32 end ) (func $~lib/polyfills/bswap (; 12 ;) (type $II) (param $0 i64) (result i64) (local $1 i64) (local $2 i64) (local $3 i64) - get_local $0 + local.get $0 i64.const 8 i64.shr_u i64.const 71777214294589695 i64.and - set_local $1 - get_local $0 + local.set $1 + local.get $0 i64.const 71777214294589695 i64.and i64.const 8 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 16 i64.shr_u i64.const 281470681808895 i64.and - set_local $1 - get_local $3 + local.set $1 + local.get $3 i64.const 281470681808895 i64.and i64.const 16 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or i64.const 32 i64.rotr @@ -702,21 +702,21 @@ (local $4 i32) (local $5 i32) i32.const 8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -727,29 +727,29 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.const 0 i32.ne if (result f64) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i64.load offset=8 call $~lib/polyfills/bswap - f64.reinterpret/i64 + f64.reinterpret_i64 end ) (func $~lib/dataview/DataView#getInt8 (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -757,21 +757,21 @@ (local $3 i32) (local $4 i32) i32.const 1 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $3 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $3 + local.get $3 i32.gt_s end if @@ -782,20 +782,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load8_s offset=8 ) (func $~lib/polyfills/bswap (; 15 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 8 i32.shl - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -813,21 +813,21 @@ (local $5 i32) (local $6 i32) i32.const 2 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -838,32 +838,32 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load16_s offset=8 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.ne if (result i32) - get_local $6 + local.get $6 else - get_local $6 + local.get $6 call $~lib/polyfills/bswap end ) (func $~lib/polyfills/bswap (; 17 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 @@ -877,21 +877,21 @@ (local $5 i32) (local $6 i32) i32.const 4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -902,22 +902,22 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.ne if (result i32) - get_local $6 + local.get $6 else - get_local $6 + local.get $6 call $~lib/polyfills/bswap end ) @@ -925,36 +925,36 @@ (local $1 i64) (local $2 i64) (local $3 i64) - get_local $0 + local.get $0 i64.const 8 i64.shr_u i64.const 71777214294589695 i64.and - set_local $1 - get_local $0 + local.set $1 + local.get $0 i64.const 71777214294589695 i64.and i64.const 8 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 16 i64.shr_u i64.const 281470681808895 i64.and - set_local $1 - get_local $3 + local.set $1 + local.get $3 i64.const 281470681808895 i64.and i64.const 16 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or i64.const 32 i64.rotr @@ -966,21 +966,21 @@ (local $5 i32) (local $6 i64) i32.const 8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -991,22 +991,22 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i64.load offset=8 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.ne if (result i64) - get_local $6 + local.get $6 else - get_local $6 + local.get $6 call $~lib/polyfills/bswap end ) @@ -1015,21 +1015,21 @@ (local $3 i32) (local $4 i32) i32.const 1 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=8 - set_local $3 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $3 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $3 + local.get $3 i32.gt_s end if @@ -1040,20 +1040,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load8_u offset=8 ) (func $~lib/polyfills/bswap (; 22 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 8 i32.shl - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 8 @@ -1069,21 +1069,21 @@ (local $5 i32) (local $6 i32) i32.const 2 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -1094,22 +1094,22 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load16_u offset=8 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.ne if (result i32) - get_local $6 + local.get $6 else - get_local $6 + local.get $6 call $~lib/polyfills/bswap end ) @@ -1119,21 +1119,21 @@ (local $5 i32) (local $6 i32) i32.const 4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -1144,22 +1144,22 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i32.load offset=8 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.ne if (result i32) - get_local $6 + local.get $6 else - get_local $6 + local.get $6 call $~lib/polyfills/bswap end ) @@ -1169,21 +1169,21 @@ (local $5 i32) (local $6 i64) i32.const 8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -1194,22 +1194,22 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add i64.load offset=8 - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.ne if (result i64) - get_local $6 + local.get $6 else - get_local $6 + local.get $6 call $~lib/polyfills/bswap end ) @@ -1218,21 +1218,21 @@ (local $5 i32) (local $6 i32) i32.const 4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1243,29 +1243,29 @@ call $~lib/env/abort unreachable end - get_local $3 + local.get $3 i32.const 0 i32.ne if - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $2 + local.get $2 f32.store offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $2 - i32.reinterpret/f32 + local.get $2 + i32.reinterpret_f32 call $~lib/polyfills/bswap i32.store offset=8 end @@ -1275,21 +1275,21 @@ (local $5 i32) (local $6 i32) i32.const 8 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1300,29 +1300,29 @@ call $~lib/env/abort unreachable end - get_local $3 + local.get $3 i32.const 0 i32.ne if - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $2 + local.get $2 f64.store offset=8 else - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $2 - i64.reinterpret/f64 + local.get $2 + i64.reinterpret_f64 call $~lib/polyfills/bswap i64.store offset=8 end @@ -1332,21 +1332,21 @@ (local $4 i32) (local $5 i32) i32.const 1 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -1357,14 +1357,14 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/dataview/DataView#setInt16 (; 29 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) @@ -1372,21 +1372,21 @@ (local $5 i32) (local $6 i32) i32.const 2 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1397,20 +1397,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $3 + local.get $3 i32.const 0 i32.ne if (result i32) - get_local $2 + local.get $2 else - get_local $2 + local.get $2 call $~lib/polyfills/bswap end i32.store16 offset=8 @@ -1420,21 +1420,21 @@ (local $5 i32) (local $6 i32) i32.const 4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1445,20 +1445,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $3 + local.get $3 i32.const 0 i32.ne if (result i32) - get_local $2 + local.get $2 else - get_local $2 + local.get $2 call $~lib/polyfills/bswap end i32.store offset=8 @@ -1468,21 +1468,21 @@ (local $5 i32) (local $6 i32) i32.const 8 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1493,20 +1493,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $3 + local.get $3 i32.const 0 i32.ne if (result i64) - get_local $2 + local.get $2 else - get_local $2 + local.get $2 call $~lib/polyfills/bswap end i64.store offset=8 @@ -1516,21 +1516,21 @@ (local $4 i32) (local $5 i32) i32.const 1 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - set_local $4 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $4 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.gt_s end if @@ -1541,14 +1541,14 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/dataview/DataView#setUint16 (; 33 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) @@ -1556,21 +1556,21 @@ (local $5 i32) (local $6 i32) i32.const 2 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1581,20 +1581,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $3 + local.get $3 i32.const 0 i32.ne if (result i32) - get_local $2 + local.get $2 else - get_local $2 + local.get $2 call $~lib/polyfills/bswap end i32.store16 offset=8 @@ -1604,21 +1604,21 @@ (local $5 i32) (local $6 i32) i32.const 4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1629,20 +1629,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $3 + local.get $3 i32.const 0 i32.ne if (result i32) - get_local $2 + local.get $2 else - get_local $2 + local.get $2 call $~lib/polyfills/bswap end i32.store offset=8 @@ -1652,21 +1652,21 @@ (local $5 i32) (local $6 i32) i32.const 8 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 - set_local $5 - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.set $5 + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.gt_s end if @@ -1677,81 +1677,81 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 i32.add - get_local $1 + local.get $1 i32.add - get_local $3 + local.get $3 i32.const 0 i32.ne if (result i64) - get_local $2 + local.get $2 else - get_local $2 + local.get $2 call $~lib/polyfills/bswap end i64.store offset=8 ) (func $start (; 36 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 i32.const 8 call $~lib/typedarray/Uint8Array#constructor - set_global $std/dataview/array - get_global $std/dataview/array + global.set $std/dataview/array + global.get $std/dataview/array i32.const 0 i32.const 246 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 1 i32.const 224 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 2 i32.const 88 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 3 i32.const 159 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 4 i32.const 130 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 5 i32.const 101 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 6 i32.const 67 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/dataview/array + global.get $std/dataview/array i32.const 7 i32.const 95 call $~lib/internal/typedarray/TypedArray#__set i32.const 0 - get_global $std/dataview/array + global.get $std/dataview/array i32.load - get_global $std/dataview/array + global.get $std/dataview/array i32.load offset=4 - get_global $std/dataview/array + global.get $std/dataview/array i32.load offset=8 call $~lib/dataview/DataView#constructor - set_global $std/dataview/view - get_global $std/dataview/view + global.set $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1766,7 +1766,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1781,7 +1781,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1796,7 +1796,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1811,7 +1811,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1826,7 +1826,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1841,7 +1841,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1856,7 +1856,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1871,7 +1871,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1886,7 +1886,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1901,7 +1901,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat64 @@ -1916,7 +1916,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat64 @@ -1931,7 +1931,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const -10 @@ -1945,7 +1945,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getInt8 i32.const -32 @@ -1959,7 +1959,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 call $~lib/dataview/DataView#getInt8 i32.const 88 @@ -1973,7 +1973,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 call $~lib/dataview/DataView#getInt8 i32.const -97 @@ -1987,7 +1987,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 call $~lib/dataview/DataView#getInt8 i32.const -126 @@ -2001,7 +2001,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 call $~lib/dataview/DataView#getInt8 i32.const 101 @@ -2015,7 +2015,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 call $~lib/dataview/DataView#getInt8 i32.const 67 @@ -2029,7 +2029,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 7 call $~lib/dataview/DataView#getInt8 i32.const 95 @@ -2043,7 +2043,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2062,7 +2062,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2081,7 +2081,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2100,7 +2100,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2119,7 +2119,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2138,7 +2138,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2157,7 +2157,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2176,7 +2176,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2195,7 +2195,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2214,7 +2214,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2233,7 +2233,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2252,7 +2252,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2271,7 +2271,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2290,7 +2290,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2309,7 +2309,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2324,7 +2324,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2339,7 +2339,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2354,7 +2354,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2369,7 +2369,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2384,7 +2384,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2399,7 +2399,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2414,7 +2414,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2429,7 +2429,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2444,7 +2444,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2459,7 +2459,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt64 @@ -2474,7 +2474,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt64 @@ -2489,7 +2489,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 246 @@ -2503,7 +2503,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 call $~lib/dataview/DataView#getUint8 i32.const 224 @@ -2517,7 +2517,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 call $~lib/dataview/DataView#getUint8 i32.const 88 @@ -2531,7 +2531,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 call $~lib/dataview/DataView#getUint8 i32.const 159 @@ -2545,7 +2545,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 call $~lib/dataview/DataView#getUint8 i32.const 130 @@ -2559,7 +2559,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 call $~lib/dataview/DataView#getUint8 i32.const 101 @@ -2573,7 +2573,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 call $~lib/dataview/DataView#getUint8 i32.const 67 @@ -2587,7 +2587,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 7 call $~lib/dataview/DataView#getUint8 i32.const 95 @@ -2601,7 +2601,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2618,7 +2618,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2635,7 +2635,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2652,7 +2652,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2669,7 +2669,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2686,7 +2686,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2703,7 +2703,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2720,7 +2720,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2737,7 +2737,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2754,7 +2754,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2771,7 +2771,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2788,7 +2788,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2805,7 +2805,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 5 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2822,7 +2822,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 6 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2839,7 +2839,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2854,7 +2854,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2869,7 +2869,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2884,7 +2884,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2899,7 +2899,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2914,7 +2914,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -2929,7 +2929,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 1 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -2944,7 +2944,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 2 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -2959,7 +2959,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 3 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -2974,7 +2974,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 4 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -2989,7 +2989,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint64 @@ -3004,7 +3004,7 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint64 @@ -3019,12 +3019,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 f32.const 1.5976661625240943e-18 i32.const 1 call $~lib/dataview/DataView#setFloat32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -3039,12 +3039,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 f32.const 1976281973381696323584 i32.const 0 call $~lib/dataview/DataView#setFloat32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -3059,12 +3059,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 f64.const -1094252199637739024055454e124 i32.const 1 call $~lib/dataview/DataView#setFloat64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat64 @@ -3079,12 +3079,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 f64.const 6.022586634778589e-103 i32.const 0 call $~lib/dataview/DataView#setFloat64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat64 @@ -3099,11 +3099,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 108 call $~lib/dataview/DataView#setInt8 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const 108 @@ -3117,12 +3117,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const -13360 i32.const 1 call $~lib/dataview/DataView#setInt16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -3141,12 +3141,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 14689 i32.const 0 call $~lib/dataview/DataView#setInt16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -3165,12 +3165,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1204680201 i32.const 1 call $~lib/dataview/DataView#setInt32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -3185,12 +3185,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 660673230 i32.const 0 call $~lib/dataview/DataView#setInt32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -3205,12 +3205,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i64.const -3290739641816099749 i32.const 1 call $~lib/dataview/DataView#setInt64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt64 @@ -3225,12 +3225,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i64.const 8178932412950708047 i32.const 0 call $~lib/dataview/DataView#setInt64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt64 @@ -3245,11 +3245,11 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 238 call $~lib/dataview/DataView#setUint8 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 238 @@ -3263,12 +3263,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 58856 i32.const 1 call $~lib/dataview/DataView#setUint16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -3285,12 +3285,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 60400 i32.const 0 call $~lib/dataview/DataView#setUint16 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -3307,12 +3307,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const -846805744 i32.const 1 call $~lib/dataview/DataView#setUint32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -3327,12 +3327,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const -1510791631 i32.const 0 call $~lib/dataview/DataView#setUint32 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -3347,12 +3347,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i64.const 2334704782995986958 i32.const 1 call $~lib/dataview/DataView#setUint64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint64 @@ -3367,12 +3367,12 @@ call $~lib/env/abort unreachable end - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i64.const -7123186897289856329 i32.const 0 call $~lib/dataview/DataView#setUint64 - get_global $std/dataview/view + global.get $std/dataview/view i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint64 diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 4efd6af7..ef8bf492 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -9,7 +9,7 @@ (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 anyfunc) + (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)) @@ -22,17 +22,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -41,16 +41,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -58,16 +58,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -76,17 +76,17 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $start (; 4 ;) (type $v) (local $0 i32) (local $1 i64) i32.const 40 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 @@ -95,7 +95,7 @@ i32.const 0 f64.const 0 call $~lib/bindings/Date/UTC - i64.trunc_s/f64 + i64.trunc_f64_s i64.const 0 i64.ne if @@ -114,7 +114,7 @@ i32.const 0 f64.const 0 call $~lib/bindings/Date/UTC - i64.trunc_s/f64 + i64.trunc_f64_s i64.const 0 i64.ne if @@ -133,9 +133,9 @@ i32.const 0 f64.const 1 call $~lib/bindings/Date/UTC - i64.trunc_s/f64 - set_global $std/date/creationTime - get_global $std/date/creationTime + i64.trunc_f64_s + global.set $std/date/creationTime + global.get $std/date/creationTime i64.const 1541847600001 i64.ne if @@ -147,8 +147,8 @@ unreachable end call $~lib/bindings/Date/now - i64.trunc_s/f64 - get_global $std/date/creationTime + i64.trunc_f64_s + global.get $std/date/creationTime i64.le_s if i32.const 0 @@ -158,20 +158,20 @@ call $~lib/env/abort unreachable end - get_global $std/date/creationTime - set_local $1 + global.get $std/date/creationTime + local.set $1 i32.const 8 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i64.const 0 i64.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.store - get_local $0 - set_global $std/date/date - get_global $std/date/creationTime - get_global $std/date/date + local.get $0 + global.set $std/date/date + global.get $std/date/creationTime + global.get $std/date/date i64.load i64.ne if @@ -182,16 +182,16 @@ call $~lib/env/abort unreachable end - get_global $std/date/date - tee_local $0 - get_global $std/date/creationTime + global.get $std/date/date + local.tee $0 + global.get $std/date/creationTime i64.const 1 i64.add - tee_local $1 + local.tee $1 i64.store - get_local $0 + local.get $0 i64.load - get_local $1 + local.get $1 i64.ne if i32.const 0 diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 060a3b26..e0fa9162 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -12,7 +12,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -33,41 +33,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -77,22 +77,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -101,42 +101,42 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $~lib/date/Date#constructor (; 5 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 end - get_local $1 + local.get $1 i64.store - get_local $0 + local.get $0 ) (func $~lib/date/Date#getTime (; 6 ;) (type $iI) (param $0 i32) (result i64) - get_local $0 + local.get $0 i64.load ) (func $~lib/date/Date#setTime (; 7 ;) (type $iII) (param $0 i32) (param $1 i64) (result i64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.store - get_local $1 + local.get $1 ) (func $start (; 8 ;) (type $v) (local $0 i32) @@ -146,41 +146,41 @@ (local $4 i32) (local $5 i32) (local $6 i64) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset block $~lib/date/Date.UTC|inlined.0 (result i64) i32.const 1970 - set_local $0 + local.set $0 i32.const 0 - set_local $1 + local.set $1 i32.const 1 - set_local $2 + local.set $2 i32.const 0 - set_local $3 + local.set $3 i32.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $5 + local.set $5 i64.const 0 - set_local $6 - get_local $0 - get_local $1 - get_local $2 - get_local $3 - get_local $4 - get_local $5 - get_local $6 - f64.convert_s/i64 + local.set $6 + local.get $0 + local.get $1 + local.get $2 + local.get $3 + local.get $4 + local.get $5 + local.get $6 + f64.convert_i64_s call $~lib/bindings/Date/UTC - i64.trunc_s/f64 + i64.trunc_f64_s end i64.const 0 i64.eq @@ -195,29 +195,29 @@ end block $~lib/date/Date.UTC|inlined.1 (result i64) i32.const 1970 - set_local $5 + local.set $5 i32.const 0 - set_local $4 + local.set $4 i32.const 1 - set_local $3 + local.set $3 i32.const 0 - set_local $2 + local.set $2 i32.const 0 - set_local $1 + local.set $1 i32.const 0 - set_local $0 + local.set $0 i64.const 0 - set_local $6 - get_local $5 - get_local $4 - get_local $3 - get_local $2 - get_local $1 - get_local $0 - get_local $6 - f64.convert_s/i64 + local.set $6 + 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 - i64.trunc_s/f64 + i64.trunc_f64_s end i64.const 0 i64.eq @@ -232,32 +232,32 @@ end block $~lib/date/Date.UTC|inlined.2 (result i64) i32.const 2018 - set_local $0 + local.set $0 i32.const 10 - set_local $1 + local.set $1 i32.const 10 - set_local $2 + local.set $2 i32.const 11 - set_local $3 + local.set $3 i32.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $5 + local.set $5 i64.const 1 - set_local $6 - get_local $0 - get_local $1 - get_local $2 - get_local $3 - get_local $4 - get_local $5 - get_local $6 - f64.convert_s/i64 + local.set $6 + local.get $0 + local.get $1 + local.get $2 + local.get $3 + local.get $4 + local.get $5 + local.get $6 + f64.convert_i64_s call $~lib/bindings/Date/UTC - i64.trunc_s/f64 + i64.trunc_f64_s end - set_global $std/date/creationTime - get_global $std/date/creationTime + global.set $std/date/creationTime + global.get $std/date/creationTime i64.const 1541847600001 i64.eq i32.eqz @@ -271,9 +271,9 @@ end block $~lib/date/Date.now|inlined.0 (result i64) call $~lib/bindings/Date/now - i64.trunc_s/f64 + i64.trunc_f64_s end - get_global $std/date/creationTime + global.get $std/date/creationTime i64.gt_s i32.eqz if @@ -285,12 +285,12 @@ unreachable end i32.const 0 - get_global $std/date/creationTime + global.get $std/date/creationTime call $~lib/date/Date#constructor - set_global $std/date/date - get_global $std/date/date + global.set $std/date/date + global.get $std/date/date call $~lib/date/Date#getTime - get_global $std/date/creationTime + global.get $std/date/creationTime i64.eq i32.eqz if @@ -301,15 +301,15 @@ call $~lib/env/abort unreachable end - get_global $std/date/date - get_global $std/date/creationTime + global.get $std/date/date + global.get $std/date/creationTime i64.const 1 i64.add call $~lib/date/Date#setTime drop - get_global $std/date/date + global.get $std/date/date call $~lib/date/Date#getTime - get_global $std/date/creationTime + global.get $std/date/creationTime i64.const 1 i64.add i64.eq diff --git a/tests/compiler/std/gc-array.optimized.wat b/tests/compiler/std/gc-array.optimized.wat index 7c5a380d..577ffab8 100644 --- a/tests/compiler/std/gc-array.optimized.wat +++ b/tests/compiler/std/gc-array.optimized.wat @@ -14,7 +14,7 @@ (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 anyfunc) + (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)) @@ -30,75 +30,75 @@ (export "table" (table $0)) (export "main" (func $std/gc-array/main)) (func $~lib/arraybuffer/ArrayBuffer~gc (; 1 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $~lib/collector/itcm/ManagedObjectList#push (; 2 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $1 + local.set $2 + local.get $1 + local.get $1 i32.load i32.const 3 i32.and - get_local $0 + local.get $0 i32.or i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load i32.const 3 i32.and - get_local $1 + local.get $1 i32.or i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#makeGray (; 3 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_global $~lib/collector/itcm/iter - get_local $0 + global.get $~lib/collector/itcm/iter + local.get $0 i32.eq if - get_local $0 + local.get $0 i32.load offset=4 - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter end - get_local $0 + local.get $0 i32.load i32.const -4 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=4 - tee_local $1 + local.tee $1 i32.store offset=4 - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load i32.const 3 i32.and - get_local $2 + local.get $2 i32.or i32.store - get_global $~lib/collector/itcm/toSpace - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.get $0 call $~lib/collector/itcm/ManagedObjectList#push - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const -4 i32.and @@ -108,19 +108,19 @@ ) (func $~lib/collector/itcm/__gc_mark (; 4 ;) (type $iv) (param $0 i32) (local $1 i32) - get_local $0 + local.get $0 if - get_global $~lib/collector/itcm/white - get_local $0 + global.get $~lib/collector/itcm/white + local.get $0 i32.const 16 i32.sub - tee_local $1 + local.tee $1 i32.load i32.const 3 i32.and i32.eq if - get_local $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#makeGray end end @@ -128,29 +128,29 @@ (func $~lib/array/Array~gc (; 5 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load - tee_local $2 + local.tee $2 call $~lib/collector/itcm/__gc_mark - get_local $0 + local.get $0 i32.load offset=4 i32.const 2 i32.shl - set_local $0 + local.set $0 loop $continue|0 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.lt_u if - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load offset=8 call $~lib/collector/itcm/__gc_mark - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 br $continue|0 end end @@ -159,17 +159,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -178,16 +178,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -195,16 +195,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -213,9 +213,9 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/allocator/arena/__memory_free (; 7 ;) (type $iv) (param $0 i32) nop @@ -226,130 +226,130 @@ block $case3|0 block $case2|0 block $case1|0 - get_global $~lib/collector/itcm/state - tee_local $0 + global.get $~lib/collector/itcm/state + local.tee $0 if - get_local $0 + 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 - set_global $~lib/collector/itcm/fromSpace - get_global $~lib/collector/itcm/fromSpace - tee_local $0 + global.set $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace + local.tee $0 i32.const -1 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 i32.const 16 call $~lib/allocator/arena/__memory_allocate - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/toSpace - tee_local $0 + global.set $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace + local.tee $0 i32.const -1 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/iter i32.const 1 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end - get_global $std/gc-array/arr + global.get $std/gc-array/arr i32.const 3 call_indirect (type $iv) i32.const 2 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state br $break|0 end - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter i32.load i32.const -4 i32.and - tee_local $0 - get_global $~lib/collector/itcm/toSpace + local.tee $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $~lib/collector/itcm/white + local.get $0 + global.set $~lib/collector/itcm/iter + local.get $0 + global.get $~lib/collector/itcm/white i32.eqz - get_local $0 + local.get $0 i32.load i32.const -4 i32.and i32.or i32.store i32.const 1 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.const 16 i32.add - get_local $0 + local.get $0 i32.load offset=8 call_indirect (type $iv) else - get_global $std/gc-array/arr + global.get $std/gc-array/arr i32.const 3 call_indirect (type $iv) - get_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter i32.load i32.const -4 i32.and i32.eq if - get_global $~lib/collector/itcm/fromSpace - set_local $0 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/fromSpace - get_local $0 - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/white + 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 - set_global $~lib/collector/itcm/white - get_local $0 + global.set $~lib/collector/itcm/white + local.get $0 i32.load i32.const -4 i32.and - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter i32.const 3 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end end br $break|0 end - get_global $~lib/collector/itcm/iter - tee_local $0 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter + local.tee $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 + local.get $0 i32.load i32.const -4 i32.and - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter else - get_global $~lib/collector/itcm/toSpace - tee_local $0 - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.tee $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 i32.const 1 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end end ) @@ -357,11 +357,11 @@ (local $0 i32) block $break|0 block $case1|0 - get_global $~lib/collector/itcm/state - tee_local $0 + global.get $~lib/collector/itcm/state + local.tee $0 i32.eqz br_if $case1|0 - get_local $0 + local.get $0 i32.const 1 i32.eq br_if $case1|0 @@ -370,7 +370,7 @@ call $~lib/collector/itcm/step end loop $continue|1 - get_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/state i32.const 1 i32.ne if @@ -381,38 +381,38 @@ ) (func $~lib/collector/itcm/__gc_allocate (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 1073741808 i32.gt_u if unreachable end call $~lib/collector/itcm/step - get_local $0 + local.get $0 i32.const 16 i32.add call $~lib/allocator/arena/__memory_allocate - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.store offset=8 - get_local $2 - get_global $~lib/collector/itcm/white - get_local $2 + local.get $2 + global.get $~lib/collector/itcm/white + local.get $2 i32.load i32.const -4 i32.and i32.or i32.store - get_global $~lib/collector/itcm/fromSpace - get_local $2 + global.get $~lib/collector/itcm/fromSpace + local.get $2 call $~lib/collector/itcm/ManagedObjectList#push - get_local $2 + local.get $2 i32.const 16 i32.add ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 11 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -425,7 +425,7 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz @@ -433,904 +433,904 @@ i32.shl i32.const 6 call $~lib/collector/itcm/__gc_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memcpy (; 12 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -1338,156 +1338,156 @@ (func $~lib/internal/memory/memmove (; 13 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1495,18 +1495,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1515,16 +1515,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1535,219 +1535,219 @@ ) (func $~lib/internal/memory/memset (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end @@ -1755,13 +1755,13 @@ (func $~lib/internal/arraybuffer/reallocateUnsafe (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.gt_s if - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_s if @@ -1772,10 +1772,10 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.const 32 - get_local $2 + local.get $2 i32.const 7 i32.add i32.clz @@ -1785,38 +1785,38 @@ i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $3 + local.tee $3 i32.const 8 i32.add - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 call $~lib/internal/memory/memmove - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.lt_s if @@ -1827,29 +1827,29 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/collector/itcm/__gc_link (; 16 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_global $~lib/collector/itcm/white + global.get $~lib/collector/itcm/white i32.eqz - get_local $0 + local.get $0 i32.const 16 i32.sub - tee_local $2 + local.tee $2 i32.load i32.const 3 i32.and i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $~lib/collector/itcm/white - get_local $1 + global.get $~lib/collector/itcm/white + local.get $1 i32.const 16 i32.sub i32.load @@ -1857,26 +1857,26 @@ i32.and i32.eq else - get_local $0 + local.get $0 end if - get_local $2 + local.get $2 call $~lib/collector/itcm/ManagedObject#makeGray end ) (func $~lib/array/Array#__set (; 17 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.load i32.const 2 i32.shr_u i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -1887,65 +1887,65 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $3 - get_local $1 + local.get $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $3 + local.tee $3 i32.store - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=4 end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $2 + local.get $2 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/collector/itcm/__gc_link ) (func $std/gc-array/main (; 18 ;) (type $i) (result i32) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end i32.const 0 ) (func $start (; 19 ;) (type $v) i32.const 184 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state call $~lib/collector/itcm/__gc_collect - get_global $std/gc-array/arr + 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 - get_global $std/gc-array/arr + 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 - get_global $std/gc-array/arr + global.get $std/gc-array/arr i32.const 0 i32.const 0 i32.const 4 diff --git a/tests/compiler/std/gc-array.untouched.wat b/tests/compiler/std/gc-array.untouched.wat index 61132e98..6c86ab95 100644 --- a/tests/compiler/std/gc-array.untouched.wat +++ b/tests/compiler/std/gc-array.untouched.wat @@ -13,7 +13,7 @@ (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 anyfunc) + (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/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -42,22 +42,22 @@ (export "table" (table $0)) (export "main" (func $std/gc-array/main)) (func $~lib/arraybuffer/ArrayBuffer~gc (; 1 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $~lib/collector/itcm/ManagedObject#get:color (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load i32.const 3 i32.and ) (func $~lib/collector/itcm/ManagedObject#get:next (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load i32.const 3 i32.const -1 @@ -65,9 +65,9 @@ i32.and ) (func $~lib/collector/itcm/ManagedObject#set:next (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 - get_local $0 + local.get $0 + local.get $1 + local.get $0 i32.load i32.const 3 i32.and @@ -77,53 +77,53 @@ (func $~lib/collector/itcm/ManagedObject#unlink (; 5 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#get:next - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/collector/itcm/ManagedObject#set:next ) (func $~lib/collector/itcm/ManagedObjectList#push (; 6 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $0 + local.set $2 + local.get $1 + local.get $0 call $~lib/collector/itcm/ManagedObject#set:next - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/collector/itcm/ManagedObject#set:next - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#makeGray (; 7 ;) (type $iv) (param $0 i32) - get_local $0 - get_global $~lib/collector/itcm/iter + local.get $0 + global.get $~lib/collector/itcm/iter i32.eq if - get_local $0 + local.get $0 i32.load offset=4 - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter end - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#unlink - get_global $~lib/collector/itcm/toSpace - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.get $0 call $~lib/collector/itcm/ManagedObjectList#push - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 3 i32.const -1 @@ -135,20 +135,20 @@ ) (func $~lib/collector/itcm/__gc_mark (; 8 ;) (type $iv) (param $0 i32) (local $1 i32) - get_local $0 + local.get $0 if block $~lib/collector/itcm/refToObj|inlined.0 (result i32) - get_local $0 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub end - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#get:color - get_global $~lib/collector/itcm/white + global.get $~lib/collector/itcm/white i32.eq if - get_local $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#makeGray end end @@ -157,34 +157,34 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/collector/itcm/__gc_mark i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 i32.const 2 i32.shl - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_u if block - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load offset=8 call $~lib/collector/itcm/__gc_mark - get_local $2 + local.get $2 i32.const 4 i32.add - set_local $2 + local.set $2 end br $continue|0 end @@ -198,41 +198,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -242,22 +242,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -266,27 +266,27 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/collector/itcm/ManagedObjectList#clear (; 11 ;) (type $iv) (param $0 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#set:color (; 12 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 3 i32.const -1 i32.xor i32.and - get_local $1 + local.get $1 i32.or i32.store ) @@ -301,117 +301,117 @@ block $case2|0 block $case1|0 block $case0|0 - get_global $~lib/collector/itcm/state - set_local $1 - get_local $1 - get_global $~lib/collector/itcm/State.INIT + global.get $~lib/collector/itcm/state + local.set $1 + local.get $1 + global.get $~lib/collector/itcm/State.INIT i32.eq br_if $case0|0 - get_local $1 - get_global $~lib/collector/itcm/State.IDLE + local.get $1 + global.get $~lib/collector/itcm/State.IDLE i32.eq br_if $case1|0 - get_local $1 - get_global $~lib/collector/itcm/State.MARK + local.get $1 + global.get $~lib/collector/itcm/State.MARK i32.eq br_if $case2|0 - get_local $1 - get_global $~lib/collector/itcm/State.SWEEP + local.get $1 + global.get $~lib/collector/itcm/State.SWEEP i32.eq br_if $case3|0 br $break|0 end block block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - set_local $1 - get_local $1 + global.get $~lib/collector/itcm/HEADER_SIZE + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_global $~lib/collector/itcm/fromSpace - get_global $~lib/collector/itcm/fromSpace + global.set $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace i32.const -1 i32.store offset=8 - get_global $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace call $~lib/collector/itcm/ManagedObjectList#clear block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - set_local $1 - get_local $1 + global.get $~lib/collector/itcm/HEADER_SIZE + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace i32.const -1 i32.store offset=8 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace call $~lib/collector/itcm/ManagedObjectList#clear - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/iter - get_global $~lib/collector/itcm/State.IDLE - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/State.IDLE + global.set $~lib/collector/itcm/state end end block i32.const 3 call $~iterateRoots - get_global $~lib/collector/itcm/State.MARK - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.MARK + global.set $~lib/collector/itcm/state br $break|0 unreachable end unreachable end block - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter call $~lib/collector/itcm/ManagedObject#get:next - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $~lib/collector/itcm/white + 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 - set_global $~argc + global.set $~argc block $~lib/collector/itcm/objToRef|inlined.0 (result i32) - get_local $0 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/collector/itcm/HEADER_SIZE i32.add end - get_local $0 + local.get $0 i32.load offset=8 call_indirect (type $iv) else i32.const 3 call $~iterateRoots - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter call $~lib/collector/itcm/ManagedObject#get:next - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.eq if - get_global $~lib/collector/itcm/fromSpace - set_local $1 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/fromSpace - get_local $1 - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/white + 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 - set_global $~lib/collector/itcm/white - get_local $1 + global.set $~lib/collector/itcm/white + local.get $1 call $~lib/collector/itcm/ManagedObject#get:next - set_global $~lib/collector/itcm/iter - get_global $~lib/collector/itcm/State.SWEEP - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/State.SWEEP + global.set $~lib/collector/itcm/state end end br $break|0 @@ -420,22 +420,22 @@ unreachable end block - get_global $~lib/collector/itcm/iter - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#get:next - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $HEAP_BASE + global.set $~lib/collector/itcm/iter + local.get $0 + global.get $HEAP_BASE i32.ge_u if block $~lib/memory/memory.free|inlined.0 block - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable @@ -444,10 +444,10 @@ end end else - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace call $~lib/collector/itcm/ManagedObjectList#clear - get_global $~lib/collector/itcm/State.IDLE - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.IDLE + global.set $~lib/collector/itcm/state end br $break|0 unreachable @@ -460,14 +460,14 @@ block $break|0 block $case1|0 block $case0|0 - get_global $~lib/collector/itcm/state - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/State.INIT + global.get $~lib/collector/itcm/state + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/State.INIT i32.eq br_if $case0|0 - get_local $0 - get_global $~lib/collector/itcm/State.IDLE + local.get $0 + global.get $~lib/collector/itcm/State.IDLE i32.eq br_if $case1|0 br $break|0 @@ -477,8 +477,8 @@ end block $break|1 loop $continue|1 - get_global $~lib/collector/itcm/state - get_global $~lib/collector/itcm/State.IDLE + global.get $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.IDLE i32.ne if call $~lib/collector/itcm/step @@ -494,9 +494,9 @@ (func $~lib/collector/itcm/__gc_allocate (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub i32.gt_u if @@ -504,53 +504,53 @@ end call $~lib/collector/itcm/step block $~lib/memory/memory.allocate|inlined.2 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - get_local $0 + global.get $~lib/collector/itcm/HEADER_SIZE + local.get $0 i32.add - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.2 end - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store offset=8 - get_local $3 - get_global $~lib/collector/itcm/white + local.get $3 + global.get $~lib/collector/itcm/white call $~lib/collector/itcm/ManagedObject#set:color - get_global $~lib/collector/itcm/fromSpace - get_local $3 + global.get $~lib/collector/itcm/fromSpace + local.get $3 call $~lib/collector/itcm/ManagedObjectList#push block $~lib/collector/itcm/objToRef|inlined.1 (result i32) - get_local $3 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $3 + global.get $~lib/collector/itcm/HEADER_SIZE i32.add end ) (func $std/gc-array/Foo~gc (; 18 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $~lib/string/String~gc (; 19 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $~lib/internal/arraybuffer/computeSize (; 20 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -563,8 +563,8 @@ ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 22 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -575,15 +575,15 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize i32.const 6 call $~lib/collector/itcm/__gc_allocate - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memcpy (; 23 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -591,44 +591,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -636,141 +636,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -778,167 +778,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -950,130 +950,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -1085,112 +1085,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -1202,585 +1202,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -1788,77 +1788,77 @@ ) (func $~lib/internal/memory/memmove (; 24 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -1869,27 +1869,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -1898,67 +1898,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1969,20 +1969,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1994,16 +1994,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2017,250 +2017,250 @@ (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -2272,15 +2272,15 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.gt_s if - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_s i32.eqz if @@ -2291,57 +2291,57 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/internal/arraybuffer/computeSize - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memmove - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $2 + local.get $2 i32.add - set_local $3 + local.set $3 i32.const 0 - set_local $5 - get_local $1 - get_local $2 + local.set $5 + local.get $1 + local.get $2 i32.sub - set_local $4 - get_local $3 - get_local $5 - get_local $4 + local.set $4 + local.get $3 + local.get $5 + local.get $4 call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.ge_s i32.eqz @@ -2353,42 +2353,42 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/collector/itcm/__gc_link (; 27 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) block $~lib/collector/itcm/refToObj|inlined.1 (result i32) - get_local $0 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub end - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/collector/itcm/ManagedObject#get:color - get_global $~lib/collector/itcm/white + global.get $~lib/collector/itcm/white i32.eqz i32.eq - tee_local $3 + local.tee $3 if (result i32) block $~lib/collector/itcm/refToObj|inlined.3 (result i32) - get_local $1 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $1 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub end call $~lib/collector/itcm/ManagedObject#get:color - get_global $~lib/collector/itcm/white + global.get $~lib/collector/itcm/white i32.eq else - get_local $3 + local.get $3 end if - get_local $2 + local.get $2 call $~lib/collector/itcm/ManagedObject#makeGray end ) @@ -2396,19 +2396,19 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -2419,45 +2419,45 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/collector/itcm/__gc_link ) (func $std/gc-array/main (; 29 ;) (type $i) (result i32) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end i32.const 0 ) @@ -2465,49 +2465,49 @@ (local $0 i32) (local $1 i32) (local $2 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $~lib/collector/itcm/State.INIT - set_global $~lib/collector/itcm/state + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $~lib/collector/itcm/State.INIT + global.set $~lib/collector/itcm/state call $~lib/gc/gc.collect - get_global $std/gc-array/arr + global.get $std/gc-array/arr i32.const 0 block (result i32) i32.const 0 i32.const 4 call $~lib/collector/itcm/__gc_allocate - set_local $0 - get_local $0 + local.set $0 + local.get $0 end call $~lib/array/Array#__set call $~lib/gc/gc.collect - get_global $std/gc-array/arr + global.get $std/gc-array/arr i32.const 1 block (result i32) i32.const 0 i32.const 4 call $~lib/collector/itcm/__gc_allocate - set_local $1 - get_local $1 + local.set $1 + local.get $1 end call $~lib/array/Array#__set call $~lib/gc/gc.collect - get_global $std/gc-array/arr + global.get $std/gc-array/arr i32.const 0 block (result i32) i32.const 0 i32.const 4 call $~lib/collector/itcm/__gc_allocate - set_local $2 - get_local $2 + local.set $2 + local.get $2 end call $~lib/array/Array#__set call $~lib/gc/gc.collect @@ -2515,8 +2515,8 @@ (func $null (; 31 ;) (type $v) ) (func $~iterateRoots (; 32 ;) (type $iv) (param $0 i32) - get_global $std/gc-array/arr - get_local $0 + global.get $std/gc-array/arr + local.get $0 call_indirect (type $iv) ) ) diff --git a/tests/compiler/std/gc-basics.optimized.wat b/tests/compiler/std/gc-basics.optimized.wat index d28a18ae..c48338aa 100644 --- a/tests/compiler/std/gc-basics.optimized.wat +++ b/tests/compiler/std/gc-basics.optimized.wat @@ -9,7 +9,7 @@ (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 anyfunc) + (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)) @@ -32,17 +32,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -51,16 +51,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -68,16 +68,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -86,71 +86,71 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/collector/itcm/ManagedObjectList#push (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $1 + local.set $2 + local.get $1 + local.get $1 i32.load i32.const 3 i32.and - get_local $0 + local.get $0 i32.or i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load i32.const 3 i32.and - get_local $1 + local.get $1 i32.or i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#makeGray (; 4 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_global $~lib/collector/itcm/iter - get_local $0 + global.get $~lib/collector/itcm/iter + local.get $0 i32.eq if - get_local $0 + local.get $0 i32.load offset=4 - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter end - get_local $0 + local.get $0 i32.load i32.const -4 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=4 - tee_local $1 + local.tee $1 i32.store offset=4 - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load i32.const 3 i32.and - get_local $2 + local.get $2 i32.or i32.store - get_global $~lib/collector/itcm/toSpace - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.get $0 call $~lib/collector/itcm/ManagedObjectList#push - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const -4 i32.and @@ -160,19 +160,19 @@ ) (func $~lib/collector/itcm/__gc_mark (; 5 ;) (type $iv) (param $0 i32) (local $1 i32) - get_local $0 + local.get $0 if - get_global $~lib/collector/itcm/white - get_local $0 + global.get $~lib/collector/itcm/white + local.get $0 i32.const 16 i32.sub - tee_local $1 + local.tee $1 i32.load i32.const 3 i32.and i32.eq if - get_local $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#makeGray end end @@ -183,136 +183,136 @@ block $case3|0 block $case2|0 block $case1|0 - get_global $~lib/collector/itcm/state - tee_local $0 + global.get $~lib/collector/itcm/state + local.tee $0 if - get_local $0 + 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 - set_global $~lib/collector/itcm/fromSpace - get_global $~lib/collector/itcm/fromSpace - tee_local $0 + global.set $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace + local.tee $0 i32.const -1 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 i32.const 16 call $~lib/allocator/arena/__memory_allocate - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/toSpace - tee_local $0 + global.set $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace + local.tee $0 i32.const -1 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/iter i32.const 1 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end - get_global $std/gc-basics/obj + global.get $std/gc-basics/obj i32.const 2 call_indirect (type $iv) - get_global $std/gc-basics/obj2 + global.get $std/gc-basics/obj2 i32.const 2 call_indirect (type $iv) i32.const 2 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state br $break|0 end - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter i32.load i32.const -4 i32.and - tee_local $0 - get_global $~lib/collector/itcm/toSpace + local.tee $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $~lib/collector/itcm/white + local.get $0 + global.set $~lib/collector/itcm/iter + local.get $0 + global.get $~lib/collector/itcm/white i32.eqz - get_local $0 + local.get $0 i32.load i32.const -4 i32.and i32.or i32.store i32.const 1 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.const 16 i32.add - get_local $0 + local.get $0 i32.load offset=8 call_indirect (type $iv) else - get_global $std/gc-basics/obj + global.get $std/gc-basics/obj i32.const 2 call_indirect (type $iv) - get_global $std/gc-basics/obj2 + global.get $std/gc-basics/obj2 i32.const 2 call_indirect (type $iv) - get_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter i32.load i32.const -4 i32.and i32.eq if - get_global $~lib/collector/itcm/fromSpace - set_local $0 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/fromSpace - get_local $0 - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/white + 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 - set_global $~lib/collector/itcm/white - get_local $0 + global.set $~lib/collector/itcm/white + local.get $0 i32.load i32.const -4 i32.and - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter i32.const 3 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end end br $break|0 end - get_global $~lib/collector/itcm/iter - tee_local $0 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter + local.tee $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 + local.get $0 i32.load i32.const -4 i32.and - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter else - get_global $~lib/collector/itcm/toSpace - tee_local $0 - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.tee $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 i32.const 1 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end end ) @@ -321,42 +321,42 @@ call $~lib/collector/itcm/step i32.const 20 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 1 i32.store offset=8 - get_local $0 - get_global $~lib/collector/itcm/white - get_local $0 + local.get $0 + global.get $~lib/collector/itcm/white + local.get $0 i32.load i32.const -4 i32.and i32.or i32.store - get_global $~lib/collector/itcm/fromSpace - get_local $0 + global.get $~lib/collector/itcm/fromSpace + local.get $0 call $~lib/collector/itcm/ManagedObjectList#push - get_local $0 + local.get $0 i32.const 16 i32.add ) (func $~lib/string/String~gc (; 8 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $~lib/collector/itcm/__gc_collect (; 9 ;) (type $v) (local $0 i32) block $break|0 block $case1|0 - get_global $~lib/collector/itcm/state - tee_local $0 + global.get $~lib/collector/itcm/state + local.tee $0 i32.eqz br_if $case1|0 - get_local $0 + local.get $0 i32.const 1 i32.eq br_if $case1|0 @@ -365,7 +365,7 @@ call $~lib/collector/itcm/step end loop $continue|1 - get_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/state i32.const 1 i32.ne if @@ -375,12 +375,12 @@ end ) (func $std/gc-basics/main (; 10 ;) (type $i) (result i32) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end i32.const 0 ) @@ -390,46 +390,46 @@ (local $2 i32) (local $3 i32) i32.const 64 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state call $~lib/collector/itcm/__gc_allocate - set_global $std/gc-basics/obj - get_global $std/gc-basics/obj - tee_local $0 + global.set $std/gc-basics/obj + global.get $std/gc-basics/obj + local.tee $0 i32.const 123 i32.store - get_local $0 + local.get $0 i32.const 16 i32.sub - tee_local $1 + local.tee $1 i32.load offset=4 - set_local $2 + local.set $2 block (result i32) - get_local $1 + local.get $1 i32.load i32.const -4 i32.and - tee_local $3 + local.tee $3 i32.const 0 i32.ne - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.const 0 i32.ne - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -440,7 +440,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 i32.const 1 i32.ne @@ -452,7 +452,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=12 if i32.const 0 @@ -462,7 +462,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=16 i32.const 123 i32.ne @@ -476,7 +476,7 @@ end call $~lib/collector/itcm/__gc_collect i32.const 0 - set_global $std/gc-basics/obj + global.set $std/gc-basics/obj call $~lib/collector/itcm/__gc_collect ) (func $null (; 12 ;) (type $v) diff --git a/tests/compiler/std/gc-basics.untouched.wat b/tests/compiler/std/gc-basics.untouched.wat index c59c3444..c24b1992 100644 --- a/tests/compiler/std/gc-basics.untouched.wat +++ b/tests/compiler/std/gc-basics.untouched.wat @@ -9,7 +9,7 @@ (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 anyfunc) + (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/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -46,41 +46,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -90,22 +90,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -114,26 +114,26 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/collector/itcm/ManagedObjectList#clear (; 3 ;) (type $iv) (param $0 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#get:color (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load i32.const 3 i32.and ) (func $~lib/collector/itcm/ManagedObject#get:next (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load i32.const 3 i32.const -1 @@ -141,9 +141,9 @@ i32.and ) (func $~lib/collector/itcm/ManagedObject#set:next (; 6 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 - get_local $0 + local.get $0 + local.get $1 + local.get $0 i32.load i32.const 3 i32.and @@ -153,53 +153,53 @@ (func $~lib/collector/itcm/ManagedObject#unlink (; 7 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#get:next - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/collector/itcm/ManagedObject#set:next ) (func $~lib/collector/itcm/ManagedObjectList#push (; 8 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $0 + local.set $2 + local.get $1 + local.get $0 call $~lib/collector/itcm/ManagedObject#set:next - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/collector/itcm/ManagedObject#set:next - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#makeGray (; 9 ;) (type $iv) (param $0 i32) - get_local $0 - get_global $~lib/collector/itcm/iter + local.get $0 + global.get $~lib/collector/itcm/iter i32.eq if - get_local $0 + local.get $0 i32.load offset=4 - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter end - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#unlink - get_global $~lib/collector/itcm/toSpace - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.get $0 call $~lib/collector/itcm/ManagedObjectList#push - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 3 i32.const -1 @@ -211,33 +211,33 @@ ) (func $~lib/collector/itcm/__gc_mark (; 10 ;) (type $iv) (param $0 i32) (local $1 i32) - get_local $0 + local.get $0 if block $~lib/collector/itcm/refToObj|inlined.0 (result i32) - get_local $0 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub end - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#get:color - get_global $~lib/collector/itcm/white + global.get $~lib/collector/itcm/white i32.eq if - get_local $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#makeGray end end ) (func $~lib/collector/itcm/ManagedObject#set:color (; 11 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 3 i32.const -1 i32.xor i32.and - get_local $1 + local.get $1 i32.or i32.store ) @@ -252,117 +252,117 @@ block $case2|0 block $case1|0 block $case0|0 - get_global $~lib/collector/itcm/state - set_local $1 - get_local $1 - get_global $~lib/collector/itcm/State.INIT + global.get $~lib/collector/itcm/state + local.set $1 + local.get $1 + global.get $~lib/collector/itcm/State.INIT i32.eq br_if $case0|0 - get_local $1 - get_global $~lib/collector/itcm/State.IDLE + local.get $1 + global.get $~lib/collector/itcm/State.IDLE i32.eq br_if $case1|0 - get_local $1 - get_global $~lib/collector/itcm/State.MARK + local.get $1 + global.get $~lib/collector/itcm/State.MARK i32.eq br_if $case2|0 - get_local $1 - get_global $~lib/collector/itcm/State.SWEEP + local.get $1 + global.get $~lib/collector/itcm/State.SWEEP i32.eq br_if $case3|0 br $break|0 end block block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - set_local $1 - get_local $1 + global.get $~lib/collector/itcm/HEADER_SIZE + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_global $~lib/collector/itcm/fromSpace - get_global $~lib/collector/itcm/fromSpace + global.set $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace i32.const -1 i32.store offset=8 - get_global $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace call $~lib/collector/itcm/ManagedObjectList#clear block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - set_local $1 - get_local $1 + global.get $~lib/collector/itcm/HEADER_SIZE + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace i32.const -1 i32.store offset=8 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace call $~lib/collector/itcm/ManagedObjectList#clear - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/iter - get_global $~lib/collector/itcm/State.IDLE - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/State.IDLE + global.set $~lib/collector/itcm/state end end block i32.const 2 call $~iterateRoots - get_global $~lib/collector/itcm/State.MARK - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.MARK + global.set $~lib/collector/itcm/state br $break|0 unreachable end unreachable end block - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter call $~lib/collector/itcm/ManagedObject#get:next - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $~lib/collector/itcm/white + 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 - set_global $~argc + global.set $~argc block $~lib/collector/itcm/objToRef|inlined.0 (result i32) - get_local $0 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/collector/itcm/HEADER_SIZE i32.add end - get_local $0 + local.get $0 i32.load offset=8 call_indirect (type $iv) else i32.const 2 call $~iterateRoots - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter call $~lib/collector/itcm/ManagedObject#get:next - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.eq if - get_global $~lib/collector/itcm/fromSpace - set_local $1 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/fromSpace - get_local $1 - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/white + 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 - set_global $~lib/collector/itcm/white - get_local $1 + global.set $~lib/collector/itcm/white + local.get $1 call $~lib/collector/itcm/ManagedObject#get:next - set_global $~lib/collector/itcm/iter - get_global $~lib/collector/itcm/State.SWEEP - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/State.SWEEP + global.set $~lib/collector/itcm/state end end br $break|0 @@ -371,22 +371,22 @@ unreachable end block - get_global $~lib/collector/itcm/iter - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#get:next - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $HEAP_BASE + global.set $~lib/collector/itcm/iter + local.get $0 + global.get $HEAP_BASE i32.ge_u if block $~lib/memory/memory.free|inlined.0 block - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable @@ -395,10 +395,10 @@ end end else - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace call $~lib/collector/itcm/ManagedObjectList#clear - get_global $~lib/collector/itcm/State.IDLE - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.IDLE + global.set $~lib/collector/itcm/state end br $break|0 unreachable @@ -409,9 +409,9 @@ (func $~lib/collector/itcm/__gc_allocate (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub i32.gt_u if @@ -419,37 +419,37 @@ end call $~lib/collector/itcm/step block $~lib/memory/memory.allocate|inlined.2 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - get_local $0 + global.get $~lib/collector/itcm/HEADER_SIZE + local.get $0 i32.add - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.2 end - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store offset=8 - get_local $3 - get_global $~lib/collector/itcm/white + local.get $3 + global.get $~lib/collector/itcm/white call $~lib/collector/itcm/ManagedObject#set:color - get_global $~lib/collector/itcm/fromSpace - get_local $3 + global.get $~lib/collector/itcm/fromSpace + local.get $3 call $~lib/collector/itcm/ManagedObjectList#push block $~lib/collector/itcm/objToRef|inlined.1 (result i32) - get_local $3 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $3 + global.get $~lib/collector/itcm/HEADER_SIZE i32.add end ) (func $~lib/string/String~gc (; 15 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $~lib/collector/itcm/__gc_collect (; 16 ;) (type $v) @@ -457,14 +457,14 @@ block $break|0 block $case1|0 block $case0|0 - get_global $~lib/collector/itcm/state - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/State.INIT + global.get $~lib/collector/itcm/state + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/State.INIT i32.eq br_if $case0|0 - get_local $0 - get_global $~lib/collector/itcm/State.IDLE + local.get $0 + global.get $~lib/collector/itcm/State.IDLE i32.eq br_if $case1|0 br $break|0 @@ -474,8 +474,8 @@ end block $break|1 loop $continue|1 - get_global $~lib/collector/itcm/state - get_global $~lib/collector/itcm/State.IDLE + global.get $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.IDLE i32.ne if call $~lib/collector/itcm/step @@ -489,12 +489,12 @@ return ) (func $std/gc-basics/main (; 18 ;) (type $i) (result i32) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end i32.const 0 ) @@ -505,58 +505,58 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $~lib/collector/itcm/State.INIT - set_global $~lib/collector/itcm/state + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $~lib/collector/itcm/State.INIT + global.set $~lib/collector/itcm/state i32.const 4 i32.const 1 call $~lib/collector/itcm/__gc_allocate - set_global $std/gc-basics/obj - get_global $std/gc-basics/obj + global.set $std/gc-basics/obj + global.get $std/gc-basics/obj i32.const 123 i32.store block - get_global $std/gc-basics/obj + global.get $std/gc-basics/obj i32.const 16 i32.sub - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.load i32.const 3 i32.const -1 i32.xor i32.and - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 i32.ne - tee_local $3 + local.tee $3 if (result i32) - get_local $2 + local.get $2 i32.const 0 i32.ne else - get_local $3 + local.get $3 end - tee_local $3 + local.tee $3 if (result i32) - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.eq else - get_local $3 + local.get $3 end i32.eqz if @@ -567,10 +567,10 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.eq i32.eqz @@ -582,10 +582,10 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=12 - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 0 i32.eq i32.eqz @@ -597,10 +597,10 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=16 - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 123 i32.eq i32.eqz @@ -615,17 +615,17 @@ end call $~lib/gc/gc.collect i32.const 0 - set_global $std/gc-basics/obj + global.set $std/gc-basics/obj call $~lib/gc/gc.collect ) (func $null (; 20 ;) (type $v) ) (func $~iterateRoots (; 21 ;) (type $iv) (param $0 i32) - get_global $std/gc-basics/obj - get_local $0 + global.get $std/gc-basics/obj + local.get $0 call_indirect (type $iv) - get_global $std/gc-basics/obj2 - get_local $0 + global.get $std/gc-basics/obj2 + local.get $0 call_indirect (type $iv) ) ) diff --git a/tests/compiler/std/gc-integration.optimized.wat b/tests/compiler/std/gc-integration.optimized.wat index c5faa5a8..3a609e04 100644 --- a/tests/compiler/std/gc-integration.optimized.wat +++ b/tests/compiler/std/gc-integration.optimized.wat @@ -5,7 +5,7 @@ (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 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $start~anonymous|1) (global $std/gc-integration/B.d (mut i32) (i32.const 16)) (global $std/gc-integration/a_ref (mut i32) (i32.const 24)) @@ -15,12 +15,12 @@ (export "table" (table $0)) (start $start) (func $start~anonymous|1 (; 1 ;) (type $iv) (param $0 i32) - get_global $std/gc-integration/i + global.get $std/gc-integration/i i32.const 1 i32.add - set_global $std/gc-integration/i - get_local $0 - get_global $std/gc-integration/i + global.set $std/gc-integration/i + local.get $0 + global.get $std/gc-integration/i i32.const 3 i32.shl i32.ne @@ -37,16 +37,16 @@ i32.const 8 i32.const 1 call_indirect (type $iv) - get_global $std/gc-integration/B.d + global.get $std/gc-integration/B.d i32.const 1 call_indirect (type $iv) - get_global $std/gc-integration/a_ref + global.get $std/gc-integration/a_ref i32.const 1 call_indirect (type $iv) - get_global $std/gc-integration/b_ref + global.get $std/gc-integration/b_ref i32.const 1 call_indirect (type $iv) - get_global $std/gc-integration/i + global.get $std/gc-integration/i i32.const 4 i32.ne if diff --git a/tests/compiler/std/gc-integration.untouched.wat b/tests/compiler/std/gc-integration.untouched.wat index 78327465..818a037e 100644 --- a/tests/compiler/std/gc-integration.untouched.wat +++ b/tests/compiler/std/gc-integration.untouched.wat @@ -5,7 +5,7 @@ (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 anyfunc) + (table $0 2 funcref) (elem (i32.const 0) $null $start~anonymous|1) (global $std/gc-integration/B.c i32 (i32.const 8)) (global $std/gc-integration/B.d (mut i32) (i32.const 16)) @@ -18,13 +18,13 @@ (export "table" (table $0)) (start $start) (func $start~anonymous|1 (; 1 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 block (result i32) - get_global $std/gc-integration/i + global.get $std/gc-integration/i i32.const 1 i32.add - set_global $std/gc-integration/i - get_global $std/gc-integration/i + global.set $std/gc-integration/i + global.get $std/gc-integration/i end i32.const 3 i32.shl @@ -40,13 +40,13 @@ end ) (func $start (; 2 ;) (type $v) - get_global $std/gc-integration/B.c + global.get $std/gc-integration/B.c drop - get_global $std/gc-integration/B.d + global.get $std/gc-integration/B.d drop i32.const 1 call $~iterateRoots - get_global $std/gc-integration/i + global.get $std/gc-integration/i i32.const 4 i32.eq i32.eqz @@ -62,17 +62,17 @@ (func $null (; 3 ;) (type $v) ) (func $~iterateRoots (; 4 ;) (type $iv) (param $0 i32) - get_global $std/gc-integration/B.c - get_local $0 + global.get $std/gc-integration/B.c + local.get $0 call_indirect (type $iv) - get_global $std/gc-integration/B.d - get_local $0 + global.get $std/gc-integration/B.d + local.get $0 call_indirect (type $iv) - get_global $std/gc-integration/a_ref - get_local $0 + global.get $std/gc-integration/a_ref + local.get $0 call_indirect (type $iv) - get_global $std/gc-integration/b_ref - get_local $0 + global.get $std/gc-integration/b_ref + local.get $0 call_indirect (type $iv) ) ) diff --git a/tests/compiler/std/gc-object.optimized.wat b/tests/compiler/std/gc-object.optimized.wat index 7e7f0ec7..5fb33fb6 100644 --- a/tests/compiler/std/gc-object.optimized.wat +++ b/tests/compiler/std/gc-object.optimized.wat @@ -6,7 +6,7 @@ (type $iiv (func (param i32 i32))) (type $FUNCSIG$i (func (result i32))) (memory $0 0) - (table $0 4 anyfunc) + (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)) @@ -25,17 +25,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -44,16 +44,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -61,16 +61,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -79,71 +79,71 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/collector/itcm/ManagedObjectList#push (; 1 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $1 + local.set $2 + local.get $1 + local.get $1 i32.load i32.const 3 i32.and - get_local $0 + local.get $0 i32.or i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load i32.const 3 i32.and - get_local $1 + local.get $1 i32.or i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#makeGray (; 2 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_global $~lib/collector/itcm/iter - get_local $0 + global.get $~lib/collector/itcm/iter + local.get $0 i32.eq if - get_local $0 + local.get $0 i32.load offset=4 - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter end - get_local $0 + local.get $0 i32.load i32.const -4 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=4 - tee_local $1 + local.tee $1 i32.store offset=4 - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load i32.const 3 i32.and - get_local $2 + local.get $2 i32.or i32.store - get_global $~lib/collector/itcm/toSpace - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.get $0 call $~lib/collector/itcm/ManagedObjectList#push - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const -4 i32.and @@ -153,19 +153,19 @@ ) (func $~lib/collector/itcm/__gc_mark (; 3 ;) (type $iv) (param $0 i32) (local $1 i32) - get_local $0 + local.get $0 if - get_global $~lib/collector/itcm/white - get_local $0 + global.get $~lib/collector/itcm/white + local.get $0 i32.const 16 i32.sub - tee_local $1 + local.tee $1 i32.load i32.const 3 i32.and i32.eq if - get_local $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#makeGray end end @@ -176,186 +176,186 @@ block $case3|0 block $case2|0 block $case1|0 - get_global $~lib/collector/itcm/state - tee_local $0 + global.get $~lib/collector/itcm/state + local.tee $0 if - get_local $0 + 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 - set_global $~lib/collector/itcm/fromSpace - get_global $~lib/collector/itcm/fromSpace - tee_local $0 + global.set $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace + local.tee $0 i32.const -1 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 i32.const 16 call $~lib/allocator/arena/__memory_allocate - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/toSpace - tee_local $0 + global.set $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace + local.tee $0 i32.const -1 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/iter i32.const 1 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end - get_global $std/gc-object/obj + global.get $std/gc-object/obj i32.const 1 call_indirect (type $iv) i32.const 2 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state br $break|0 end - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter i32.load i32.const -4 i32.and - tee_local $0 - get_global $~lib/collector/itcm/toSpace + local.tee $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $~lib/collector/itcm/white + local.get $0 + global.set $~lib/collector/itcm/iter + local.get $0 + global.get $~lib/collector/itcm/white i32.eqz - get_local $0 + local.get $0 i32.load i32.const -4 i32.and i32.or i32.store i32.const 1 - set_global $~argc - get_local $0 + global.set $~argc + local.get $0 i32.const 16 i32.add - get_local $0 + local.get $0 i32.load offset=8 call_indirect (type $iv) else - get_global $std/gc-object/obj + global.get $std/gc-object/obj i32.const 1 call_indirect (type $iv) - get_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter i32.load i32.const -4 i32.and i32.eq if - get_global $~lib/collector/itcm/fromSpace - set_local $0 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/fromSpace - get_local $0 - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/white + 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 - set_global $~lib/collector/itcm/white - get_local $0 + global.set $~lib/collector/itcm/white + local.get $0 i32.load i32.const -4 i32.and - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter i32.const 3 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end end br $break|0 end - get_global $~lib/collector/itcm/iter - tee_local $0 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter + local.tee $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 + local.get $0 i32.load i32.const -4 i32.and - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter else - get_global $~lib/collector/itcm/toSpace - tee_local $0 - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.tee $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 i32.const 1 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state end end ) (func $~lib/collector/itcm/__gc_allocate (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 1073741808 i32.gt_u if unreachable end call $~lib/collector/itcm/step - get_local $0 + local.get $0 i32.const 16 i32.add call $~lib/allocator/arena/__memory_allocate - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.store offset=8 - get_local $2 - get_global $~lib/collector/itcm/white - get_local $2 + local.get $2 + global.get $~lib/collector/itcm/white + local.get $2 i32.load i32.const -4 i32.and i32.or i32.store - get_global $~lib/collector/itcm/fromSpace - get_local $2 + global.get $~lib/collector/itcm/fromSpace + local.get $2 call $~lib/collector/itcm/ManagedObjectList#push - get_local $2 + local.get $2 i32.const 16 i32.add ) (func $std/gc-object/Base~gc (; 6 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $std/gc-object/Custom~gc (; 7 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 i32.const 2 call_indirect (type $iv) - get_local $0 + local.get $0 i32.load call $~lib/collector/itcm/__gc_mark - get_local $0 + local.get $0 i32.load offset=4 call $~lib/collector/itcm/__gc_mark ) @@ -364,31 +364,31 @@ i32.const 8 i32.const 3 call $~lib/collector/itcm/__gc_allocate - tee_local $0 + local.tee $0 i32.eqz if i32.const 0 i32.const 2 call $~lib/collector/itcm/__gc_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 ) (func $~lib/collector/itcm/__gc_collect (; 9 ;) (type $v) (local $0 i32) block $break|0 block $case1|0 - get_global $~lib/collector/itcm/state - tee_local $0 + global.get $~lib/collector/itcm/state + local.tee $0 i32.eqz br_if $case1|0 - get_local $0 + local.get $0 i32.const 1 i32.eq br_if $case1|0 @@ -397,7 +397,7 @@ call $~lib/collector/itcm/step end loop $continue|1 - get_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/state i32.const 1 i32.ne if @@ -407,32 +407,32 @@ end ) (func $std/gc-object/main (; 10 ;) (type $v) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end ) (func $start (; 11 ;) (type $v) (local $0 i32) i32.const 8 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/state call $std/gc-object/Custom#constructor - set_global $std/gc-object/obj + global.set $std/gc-object/obj call $~lib/collector/itcm/__gc_collect - get_global $std/gc-object/obj - tee_local $0 - get_local $0 + global.get $std/gc-object/obj + local.tee $0 + local.get $0 i32.store call $~lib/collector/itcm/__gc_collect i32.const 0 - set_global $std/gc-object/obj + global.set $std/gc-object/obj call $~lib/collector/itcm/__gc_collect ) (func $null (; 12 ;) (type $v) diff --git a/tests/compiler/std/gc-object.untouched.wat b/tests/compiler/std/gc-object.untouched.wat index b0b492c7..dc1e1fbf 100644 --- a/tests/compiler/std/gc-object.untouched.wat +++ b/tests/compiler/std/gc-object.untouched.wat @@ -5,7 +5,7 @@ (type $iv (func (param i32))) (type $iiv (func (param i32 i32))) (memory $0 0) - (table $0 4 anyfunc) + (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/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -38,41 +38,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -82,22 +82,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -106,26 +106,26 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/collector/itcm/ManagedObjectList#clear (; 1 ;) (type $iv) (param $0 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#get:color (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load i32.const 3 i32.and ) (func $~lib/collector/itcm/ManagedObject#get:next (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load i32.const 3 i32.const -1 @@ -133,9 +133,9 @@ i32.and ) (func $~lib/collector/itcm/ManagedObject#set:next (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $1 - get_local $0 + local.get $0 + local.get $1 + local.get $0 i32.load i32.const 3 i32.and @@ -145,53 +145,53 @@ (func $~lib/collector/itcm/ManagedObject#unlink (; 5 ;) (type $iv) (param $0 i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#get:next - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/collector/itcm/ManagedObject#set:next ) (func $~lib/collector/itcm/ManagedObjectList#push (; 6 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $1 - get_local $0 + local.set $2 + local.get $1 + local.get $0 call $~lib/collector/itcm/ManagedObject#set:next - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store offset=4 - get_local $2 - get_local $1 + local.get $2 + local.get $1 call $~lib/collector/itcm/ManagedObject#set:next - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 ) (func $~lib/collector/itcm/ManagedObject#makeGray (; 7 ;) (type $iv) (param $0 i32) - get_local $0 - get_global $~lib/collector/itcm/iter + local.get $0 + global.get $~lib/collector/itcm/iter i32.eq if - get_local $0 + local.get $0 i32.load offset=4 - set_global $~lib/collector/itcm/iter + global.set $~lib/collector/itcm/iter end - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#unlink - get_global $~lib/collector/itcm/toSpace - get_local $0 + global.get $~lib/collector/itcm/toSpace + local.get $0 call $~lib/collector/itcm/ManagedObjectList#push - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 3 i32.const -1 @@ -203,33 +203,33 @@ ) (func $~lib/collector/itcm/__gc_mark (; 8 ;) (type $iv) (param $0 i32) (local $1 i32) - get_local $0 + local.get $0 if block $~lib/collector/itcm/refToObj|inlined.0 (result i32) - get_local $0 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub end - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#get:color - get_global $~lib/collector/itcm/white + global.get $~lib/collector/itcm/white i32.eq if - get_local $1 + local.get $1 call $~lib/collector/itcm/ManagedObject#makeGray end end ) (func $~lib/collector/itcm/ManagedObject#set:color (; 9 ;) (type $iiv) (param $0 i32) (param $1 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 3 i32.const -1 i32.xor i32.and - get_local $1 + local.get $1 i32.or i32.store ) @@ -244,117 +244,117 @@ block $case2|0 block $case1|0 block $case0|0 - get_global $~lib/collector/itcm/state - set_local $1 - get_local $1 - get_global $~lib/collector/itcm/State.INIT + global.get $~lib/collector/itcm/state + local.set $1 + local.get $1 + global.get $~lib/collector/itcm/State.INIT i32.eq br_if $case0|0 - get_local $1 - get_global $~lib/collector/itcm/State.IDLE + local.get $1 + global.get $~lib/collector/itcm/State.IDLE i32.eq br_if $case1|0 - get_local $1 - get_global $~lib/collector/itcm/State.MARK + local.get $1 + global.get $~lib/collector/itcm/State.MARK i32.eq br_if $case2|0 - get_local $1 - get_global $~lib/collector/itcm/State.SWEEP + local.get $1 + global.get $~lib/collector/itcm/State.SWEEP i32.eq br_if $case3|0 br $break|0 end block block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - set_local $1 - get_local $1 + global.get $~lib/collector/itcm/HEADER_SIZE + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_global $~lib/collector/itcm/fromSpace - get_global $~lib/collector/itcm/fromSpace + global.set $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace i32.const -1 i32.store offset=8 - get_global $~lib/collector/itcm/fromSpace + global.get $~lib/collector/itcm/fromSpace call $~lib/collector/itcm/ManagedObjectList#clear block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - set_local $1 - get_local $1 + global.get $~lib/collector/itcm/HEADER_SIZE + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace i32.const -1 i32.store offset=8 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace call $~lib/collector/itcm/ManagedObjectList#clear - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/iter - get_global $~lib/collector/itcm/State.IDLE - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/toSpace + global.set $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/State.IDLE + global.set $~lib/collector/itcm/state end end block i32.const 1 call $~iterateRoots - get_global $~lib/collector/itcm/State.MARK - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.MARK + global.set $~lib/collector/itcm/state br $break|0 unreachable end unreachable end block - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter call $~lib/collector/itcm/ManagedObject#get:next - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $~lib/collector/itcm/white + 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 - set_global $~argc + global.set $~argc block $~lib/collector/itcm/objToRef|inlined.0 (result i32) - get_local $0 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/collector/itcm/HEADER_SIZE i32.add end - get_local $0 + local.get $0 i32.load offset=8 call_indirect (type $iv) else i32.const 1 call $~iterateRoots - get_global $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/iter call $~lib/collector/itcm/ManagedObject#get:next - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.eq if - get_global $~lib/collector/itcm/fromSpace - set_local $1 - get_global $~lib/collector/itcm/toSpace - set_global $~lib/collector/itcm/fromSpace - get_local $1 - set_global $~lib/collector/itcm/toSpace - get_global $~lib/collector/itcm/white + 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 - set_global $~lib/collector/itcm/white - get_local $1 + global.set $~lib/collector/itcm/white + local.get $1 call $~lib/collector/itcm/ManagedObject#get:next - set_global $~lib/collector/itcm/iter - get_global $~lib/collector/itcm/State.SWEEP - set_global $~lib/collector/itcm/state + global.set $~lib/collector/itcm/iter + global.get $~lib/collector/itcm/State.SWEEP + global.set $~lib/collector/itcm/state end end br $break|0 @@ -363,22 +363,22 @@ unreachable end block - get_global $~lib/collector/itcm/iter - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/iter + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/toSpace i32.ne if - get_local $0 + local.get $0 call $~lib/collector/itcm/ManagedObject#get:next - set_global $~lib/collector/itcm/iter - get_local $0 - get_global $HEAP_BASE + global.set $~lib/collector/itcm/iter + local.get $0 + global.get $HEAP_BASE i32.ge_u if block $~lib/memory/memory.free|inlined.0 block - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable @@ -387,10 +387,10 @@ end end else - get_global $~lib/collector/itcm/toSpace + global.get $~lib/collector/itcm/toSpace call $~lib/collector/itcm/ManagedObjectList#clear - get_global $~lib/collector/itcm/State.IDLE - set_global $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.IDLE + global.set $~lib/collector/itcm/state end br $break|0 unreachable @@ -401,9 +401,9 @@ (func $~lib/collector/itcm/__gc_allocate (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 + global.get $~lib/collector/itcm/HEADER_SIZE i32.sub i32.gt_u if @@ -411,99 +411,99 @@ end call $~lib/collector/itcm/step block $~lib/memory/memory.allocate|inlined.2 (result i32) - get_global $~lib/collector/itcm/HEADER_SIZE - get_local $0 + global.get $~lib/collector/itcm/HEADER_SIZE + local.get $0 i32.add - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.2 end - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store offset=8 - get_local $3 - get_global $~lib/collector/itcm/white + local.get $3 + global.get $~lib/collector/itcm/white call $~lib/collector/itcm/ManagedObject#set:color - get_global $~lib/collector/itcm/fromSpace - get_local $3 + global.get $~lib/collector/itcm/fromSpace + local.get $3 call $~lib/collector/itcm/ManagedObjectList#push block $~lib/collector/itcm/objToRef|inlined.1 (result i32) - get_local $3 - get_global $~lib/collector/itcm/HEADER_SIZE + local.get $3 + global.get $~lib/collector/itcm/HEADER_SIZE i32.add end ) (func $std/gc-object/Base~gc (; 13 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 call $~lib/collector/itcm/__gc_mark ) (func $std/gc-object/Base#constructor (; 14 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 i32.const 2 call $~lib/collector/itcm/__gc_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 ) (func $std/gc-object/Custom~gc (; 15 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.eqz if return end - get_local $0 + local.get $0 i32.const 2 call_indirect (type $iv) - get_local $0 + local.get $0 i32.load call $~lib/collector/itcm/__gc_mark - get_local $0 + local.get $0 i32.load offset=4 call $~lib/collector/itcm/__gc_mark ) (func $std/gc-object/Custom#constructor (; 16 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 i32.const 3 call $~lib/collector/itcm/__gc_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $std/gc-object/Base#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 ) (func $~lib/collector/itcm/__gc_collect (; 17 ;) (type $v) (local $0 i32) block $break|0 block $case1|0 block $case0|0 - get_global $~lib/collector/itcm/state - set_local $0 - get_local $0 - get_global $~lib/collector/itcm/State.INIT + global.get $~lib/collector/itcm/state + local.set $0 + local.get $0 + global.get $~lib/collector/itcm/State.INIT i32.eq br_if $case0|0 - get_local $0 - get_global $~lib/collector/itcm/State.IDLE + local.get $0 + global.get $~lib/collector/itcm/State.IDLE i32.eq br_if $case1|0 br $break|0 @@ -513,8 +513,8 @@ end block $break|1 loop $continue|1 - get_global $~lib/collector/itcm/state - get_global $~lib/collector/itcm/State.IDLE + global.get $~lib/collector/itcm/state + global.get $~lib/collector/itcm/State.IDLE i32.ne if call $~lib/collector/itcm/step @@ -528,44 +528,44 @@ return ) (func $std/gc-object/main (; 19 ;) (type $v) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end ) (func $start (; 20 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $~lib/collector/itcm/State.INIT - set_global $~lib/collector/itcm/state + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $~lib/collector/itcm/State.INIT + global.set $~lib/collector/itcm/state i32.const 0 call $std/gc-object/Custom#constructor - set_global $std/gc-object/obj + global.set $std/gc-object/obj call $~lib/gc/gc.collect - get_global $std/gc-object/obj - get_global $std/gc-object/obj + global.get $std/gc-object/obj + global.get $std/gc-object/obj i32.store call $~lib/gc/gc.collect i32.const 0 - set_global $std/gc-object/obj + global.set $std/gc-object/obj call $~lib/gc/gc.collect ) (func $null (; 21 ;) (type $v) ) (func $~iterateRoots (; 22 ;) (type $iv) (param $0 i32) - get_global $std/gc-object/obj - get_local $0 + global.get $std/gc-object/obj + local.get $0 call_indirect (type $iv) ) ) diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 7242b18b..ed184db6 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -6,7 +6,7 @@ (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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) @@ -16,45 +16,45 @@ (local $2 i32) (local $3 i32) i32.const -2128831035 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load i32.const 1 i32.shl - set_local $3 + local.set $3 loop $repeat|0 block $break|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.ge_u br_if $break|0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.load8_u offset=4 - get_local $2 + local.get $2 i32.xor i32.const 16777619 i32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $~lib/internal/hash/hash32 (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.const 255 @@ -62,7 +62,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 16 i32.shr_u i32.const 255 @@ -70,7 +70,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 24 i32.shr_u i32.xor @@ -79,16 +79,16 @@ ) (func $~lib/internal/hash/hash64 (; 2 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) - get_local $0 - i32.wrap/i64 - tee_local $1 + local.get $0 + i32.wrap_i64 + local.tee $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.const 255 @@ -96,7 +96,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 16 i32.shr_u i32.const 255 @@ -104,23 +104,23 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 24 i32.shr_u i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 255 i32.and i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.const 255 @@ -128,7 +128,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 16 i32.shr_u i32.const 255 @@ -136,7 +136,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 24 i32.shr_u i32.xor diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 2c3e479f..5730371a 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -7,7 +7,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -29,176 +29,176 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 block $break|0 block i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load i32.const 1 i32.shl - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_u i32.eqz br_if $break|0 - get_local $1 - get_local $0 - get_local $2 + local.get $1 + local.get $0 + local.get $2 i32.add i32.load8_u offset=4 i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $std/hash/check (; 1 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 ) (func $~lib/internal/hash/hash32 (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 - get_local $1 - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 + local.get $1 + local.get $0 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 + local.set $1 + local.get $1 ) (func $~lib/internal/hash/hash64 (; 3 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 - i32.wrap/i64 - set_local $1 - get_local $0 + local.get $0 + i32.wrap_i64 + local.set $1 + local.get $0 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 - get_global $~lib/internal/hash/FNV_OFFSET - set_local $3 - get_local $3 - get_local $1 + i32.wrap_i64 + local.set $2 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $3 + local.get $3 + local.get $1 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $start (; 4 ;) (type $v) (local $0 i32) @@ -206,8 +206,8 @@ (local $2 f64) block $~lib/internal/hash/HASH|inlined.0 (result i32) i32.const 0 - set_local $0 - get_local $0 + local.set $0 + local.get $0 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.0 end @@ -215,8 +215,8 @@ drop block $~lib/internal/hash/HASH|inlined.1 (result i32) i32.const 8 - set_local $0 - get_local $0 + local.set $0 + local.get $0 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.1 end @@ -224,8 +224,8 @@ drop block $~lib/internal/hash/HASH|inlined.2 (result i32) i32.const 16 - set_local $0 - get_local $0 + local.set $0 + local.get $0 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.2 end @@ -233,8 +233,8 @@ drop block $~lib/internal/hash/HASH|inlined.3 (result i32) i32.const 24 - set_local $0 - get_local $0 + local.set $0 + local.get $0 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.3 end @@ -242,8 +242,8 @@ drop block $~lib/internal/hash/HASH|inlined.4 (result i32) i32.const 32 - set_local $0 - get_local $0 + local.set $0 + local.get $0 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.4 end @@ -251,9 +251,9 @@ drop block $~lib/internal/hash/HASH|inlined.0 (result i32) f32.const 0 - set_local $1 - get_local $1 - i32.reinterpret/f32 + local.set $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end @@ -261,9 +261,9 @@ drop block $~lib/internal/hash/HASH|inlined.1 (result i32) f32.const 1 - set_local $1 - get_local $1 - i32.reinterpret/f32 + local.set $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end @@ -271,9 +271,9 @@ drop block $~lib/internal/hash/HASH|inlined.2 (result i32) f32.const 1.100000023841858 - set_local $1 - get_local $1 - i32.reinterpret/f32 + local.set $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.2 end @@ -281,9 +281,9 @@ drop block $~lib/internal/hash/HASH|inlined.3 (result i32) f32.const 0 - set_local $1 - get_local $1 - i32.reinterpret/f32 + local.set $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.3 end @@ -291,9 +291,9 @@ drop block $~lib/internal/hash/HASH|inlined.4 (result i32) f32.const inf - set_local $1 - get_local $1 - i32.reinterpret/f32 + local.set $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.4 end @@ -301,9 +301,9 @@ drop block $~lib/internal/hash/HASH|inlined.5 (result i32) f32.const nan:0x400000 - set_local $1 - get_local $1 - i32.reinterpret/f32 + local.set $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.5 end @@ -311,9 +311,9 @@ drop block $~lib/internal/hash/HASH|inlined.0 (result i32) f64.const 0 - set_local $2 - get_local $2 - i64.reinterpret/f64 + local.set $2 + local.get $2 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.0 end @@ -321,9 +321,9 @@ drop block $~lib/internal/hash/HASH|inlined.1 (result i32) f64.const 1 - set_local $2 - get_local $2 - i64.reinterpret/f64 + local.set $2 + local.get $2 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.1 end @@ -331,9 +331,9 @@ drop block $~lib/internal/hash/HASH|inlined.2 (result i32) f64.const 1.1 - set_local $2 - get_local $2 - i64.reinterpret/f64 + local.set $2 + local.get $2 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.2 end @@ -341,9 +341,9 @@ drop block $~lib/internal/hash/HASH|inlined.3 (result i32) f64.const 0 - set_local $2 - get_local $2 - i64.reinterpret/f64 + local.set $2 + local.get $2 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.3 end @@ -351,9 +351,9 @@ drop block $~lib/internal/hash/HASH|inlined.4 (result i32) f64.const inf - set_local $2 - get_local $2 - i64.reinterpret/f64 + local.set $2 + local.get $2 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.4 end @@ -361,9 +361,9 @@ drop block $~lib/internal/hash/HASH|inlined.5 (result i32) f64.const nan:0x8000000000000 - set_local $2 - get_local $2 - i64.reinterpret/f64 + local.set $2 + local.get $2 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.5 end diff --git a/tests/compiler/std/libm.optimized.wat b/tests/compiler/std/libm.optimized.wat index 252633e6..94a701db 100644 --- a/tests/compiler/std/libm.optimized.wat +++ b/tests/compiler/std/libm.optimized.wat @@ -5,7 +5,7 @@ (type $Ff (func (param f64) (result f32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -60,21 +60,21 @@ (export "tanh" (func $std/libm/tanh)) (export "trunc" (func $std/libm/trunc)) (func $std/libm/abs (; 0 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.abs ) (func $~lib/math/R (; 1 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.const 0.16666666666666666 - get_local $0 + local.get $0 f64.const -0.3255658186224009 - get_local $0 + local.get $0 f64.const 0.20121253213486293 - get_local $0 + local.get $0 f64.const -0.04005553450067941 - get_local $0 + local.get $0 f64.const 7.915349942898145e-04 - get_local $0 + local.get $0 f64.const 3.479331075960212e-05 f64.mul f64.add @@ -88,13 +88,13 @@ f64.add f64.mul f64.const 1 - get_local $0 + local.get $0 f64.const -2.403394911734414 - get_local $0 + local.get $0 f64.const 2.0209457602335057 - get_local $0 + local.get $0 f64.const -0.6882839716054533 - get_local $0 + local.get $0 f64.const 0.07703815055590194 f64.mul f64.add @@ -112,28 +112,28 @@ (local $3 f64) (local $4 i32) (local $5 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $4 + i32.wrap_i64 + local.tee $4 i32.const 2147483647 i32.and - tee_local $2 + local.tee $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.get $2 i32.const 1072693248 i32.sub i32.or i32.eqz if - get_local $4 + local.get $4 i32.const 31 i32.shr_u if @@ -144,17 +144,17 @@ return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1012924416 i32.le_u if @@ -162,11 +162,11 @@ return end f64.const 1.5707963267948966 - get_local $0 + local.get $0 f64.const 6.123233995736766e-17 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -175,23 +175,23 @@ f64.sub return end - get_local $4 + local.get $4 i32.const 31 i32.shr_u if f64.const 2 f64.const 1.5707963267948966 f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.add - tee_local $1 + local.tee $1 f64.sqrt - tee_local $0 - get_local $1 + local.tee $0 + local.get $1 call $~lib/math/R - get_local $0 + local.get $0 f64.mul f64.const 6.123233995736766e-17 f64.sub @@ -201,41 +201,41 @@ return end f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.sub - tee_local $1 + local.tee $1 f64.sqrt - set_local $0 - get_local $1 - get_local $0 - i64.reinterpret/f64 + local.set $0 + local.get $1 + local.get $0 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $3 - get_local $3 + f64.reinterpret_i64 + local.tee $3 + local.get $3 f64.mul f64.sub - get_local $0 - get_local $3 + local.get $0 + local.get $3 f64.add f64.div - set_local $5 + local.set $5 f64.const 2 - get_local $3 - get_local $1 + local.get $3 + local.get $1 call $~lib/math/R - get_local $0 + local.get $0 f64.mul - get_local $5 + local.get $5 f64.add f64.add f64.mul ) (func $std/libm/acos (; 3 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acos ) (func $~lib/math/NativeMath.log1p (; 4 ;) (type $FF) (param $0 f64) (result f64) @@ -248,159 +248,159 @@ (local $7 i64) (local $8 f64) i32.const 1 - set_local $2 - get_local $0 - i64.reinterpret/f64 + local.set $2 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $3 + i32.wrap_i64 + local.tee $3 i32.const 1071284858 i32.lt_u - tee_local $4 + local.tee $4 i32.eqz if - get_local $3 + local.get $3 i32.const 31 i32.shr_u - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $3 + local.get $3 i32.const -1074790400 i32.ge_u if - get_local $0 + local.get $0 f64.const -1 f64.eq if - get_local $0 + local.get $0 f64.const 0 f64.div return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 1 i32.shl i32.const 2034237440 i32.lt_u if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i32.const -1076707644 i32.le_u if i32.const 0 - set_local $2 - get_local $0 - set_local $1 + local.set $2 + local.get $0 + local.set $1 end else - get_local $3 + local.get $3 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return end end - get_local $2 + local.get $2 if f64.const 1 - get_local $0 + local.get $0 f64.add - i64.reinterpret/f64 - tee_local $7 + i64.reinterpret_f64 + local.tee $7 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 614242 i32.add - tee_local $4 + local.tee $4 i32.const 20 i32.shr_u i32.const 1023 i32.sub - tee_local $2 + local.tee $2 i32.const 54 i32.lt_s if (result f64) - get_local $7 - f64.reinterpret/i64 - set_local $1 + local.get $7 + f64.reinterpret_i64 + local.set $1 f64.const 1 - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.sub f64.sub - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.const 1 f64.sub f64.sub - get_local $2 + local.get $2 i32.const 2 i32.ge_s select - get_local $1 + local.get $1 f64.div else f64.const 0 end - set_local $6 - get_local $7 + local.set $6 + local.get $7 i64.const 4294967295 i64.and - get_local $4 + local.get $4 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - set_local $1 + local.set $1 end - get_local $1 + local.get $1 f64.const 2 - get_local $1 + local.get $1 f64.add f64.div - tee_local $5 - get_local $5 + local.tee $5 + local.get $5 f64.mul - tee_local $8 - get_local $8 + local.tee $8 + local.get $8 f64.mul - set_local $0 - get_local $5 + local.set $0 + local.get $5 f64.const 0.5 - get_local $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $5 - get_local $8 + local.tee $5 + local.get $8 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -409,11 +409,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -423,19 +423,19 @@ f64.add f64.add f64.mul - get_local $2 - f64.convert_s/i32 - tee_local $0 + local.get $2 + f64.convert_i32_s + local.tee $0 f64.const 1.9082149292705877e-10 f64.mul - get_local $6 + local.get $6 f64.add f64.add - get_local $5 + local.get $5 f64.sub - get_local $1 + local.get $1 f64.add - get_local $0 + local.get $0 f64.const 0.6931471803691238 f64.mul f64.add @@ -448,139 +448,139 @@ (local $5 f64) (local $6 f64) (local $7 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $4 + local.get $0 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 1048576 i32.lt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.const 31 i32.shr_u - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $4 + local.get $4 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $4 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 + i32.wrap_i64 + local.set $1 else - get_local $1 + local.get $1 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1072693248 i32.eq - tee_local $2 + local.tee $2 if - get_local $4 + local.get $4 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if f64.const 0 return end end end - get_local $1 + local.get $1 i32.const 614242 i32.add - tee_local $1 + local.tee $1 i32.const 20 i32.shr_s i32.const 1023 i32.sub - get_local $3 + local.get $3 i32.add - set_local $3 - get_local $4 + local.set $3 + local.get $4 i64.const 4294967295 i64.and - get_local $1 + local.get $1 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $5 + local.tee $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f64.mul - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - set_local $0 - get_local $6 + local.set $0 + local.get $6 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - tee_local $6 - get_local $7 + local.tee $6 + local.get $7 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -589,11 +589,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -603,42 +603,42 @@ f64.add f64.add f64.mul - get_local $3 - f64.convert_s/i32 - tee_local $0 + local.get $3 + f64.convert_i32_s + local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add - get_local $6 + local.get $6 f64.sub - get_local $5 + local.get $5 f64.add - get_local $0 + local.get $0 f64.const 0.6931471803691238 f64.mul f64.add ) (func $~lib/math/NativeMath.acosh (; 6 ;) (type $FF) (param $0 f64) (result f64) (local $1 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 52 i64.shr_u i64.const 2047 i64.and - tee_local $1 + local.tee $1 i64.const 1024 i64.lt_u if - get_local $0 + local.get $0 f64.const 1 f64.sub - tee_local $0 - get_local $0 - get_local $0 + local.tee $0 + local.get $0 + local.get $0 f64.mul f64.const 2 - get_local $0 + local.get $0 f64.mul f64.add f64.sqrt @@ -646,17 +646,17 @@ call $~lib/math/NativeMath.log1p return end - get_local $1 + local.get $1 i64.const 1049 i64.lt_u if f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul f64.const 1 f64.sub @@ -667,13 +667,13 @@ call $~lib/math/NativeMath.log return end - get_local $0 + local.get $0 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add ) (func $std/libm/acosh (; 7 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acosh ) (func $~lib/math/NativeMath.asin (; 8 ;) (type $FF) (param $0 f64) (result f64) @@ -681,28 +681,28 @@ (local $2 i32) (local $3 i32) (local $4 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $3 + i32.wrap_i64 + local.tee $3 i32.const 2147483647 i32.and - tee_local $2 + local.tee $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.get $2 i32.const 1072693248 i32.sub i32.or i32.eqz if - get_local $0 + local.get $0 f64.const 1.5707963267948966 f64.mul f64.const 7.52316384526264e-37 @@ -710,35 +710,35 @@ return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1045430272 i32.lt_u - tee_local $3 + local.tee $3 if - get_local $2 + local.get $2 i32.const 1048576 i32.ge_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -746,26 +746,26 @@ return end f64.const 0.5 - get_local $0 + local.get $0 f64.abs f64.const 0.5 f64.mul f64.sub - tee_local $1 + local.tee $1 f64.sqrt - set_local $0 - get_local $1 + local.set $0 + local.get $1 call $~lib/math/R - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 1072640819 i32.ge_u if (result f64) f64.const 1.5707963267948966 f64.const 2 - get_local $0 - get_local $0 - get_local $4 + local.get $0 + local.get $0 + local.get $4 f64.mul f64.add f64.mul @@ -775,24 +775,24 @@ else f64.const 0.7853981633974483 f64.const 2 - get_local $0 + local.get $0 f64.mul - get_local $4 + local.get $4 f64.mul f64.const 6.123233995736766e-17 f64.const 2 - get_local $1 - get_local $0 - i64.reinterpret/f64 + local.get $1 + local.get $0 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $1 - get_local $1 + f64.reinterpret_i64 + local.tee $1 + local.get $1 f64.mul f64.sub - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add f64.div f64.mul @@ -800,81 +800,81 @@ f64.sub f64.const 0.7853981633974483 f64.const 2 - get_local $1 + local.get $1 f64.mul f64.sub f64.sub f64.sub end - set_local $0 - get_local $3 + local.set $0 + local.get $3 i32.const 31 i32.shr_u if - get_local $0 + local.get $0 f64.neg return end - get_local $0 + local.get $0 ) (func $std/libm/asin (; 9 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asin ) (func $~lib/math/NativeMath.asinh (; 10 ;) (type $FF) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $2 + local.get $0 + i64.reinterpret_f64 + local.tee $2 i64.const 9223372036854775807 i64.and - f64.reinterpret/i64 - set_local $1 - get_local $2 + f64.reinterpret_i64 + local.set $1 + local.get $2 i64.const 52 i64.shr_u i64.const 2047 i64.and - tee_local $2 + local.tee $2 i64.const 1049 i64.ge_u if (result f64) - get_local $1 + local.get $1 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add else - get_local $2 + local.get $2 i64.const 1024 i64.ge_u if (result f64) f64.const 2 - get_local $1 + local.get $1 f64.mul f64.const 1 - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.mul f64.const 1 f64.add f64.sqrt - get_local $1 + local.get $1 f64.add f64.div f64.add call $~lib/math/NativeMath.log else - get_local $2 + local.get $2 i64.const 997 i64.ge_u if (result f64) - get_local $1 - get_local $1 - get_local $1 + local.get $1 + local.get $1 + local.get $1 f64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f64.const 1 f64.add f64.sqrt @@ -884,15 +884,15 @@ f64.add call $~lib/math/NativeMath.log1p else - get_local $1 + local.get $1 end end end - get_local $0 + local.get $0 f64.copysign ) (func $std/libm/asinh (; 11 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asinh ) (func $~lib/math/NativeMath.atan (; 12 ;) (type $FF) (param $0 f64) (result f64) @@ -900,123 +900,123 @@ (local $2 i32) (local $3 f64) (local $4 f64) - get_local $0 - set_local $4 - get_local $0 - i64.reinterpret/f64 + local.get $0 + local.set $4 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - tee_local $2 + local.tee $2 i32.const 1141899264 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if - get_local $0 + local.get $0 return end f64.const 1.5707963267948966 - get_local $4 + local.get $4 f64.copysign return end - get_local $2 + local.get $2 i32.const 1071382528 i32.lt_u if - get_local $2 + local.get $2 i32.const 1044381696 i32.lt_u if - get_local $0 + local.get $0 return end i32.const -1 - set_local $2 + local.set $2 else - get_local $0 + local.get $0 f64.abs - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 1072889856 i32.lt_u if (result f64) - get_local $2 + local.get $2 i32.const 1072037888 i32.lt_u if (result f64) i32.const 0 - set_local $2 + local.set $2 f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 f64.sub f64.const 2 - get_local $0 + local.get $0 f64.add f64.div else i32.const 1 - set_local $2 - get_local $0 + local.set $2 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.add f64.div end else - get_local $2 + local.get $2 i32.const 1073971200 i32.lt_u if (result f64) i32.const 2 - set_local $2 - get_local $0 + local.set $2 + local.get $0 f64.const 1.5 f64.sub f64.const 1 f64.const 1.5 - get_local $0 + local.get $0 f64.mul f64.add f64.div else i32.const 3 - set_local $2 + local.set $2 f64.const -1 - get_local $0 + local.get $0 f64.div end end - set_local $0 + local.set $0 end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul - set_local $1 - get_local $0 - get_local $3 + local.set $1 + local.get $0 + local.get $3 f64.const 0.3333333333333293 - get_local $1 + local.get $1 f64.const 0.14285714272503466 - get_local $1 + local.get $1 f64.const 0.09090887133436507 - get_local $1 + local.get $1 f64.const 0.06661073137387531 - get_local $1 + local.get $1 f64.const 0.049768779946159324 - get_local $1 + local.get $1 f64.const 0.016285820115365782 f64.mul f64.add @@ -1029,15 +1029,15 @@ f64.mul f64.add f64.mul - get_local $1 + local.get $1 f64.const -0.19999999999876483 - get_local $1 + local.get $1 f64.const -0.11111110405462356 - get_local $1 + local.get $1 f64.const -0.0769187620504483 - get_local $1 + local.get $1 f64.const -0.058335701337905735 - get_local $1 + local.get $1 f64.const -0.036531572744216916 f64.mul f64.add @@ -1050,13 +1050,13 @@ f64.mul f64.add f64.mul - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 0 i32.lt_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub return end @@ -1065,61 +1065,61 @@ block $case3|0 block $case2|0 block $case1|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case1|0 $case2|0 $case3|0 $case4|0 end f64.const 0.4636476090008061 - get_local $1 + local.get $1 f64.const 2.2698777452961687e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end f64.const 0.7853981633974483 - get_local $1 + local.get $1 f64.const 3.061616997868383e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end f64.const 0.982793723247329 - get_local $1 + local.get $1 f64.const 1.3903311031230998e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end f64.const 1.5707963267948966 - get_local $1 + local.get $1 f64.const 6.123233995736766e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end unreachable end - get_local $3 - get_local $4 + local.get $3 + local.get $4 f64.copysign ) (func $std/libm/atan (; 13 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan ) (func $~lib/math/NativeMath.atanh (; 14 ;) (type $FF) (param $0 f64) (result f64) @@ -1127,62 +1127,62 @@ (local $2 i64) (local $3 i64) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $3 + local.get $0 + i64.reinterpret_f64 + local.tee $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $3 + local.set $2 + local.get $3 i64.const 9223372036854775807 i64.and - f64.reinterpret/i64 - set_local $1 - get_local $2 + f64.reinterpret_i64 + local.set $1 + local.get $2 i64.const 1022 i64.lt_u if (result f64) - get_local $2 + local.get $2 i64.const 991 i64.ge_u if (result f64) f64.const 0.5 f64.const 2 - get_local $1 + local.get $1 f64.mul - tee_local $4 - get_local $4 - get_local $1 + local.tee $4 + local.get $4 + local.get $1 f64.mul f64.const 1 - get_local $1 + local.get $1 f64.sub f64.div f64.add call $~lib/math/NativeMath.log1p f64.mul else - get_local $1 + local.get $1 end else f64.const 0.5 f64.const 2 - get_local $1 + local.get $1 f64.const 1 - get_local $1 + local.get $1 f64.sub f64.div f64.mul call $~lib/math/NativeMath.log1p f64.mul end - get_local $0 + local.get $0 f64.copysign ) (func $std/libm/atanh (; 15 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atanh ) (func $~lib/math/NativeMath.atan2 (; 16 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -1192,73 +1192,73 @@ (local $5 i32) (local $6 i64) (local $7 i32) - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne end if - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.add return end - get_local $1 - i64.reinterpret/f64 - tee_local $6 + local.get $1 + i64.reinterpret_f64 + local.tee $6 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $6 - i32.wrap/i64 - set_local $2 - get_local $0 - i64.reinterpret/f64 - tee_local $6 + i32.wrap_i64 + local.set $4 + local.get $6 + i32.wrap_i64 + local.set $2 + local.get $0 + i64.reinterpret_f64 + local.tee $6 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $6 - i32.wrap/i64 - set_local $7 - get_local $4 + i32.wrap_i64 + local.set $5 + local.get $6 + i32.wrap_i64 + local.set $7 + local.get $4 i32.const 1072693248 i32.sub - get_local $2 + local.get $2 i32.or i32.eqz if - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan return end - get_local $4 + local.get $4 i32.const 30 i32.shr_u i32.const 2 i32.and - get_local $5 + local.get $5 i32.const 31 i32.shr_u i32.or - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 2147483647 i32.and - set_local $4 - get_local $7 - get_local $5 + local.set $4 + local.get $7 + local.get $5 i32.const 2147483647 i32.and - tee_local $5 + local.tee $5 i32.or i32.eqz if @@ -1266,18 +1266,18 @@ block $case3|0 block $case2|0 block $case1|0 - get_local $3 + local.get $3 i32.eqz br_if $case1|0 block $tablify|0 - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case1|0 $case2|0 $case3|0 $tablify|0 end br $break|0 end - get_local $0 + local.get $0 return end f64.const 3.141592653589793 @@ -1288,16 +1288,16 @@ end end block $folding-inner0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.or i32.eqz br_if $folding-inner0 - get_local $4 + local.get $4 i32.const 2146435072 i32.eq if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq if @@ -1305,9 +1305,9 @@ block $case3|1 block $case2|1 block $case1|1 - get_local $3 + local.get $3 if - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case1|1 $case2|1 $case3|1 $break|1 @@ -1329,9 +1329,9 @@ block $case3|2 block $case2|2 block $case1|2 - get_local $3 + local.get $3 if - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case1|2 $case2|2 $case3|2 $break|2 @@ -1350,70 +1350,70 @@ end end end - get_local $4 + local.get $4 i32.const 67108864 i32.add - get_local $5 + local.get $5 i32.lt_u - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $5 + local.get $5 i32.const 2146435072 i32.eq end br_if $folding-inner0 - get_local $3 + local.get $3 i32.const 2 i32.and - tee_local $2 + local.tee $2 if (result i32) - get_local $5 + local.get $5 i32.const 67108864 i32.add - get_local $4 + local.get $4 i32.lt_u else - get_local $2 + local.get $2 end if (result f64) f64.const 0 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.div f64.abs call $~lib/math/NativeMath.atan end - set_local $0 + local.set $0 block $break|3 block $case3|3 block $case2|3 block $case1|3 - get_local $3 - tee_local $2 + local.get $3 + local.tee $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case1|3 $case2|3 $case3|3 $break|3 end - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f64.neg return end f64.const 3.141592653589793 - get_local $0 + local.get $0 f64.const 1.2246467991473532e-16 f64.sub f64.sub return end - get_local $0 + local.get $0 f64.const 1.2246467991473532e-16 f64.sub f64.const 3.141592653589793 @@ -1424,14 +1424,14 @@ end f64.const -1.5707963267948966 f64.const 1.5707963267948966 - get_local $3 + local.get $3 i32.const 1 i32.and select ) (func $std/libm/atan2 (; 17 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.atan2 ) (func $~lib/math/NativeMath.cbrt (; 18 ;) (type $FF) (param $0 f64) (result f64) @@ -1439,135 +1439,135 @@ (local $2 f64) (local $3 i32) (local $4 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $4 + local.get $0 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - tee_local $3 + local.tee $3 i32.const 2146435072 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.add return end - get_local $3 + local.get $3 i32.const 1048576 i32.lt_u if (result i32) - get_local $0 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $4 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i32.const 3 i32.div_u i32.const 696219795 i32.add else - get_local $3 + local.get $3 i32.const 3 i32.div_u i32.const 715094163 i32.add end - set_local $3 - get_local $4 + local.set $3 + local.get $4 i64.const -9223372036854775808 i64.and - get_local $3 - i64.extend_u/i32 + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - tee_local $1 - get_local $1 + f64.reinterpret_i64 + local.tee $1 + local.get $1 f64.mul - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.div f64.mul - set_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $0 + local.get $1 f64.const 1.87595182427177 - get_local $2 + local.get $2 f64.const -1.8849797954337717 - get_local $2 + local.get $2 f64.const 1.6214297201053545 f64.mul f64.add f64.mul f64.add - get_local $2 - get_local $2 + local.get $2 + local.get $2 f64.mul - get_local $2 + local.get $2 f64.mul f64.const -0.758397934778766 - get_local $2 + local.get $2 f64.const 0.14599619288661245 f64.mul f64.add f64.mul f64.add f64.mul - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const 2147483648 i64.add i64.const -1073741824 i64.and - f64.reinterpret/i64 - tee_local $1 - get_local $1 + f64.reinterpret_i64 + local.tee $1 + local.get $1 f64.mul f64.div - set_local $2 - get_local $1 - get_local $1 - get_local $2 - get_local $1 + local.set $2 + local.get $1 + local.get $1 + local.get $2 + local.get $1 f64.sub f64.const 2 - get_local $1 + local.get $1 f64.mul - get_local $2 + local.get $2 f64.add f64.div f64.mul f64.add ) (func $std/libm/cbrt (; 19 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cbrt ) (func $std/libm/ceil (; 20 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.ceil ) (func $std/libm/clz32 (; 21 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 - i32.trunc_s/f64 + local.get $0 + i32.trunc_f64_s i32.clz - f64.convert_s/i32 + f64.convert_i32_s ) (func $std/libm/cos (; 22 ;) (type $FF) (param $0 f64) (result f64) unreachable @@ -1582,120 +1582,120 @@ (local $7 i64) (local $8 f64) (local $9 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $7 + local.get $0 + i64.reinterpret_f64 + local.tee $7 i64.const 63 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $7 + i32.wrap_i64 + local.set $6 + local.get $7 i64.const 32 i64.shr_u i64.const 2147483647 i64.and - i32.wrap/i64 - tee_local $4 + i32.wrap_i64 + local.tee $4 i32.const 1078159482 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if - get_local $0 + local.get $0 return end - get_local $6 + local.get $6 if f64.const -1 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end end - get_local $4 + local.get $4 i32.const 1071001154 i32.gt_u if - get_local $0 + local.get $0 i32.const 1 - get_local $6 + local.get $6 i32.const 1 i32.shl i32.sub f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 - get_local $4 + i32.trunc_f64_s + local.get $4 i32.const 1072734898 i32.lt_u select - tee_local $3 - f64.convert_s/i32 - tee_local $1 + local.tee $3 + f64.convert_i32_s + local.tee $1 f64.const 0.6931471803691238 f64.mul f64.sub - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 f64.const 1.9082149292705877e-10 f64.mul - tee_local $1 + local.tee $1 f64.sub - set_local $0 - get_local $2 - get_local $0 + local.set $0 + local.get $2 + local.get $0 f64.sub - get_local $1 + local.get $1 f64.sub - set_local $5 + local.set $5 else - get_local $4 + local.get $4 i32.const 1016070144 i32.lt_u if - get_local $0 + local.get $0 return end end - get_local $0 + local.get $0 f64.const 0.5 - get_local $0 + local.get $0 f64.mul - tee_local $8 + local.tee $8 f64.mul - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.mul - set_local $1 + local.set $1 f64.const 3 f64.const 1 - get_local $2 + local.get $2 f64.const -0.03333333333333313 f64.mul f64.add - get_local $1 + local.get $1 f64.const 1.5873015872548146e-03 - get_local $2 + local.get $2 f64.const -7.93650757867488e-05 f64.mul f64.add - get_local $1 + local.get $1 f64.const 4.008217827329362e-06 - get_local $2 + local.get $2 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -1703,69 +1703,69 @@ f64.add f64.mul f64.add - tee_local $9 - get_local $8 + local.tee $9 + local.get $8 f64.mul f64.sub - set_local $1 - get_local $2 - get_local $9 - get_local $1 + local.set $1 + local.get $2 + local.get $9 + local.get $1 f64.sub f64.const 6 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul f64.sub f64.div f64.mul - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.eqz if - get_local $0 - get_local $0 - get_local $1 + local.get $0 + local.get $0 + local.get $1 f64.mul - get_local $2 + local.get $2 f64.sub f64.sub return end - get_local $0 - get_local $1 - get_local $5 + local.get $0 + local.get $1 + local.get $5 f64.sub f64.mul - get_local $5 + local.get $5 f64.sub - get_local $2 + local.get $2 f64.sub - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.const -1 i32.eq if f64.const 0.5 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub f64.mul f64.const 0.5 f64.sub return end - get_local $3 + local.get $3 i32.const 1 i32.eq if - get_local $0 + local.get $0 f64.const -0.25 f64.lt if f64.const -2 - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.const 0.5 f64.add f64.sub @@ -1774,158 +1774,158 @@ end f64.const 1 f64.const 2 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub f64.mul f64.add return end - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl - f64.reinterpret/i64 - set_local $5 - get_local $3 + f64.reinterpret_i64 + local.set $5 + local.get $3 i32.const 0 i32.lt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $3 + local.get $3 i32.const 56 i32.gt_s end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub f64.const 1 f64.add - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 1024 i32.eq if (result f64) - get_local $2 + local.get $2 f64.const 2 f64.mul f64.const 8988465674311579538646525e283 f64.mul else - get_local $2 - get_local $5 + local.get $2 + local.get $5 f64.mul end f64.const 1 f64.sub return end - get_local $0 + local.get $0 f64.const 1 i64.const 1023 - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.sub i64.const 52 i64.shl - f64.reinterpret/i64 - tee_local $2 + f64.reinterpret_i64 + local.tee $2 f64.sub - get_local $1 + local.get $1 f64.sub f64.const 1 - get_local $1 - get_local $2 + local.get $1 + local.get $2 f64.add f64.sub - get_local $3 + local.get $3 i32.const 20 i32.lt_s select f64.add - get_local $5 + local.get $5 f64.mul ) (func $~lib/math/NativeMath.scalbn (; 24 ;) (type $FiF) (param $0 f64) (param $1 i32) (result f64) - get_local $1 + local.get $1 i32.const 1023 i32.gt_s if (result f64) - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1023 i32.sub - tee_local $1 + local.tee $1 i32.const 1023 i32.gt_s if (result f64) - get_local $1 + local.get $1 i32.const 1023 i32.sub - tee_local $1 + local.tee $1 i32.const 1023 - get_local $1 + local.get $1 i32.const 1023 i32.lt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul else - get_local $0 + local.get $0 end else - get_local $1 + local.get $1 i32.const -1022 i32.lt_s if (result f64) - get_local $0 + local.get $0 f64.const 2.004168360008973e-292 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 969 i32.add - tee_local $1 + local.tee $1 i32.const -1022 i32.lt_s if (result f64) - get_local $1 + local.get $1 i32.const 969 i32.add - tee_local $1 + local.tee $1 i32.const -1022 - get_local $1 + local.get $1 i32.const -1022 i32.gt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 2.004168360008973e-292 f64.mul else - get_local $0 + local.get $0 end else - get_local $0 + local.get $0 end end - get_local $1 - i64.extend_s/i32 + local.get $1 + i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl - f64.reinterpret/i64 + f64.reinterpret_i64 f64.mul ) (func $~lib/math/NativeMath.exp (; 25 ;) (type $FF) (param $0 f64) (result f64) @@ -1936,39 +1936,39 @@ (local $5 f64) (local $6 i32) (local $7 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 31 i32.shr_u - set_local $6 - get_local $1 + local.set $6 + local.get $1 i32.const 2147483647 i32.and - tee_local $1 + local.tee $1 i32.const 1082532651 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end - get_local $0 + local.get $0 f64.const -745.1332191019411 f64.lt if @@ -1976,78 +1976,78 @@ return end end - get_local $1 + local.get $1 i32.const 1071001154 i32.gt_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1072734898 i32.ge_u if (result i32) f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 + i32.trunc_f64_s else i32.const 1 - get_local $6 + local.get $6 i32.const 1 i32.shl i32.sub end - tee_local $3 - f64.convert_s/i32 - tee_local $0 + local.tee $3 + f64.convert_i32_s + local.tee $0 f64.const 0.6931471803691238 f64.mul f64.sub - tee_local $4 - get_local $0 + local.tee $4 + local.get $0 f64.const 1.9082149292705877e-10 f64.mul - tee_local $7 + local.tee $7 f64.sub - set_local $0 + local.set $0 else - get_local $1 + local.get $1 i32.const 1043333120 i32.le_u if f64.const 1 - get_local $0 + local.get $0 f64.add return end - get_local $0 - set_local $4 + local.get $0 + local.set $4 end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.mul - set_local $5 + local.set $5 f64.const 1 - get_local $0 - get_local $0 - get_local $2 + local.get $0 + local.get $0 + local.get $2 f64.const 0.16666666666666602 f64.mul - get_local $5 + local.get $5 f64.const -2.7777777777015593e-03 - get_local $2 + local.get $2 f64.const 6.613756321437934e-05 f64.mul f64.add - get_local $5 + local.get $5 f64.const -1.6533902205465252e-06 - get_local $2 + local.get $2 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -2056,47 +2056,47 @@ f64.mul f64.add f64.sub - tee_local $0 + local.tee $0 f64.mul f64.const 2 - get_local $0 + local.get $0 f64.sub f64.div - get_local $7 + local.get $7 f64.sub - get_local $4 + local.get $4 f64.add f64.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 i32.eqz if - get_local $0 + local.get $0 return end - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/math/NativeMath.scalbn ) (func $~lib/math/NativeMath.cosh (; 26 ;) (type $FF) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $2 - f64.reinterpret/i64 - set_local $0 - get_local $2 + local.tee $2 + f64.reinterpret_i64 + local.set $0 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 1072049730 i32.lt_u if - get_local $1 + local.get $1 i32.const 1045430272 i32.lt_u if @@ -2104,36 +2104,36 @@ return end f64.const 1 - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.mul f64.const 2 f64.const 2 - get_local $0 + local.get $0 f64.mul f64.add f64.div f64.add return end - get_local $1 + local.get $1 i32.const 1082535490 i32.lt_u if f64.const 0.5 - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp - tee_local $0 + local.tee $0 f64.const 1 - get_local $0 + local.get $0 f64.div f64.add f64.mul return end - get_local $0 + local.get $0 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp @@ -2143,24 +2143,24 @@ f64.mul ) (func $std/libm/cosh (; 27 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cosh ) (func $std/libm/exp (; 28 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp ) (func $std/libm/expm1 (; 29 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 ) (func $std/libm/floor (; 30 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.floor ) (func $std/libm/fround (; 31 ;) (type $Ff) (param $0 f64) (result f32) - get_local $0 - f32.demote/f64 + local.get $0 + f32.demote_f64 ) (func $~lib/math/NativeMath.hypot (; 32 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) @@ -2173,186 +2173,186 @@ (local $9 i32) (local $10 i64) (local $11 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $5 - get_local $1 - i64.reinterpret/f64 + local.tee $5 + local.get $1 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $3 + local.tee $3 i64.lt_u if - get_local $5 - set_local $10 - get_local $3 - set_local $5 - get_local $10 - set_local $3 + local.get $5 + local.set $10 + local.get $3 + local.set $5 + local.get $10 + local.set $3 end - get_local $5 + local.get $5 i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $3 - f64.reinterpret/i64 - set_local $1 - get_local $3 + i32.wrap_i64 + local.set $6 + local.get $3 + f64.reinterpret_i64 + local.set $1 + local.get $3 i64.const 52 i64.shr_u - i32.wrap/i64 - tee_local $8 + i32.wrap_i64 + local.tee $8 i32.const 2047 i32.eq if - get_local $1 + local.get $1 return end - get_local $5 - f64.reinterpret/i64 - set_local $0 - get_local $6 + local.get $5 + f64.reinterpret_i64 + local.set $0 + local.get $6 i32.const 2047 i32.eq - tee_local $9 + local.tee $9 i32.eqz if - get_local $3 + local.get $3 i64.const 0 i64.eq - set_local $9 + local.set $9 end - get_local $9 + local.get $9 if - get_local $0 + local.get $0 return end - get_local $6 - get_local $8 + local.get $6 + local.get $8 i32.sub i32.const 64 i32.gt_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end f64.const 1 - set_local $7 - get_local $6 + local.set $7 + local.get $6 i32.const 1533 i32.gt_s if (result f64) f64.const 5260135901548373507240989e186 - set_local $7 - get_local $1 + local.set $7 + local.get $1 f64.const 1.90109156629516e-211 f64.mul - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 1.90109156629516e-211 f64.mul else - get_local $8 + local.get $8 i32.const 573 i32.lt_s if (result f64) f64.const 1.90109156629516e-211 - set_local $7 - get_local $1 + local.set $7 + local.get $1 f64.const 5260135901548373507240989e186 f64.mul - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 5260135901548373507240989e186 f64.mul else - get_local $0 + local.get $0 end end - tee_local $0 - get_local $0 - get_local $0 + local.tee $0 + local.get $0 + local.get $0 f64.const 134217729 f64.mul - tee_local $2 + local.tee $2 f64.sub - get_local $2 + local.get $2 f64.add - tee_local $2 + local.tee $2 f64.sub - set_local $4 - get_local $2 - get_local $2 + local.set $4 + local.get $2 + local.get $2 f64.mul - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - tee_local $0 + local.tee $0 f64.sub f64.const 2 - get_local $2 + local.get $2 f64.mul - get_local $4 + local.get $4 f64.add - get_local $4 + local.get $4 f64.mul f64.add - set_local $11 - get_local $1 - get_local $1 - get_local $1 + local.set $11 + local.get $1 + local.get $1 + local.get $1 f64.const 134217729 f64.mul - tee_local $2 + local.tee $2 f64.sub - get_local $2 + local.get $2 f64.add - tee_local $2 + local.tee $2 f64.sub - set_local $4 - get_local $7 - get_local $2 - get_local $2 + local.set $4 + local.get $7 + local.get $2 + local.get $2 f64.mul - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.mul - tee_local $1 + local.tee $1 f64.sub f64.const 2 - get_local $2 + local.get $2 f64.mul - get_local $4 + local.get $4 f64.add - get_local $4 + local.get $4 f64.mul f64.add - get_local $11 + local.get $11 f64.add - get_local $1 + local.get $1 f64.add - get_local $0 + local.get $0 f64.add f64.sqrt f64.mul ) (func $std/libm/hypot (; 33 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.hypot ) (func $~lib/math/NativeMath.imul (; 34 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.sub f64.const 0 f64.ne @@ -2360,36 +2360,36 @@ f64.const 0 return end - get_local $0 + local.get $0 f64.const 4294967296 - get_local $0 + local.get $0 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 - get_local $1 + i64.trunc_f64_s + i32.wrap_i64 + local.get $1 f64.const 4294967296 - get_local $1 + local.get $1 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 + i64.trunc_f64_s + i32.wrap_i64 i32.mul - f64.convert_s/i32 + f64.convert_i32_s ) (func $std/libm/imul (; 35 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.imul ) (func $std/libm/log (; 36 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log ) (func $~lib/math/NativeMath.log10 (; 37 ;) (type $FF) (param $0 f64) (result f64) @@ -2402,160 +2402,160 @@ (local $7 f64) (local $8 f64) (local $9 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $5 + local.get $0 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $2 + i32.wrap_i64 + local.tee $2 i32.const 1048576 i32.lt_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $2 + local.get $2 i32.const 31 i32.shr_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $5 + local.get $5 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $5 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if f64.const 0 return end end end - get_local $2 + local.get $2 i32.const 614242 i32.add - tee_local $2 + local.tee $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - get_local $4 + local.get $4 i32.add - set_local $4 - get_local $5 + local.set $4 + local.get $5 i64.const 4294967295 i64.and - get_local $2 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $1 + local.tee $1 f64.const 2 - get_local $1 + local.get $1 f64.add f64.div - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - tee_local $8 - get_local $8 + local.tee $8 + local.get $8 f64.mul - set_local $0 - get_local $4 - f64.convert_s/i32 - tee_local $6 + local.set $0 + local.get $4 + f64.convert_i32_s + local.tee $6 f64.const 0.30102999566361177 f64.mul - set_local $9 - get_local $6 + local.set $9 + local.get $6 f64.const 3.694239077158931e-13 f64.mul - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.const 0.5 - get_local $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $6 + local.tee $6 f64.sub - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $1 + f64.reinterpret_i64 + local.tee $1 f64.sub - get_local $6 + local.get $6 f64.sub - get_local $7 - get_local $6 - get_local $8 + local.get $7 + local.get $6 + local.get $8 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -2564,11 +2564,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -2579,37 +2579,37 @@ f64.add f64.mul f64.add - tee_local $0 - get_local $1 + local.tee $0 + local.get $1 f64.add f64.const 2.5082946711645275e-11 f64.mul f64.add - get_local $0 + local.get $0 f64.const 0.4342944818781689 f64.mul f64.add - get_local $9 - get_local $9 - get_local $1 + local.get $9 + local.get $9 + local.get $1 f64.const 0.4342944818781689 f64.mul - tee_local $1 + local.tee $1 f64.add - tee_local $0 + local.tee $0 f64.sub - get_local $1 + local.get $1 f64.add f64.add - get_local $0 + local.get $0 f64.add ) (func $std/libm/log10 (; 38 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log10 ) (func $std/libm/log1p (; 39 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log1p ) (func $~lib/math/NativeMath.log2 (; 40 ;) (type $FF) (param $0 f64) (result f64) @@ -2621,151 +2621,151 @@ (local $6 f64) (local $7 f64) (local $8 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $5 + local.get $0 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $2 + i32.wrap_i64 + local.tee $2 i32.const 1048576 i32.lt_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $2 + local.get $2 i32.const 31 i32.shr_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $5 + local.get $5 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $5 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if f64.const 0 return end end end - get_local $2 + local.get $2 i32.const 614242 i32.add - tee_local $2 + local.tee $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - get_local $4 + local.get $4 i32.add - set_local $4 - get_local $5 + local.set $4 + local.get $5 i64.const 4294967295 i64.and - get_local $2 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $1 + local.tee $1 f64.const 2 - get_local $1 + local.get $1 f64.add f64.div - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f64.mul - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - set_local $0 - get_local $1 - get_local $1 + local.set $0 + local.get $1 + local.get $1 f64.const 0.5 - get_local $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $1 + local.tee $1 f64.sub - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 + f64.reinterpret_i64 + local.tee $8 f64.sub - get_local $1 + local.get $1 f64.sub - get_local $6 - get_local $1 - get_local $7 + local.get $6 + local.get $1 + local.get $7 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -2774,11 +2774,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -2789,47 +2789,47 @@ f64.add f64.mul f64.add - tee_local $0 - get_local $8 + local.tee $0 + local.get $8 f64.add f64.const 1.6751713164886512e-10 f64.mul - get_local $0 + local.get $0 f64.const 1.4426950407214463 f64.mul f64.add - set_local $6 - get_local $4 - f64.convert_s/i32 - tee_local $7 - get_local $8 + local.set $6 + local.get $4 + f64.convert_i32_s + local.tee $7 + local.get $8 f64.const 1.4426950407214463 f64.mul - tee_local $1 + local.tee $1 f64.add - set_local $0 - get_local $6 - get_local $7 - get_local $0 + local.set $0 + local.get $6 + local.get $7 + local.get $0 f64.sub - get_local $1 + local.get $1 f64.add f64.add - get_local $0 + local.get $0 f64.add ) (func $std/libm/log2 (; 41 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log2 ) (func $std/libm/max (; 42 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.max ) (func $std/libm/min (; 43 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.min ) (func $~lib/math/NativeMath.pow (; 44 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -2853,171 +2853,171 @@ (local $19 f64) (local $20 i32) (local $21 i32) - get_local $0 - i64.reinterpret/f64 - tee_local $17 + local.get $0 + i64.reinterpret_f64 + local.tee $17 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $18 - get_local $17 - i32.wrap/i64 - set_local $20 - get_local $18 + i32.wrap_i64 + local.set $18 + local.get $17 + i32.wrap_i64 + local.set $20 + local.get $18 i32.const 2147483647 i32.and - set_local $5 - get_local $1 - i64.reinterpret/f64 - tee_local $17 + local.set $5 + local.get $1 + i64.reinterpret_f64 + local.tee $17 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $13 + i32.wrap_i64 + local.tee $13 i32.const 2147483647 i32.and - set_local $11 - get_local $11 - get_local $17 - i32.wrap/i64 - tee_local $21 + local.set $11 + local.get $11 + local.get $17 + i32.wrap_i64 + local.tee $21 i32.or i32.eqz if f64.const 1 return end - get_local $5 + local.get $5 i32.const 2146435072 i32.gt_s - tee_local $4 + local.tee $4 i32.eqz if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq - tee_local $4 + local.tee $4 if - get_local $20 + local.get $20 i32.const 0 i32.ne - set_local $4 + local.set $4 end end - get_local $4 + local.get $4 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.gt_s - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.eq - tee_local $4 + local.tee $4 if - get_local $21 + local.get $21 i32.const 0 i32.ne - set_local $4 + local.set $4 end end - get_local $4 + local.get $4 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end - get_local $18 + local.get $18 i32.const 0 i32.lt_s if - get_local $11 + local.get $11 i32.const 1128267776 i32.ge_s if (result i32) i32.const 2 else - get_local $11 + local.get $11 i32.const 1072693248 i32.ge_s if (result i32) - get_local $21 - get_local $11 - get_local $11 + local.get $21 + local.get $11 + local.get $11 i32.const 20 i32.shr_s i32.const 1023 i32.sub - tee_local $12 + local.tee $12 i32.const 20 i32.gt_s - tee_local $4 + local.tee $4 select - tee_local $7 + local.tee $7 i32.const 52 i32.const 20 - get_local $4 + local.get $4 select - get_local $12 + local.get $12 i32.sub - tee_local $9 + local.tee $9 i32.shr_s - set_local $4 + local.set $4 i32.const 2 - get_local $4 + local.get $4 i32.const 1 i32.and i32.sub i32.const 0 - get_local $4 - get_local $9 + local.get $4 + local.get $9 i32.shl - get_local $7 + local.get $7 i32.eq select else i32.const 0 end end - set_local $15 + local.set $15 end - get_local $21 + local.get $21 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.eq if - get_local $5 + local.get $5 i32.const 1072693248 i32.sub - get_local $20 + local.get $20 i32.or if - get_local $5 + local.get $5 i32.const 1072693248 i32.ge_s if - get_local $13 + local.get $13 i32.const 0 i32.lt_s if f64.const 0 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 return else f64.const 0 - get_local $1 + local.get $1 f64.neg - get_local $13 + local.get $13 i32.const 0 i32.ge_s select @@ -3030,184 +3030,184 @@ end unreachable end - get_local $11 + local.get $11 i32.const 1072693248 i32.eq if - get_local $13 + local.get $13 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 return end f64.const 1 - get_local $0 + local.get $0 f64.div return end - get_local $13 + local.get $13 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul return end - get_local $13 + local.get $13 i32.const 1071644672 i32.eq if - get_local $18 + local.get $18 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f64.sqrt return end end end - get_local $0 + local.get $0 f64.abs - set_local $2 - get_local $20 + local.set $2 + local.get $20 i32.eqz if - get_local $5 + local.get $5 i32.eqz - tee_local $4 + local.tee $4 i32.eqz if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz if - get_local $5 + local.get $5 i32.const 1072693248 i32.eq - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if f64.const 1 - get_local $2 + local.get $2 f64.div - get_local $2 - get_local $13 + local.get $2 + local.get $13 i32.const 0 i32.lt_s select - set_local $2 - get_local $18 + local.set $2 + local.get $18 i32.const 0 i32.lt_s if (result f64) - get_local $5 + local.get $5 i32.const 1072693248 i32.sub - get_local $15 + local.get $15 i32.or if (result f64) - get_local $2 + local.get $2 f64.neg - get_local $2 - get_local $15 + local.get $2 + local.get $15 i32.const 1 i32.eq select else - get_local $2 - get_local $2 + local.get $2 + local.get $2 f64.sub - tee_local $14 - get_local $14 + local.tee $14 + local.get $14 f64.div end else - get_local $2 + local.get $2 end return end end f64.const 1 - set_local $10 - get_local $18 + local.set $10 + local.get $18 i32.const 0 i32.lt_s if - get_local $15 + local.get $15 i32.eqz if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub - tee_local $14 - get_local $14 + local.tee $14 + local.get $14 f64.div return end f64.const -1 f64.const 1 - get_local $15 + local.get $15 i32.const 1 i32.eq select - set_local $10 + local.set $10 end - get_local $11 + local.get $11 i32.const 1105199104 i32.gt_s if (result f64) - get_local $11 + local.get $11 i32.const 1139802112 i32.gt_s if - get_local $5 + local.get $5 i32.const 1072693247 i32.le_s if f64.const inf f64.const 0 - get_local $13 + local.get $13 i32.const 0 i32.lt_s select return end - get_local $5 + local.get $5 i32.const 1072693248 i32.ge_s if f64.const inf f64.const 0 - get_local $13 + local.get $13 i32.const 0 i32.gt_s select return end end - get_local $5 + local.get $5 i32.const 1072693247 i32.lt_s if - get_local $13 + local.get $13 i32.const 0 i32.lt_s if (result f64) - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -3215,21 +3215,21 @@ end return end - get_local $5 + local.get $5 i32.const 1072693248 i32.gt_s if - get_local $13 + local.get $13 i32.const 0 i32.gt_s if (result f64) - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -3237,168 +3237,168 @@ end return end - get_local $2 + local.get $2 f64.const 1 f64.sub - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul f64.const 0.5 - get_local $3 + local.get $3 f64.const 0.3333333333333333 - get_local $3 + local.get $3 f64.const 0.25 f64.mul f64.sub f64.mul f64.sub f64.mul - set_local $0 + local.set $0 f64.const 1.4426950216293335 - get_local $3 + local.get $3 f64.mul - tee_local $16 - get_local $3 + local.tee $16 + local.get $3 f64.const 1.9259629911266175e-08 f64.mul - get_local $0 + local.get $0 f64.const 1.4426950408889634 f64.mul f64.sub - tee_local $6 + local.tee $6 f64.add - set_local $8 - get_local $6 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $6 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 - get_local $16 + f64.reinterpret_i64 + local.tee $8 + local.get $16 f64.sub f64.sub else i32.const 0 - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 1048576 i32.lt_s if (result i32) - get_local $2 + local.get $2 f64.const 9007199254740992 f64.mul - tee_local $2 - i64.reinterpret/f64 + local.tee $2 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 + i32.wrap_i64 + local.set $5 i32.const -53 else i32.const 0 end - get_local $5 + local.get $5 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 1048575 i32.and - tee_local $9 + local.tee $9 i32.const 1072693248 i32.or - set_local $5 - get_local $9 + local.set $5 + local.get $9 i32.const 235662 i32.le_s if (result i32) i32.const 0 else - get_local $9 + local.get $9 i32.const 767610 i32.lt_s if (result i32) i32.const 1 else - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const -1048576 i32.add - set_local $5 + local.set $5 i32.const 0 end end - set_local $12 - get_local $2 - i64.reinterpret/f64 + local.set $12 + local.get $2 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $5 - i64.extend_s/i32 + local.get $5 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - tee_local $2 + f64.reinterpret_i64 + local.tee $2 f64.const 1.5 f64.const 1 - get_local $12 + local.get $12 select - tee_local $0 + local.tee $0 f64.sub - tee_local $16 + local.tee $16 f64.const 1 - get_local $2 - get_local $0 + local.get $2 + local.get $0 f64.add f64.div - tee_local $6 + local.tee $6 f64.mul - set_local $14 - get_local $2 - get_local $5 + local.set $14 + local.get $2 + local.get $5 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - get_local $12 + local.get $12 i32.const 18 i32.shl i32.add - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - tee_local $8 - get_local $0 + f64.reinterpret_i64 + local.tee $8 + local.get $0 f64.sub f64.sub - set_local $2 - get_local $14 - get_local $14 + local.set $2 + local.get $14 + local.get $14 f64.mul - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul f64.const 0.5999999999999946 - get_local $3 + local.get $3 f64.const 0.4285714285785502 - get_local $3 + local.get $3 f64.const 0.33333332981837743 - get_local $3 + local.get $3 f64.const 0.272728123808534 - get_local $3 + local.get $3 f64.const 0.23066074577556175 - get_local $3 + local.get $3 f64.const 0.20697501780033842 f64.mul f64.add @@ -3411,300 +3411,300 @@ f64.mul f64.add f64.mul - set_local $19 - get_local $6 - get_local $16 - get_local $14 - i64.reinterpret/f64 + local.set $19 + local.get $6 + local.get $16 + local.get $14 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $6 - get_local $8 + f64.reinterpret_i64 + local.tee $6 + local.get $8 f64.mul f64.sub - get_local $6 - get_local $2 + local.get $6 + local.get $2 f64.mul f64.sub f64.mul - set_local $0 + local.set $0 f64.const 3 - get_local $6 - get_local $6 + local.get $6 + local.get $6 f64.mul - tee_local $3 + local.tee $3 f64.add - get_local $19 - get_local $0 - get_local $6 - get_local $14 + local.get $19 + local.get $0 + local.get $6 + local.get $14 f64.add f64.mul f64.add - tee_local $19 + local.tee $19 f64.add - set_local $8 - get_local $19 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $19 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 + f64.reinterpret_i64 + local.tee $8 f64.const 3 f64.sub - get_local $3 + local.get $3 f64.sub f64.sub - set_local $2 - get_local $6 - get_local $8 + local.set $2 + local.get $6 + local.get $8 f64.mul - tee_local $16 - get_local $0 - get_local $8 + local.tee $16 + local.get $0 + local.get $8 f64.mul - get_local $2 - get_local $14 + local.get $2 + local.get $14 f64.mul f64.add - tee_local $6 + local.tee $6 f64.add - set_local $0 - get_local $6 - get_local $0 - i64.reinterpret/f64 + local.set $0 + local.get $6 + local.get $0 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $0 - get_local $16 + f64.reinterpret_i64 + local.tee $0 + local.get $16 f64.sub f64.sub - set_local $6 + local.set $6 f64.const 0.9617967009544373 - get_local $0 + local.get $0 f64.mul - tee_local $19 + local.tee $19 f64.const -7.028461650952758e-09 - get_local $0 + local.get $0 f64.mul - get_local $6 + local.get $6 f64.const 0.9617966939259756 f64.mul f64.add f64.const 1.350039202129749e-08 f64.const 0 - get_local $12 + local.get $12 select f64.add - tee_local $2 + local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - get_local $12 + local.get $12 select - tee_local $0 + local.tee $0 f64.add - get_local $7 - f64.convert_s/i32 - tee_local $3 + local.get $7 + f64.convert_i32_s + local.tee $3 f64.add - set_local $8 - get_local $2 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $2 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 - get_local $3 + f64.reinterpret_i64 + local.tee $8 + local.get $3 f64.sub - get_local $0 + local.get $0 f64.sub - get_local $19 + local.get $19 f64.sub f64.sub end - set_local $2 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $2 + local.get $1 + local.get $1 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $0 + f64.reinterpret_i64 + local.tee $0 f64.sub - get_local $8 + local.get $8 f64.mul - get_local $1 - get_local $2 + local.get $1 + local.get $2 f64.mul f64.add - tee_local $6 - get_local $0 - get_local $8 + local.tee $6 + local.get $0 + local.get $8 f64.mul - tee_local $0 + local.tee $0 f64.add - tee_local $2 - i64.reinterpret/f64 - tee_local $17 - i32.wrap/i64 - set_local $4 + local.tee $2 + i64.reinterpret_f64 + local.tee $17 + i32.wrap_i64 + local.set $4 block $folding-inner1 block $folding-inner0 - get_local $17 + local.get $17 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $9 + i32.wrap_i64 + local.tee $9 i32.const 1083179008 i32.ge_s if - get_local $9 + local.get $9 i32.const 1083179008 i32.sub - get_local $4 + local.get $4 i32.or br_if $folding-inner0 - get_local $6 + local.get $6 f64.const 8.008566259537294e-17 f64.add - get_local $2 - get_local $0 + local.get $2 + local.get $0 f64.sub f64.gt br_if $folding-inner0 else - get_local $9 + local.get $9 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_s if - get_local $9 + local.get $9 i32.const -1064252416 i32.sub - get_local $4 + local.get $4 i32.or br_if $folding-inner1 - get_local $6 - get_local $2 - get_local $0 + local.get $6 + local.get $2 + local.get $0 f64.sub f64.le br_if $folding-inner1 end end - get_local $9 + local.get $9 i32.const 2147483647 i32.and - tee_local $4 + local.tee $4 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $12 + local.set $12 i32.const 0 - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.const 1071644672 i32.gt_s if i32.const 1048576 - get_local $12 + local.get $12 i32.const 1 i32.add i32.shr_s - get_local $9 + local.get $9 i32.add - tee_local $7 + local.tee $7 i32.const 2147483647 i32.and i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $12 + local.set $12 i32.const 1048575 - get_local $12 + local.get $12 i32.shr_s i32.const -1 i32.xor - get_local $7 + local.get $7 i32.and - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $3 - get_local $7 + f64.reinterpret_i64 + local.set $3 + local.get $7 i32.const 1048575 i32.and i32.const 1048576 i32.or i32.const 20 - get_local $12 + local.get $12 i32.sub i32.shr_s - set_local $7 + local.set $7 i32.const 0 - get_local $7 + local.get $7 i32.sub - get_local $7 - get_local $9 + local.get $7 + local.get $9 i32.const 0 i32.lt_s select - set_local $7 - get_local $0 - get_local $3 + local.set $7 + local.get $0 + local.get $3 f64.sub - set_local $0 + local.set $0 end - get_local $6 - get_local $0 + local.get $6 + local.get $0 f64.add - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $3 + f64.reinterpret_i64 + local.tee $3 f64.const 0.6931471824645996 f64.mul - tee_local $16 - get_local $6 - get_local $3 - get_local $0 + local.tee $16 + local.get $6 + local.get $3 + local.get $0 f64.sub f64.sub f64.const 0.6931471805599453 f64.mul - get_local $3 + local.get $3 f64.const -1.904654299957768e-09 f64.mul f64.add - tee_local $6 + local.tee $6 f64.add - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.mul - set_local $3 - get_local $10 + local.set $3 + local.get $10 f64.const 1 - get_local $2 - get_local $2 - get_local $3 + local.get $2 + local.get $2 + local.get $3 f64.const 0.16666666666666602 - get_local $3 + local.get $3 f64.const -2.7777777777015593e-03 - get_local $3 + local.get $3 f64.const 6.613756321437934e-05 - get_local $3 + local.get $3 f64.const -1.6533902205465252e-06 - get_local $3 + local.get $3 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -3716,149 +3716,149 @@ f64.add f64.mul f64.sub - tee_local $8 + local.tee $8 f64.mul - get_local $8 + local.get $8 f64.const 2 f64.sub f64.div - get_local $6 - get_local $2 - get_local $16 + local.get $6 + local.get $2 + local.get $16 f64.sub f64.sub - tee_local $0 - get_local $2 - get_local $0 + local.tee $0 + local.get $2 + local.get $0 f64.mul f64.add f64.sub - get_local $2 + local.get $2 f64.sub f64.sub - tee_local $2 - i64.reinterpret/f64 + local.tee $2 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - get_local $7 + i32.wrap_i64 + local.get $7 i32.const 20 i32.shl i32.add - tee_local $9 + local.tee $9 i32.const 20 i32.shr_s i32.const 0 i32.le_s if (result f64) - get_local $2 - get_local $7 + local.get $2 + local.get $7 call $~lib/math/NativeMath.scalbn else - get_local $2 - i64.reinterpret/f64 + local.get $2 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $9 - i64.extend_s/i32 + local.get $9 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 end f64.mul return end - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul ) (func $std/libm/pow (; 45 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.pow ) (func $std/libm/round (; 46 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.const 0.5 f64.add f64.floor - get_local $0 + local.get $0 f64.copysign ) (func $std/libm/sign (; 47 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.const 0 f64.gt if f64.const 1 - set_local $0 + local.set $0 else - get_local $0 + local.get $0 f64.const 0 f64.lt if f64.const -1 - set_local $0 + local.set $0 end end - get_local $0 + local.get $0 ) (func $~lib/math/NativeMath.sinh (; 48 ;) (type $FF) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 i32) (local $4 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $4 - f64.reinterpret/i64 - set_local $1 + local.tee $4 + f64.reinterpret_i64 + local.set $1 f64.const 0.5 - get_local $0 + local.get $0 f64.copysign - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $3 + i32.wrap_i64 + local.tee $3 i32.const 1082535490 i32.lt_u if - get_local $1 + local.get $1 call $~lib/math/NativeMath.expm1 - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.const 1072693248 i32.lt_u if - get_local $3 + local.get $3 i32.const 1045430272 i32.lt_u if - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 f64.const 2 - get_local $1 + local.get $1 f64.mul - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.const 1 f64.add f64.div @@ -3866,10 +3866,10 @@ f64.mul return end - get_local $2 - get_local $1 - get_local $1 - get_local $1 + local.get $2 + local.get $1 + local.get $1 + local.get $1 f64.const 1 f64.add f64.div @@ -3878,9 +3878,9 @@ return end f64.const 2 - get_local $2 + local.get $2 f64.mul - get_local $1 + local.get $1 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp @@ -3891,46 +3891,46 @@ f64.mul ) (func $std/libm/sinh (; 49 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.sinh ) (func $std/libm/sqrt (; 50 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.sqrt ) (func $~lib/math/NativeMath.tanh (; 51 ;) (type $FF) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $3 - f64.reinterpret/i64 - set_local $1 - get_local $3 + local.tee $3 + f64.reinterpret_i64 + local.set $1 + local.get $3 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $2 + i32.wrap_i64 + local.tee $2 i32.const 1071748074 i32.gt_u if - get_local $2 + local.get $2 i32.const 1077149696 i32.gt_u if (result f64) f64.const 1 f64.const 0 - get_local $1 + local.get $1 f64.div f64.sub else f64.const 1 f64.const 2 f64.const 2 - get_local $1 + local.get $1 f64.mul call $~lib/math/NativeMath.expm1 f64.const 2 @@ -3938,51 +3938,51 @@ f64.div f64.sub end - set_local $1 + local.set $1 else - get_local $2 + local.get $2 i32.const 1070618798 i32.gt_u if f64.const 2 - get_local $1 + local.get $1 f64.mul call $~lib/math/NativeMath.expm1 - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f64.const 2 f64.add f64.div - set_local $1 + local.set $1 else - get_local $2 + local.get $2 i32.const 1048576 i32.ge_u if f64.const -2 - get_local $1 + local.get $1 f64.mul call $~lib/math/NativeMath.expm1 - tee_local $1 + local.tee $1 f64.neg - get_local $1 + local.get $1 f64.const 2 f64.add f64.div - set_local $1 + local.set $1 end end end - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.copysign ) (func $std/libm/tanh (; 52 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.tanh ) (func $std/libm/trunc (; 53 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.trunc ) (func $null (; 54 ;) (type $v) diff --git a/tests/compiler/std/libm.untouched.wat b/tests/compiler/std/libm.untouched.wat index ce8b000c..a4189e0d 100644 --- a/tests/compiler/std/libm.untouched.wat +++ b/tests/compiler/std/libm.untouched.wat @@ -6,7 +6,7 @@ (type $Ff (func (param f64) (result f32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -72,23 +72,23 @@ (export "tanh" (func $std/libm/tanh)) (export "trunc" (func $std/libm/trunc)) (func $std/libm/abs (; 0 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.abs ) (func $~lib/math/R (; 1 ;) (type $FF) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) - get_local $0 + local.get $0 f64.const 0.16666666666666666 - get_local $0 + local.get $0 f64.const -0.3255658186224009 - get_local $0 + local.get $0 f64.const 0.20121253213486293 - get_local $0 + local.get $0 f64.const -0.04005553450067941 - get_local $0 + local.get $0 f64.const 7.915349942898145e-04 - get_local $0 + local.get $0 f64.const 3.479331075960212e-05 f64.mul f64.add @@ -101,15 +101,15 @@ f64.mul f64.add f64.mul - set_local $1 + local.set $1 f64.const 1 - get_local $0 + local.get $0 f64.const -2.403394911734414 - get_local $0 + local.get $0 f64.const 2.0209457602335057 - get_local $0 + local.get $0 f64.const -0.6882839716054533 - get_local $0 + local.get $0 f64.const 0.07703815055590194 f64.mul f64.add @@ -119,9 +119,9 @@ f64.add f64.mul f64.add - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 f64.div ) (func $~lib/math/NativeMath.acos (; 2 ;) (type $FF) (param $0 f64) (result f64) @@ -133,33 +133,33 @@ (local $6 f64) (local $7 f64) (local $8 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - set_local $3 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.set $3 + local.get $2 i32.const 1072693248 i32.sub - get_local $3 + local.get $3 i32.or i32.const 0 i32.eq if - get_local $1 + local.get $1 i32.const 31 i32.shr_u if @@ -167,7 +167,7 @@ f64.const 1.5707963267948966 f64.mul f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add return end @@ -175,32 +175,32 @@ return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1012924416 i32.le_u if f64.const 1.5707963267948966 f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add return end f64.const 1.5707963267948966 - get_local $0 + local.get $0 f64.const 6.123233995736766e-17 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -209,75 +209,75 @@ f64.sub return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.add - set_local $6 - get_local $6 + local.set $6 + local.get $6 f64.sqrt - set_local $4 - get_local $6 + local.set $4 + local.get $6 call $~lib/math/R - get_local $4 + local.get $4 f64.mul f64.const 6.123233995736766e-17 f64.sub - set_local $5 + local.set $5 f64.const 2 f64.const 1.5707963267948966 - get_local $4 - get_local $5 + local.get $4 + local.get $5 f64.add f64.sub f64.mul return end f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.sub - set_local $6 - get_local $6 + local.set $6 + local.get $6 f64.sqrt - set_local $4 - get_local $4 - i64.reinterpret/f64 + local.set $4 + local.get $4 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $7 - get_local $6 - get_local $7 - get_local $7 + f64.reinterpret_i64 + local.set $7 + local.get $6 + local.get $7 + local.get $7 f64.mul f64.sub - get_local $4 - get_local $7 + local.get $4 + local.get $7 f64.add f64.div - set_local $8 - get_local $6 + local.set $8 + local.get $6 call $~lib/math/R - get_local $4 + local.get $4 f64.mul - get_local $8 + local.get $8 f64.add - set_local $5 + local.set $5 f64.const 2 - get_local $7 - get_local $5 + local.get $7 + local.get $5 f64.add f64.mul ) (func $std/libm/acos (; 3 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acos ) (func $~lib/math/NativeMath.log1p (; 4 ;) (type $FF) (param $0 f64) (result f64) @@ -296,53 +296,53 @@ (local $13 f64) (local $14 f64) (local $15 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 1 - set_local $3 + local.set $3 f64.const 0 - set_local $4 + local.set $4 f64.const 0 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 1071284858 i32.lt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $2 + local.get $2 i32.const -1074790400 i32.ge_u if - get_local $0 + local.get $0 f64.const -1 f64.eq if - get_local $0 + local.get $0 f64.const 0 f64.div return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl i32.const 1017118720 @@ -350,145 +350,145 @@ i32.shl i32.lt_u if - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 i32.const -1076707644 i32.le_u if i32.const 0 - set_local $3 + local.set $3 f64.const 0 - set_local $4 - get_local $0 - set_local $5 + local.set $4 + local.get $0 + local.set $5 end else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return end end - get_local $3 + local.get $3 if f64.const 1 - get_local $0 + local.get $0 f64.add - i64.reinterpret/f64 - set_local $1 - get_local $1 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $6 + i32.wrap_i64 + local.set $6 + local.get $6 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 20 i32.shr_u i32.const 1023 i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 54 i32.lt_s if - get_local $1 - f64.reinterpret/i64 - set_local $7 - get_local $3 + local.get $1 + f64.reinterpret_i64 + local.set $7 + local.get $3 i32.const 2 i32.ge_s if (result f64) f64.const 1 - get_local $7 - get_local $0 + local.get $7 + local.get $0 f64.sub f64.sub else - get_local $0 - get_local $7 + local.get $0 + local.get $7 f64.const 1 f64.sub f64.sub end - set_local $4 - get_local $4 - get_local $7 + local.set $4 + local.get $4 + local.get $7 f64.div - set_local $4 + local.set $4 else f64.const 0 - set_local $4 + local.set $4 end - get_local $6 + local.get $6 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $6 - get_local $6 - i64.extend_u/i32 + local.set $6 + local.get $6 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 + local.set $1 + local.get $1 + f64.reinterpret_i64 f64.const 1 f64.sub - set_local $5 + local.set $5 end f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $8 - get_local $5 + local.set $8 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f64.mul - set_local $10 - get_local $10 - get_local $10 + local.set $10 + local.get $10 + local.get $10 f64.mul - set_local $11 - get_local $11 + local.set $11 + local.get $11 f64.const 0.3999999999940942 - get_local $11 + local.get $11 f64.const 0.22222198432149784 - get_local $11 + local.get $11 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $12 - get_local $10 + local.set $12 + local.get $10 f64.const 0.6666666666666735 - get_local $11 + local.get $11 f64.const 0.2857142874366239 - get_local $11 + local.get $11 f64.const 0.1818357216161805 - get_local $11 + local.get $11 f64.const 0.14798198605116586 f64.mul f64.add @@ -497,30 +497,30 @@ f64.mul f64.add f64.mul - set_local $13 - get_local $13 - get_local $12 + local.set $13 + local.get $13 + local.get $12 f64.add - set_local $14 - get_local $3 - f64.convert_s/i32 - set_local $15 - get_local $9 - get_local $8 - get_local $14 + local.set $14 + local.get $3 + f64.convert_i32_s + local.set $15 + local.get $9 + local.get $8 + local.get $14 f64.add f64.mul - get_local $15 + local.get $15 f64.const 1.9082149292705877e-10 f64.mul - get_local $4 + local.get $4 f64.add f64.add - get_local $8 + local.get $8 f64.sub - get_local $5 + local.get $5 f64.add - get_local $15 + local.get $15 f64.const 0.6931471803691238 f64.mul f64.add @@ -539,88 +539,88 @@ (local $11 f64) (local $12 f64) (local $13 i32) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -628,81 +628,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -711,60 +711,60 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $3 - set_local $13 - get_local $7 - get_local $6 - get_local $12 + local.set $12 + local.get $3 + local.set $13 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul - get_local $13 - f64.convert_s/i32 + local.get $13 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul f64.add - get_local $6 + local.get $6 f64.sub - get_local $5 + local.get $5 f64.add - get_local $13 - f64.convert_s/i32 + local.get $13 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add ) (func $~lib/math/NativeMath.acosh (; 6 ;) (type $FF) (param $0 f64) (result f64) (local $1 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i64.const 1023 i64.const 1 i64.add i64.lt_u if - get_local $0 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.sub f64.mul f64.const 2 - get_local $0 + local.get $0 f64.const 1 f64.sub f64.mul @@ -774,19 +774,19 @@ call $~lib/math/NativeMath.log1p return end - get_local $1 + local.get $1 i64.const 1023 i64.const 26 i64.add i64.lt_u if f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul f64.const 1 f64.sub @@ -797,13 +797,13 @@ call $~lib/math/NativeMath.log return end - get_local $0 + local.get $0 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add ) (func $std/libm/acosh (; 7 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acosh ) (func $~lib/math/NativeMath.asin (; 8 ;) (type $FF) (param $0 f64) (result f64) @@ -815,70 +815,70 @@ (local $6 f64) (local $7 f64) (local $8 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - set_local $3 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.set $3 + local.get $2 i32.const 1072693248 i32.sub - get_local $3 + local.get $3 i32.or i32.const 0 i32.eq if - get_local $0 + local.get $0 f64.const 1.5707963267948966 f64.mul f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1045430272 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $2 + local.get $2 i32.const 1048576 i32.ge_u else - get_local $3 + local.get $3 end if - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -886,62 +886,62 @@ return end f64.const 0.5 - get_local $0 + local.get $0 f64.abs f64.const 0.5 f64.mul f64.sub - set_local $4 - get_local $4 + local.set $4 + local.get $4 f64.sqrt - set_local $5 - get_local $4 + local.set $5 + local.get $4 call $~lib/math/R - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 1072640819 i32.ge_u if f64.const 1.5707963267948966 f64.const 2 - get_local $5 - get_local $5 - get_local $6 + local.get $5 + local.get $5 + local.get $6 f64.mul f64.add f64.mul f64.const 6.123233995736766e-17 f64.sub f64.sub - set_local $0 + local.set $0 else - get_local $5 - i64.reinterpret/f64 + local.get $5 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $7 - get_local $4 - get_local $7 - get_local $7 + f64.reinterpret_i64 + local.set $7 + local.get $4 + local.get $7 + local.get $7 f64.mul f64.sub - get_local $5 - get_local $7 + local.get $5 + local.get $7 f64.add f64.div - set_local $8 + local.set $8 f64.const 0.5 f64.const 1.5707963267948966 f64.mul f64.const 2 - get_local $5 + local.get $5 f64.mul - get_local $6 + local.get $6 f64.mul f64.const 6.123233995736766e-17 f64.const 2 - get_local $8 + local.get $8 f64.mul f64.sub f64.sub @@ -949,92 +949,92 @@ f64.const 1.5707963267948966 f64.mul f64.const 2 - get_local $7 + local.get $7 f64.mul f64.sub f64.sub f64.sub - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 + local.get $0 f64.neg return end - get_local $0 + local.get $0 ) (func $std/libm/asin (; 9 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asin ) (func $~lib/math/NativeMath.asinh (; 10 ;) (type $FF) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i64.const 9223372036854775807 i64.and - f64.reinterpret/i64 - set_local $3 - get_local $2 + f64.reinterpret_i64 + local.set $3 + local.get $2 i64.const 1023 i64.const 26 i64.add i64.ge_u if - get_local $3 + local.get $3 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add - set_local $3 + local.set $3 else - get_local $2 + local.get $2 i64.const 1023 i64.const 1 i64.add i64.ge_u if f64.const 2 - get_local $3 + local.get $3 f64.mul f64.const 1 - get_local $3 - get_local $3 + local.get $3 + local.get $3 f64.mul f64.const 1 f64.add f64.sqrt - get_local $3 + local.get $3 f64.add f64.div f64.add call $~lib/math/NativeMath.log - set_local $3 + local.set $3 else - get_local $2 + local.get $2 i64.const 1023 i64.const 26 i64.sub i64.ge_u if - get_local $3 - get_local $3 - get_local $3 + local.get $3 + local.get $3 + local.get $3 f64.mul - get_local $3 - get_local $3 + local.get $3 + local.get $3 f64.mul f64.const 1 f64.add @@ -1044,21 +1044,21 @@ f64.div f64.add call $~lib/math/NativeMath.log1p - set_local $3 + local.set $3 end end end - get_local $3 - get_local $0 + local.get $3 + local.get $0 f64.copysign ) (func $std/libm/asinh (; 11 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asinh ) (func $~lib/builtins/isNaN (; 12 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne ) (func $~lib/math/NativeMath.atan (; 13 ;) (type $FF) (param $0 f64) (result f64) @@ -1071,133 +1071,133 @@ (local $7 f64) (local $8 f64) (local $9 i32) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $0 - set_local $2 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $0 + local.set $2 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1141899264 i32.ge_u if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 return end f64.const 1.5707963267948966 f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 f64.copysign return end - get_local $1 + local.get $1 i32.const 1071382528 i32.lt_u if - get_local $1 + local.get $1 i32.const 1044381696 i32.lt_u if - get_local $0 + local.get $0 return end i32.const -1 - set_local $4 + local.set $4 else - get_local $0 + local.get $0 f64.abs - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1072889856 i32.lt_u if - get_local $1 + local.get $1 i32.const 1072037888 i32.lt_u if i32.const 0 - set_local $4 + local.set $4 f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 f64.sub f64.const 2 - get_local $0 + local.get $0 f64.add f64.div - set_local $0 + local.set $0 else i32.const 1 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.add f64.div - set_local $0 + local.set $0 end else - get_local $1 + local.get $1 i32.const 1073971200 i32.lt_u if i32.const 2 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 1.5 f64.sub f64.const 1 f64.const 1.5 - get_local $0 + local.get $0 f64.mul f64.add f64.div - set_local $0 + local.set $0 else i32.const 3 - set_local $4 + local.set $4 f64.const -1 - get_local $0 + local.get $0 f64.div - set_local $0 + local.set $0 end end end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - set_local $3 - get_local $3 - get_local $3 + local.set $3 + local.get $3 + local.get $3 f64.mul - set_local $5 - get_local $3 + local.set $5 + local.get $3 f64.const 0.3333333333333293 - get_local $5 + local.get $5 f64.const 0.14285714272503466 - get_local $5 + local.get $5 f64.const 0.09090887133436507 - get_local $5 + local.get $5 f64.const 0.06661073137387531 - get_local $5 + local.get $5 f64.const 0.049768779946159324 - get_local $5 + local.get $5 f64.const 0.016285820115365782 f64.mul f64.add @@ -1210,16 +1210,16 @@ f64.mul f64.add f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const -0.19999999999876483 - get_local $5 + local.get $5 f64.const -0.11111110405462356 - get_local $5 + local.get $5 f64.const -0.0769187620504483 - get_local $5 + local.get $5 f64.const -0.058335701337905735 - get_local $5 + local.get $5 f64.const -0.036531572744216916 f64.mul f64.add @@ -1230,19 +1230,19 @@ f64.mul f64.add f64.mul - set_local $7 - get_local $0 - get_local $6 - get_local $7 + local.set $7 + local.get $0 + local.get $6 + local.get $7 f64.add f64.mul - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 0 i32.lt_s if - get_local $0 - get_local $8 + local.get $0 + local.get $8 f64.sub return end @@ -1252,21 +1252,21 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $4 - set_local $9 - get_local $9 + local.get $4 + local.set $9 + local.get $9 i32.const 0 i32.eq br_if $case0|0 - get_local $9 + local.get $9 i32.const 1 i32.eq br_if $case1|0 - get_local $9 + local.get $9 i32.const 2 i32.eq br_if $case2|0 - get_local $9 + local.get $9 i32.const 3 i32.eq br_if $case3|0 @@ -1274,13 +1274,13 @@ end block f64.const 0.4636476090008061 - get_local $8 + local.get $8 f64.const 2.2698777452961687e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -1288,13 +1288,13 @@ end block f64.const 0.7853981633974483 - get_local $8 + local.get $8 f64.const 3.061616997868383e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -1302,13 +1302,13 @@ end block f64.const 0.982793723247329 - get_local $8 + local.get $8 f64.const 1.3903311031230998e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -1316,13 +1316,13 @@ end block f64.const 1.5707963267948966 - get_local $8 + local.get $8 f64.const 6.123233995736766e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -1330,12 +1330,12 @@ end unreachable end - get_local $3 - get_local $2 + local.get $3 + local.get $2 f64.copysign ) (func $std/libm/atan (; 14 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan ) (func $~lib/math/NativeMath.atanh (; 15 ;) (type $FF) (param $0 f64) (result f64) @@ -1343,33 +1343,33 @@ (local $2 i64) (local $3 i64) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i64.const 63 i64.shr_u - set_local $3 - get_local $1 + local.set $3 + local.get $1 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $4 - get_local $2 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $4 + local.get $2 i64.const 1023 i64.const 1 i64.sub i64.lt_u if - get_local $2 + local.get $2 i64.const 1023 i64.const 32 i64.sub @@ -1377,41 +1377,41 @@ if f64.const 0.5 f64.const 2 - get_local $4 + local.get $4 f64.mul f64.const 2 - get_local $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.mul f64.const 1 - get_local $4 + local.get $4 f64.sub f64.div f64.add call $~lib/math/NativeMath.log1p f64.mul - set_local $4 + local.set $4 end else f64.const 0.5 f64.const 2 - get_local $4 + local.get $4 f64.const 1 - get_local $4 + local.get $4 f64.sub f64.div f64.mul call $~lib/math/NativeMath.log1p f64.mul - set_local $4 + local.set $4 end - get_local $4 - get_local $0 + local.get $4 + local.get $0 f64.copysign ) (func $std/libm/atanh (; 16 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atanh ) (func $~lib/math/NativeMath.atan2 (; 17 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -1423,77 +1423,77 @@ (local $7 i32) (local $8 i32) (local $9 f64) - get_local $1 + local.get $1 call $~lib/builtins/isNaN - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 + local.get $0 call $~lib/builtins/isNaN end if - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.add return end - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $3 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $3 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $3 - i32.wrap/i64 - set_local $5 - get_local $0 - i64.reinterpret/f64 - set_local $3 - get_local $3 + i32.wrap_i64 + local.set $4 + local.get $3 + i32.wrap_i64 + local.set $5 + local.get $0 + i64.reinterpret_f64 + local.set $3 + local.get $3 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $3 - i32.wrap/i64 - set_local $7 - get_local $4 + i32.wrap_i64 + local.set $6 + local.get $3 + i32.wrap_i64 + local.set $7 + local.get $4 i32.const 1072693248 i32.sub - get_local $5 + local.get $5 i32.or i32.const 0 i32.eq if - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan return end - get_local $6 + local.get $6 i32.const 31 i32.shr_u i32.const 1 i32.and - get_local $4 + local.get $4 i32.const 30 i32.shr_u i32.const 2 i32.and i32.or - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 2147483647 i32.and - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2147483647 i32.and - set_local $6 - get_local $6 - get_local $7 + local.set $6 + local.get $6 + local.get $7 i32.or i32.const 0 i32.eq @@ -1503,64 +1503,64 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|0 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|0 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|0 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|0 br $break|0 end end - get_local $0 + local.get $0 return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg return end end - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.or i32.const 0 i32.eq if - get_local $8 + local.get $8 i32.const 1 i32.and if (result f64) - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg f64.const 2 f64.div else - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.const 2 f64.div end return end - get_local $4 + local.get $4 i32.const 2146435072 i32.eq if - get_local $6 + local.get $6 i32.const 2146435072 i32.eq if @@ -1569,46 +1569,46 @@ block $case2|1 block $case1|1 block $case0|1 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|1 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|1 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|1 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|1 br $break|1 end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.const 4 f64.div return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg f64.const 4 f64.div return end f64.const 3 - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.mul f64.const 4 f64.div return end f64.const -3 - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.mul f64.const 4 f64.div @@ -1620,21 +1620,21 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|2 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|2 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|2 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|2 @@ -1646,115 +1646,115 @@ f64.const -0 return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg return end end end - get_local $4 + local.get $4 i32.const 64 i32.const 20 i32.shl i32.add - get_local $6 + local.get $6 i32.lt_u - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $6 + local.get $6 i32.const 2146435072 i32.eq end if - get_local $8 + local.get $8 i32.const 1 i32.and if (result f64) - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg f64.const 2 f64.div else - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.const 2 f64.div end return end - get_local $8 + local.get $8 i32.const 2 i32.and - tee_local $2 + local.tee $2 if (result i32) - get_local $6 + local.get $6 i32.const 64 i32.const 20 i32.shl i32.add - get_local $4 + local.get $4 i32.lt_u else - get_local $2 + local.get $2 end if f64.const 0 - set_local $9 + local.set $9 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.div f64.abs call $~lib/math/NativeMath.atan - set_local $9 + local.set $9 end block $break|3 block $case3|3 block $case2|3 block $case1|3 block $case0|3 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|3 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|3 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|3 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|3 br $break|3 end - get_local $9 + local.get $9 return end - get_local $9 + local.get $9 f64.neg return end - get_global $~lib/math/NativeMath.PI - get_local $9 + global.get $~lib/math/NativeMath.PI + local.get $9 f64.const 1.2246467991473532e-16 f64.sub f64.sub return end - get_local $9 + local.get $9 f64.const 1.2246467991473532e-16 f64.sub - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.sub return end @@ -1762,8 +1762,8 @@ f64.const 0 ) (func $std/libm/atan2 (; 18 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.atan2 ) (func $~lib/math/NativeMath.cbrt (; 19 ;) (type $FF) (param $0 f64) (result f64) @@ -1772,164 +1772,164 @@ (local $3 f64) (local $4 f64) (local $5 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.add return end - get_local $2 + local.get $2 i32.const 1048576 i32.lt_u if - get_local $0 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - set_local $1 - get_local $1 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.eq if - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 i32.const 3 i32.div_u i32.const 696219795 i32.add - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const 3 i32.div_u i32.const 715094163 i32.add - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i64.const 1 i64.const 63 i64.shl i64.and - set_local $1 - get_local $1 - get_local $2 - i64.extend_u/i32 + local.set $1 + local.get $1 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $3 - get_local $3 - get_local $3 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $3 + local.get $3 + local.get $3 f64.mul - get_local $3 - get_local $0 + local.get $3 + local.get $0 f64.div f64.mul - set_local $4 - get_local $3 + local.set $4 + local.get $3 f64.const 1.87595182427177 - get_local $4 + local.get $4 f64.const -1.8849797954337717 - get_local $4 + local.get $4 f64.const 1.6214297201053545 f64.mul f64.add f64.mul f64.add - get_local $4 - get_local $4 + local.get $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.mul f64.const -0.758397934778766 - get_local $4 + local.get $4 f64.const 0.14599619288661245 f64.mul f64.add f64.mul f64.add f64.mul - set_local $3 - get_local $3 - i64.reinterpret/f64 + local.set $3 + local.get $3 + i64.reinterpret_f64 i64.const 2147483648 i64.add i64.const -1073741824 i64.and - f64.reinterpret/i64 - set_local $3 - get_local $3 - get_local $3 + f64.reinterpret_i64 + local.set $3 + local.get $3 + local.get $3 f64.mul - set_local $5 - get_local $0 - get_local $5 + local.set $5 + local.get $0 + local.get $5 f64.div - set_local $4 - get_local $4 - get_local $3 + local.set $4 + local.get $4 + local.get $3 f64.sub f64.const 2 - get_local $3 + local.get $3 f64.mul - get_local $4 + local.get $4 f64.add f64.div - set_local $4 - get_local $3 - get_local $3 - get_local $4 + local.set $4 + local.get $3 + local.get $3 + local.get $4 f64.mul f64.add - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $std/libm/cbrt (; 20 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cbrt ) (func $std/libm/ceil (; 21 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.ceil ) (func $std/libm/clz32 (; 22 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 - i32.trunc_s/f64 + local.get $0 + i32.trunc_f64_s i32.clz - f64.convert_s/i32 + f64.convert_i32_s ) (func $~lib/math/NativeMath.cos (; 23 ;) (type $FF) (param $0 f64) (result f64) unreachable f64.const 0 ) (func $std/libm/cos (; 24 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cos ) (func $~lib/math/NativeMath.expm1 (; 25 ;) (type $FF) (param $0 f64) (result f64) @@ -1949,130 +1949,130 @@ (local $14 f64) (local $15 f64) (local $16 i32) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u i64.const 2147483647 i64.and - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i64.const 63 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $2 + i32.wrap_i64 + local.set $4 + local.get $2 i32.const 1078159482 i32.ge_u if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 if f64.const -1 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end end f64.const 0 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 1071001154 i32.gt_u if i32.const 1 - get_local $4 + local.get $4 i32.const 1 i32.shl i32.sub f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 - get_local $2 + i32.trunc_f64_s + local.get $2 i32.const 1072734898 i32.lt_u select - set_local $3 - get_local $3 - f64.convert_s/i32 - set_local $6 - get_local $0 - get_local $6 + local.set $3 + local.get $3 + f64.convert_i32_s + local.set $6 + local.get $0 + local.get $6 f64.const 0.6931471803691238 f64.mul f64.sub - set_local $7 - get_local $6 + local.set $7 + local.get $6 f64.const 1.9082149292705877e-10 f64.mul - set_local $8 - get_local $7 - get_local $8 + local.set $8 + local.get $7 + local.get $8 f64.sub - set_local $0 - get_local $7 - get_local $0 + local.set $0 + local.get $7 + local.get $0 f64.sub - get_local $8 + local.get $8 f64.sub - set_local $5 + local.set $5 else - get_local $2 + local.get $2 i32.const 1016070144 i32.lt_u if - get_local $0 + local.get $0 return end end f64.const 0.5 - get_local $0 + local.get $0 f64.mul - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 f64.mul - set_local $10 - get_local $10 - get_local $10 + local.set $10 + local.get $10 + local.get $10 f64.mul - set_local $11 + local.set $11 f64.const 1 - get_local $10 + local.get $10 f64.const -0.03333333333333313 f64.mul f64.add - get_local $11 + local.get $11 f64.const 1.5873015872548146e-03 - get_local $10 + local.get $10 f64.const -7.93650757867488e-05 f64.mul f64.add - get_local $11 + local.get $11 f64.const 4.008217827329362e-06 - get_local $10 + local.get $10 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -2080,74 +2080,74 @@ f64.add f64.mul f64.add - set_local $12 + local.set $12 f64.const 3 - get_local $12 - get_local $9 + local.get $12 + local.get $9 f64.mul f64.sub - set_local $6 - get_local $10 - get_local $12 - get_local $6 + local.set $6 + local.get $10 + local.get $12 + local.get $6 f64.sub f64.const 6 - get_local $0 - get_local $6 + local.get $0 + local.get $6 f64.mul f64.sub f64.div f64.mul - set_local $13 - get_local $3 + local.set $13 + local.get $3 i32.const 0 i32.eq if - get_local $0 - get_local $0 - get_local $13 + local.get $0 + local.get $0 + local.get $13 f64.mul - get_local $10 + local.get $10 f64.sub f64.sub return end - get_local $0 - get_local $13 - get_local $5 + local.get $0 + local.get $13 + local.get $5 f64.sub f64.mul - get_local $5 + local.get $5 f64.sub - set_local $13 - get_local $13 - get_local $10 + local.set $13 + local.get $13 + local.get $10 f64.sub - set_local $13 - get_local $3 + local.set $13 + local.get $3 i32.const -1 i32.eq if f64.const 0.5 - get_local $0 - get_local $13 + local.get $0 + local.get $13 f64.sub f64.mul f64.const 0.5 f64.sub return end - get_local $3 + local.get $3 i32.const 1 i32.eq if - get_local $0 + local.get $0 f64.const -0.25 f64.lt if f64.const -2 - get_local $13 - get_local $0 + local.get $13 + local.get $0 f64.const 0.5 f64.add f64.sub @@ -2156,185 +2156,185 @@ end f64.const 1 f64.const 2 - get_local $0 - get_local $13 + local.get $0 + local.get $13 f64.sub f64.mul f64.add return end i64.const 1023 - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.add i64.const 52 i64.shl - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $14 - get_local $3 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $14 + local.get $3 i32.const 0 i32.lt_s - tee_local $16 + local.tee $16 if (result i32) - get_local $16 + local.get $16 else - get_local $3 + local.get $3 i32.const 56 i32.gt_s end if - get_local $0 - get_local $13 + local.get $0 + local.get $13 f64.sub f64.const 1 f64.add - set_local $15 - get_local $3 + local.set $15 + local.get $3 i32.const 1024 i32.eq if - get_local $15 + local.get $15 f64.const 2 f64.mul f64.const 8988465674311579538646525e283 f64.mul - set_local $15 + local.set $15 else - get_local $15 - get_local $14 + local.get $15 + local.get $14 f64.mul - set_local $15 + local.set $15 end - get_local $15 + local.get $15 f64.const 1 f64.sub return end i64.const 1023 - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.sub i64.const 52 i64.shl - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $15 - get_local $3 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $15 + local.get $3 i32.const 20 i32.lt_s if f64.const 1 - get_local $15 + local.get $15 f64.sub - get_local $13 + local.get $13 f64.sub - set_local $15 + local.set $15 else f64.const 1 - get_local $13 - get_local $15 + local.get $13 + local.get $15 f64.add f64.sub - set_local $15 + local.set $15 end - get_local $0 - get_local $15 + local.get $0 + local.get $15 f64.add - get_local $14 + local.get $14 f64.mul ) (func $~lib/math/NativeMath.scalbn (; 26 ;) (type $FiF) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) (local $3 i32) (local $4 i32) - get_local $0 - set_local $2 - get_local $1 + local.get $0 + local.set $2 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - tee_local $3 + local.tee $3 i32.const 1023 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - set_local $1 + local.set $1 end else - get_local $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.const 53 i32.sub i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.add i32.const 53 i32.sub - tee_local $3 + local.tee $3 i32.const -1022 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - set_local $1 + local.set $1 end end end - get_local $2 + local.get $2 i64.const 1023 - get_local $1 - i64.extend_s/i32 + local.get $1 + i64.extend_i32_s i64.add i64.const 52 i64.shl - f64.reinterpret/i64 + f64.reinterpret_i64 f64.mul ) (func $~lib/math/NativeMath.exp (; 27 ;) (type $FF) (param $0 f64) (result f64) @@ -2347,40 +2347,40 @@ (local $7 f64) (local $8 f64) (local $9 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $1 i32.const 31 i32.shr_u - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1082532651 i32.ge_u if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end - get_local $0 + local.get $0 f64.const -745.1332191019411 f64.lt if @@ -2389,85 +2389,85 @@ end end f64.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.const 1071001154 i32.gt_u if - get_local $1 + local.get $1 i32.const 1072734898 i32.ge_u if f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 - set_local $5 + i32.trunc_f64_s + local.set $5 else i32.const 1 - get_local $2 + local.get $2 i32.const 1 i32.shl i32.sub - set_local $5 + local.set $5 end - get_local $0 - get_local $5 - f64.convert_s/i32 + local.get $0 + local.get $5 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.sub - set_local $3 - get_local $5 - f64.convert_s/i32 + local.set $3 + local.get $5 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul - set_local $4 - get_local $3 - get_local $4 + local.set $4 + local.get $3 + local.get $4 f64.sub - set_local $0 + local.set $0 else - get_local $1 + local.get $1 i32.const 1043333120 i32.gt_u if - get_local $0 - set_local $3 + local.get $0 + local.set $3 else f64.const 1 - get_local $0 + local.get $0 f64.add return end end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - set_local $6 - get_local $6 - get_local $6 + local.set $6 + local.get $6 + local.get $6 f64.mul - set_local $7 - get_local $0 - get_local $6 + local.set $7 + local.get $0 + local.get $6 f64.const 0.16666666666666602 f64.mul - get_local $7 + local.get $7 f64.const -2.7777777777015593e-03 - get_local $6 + local.get $6 f64.const 6.613756321437934e-05 f64.mul f64.add - get_local $7 + local.get $7 f64.const -1.6533902205465252e-06 - get_local $6 + local.get $6 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -2476,30 +2476,30 @@ f64.mul f64.add f64.sub - set_local $8 + local.set $8 f64.const 1 - get_local $0 - get_local $8 + local.get $0 + local.get $8 f64.mul f64.const 2 - get_local $8 + local.get $8 f64.sub f64.div - get_local $4 + local.get $4 f64.sub - get_local $3 + local.get $3 f64.add f64.add - set_local $9 - get_local $5 + local.set $9 + local.get $5 i32.const 0 i32.eq if - get_local $9 + local.get $9 return end - get_local $9 - get_local $5 + local.get $9 + local.get $5 call $~lib/math/NativeMath.scalbn ) (func $~lib/math/NativeMath.cosh (; 28 ;) (type $FF) (param $0 f64) (result f64) @@ -2507,26 +2507,26 @@ (local $2 i32) (local $3 f64) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $1 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 - get_local $2 + i32.wrap_i64 + local.set $2 + local.get $2 i32.const 1072049730 i32.lt_u if - get_local $2 + local.get $2 i32.const 1072693248 i32.const 26 i32.const 20 @@ -2537,33 +2537,33 @@ f64.const 1 return end - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 - set_local $3 + local.set $3 f64.const 1 - get_local $3 - get_local $3 + local.get $3 + local.get $3 f64.mul f64.const 2 f64.const 2 - get_local $3 + local.get $3 f64.mul f64.add f64.div f64.add return end - get_local $2 + local.get $2 i32.const 1082535490 i32.lt_u if - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp - set_local $3 + local.set $3 f64.const 0.5 - get_local $3 + local.get $3 f64.const 1 - get_local $3 + local.get $3 f64.div f64.add f64.mul @@ -2577,42 +2577,42 @@ i32.add i32.const 20 i32.shl - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $4 - get_local $0 + f64.reinterpret_i64 + local.set $4 + local.get $0 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp - get_local $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.mul end - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $std/libm/cosh (; 29 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cosh ) (func $std/libm/exp (; 30 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp ) (func $std/libm/expm1 (; 31 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 ) (func $std/libm/floor (; 32 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.floor ) (func $std/libm/fround (; 33 ;) (type $Ff) (param $0 f64) (result f32) - get_local $0 - f32.demote/f64 + local.get $0 + f32.demote_f64 ) (func $~lib/math/NativeMath.hypot (; 34 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) @@ -2629,207 +2629,207 @@ (local $13 f64) (local $14 f64) (local $15 f64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $2 i64.const 9223372036854775807 i64.and - set_local $2 - get_local $3 + local.set $2 + local.get $3 i64.const 9223372036854775807 i64.and - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i64.lt_u if - get_local $2 - set_local $4 - get_local $3 - set_local $2 - get_local $4 - set_local $3 + local.get $2 + local.set $4 + local.get $3 + local.set $2 + local.get $4 + local.set $3 end - get_local $2 + local.get $2 i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $3 + i32.wrap_i64 + local.set $5 + local.get $3 i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $3 - f64.reinterpret/i64 - set_local $1 - get_local $6 + i32.wrap_i64 + local.set $6 + local.get $3 + f64.reinterpret_i64 + local.set $1 + local.get $6 i32.const 2047 i32.eq if - get_local $1 + local.get $1 return end - get_local $2 - f64.reinterpret/i64 - set_local $0 - get_local $5 + local.get $2 + f64.reinterpret_i64 + local.set $0 + local.get $5 i32.const 2047 i32.eq - tee_local $7 + local.tee $7 if (result i32) - get_local $7 + local.get $7 else - get_local $3 + local.get $3 i64.const 0 i64.eq end if - get_local $0 + local.get $0 return end - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.sub i32.const 64 i32.gt_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end f64.const 1 - set_local $8 - get_local $5 + local.set $8 + local.get $5 i32.const 1023 i32.const 510 i32.add i32.gt_s if f64.const 5260135901548373507240989e186 - set_local $8 - get_local $0 + local.set $8 + local.get $0 f64.const 1.90109156629516e-211 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 f64.const 1.90109156629516e-211 f64.mul - set_local $1 + local.set $1 else - get_local $6 + local.get $6 i32.const 1023 i32.const 450 i32.sub i32.lt_s if f64.const 1.90109156629516e-211 - set_local $8 - get_local $0 + local.set $8 + local.get $0 f64.const 5260135901548373507240989e186 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 f64.const 5260135901548373507240989e186 f64.mul - set_local $1 + local.set $1 end end - get_local $0 + local.get $0 f64.const 134217729 f64.mul - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 f64.sub - get_local $9 + local.get $9 f64.add - set_local $10 - get_local $0 - get_local $10 + local.set $10 + local.get $0 + local.get $10 f64.sub - set_local $11 - get_local $0 - get_local $0 + local.set $11 + local.get $0 + local.get $0 f64.mul - set_local $12 - get_local $10 - get_local $10 + local.set $12 + local.get $10 + local.get $10 f64.mul - get_local $12 + local.get $12 f64.sub f64.const 2 - get_local $10 + local.get $10 f64.mul - get_local $11 + local.get $11 f64.add - get_local $11 + local.get $11 f64.mul f64.add - set_local $13 - get_local $1 + local.set $13 + local.get $1 f64.const 134217729 f64.mul - set_local $9 - get_local $1 - get_local $9 + local.set $9 + local.get $1 + local.get $9 f64.sub - get_local $9 + local.get $9 f64.add - set_local $10 - get_local $1 - get_local $10 + local.set $10 + local.get $1 + local.get $10 f64.sub - set_local $11 - get_local $1 - get_local $1 + local.set $11 + local.get $1 + local.get $1 f64.mul - set_local $14 - get_local $10 - get_local $10 + local.set $14 + local.get $10 + local.get $10 f64.mul - get_local $14 + local.get $14 f64.sub f64.const 2 - get_local $10 + local.get $10 f64.mul - get_local $11 + local.get $11 f64.add - get_local $11 + local.get $11 f64.mul f64.add - set_local $15 - get_local $8 - get_local $15 - get_local $13 + local.set $15 + local.get $8 + local.get $15 + local.get $13 f64.add - get_local $14 + local.get $14 f64.add - get_local $12 + local.get $12 f64.add f64.sqrt f64.mul ) (func $std/libm/hypot (; 35 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.hypot ) (func $~lib/builtins/isFinite (; 36 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.eq ) (func $~lib/math/NativeMath.imul (; 37 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add call $~lib/builtins/isFinite i32.eqz @@ -2837,36 +2837,36 @@ f64.const 0 return end - get_local $0 + local.get $0 f64.const 4294967296 - get_local $0 + local.get $0 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 - get_local $1 + i64.trunc_f64_s + i32.wrap_i64 + local.get $1 f64.const 4294967296 - get_local $1 + local.get $1 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 + i64.trunc_f64_s + i32.wrap_i64 i32.mul - f64.convert_s/i32 + f64.convert_i32_s ) (func $std/libm/imul (; 38 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.imul ) (func $std/libm/log (; 39 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log ) (func $~lib/math/NativeMath.log10 (; 40 ;) (type $FF) (param $0 f64) (result f64) @@ -2888,88 +2888,88 @@ (local $16 f64) (local $17 f64) (local $18 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -2977,81 +2977,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -3060,84 +3060,84 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $5 - get_local $6 + local.set $12 + local.get $5 + local.get $6 f64.sub - set_local $13 - get_local $13 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $13 + local.get $13 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const -4294967296 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $13 - get_local $5 - get_local $13 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $13 + local.get $5 + local.get $13 f64.sub - get_local $6 + local.get $6 f64.sub - get_local $7 - get_local $6 - get_local $12 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul f64.add - set_local $14 - get_local $13 + local.set $14 + local.get $13 f64.const 0.4342944818781689 f64.mul - set_local $15 - get_local $3 - f64.convert_s/i32 - set_local $16 - get_local $16 + local.set $15 + local.get $3 + f64.convert_i32_s + local.set $16 + local.get $16 f64.const 0.30102999566361177 f64.mul - set_local $17 - get_local $16 + local.set $17 + local.get $16 f64.const 3.694239077158931e-13 f64.mul - get_local $14 - get_local $13 + local.get $14 + local.get $13 f64.add f64.const 2.5082946711645275e-11 f64.mul f64.add - get_local $14 + local.get $14 f64.const 0.4342944818781689 f64.mul f64.add - set_local $18 - get_local $17 - get_local $15 + local.set $18 + local.get $17 + local.get $15 f64.add - set_local $9 - get_local $18 - get_local $17 - get_local $9 + local.set $9 + local.get $18 + local.get $17 + local.get $9 f64.sub - get_local $15 + local.get $15 f64.add f64.add - set_local $18 - get_local $18 - get_local $9 + local.set $18 + local.get $18 + local.get $9 f64.add ) (func $std/libm/log10 (; 41 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log10 ) (func $std/libm/log1p (; 42 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log1p ) (func $~lib/math/NativeMath.log2 (; 43 ;) (type $FF) (param $0 f64) (result f64) @@ -3158,88 +3158,88 @@ (local $15 f64) (local $16 f64) (local $17 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -3247,81 +3247,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -3330,84 +3330,84 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $5 - get_local $6 + local.set $12 + local.get $5 + local.get $6 f64.sub - set_local $13 - get_local $13 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $13 + local.get $13 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const -4294967296 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $13 - get_local $5 - get_local $13 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $13 + local.get $5 + local.get $13 f64.sub - get_local $6 + local.get $6 f64.sub - get_local $7 - get_local $6 - get_local $12 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul f64.add - set_local $14 - get_local $13 + local.set $14 + local.get $13 f64.const 1.4426950407214463 f64.mul - set_local $15 - get_local $14 - get_local $13 + local.set $15 + local.get $14 + local.get $13 f64.add f64.const 1.6751713164886512e-10 f64.mul - get_local $14 + local.get $14 f64.const 1.4426950407214463 f64.mul f64.add - set_local $16 - get_local $3 - f64.convert_s/i32 - set_local $17 - get_local $17 - get_local $15 + local.set $16 + local.get $3 + f64.convert_i32_s + local.set $17 + local.get $17 + local.get $15 f64.add - set_local $9 - get_local $16 - get_local $17 - get_local $9 + local.set $9 + local.get $16 + local.get $17 + local.get $9 f64.sub - get_local $15 + local.get $15 f64.add f64.add - set_local $16 - get_local $9 - set_local $15 - get_local $16 - get_local $15 + local.set $16 + local.get $9 + local.set $15 + local.get $16 + local.get $15 f64.add ) (func $std/libm/log2 (; 44 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log2 ) (func $std/libm/max (; 45 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.max ) (func $std/libm/min (; 46 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.min ) (func $~lib/math/NativeMath.pow (; 47 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -3451,38 +3451,38 @@ (local $39 f64) (local $40 f64) (local $41 i32) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 - get_local $2 - i32.wrap/i64 - set_local $4 - get_local $1 - i64.reinterpret/f64 - set_local $2 - get_local $2 + i32.wrap_i64 + local.set $3 + local.get $2 + i32.wrap_i64 + local.set $4 + local.get $1 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $2 - i32.wrap/i64 - set_local $6 - get_local $3 + i32.wrap_i64 + local.set $5 + local.get $2 + i32.wrap_i64 + local.set $6 + local.get $3 i32.const 2147483647 i32.and - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 2147483647 i32.and - set_local $8 - get_local $8 - get_local $6 + local.set $8 + local.get $8 + local.get $6 i32.or i32.const 0 i32.eq @@ -3490,126 +3490,126 @@ f64.const 1 return end - get_local $7 + local.get $7 i32.const 2146435072 i32.gt_s - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $4 + local.get $4 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.gt_s end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $6 + local.get $6 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end i32.const 0 - set_local $10 - get_local $3 + local.set $10 + local.get $3 i32.const 0 i32.lt_s if - get_local $8 + local.get $8 i32.const 1128267776 i32.ge_s if i32.const 2 - set_local $10 + local.set $10 else - get_local $8 + local.get $8 i32.const 1072693248 i32.ge_s if - get_local $8 + local.get $8 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 - get_local $11 + local.set $11 + local.get $11 i32.const 20 i32.gt_s - set_local $9 + local.set $9 i32.const 52 i32.const 20 - get_local $9 + local.get $9 select - get_local $11 + local.get $11 i32.sub - set_local $12 - get_local $6 - get_local $8 - get_local $9 + local.set $12 + local.get $6 + local.get $8 + local.get $9 select - set_local $13 - get_local $13 - get_local $12 + local.set $13 + local.get $13 + local.get $12 i32.shr_s - set_local $14 - get_local $14 - get_local $12 + local.set $14 + local.get $14 + local.get $12 i32.shl - get_local $13 + local.get $13 i32.eq if i32.const 2 - get_local $14 + local.get $14 i32.const 1 i32.and i32.sub - set_local $10 + local.set $10 end end end end - get_local $6 + local.get $6 i32.const 0 i32.eq if - get_local $8 + local.get $8 i32.const 2146435072 i32.eq if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $4 + local.get $4 i32.or i32.const 0 i32.eq @@ -3617,27 +3617,27 @@ f64.const nan:0x8000000000000 return else - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) - get_local $1 + local.get $1 else f64.const 0 end return else - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) f64.const 0 else - get_local $1 + local.get $1 f64.neg end return @@ -3647,158 +3647,158 @@ unreachable unreachable end - get_local $8 + local.get $8 i32.const 1072693248 i32.eq if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 return end f64.const 1 - get_local $0 + local.get $0 f64.div return end - get_local $5 + local.get $5 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul return end - get_local $5 + local.get $5 i32.const 1071644672 i32.eq if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f64.sqrt return end end end - get_local $0 + local.get $0 f64.abs - set_local $15 - get_local $4 + local.set $15 + local.get $4 i32.const 0 i32.eq if - get_local $7 + local.get $7 i32.const 0 i32.eq - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq end - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 1072693248 i32.eq end if - get_local $15 - set_local $16 - get_local $5 + local.get $15 + local.set $16 + local.get $5 i32.const 0 i32.lt_s if f64.const 1 - get_local $16 + local.get $16 f64.div - set_local $16 + local.set $16 end - get_local $3 + local.get $3 i32.const 0 i32.lt_s if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $10 + local.get $10 i32.or i32.const 0 i32.eq if - get_local $16 - get_local $16 + local.get $16 + local.get $16 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div - set_local $16 + local.set $16 else - get_local $10 + local.get $10 i32.const 1 i32.eq if - get_local $16 + local.get $16 f64.neg - set_local $16 + local.set $16 end end end - get_local $16 + local.get $16 return end end f64.const 1 - set_local $18 - get_local $3 + local.set $18 + local.get $3 i32.const 0 i32.lt_s if - get_local $10 + local.get $10 i32.const 0 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div return end - get_local $10 + local.get $10 i32.const 1 i32.eq if f64.const -1 - set_local $18 + local.set $18 end end - get_local $8 + local.get $8 i32.const 1105199104 i32.gt_s if - get_local $8 + local.get $8 i32.const 1139802112 i32.gt_s if - get_local $7 + local.get $7 i32.const 1072693247 i32.le_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) @@ -3812,11 +3812,11 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) @@ -3831,21 +3831,21 @@ return end end - get_local $7 + local.get $7 i32.const 1072693247 i32.lt_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -3853,21 +3853,21 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.gt_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -3875,205 +3875,205 @@ end return end - get_local $15 + local.get $15 f64.const 1 f64.sub - set_local $24 - get_local $24 - get_local $24 + local.set $24 + local.get $24 + local.get $24 f64.mul f64.const 0.5 - get_local $24 + local.get $24 f64.const 0.3333333333333333 - get_local $24 + local.get $24 f64.const 0.25 f64.mul f64.sub f64.mul f64.sub f64.mul - set_local $27 + local.set $27 f64.const 1.4426950216293335 - get_local $24 + local.get $24 f64.mul - set_local $25 - get_local $24 + local.set $25 + local.get $24 f64.const 1.9259629911266175e-08 f64.mul - get_local $27 + local.get $27 f64.const 1.4426950408889634 f64.mul f64.sub - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $26 - get_local $19 - get_local $25 + f64.reinterpret_i64 + local.set $19 + local.get $26 + local.get $19 + local.get $25 f64.sub f64.sub - set_local $20 + local.set $20 else i32.const 0 - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.lt_s if - get_local $15 + local.get $15 f64.const 9007199254740992 f64.mul - set_local $15 - get_local $29 + local.set $15 + local.get $29 i32.const 53 i32.sub - set_local $29 - get_local $15 - i64.reinterpret/f64 + local.set $29 + local.get $15 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $7 + i32.wrap_i64 + local.set $7 end - get_local $29 - get_local $7 + local.get $29 + local.get $7 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048575 i32.and - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 1072693248 i32.or - set_local $7 - get_local $28 + local.set $7 + local.get $28 i32.const 235662 i32.le_s if i32.const 0 - set_local $11 + local.set $11 else - get_local $28 + local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - set_local $11 + local.set $11 else i32.const 0 - set_local $11 - get_local $29 + local.set $11 + local.get $29 i32.const 1 i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.sub - set_local $7 + local.set $7 end end - get_local $15 - i64.reinterpret/f64 + local.get $15 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $15 + f64.reinterpret_i64 + local.set $15 f64.const 1.5 f64.const 1 - get_local $11 + local.get $11 select - set_local $35 - get_local $15 - get_local $35 + local.set $35 + local.get $15 + local.get $35 f64.sub - set_local $25 + local.set $25 f64.const 1 - get_local $15 - get_local $35 + local.get $15 + local.get $35 f64.add f64.div - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.mul - set_local $17 - get_local $17 - set_local $31 - get_local $31 - i64.reinterpret/f64 + local.set $17 + local.get $17 + local.set $31 + local.get $31 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $31 - get_local $7 + f64.reinterpret_i64 + local.set $31 + local.get $7 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - get_local $11 + local.get $11 i32.const 18 i32.shl i32.add - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $33 - get_local $15 - get_local $33 - get_local $35 + f64.reinterpret_i64 + local.set $33 + local.get $15 + local.get $33 + local.get $35 f64.sub f64.sub - set_local $34 - get_local $26 - get_local $25 - get_local $31 - get_local $33 + local.set $34 + local.get $26 + local.get $25 + local.get $31 + local.get $33 f64.mul f64.sub - get_local $31 - get_local $34 + local.get $31 + local.get $34 f64.mul f64.sub f64.mul - set_local $32 - get_local $17 - get_local $17 + local.set $32 + local.get $17 + local.get $17 f64.mul - set_local $30 - get_local $30 - get_local $30 + local.set $30 + local.get $30 + local.get $30 f64.mul f64.const 0.5999999999999946 - get_local $30 + local.get $30 f64.const 0.4285714285785502 - get_local $30 + local.get $30 f64.const 0.33333332981837743 - get_local $30 + local.get $30 f64.const 0.272728123808534 - get_local $30 + local.get $30 f64.const 0.23066074577556175 - get_local $30 + local.get $30 f64.const 0.20697501780033842 f64.mul f64.add @@ -4086,184 +4086,184 @@ f64.mul f64.add f64.mul - set_local $23 - get_local $23 - get_local $32 - get_local $31 - get_local $17 + local.set $23 + local.get $23 + local.get $32 + local.get $31 + local.get $17 f64.add f64.mul f64.add - set_local $23 - get_local $31 - get_local $31 + local.set $23 + local.get $31 + local.get $31 f64.mul - set_local $30 + local.set $30 f64.const 3 - get_local $30 + local.get $30 f64.add - get_local $23 + local.get $23 f64.add - set_local $33 - get_local $33 - i64.reinterpret/f64 + local.set $33 + local.get $33 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $33 - get_local $23 - get_local $33 + f64.reinterpret_i64 + local.set $33 + local.get $23 + local.get $33 f64.const 3 f64.sub - get_local $30 + local.get $30 f64.sub f64.sub - set_local $34 - get_local $31 - get_local $33 + local.set $34 + local.get $31 + local.get $33 f64.mul - set_local $25 - get_local $32 - get_local $33 + local.set $25 + local.get $32 + local.get $33 f64.mul - get_local $34 - get_local $17 + local.get $34 + local.get $17 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $21 - get_local $21 - i64.reinterpret/f64 + local.set $21 + local.get $21 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $21 - get_local $26 - get_local $21 - get_local $25 + f64.reinterpret_i64 + local.set $21 + local.get $26 + local.get $21 + local.get $25 f64.sub f64.sub - set_local $22 + local.set $22 f64.const 0.9617967009544373 - get_local $21 + local.get $21 f64.mul - set_local $36 + local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - get_local $11 + local.get $11 select - set_local $37 + local.set $37 f64.const -7.028461650952758e-09 - get_local $21 + local.get $21 f64.mul - get_local $22 + local.get $22 f64.const 0.9617966939259756 f64.mul f64.add - get_local $37 + local.get $37 f64.add - set_local $38 - get_local $29 - f64.convert_s/i32 - set_local $24 + local.set $38 + local.get $29 + f64.convert_i32_s + local.set $24 f64.const 0.5849624872207642 f64.const 0 - get_local $11 + local.get $11 select - set_local $39 - get_local $36 - get_local $38 + local.set $39 + local.get $36 + local.get $38 f64.add - get_local $39 + local.get $39 f64.add - get_local $24 + local.get $24 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $38 - get_local $19 - get_local $24 + f64.reinterpret_i64 + local.set $19 + local.get $38 + local.get $19 + local.get $24 f64.sub - get_local $39 + local.get $39 f64.sub - get_local $36 + local.get $36 f64.sub f64.sub - set_local $20 + local.set $20 end - get_local $1 - set_local $40 - get_local $40 - i64.reinterpret/f64 + local.get $1 + local.set $40 + local.get $40 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $40 - get_local $1 - get_local $40 + f64.reinterpret_i64 + local.set $40 + local.get $1 + local.get $40 f64.sub - get_local $19 + local.get $19 f64.mul - get_local $1 - get_local $20 + local.get $1 + local.get $20 f64.mul f64.add - set_local $22 - get_local $40 - get_local $19 + local.set $22 + local.get $40 + local.get $19 f64.mul - set_local $21 - get_local $22 - get_local $21 + local.set $21 + local.get $22 + local.get $21 f64.add - set_local $16 - get_local $16 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.set $16 + local.get $16 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $2 - i32.wrap/i64 - set_local $41 - get_local $28 + i32.wrap_i64 + local.set $28 + local.get $2 + i32.wrap_i64 + local.set $41 + local.get $28 i32.const 1083179008 i32.ge_s if - get_local $28 + local.get $28 i32.const 1083179008 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - get_local $22 + local.get $22 f64.const 8.008566259537294e-17 f64.add - get_local $16 - get_local $21 + local.get $16 + local.get $21 f64.sub f64.gt if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 @@ -4271,34 +4271,34 @@ return end else - get_local $28 + local.get $28 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_s if - get_local $28 + local.get $28 i32.const -1064252416 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul return end - get_local $22 - get_local $16 - get_local $21 + local.get $22 + local.get $16 + local.get $21 f64.sub f64.le if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -4307,126 +4307,126 @@ end end end - get_local $28 + local.get $28 i32.const 2147483647 i32.and - set_local $41 - get_local $41 + local.set $41 + local.get $41 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 i32.const 0 - set_local $29 - get_local $41 + local.set $29 + local.get $41 i32.const 1071644672 i32.gt_s if - get_local $28 + local.get $28 i32.const 1048576 - get_local $11 + local.get $11 i32.const 1 i32.add i32.shr_s i32.add - set_local $29 - get_local $29 + local.set $29 + local.get $29 i32.const 2147483647 i32.and i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 f64.const 0 - set_local $24 - get_local $29 + local.set $24 + local.get $29 i32.const 1048575 - get_local $11 + local.get $11 i32.shr_s i32.const -1 i32.xor i32.and - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $24 - get_local $29 + f64.reinterpret_i64 + local.set $24 + local.get $29 i32.const 1048575 i32.and i32.const 1048576 i32.or i32.const 20 - get_local $11 + local.get $11 i32.sub i32.shr_s - set_local $29 - get_local $28 + local.set $29 + local.get $28 i32.const 0 i32.lt_s if i32.const 0 - get_local $29 + local.get $29 i32.sub - set_local $29 + local.set $29 end - get_local $21 - get_local $24 + local.get $21 + local.get $24 f64.sub - set_local $21 + local.set $21 end - get_local $22 - get_local $21 + local.get $22 + local.get $21 f64.add - set_local $24 - get_local $24 - i64.reinterpret/f64 + local.set $24 + local.get $24 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $24 - get_local $24 + f64.reinterpret_i64 + local.set $24 + local.get $24 f64.const 0.6931471824645996 f64.mul - set_local $25 - get_local $22 - get_local $24 - get_local $21 + local.set $25 + local.get $22 + local.get $24 + local.get $21 f64.sub f64.sub f64.const 0.6931471805599453 f64.mul - get_local $24 + local.get $24 f64.const -1.904654299957768e-09 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $16 - get_local $26 - get_local $16 - get_local $25 + local.set $16 + local.get $26 + local.get $16 + local.get $25 f64.sub f64.sub - set_local $27 - get_local $16 - get_local $16 + local.set $27 + local.get $16 + local.get $16 f64.mul - set_local $24 - get_local $16 - get_local $24 + local.set $24 + local.get $16 + local.get $24 f64.const 0.16666666666666602 - get_local $24 + local.get $24 f64.const -2.7777777777015593e-03 - get_local $24 + local.get $24 f64.const 6.613756321437934e-05 - get_local $24 + local.get $24 f64.const -1.6533902205465252e-06 - get_local $24 + local.get $24 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -4438,94 +4438,94 @@ f64.add f64.mul f64.sub - set_local $19 - get_local $16 - get_local $19 + local.set $19 + local.get $16 + local.get $19 f64.mul - get_local $19 + local.get $19 f64.const 2 f64.sub f64.div - get_local $27 - get_local $16 - get_local $27 + local.get $27 + local.get $16 + local.get $27 f64.mul f64.add f64.sub - set_local $23 + local.set $23 f64.const 1 - get_local $23 - get_local $16 + local.get $23 + local.get $16 f64.sub f64.sub - set_local $16 - get_local $16 - i64.reinterpret/f64 + local.set $16 + local.get $16 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $28 - get_local $29 + i32.wrap_i64 + local.set $28 + local.get $28 + local.get $29 i32.const 20 i32.shl i32.add - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 20 i32.shr_s i32.const 0 i32.le_s if - get_local $16 - get_local $29 + local.get $16 + local.get $29 call $~lib/math/NativeMath.scalbn - set_local $16 + local.set $16 else - get_local $16 - i64.reinterpret/f64 + local.get $16 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $28 - i64.extend_s/i32 + local.get $28 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $16 + f64.reinterpret_i64 + local.set $16 end - get_local $18 - get_local $16 + local.get $18 + local.get $16 f64.mul ) (func $std/libm/pow (; 48 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.pow ) (func $std/libm/round (; 49 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.const 0.5 f64.add f64.floor - get_local $0 + local.get $0 f64.copysign ) (func $std/libm/sign (; 50 ;) (type $FF) (param $0 f64) (result f64) block $~lib/math/NativeMath.sign|inlined.0 (result f64) - get_local $0 + local.get $0 f64.const 0 f64.gt if (result f64) f64.const 1 else - get_local $0 + local.get $0 f64.const 0 f64.lt if (result f64) f64.const -1 else - get_local $0 + local.get $0 end end br $~lib/math/NativeMath.sign|inlined.0 @@ -4536,7 +4536,7 @@ f64.const 0 ) (func $std/libm/sin (; 52 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.sin ) (func $~lib/math/NativeMath.sinh (; 53 ;) (type $FF) (param $0 f64) (result f64) @@ -4546,35 +4546,35 @@ (local $4 f64) (local $5 f64) (local $6 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $2 - get_local $1 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $2 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 + i32.wrap_i64 + local.set $3 f64.const 0.5 - get_local $0 + local.get $0 f64.copysign - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 1082535490 i32.lt_u if - get_local $2 + local.get $2 call $~lib/math/NativeMath.expm1 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1072693248 i32.lt_u if - get_local $3 + local.get $3 i32.const 1072693248 i32.const 26 i32.const 20 @@ -4582,17 +4582,17 @@ i32.sub i32.lt_u if - get_local $0 + local.get $0 return end - get_local $5 + local.get $5 f64.const 2 - get_local $4 + local.get $4 f64.mul - get_local $4 - get_local $4 + local.get $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.const 1 f64.add f64.div @@ -4600,10 +4600,10 @@ f64.mul return end - get_local $5 - get_local $4 - get_local $4 - get_local $4 + local.get $5 + local.get $4 + local.get $4 + local.get $4 f64.const 1 f64.add f64.div @@ -4612,7 +4612,7 @@ return end f64.const 2 - get_local $5 + local.get $5 f64.mul block $~lib/math/expo2|inlined.1 (result f64) i32.const 1023 @@ -4622,30 +4622,30 @@ i32.add i32.const 20 i32.shl - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $6 - get_local $2 + f64.reinterpret_i64 + local.set $6 + local.get $2 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp - get_local $6 + local.get $6 f64.mul - get_local $6 + local.get $6 f64.mul end f64.mul - set_local $4 - get_local $4 + local.set $4 + local.get $4 ) (func $std/libm/sinh (; 54 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.sinh ) (func $std/libm/sqrt (; 55 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.sqrt ) (func $~lib/math/NativeMath.tan (; 56 ;) (type $FF) (param $0 f64) (result f64) @@ -4653,7 +4653,7 @@ f64.const 0 ) (func $std/libm/tan (; 57 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.tan ) (func $~lib/math/NativeMath.tanh (; 58 ;) (type $FF) (param $0 f64) (result f64) @@ -4661,99 +4661,99 @@ (local $2 f64) (local $3 i32) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $2 - get_local $1 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $2 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 - get_local $3 + i32.wrap_i64 + local.set $3 + local.get $3 i32.const 1071748074 i32.gt_u if - get_local $3 + local.get $3 i32.const 1077149696 i32.gt_u if f64.const 1 f64.const 0 - get_local $2 + local.get $2 f64.div f64.sub - set_local $4 + local.set $4 else f64.const 2 - get_local $2 + local.get $2 f64.mul call $~lib/math/NativeMath.expm1 - set_local $4 + local.set $4 f64.const 1 f64.const 2 - get_local $4 + local.get $4 f64.const 2 f64.add f64.div f64.sub - set_local $4 + local.set $4 end else - get_local $3 + local.get $3 i32.const 1070618798 i32.gt_u if f64.const 2 - get_local $2 + local.get $2 f64.mul call $~lib/math/NativeMath.expm1 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f64.const 2 f64.add f64.div - set_local $4 + local.set $4 else - get_local $3 + local.get $3 i32.const 1048576 i32.ge_u if f64.const -2 - get_local $2 + local.get $2 f64.mul call $~lib/math/NativeMath.expm1 - set_local $4 - get_local $4 + local.set $4 + local.get $4 f64.neg - get_local $4 + local.get $4 f64.const 2 f64.add f64.div - set_local $4 + local.set $4 else - get_local $2 - set_local $4 + local.get $2 + local.set $4 end end end - get_local $4 - get_local $0 + local.get $4 + local.get $0 f64.copysign ) (func $std/libm/tanh (; 59 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 call $~lib/math/NativeMath.tanh ) (func $std/libm/trunc (; 60 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.trunc ) (func $null (; 61 ;) (type $v) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index fad22caa..30d40aa2 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -25,7 +25,7 @@ (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 anyfunc) + (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)) @@ -36,17 +36,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -55,16 +55,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -72,16 +72,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -90,13 +90,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -109,240 +109,240 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + 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) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -353,41 +353,41 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.eqz if - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $0 + local.get $0 call $~lib/internal/memory/memset end - get_local $2 + local.get $2 ) (func $~lib/map/Map#clear (; 5 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 + local.get $0 i32.const 3 i32.store offset=4 - get_local $0 + local.get $0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 + local.get $0 i32.const 4 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) @@ -395,77 +395,77 @@ (local $0 i32) i32.const 24 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#find (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load8_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/map/Map#has (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -486,105 +486,105 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_s i32.store8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_s i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -592,7 +592,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -601,39 +601,39 @@ i32.xor i32.const 16777619 i32.mul - tee_local $3 - set_local $5 - get_local $0 - get_local $1 - get_local $3 + local.tee $3 + local.set $5 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -642,57 +642,57 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.store8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -702,9 +702,9 @@ i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -712,9 +712,9 @@ ) (func $~lib/map/Map#delete (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -724,57 +724,57 @@ i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/map/Map#rehash end i32.const 1 @@ -783,14 +783,14 @@ (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -800,9 +800,9 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -810,8 +810,8 @@ i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -822,10 +822,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -841,16 +841,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -863,14 +863,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -881,10 +881,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -900,9 +900,9 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -910,8 +910,8 @@ i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -922,10 +922,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -941,16 +941,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -963,14 +963,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -981,10 +981,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -1000,12 +1000,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -1015,16 +1015,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -1037,14 +1037,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -1054,9 +1054,9 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -1064,8 +1064,8 @@ i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -1076,12 +1076,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -1091,16 +1091,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -1112,9 +1112,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -1126,9 +1126,9 @@ end ) (func $~lib/map/Map#has (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 255 i32.and i32.const -2128831035 @@ -1147,105 +1147,105 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_u i32.store8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_u i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -1253,46 +1253,46 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - tee_local $3 - set_local $5 - get_local $0 - get_local $1 - get_local $3 + local.tee $3 + local.set $5 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1301,57 +1301,57 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.store8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 255 i32.and i32.const -2128831035 @@ -1359,9 +1359,9 @@ i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -1369,9 +1369,9 @@ ) (func $~lib/map/Map#delete (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 255 i32.and i32.const -2128831035 @@ -1379,57 +1379,57 @@ i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/map/Map#rehash end i32.const 1 @@ -1438,14 +1438,14 @@ (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -1455,16 +1455,16 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 255 i32.and i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -1475,10 +1475,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 10 @@ -1492,16 +1492,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -1514,14 +1514,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -1532,10 +1532,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 10 @@ -1549,16 +1549,16 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 255 i32.and i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -1569,10 +1569,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 20 @@ -1586,16 +1586,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -1608,14 +1608,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -1626,10 +1626,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 20 @@ -1643,12 +1643,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -1658,16 +1658,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -1680,14 +1680,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -1697,16 +1697,16 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 255 i32.and i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -1717,12 +1717,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -1732,16 +1732,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -1753,9 +1753,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -1767,45 +1767,45 @@ end ) (func $~lib/map/Map#find (; 20 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load16_u - get_local $1 + local.get $1 i32.const 65535 i32.and i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end @@ -1813,21 +1813,21 @@ ) (func $~lib/map/Map#has (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - tee_local $2 + local.tee $2 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $2 + local.get $2 i32.const 8 i32.shr_u i32.xor @@ -1845,114 +1845,114 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $2 - f64.convert_s/i32 + local.set $5 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $7 + i32.trunc_f64_s + local.tee $7 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $8 + local.get $2 + local.get $8 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_s i32.store16 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_s - tee_local $4 + local.tee $4 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $4 + local.get $4 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=8 - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -1960,57 +1960,57 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - tee_local $3 + local.tee $3 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - tee_local $3 - set_local $5 - get_local $0 - get_local $1 - get_local $3 + local.tee $3 + local.set $5 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -2019,78 +2019,78 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.store16 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - tee_local $0 + local.tee $0 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -2098,78 +2098,78 @@ ) (func $~lib/map/Map#delete (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - tee_local $1 + local.tee $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/map/Map#rehash end i32.const 1 @@ -2178,14 +2178,14 @@ (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -2195,9 +2195,9 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2205,8 +2205,8 @@ i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -2217,10 +2217,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2236,16 +2236,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -2258,14 +2258,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -2276,10 +2276,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2295,9 +2295,9 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2305,8 +2305,8 @@ i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -2317,10 +2317,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2336,16 +2336,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -2358,14 +2358,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -2376,10 +2376,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2395,12 +2395,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -2410,16 +2410,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -2432,14 +2432,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -2449,9 +2449,9 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2459,8 +2459,8 @@ i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -2471,12 +2471,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -2486,16 +2486,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -2507,9 +2507,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -2522,19 +2522,19 @@ ) (func $~lib/map/Map#has (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 65535 i32.and - tee_local $2 + local.tee $2 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $2 + local.get $2 i32.const 8 i32.shr_u i32.xor @@ -2552,114 +2552,114 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $2 - f64.convert_s/i32 + local.set $5 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $7 + i32.trunc_f64_s + local.tee $7 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $8 + local.get $2 + local.get $8 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_u i32.store16 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_u - tee_local $4 + local.tee $4 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $4 + local.get $4 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=8 - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -2667,55 +2667,55 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 65535 i32.and - tee_local $3 + local.tee $3 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - tee_local $3 - set_local $5 - get_local $0 - get_local $1 - get_local $3 + local.tee $3 + local.set $5 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -2724,76 +2724,76 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.store16 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 30 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 65535 i32.and - tee_local $0 + local.tee $0 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -2801,76 +2801,76 @@ ) (func $~lib/map/Map#delete (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 65535 i32.and - tee_local $1 + local.tee $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul call $~lib/map/Map#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/map/Map#rehash end i32.const 1 @@ -2879,14 +2879,14 @@ (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -2896,16 +2896,16 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 65535 i32.and i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -2916,10 +2916,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 10 @@ -2933,16 +2933,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -2955,14 +2955,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -2973,10 +2973,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 10 @@ -2990,16 +2990,16 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 65535 i32.and i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3010,10 +3010,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 20 @@ -3027,16 +3027,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3049,14 +3049,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3067,10 +3067,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 20 @@ -3084,12 +3084,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3099,16 +3099,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3121,14 +3121,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3138,16 +3138,16 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 65535 i32.and i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3158,12 +3158,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3173,16 +3173,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3194,9 +3194,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -3208,14 +3208,14 @@ end ) (func $~lib/internal/hash/hash32 (; 33 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.const 255 @@ -3223,7 +3223,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 16 i32.shr_u i32.const 255 @@ -3231,7 +3231,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 24 i32.shr_u i32.xor @@ -3239,52 +3239,52 @@ i32.mul ) (func $~lib/map/Map#find (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load - get_local $1 + local.get $1 i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/map/Map#has (; 35 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 call $~lib/map/Map#find i32.const 0 @@ -3298,102 +3298,102 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load i32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load call $~lib/internal/hash/hash32 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -3401,39 +3401,39 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 - tee_local $5 + local.tee $5 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -3442,62 +3442,62 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 38 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -3505,62 +3505,62 @@ ) (func $~lib/map/Map#delete (; 39 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 call $~lib/map/Map#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $1 + local.set $1 end - get_local $1 + local.get $1 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/map/Map#rehash end i32.const 1 @@ -3569,14 +3569,14 @@ (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3586,14 +3586,14 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3604,10 +3604,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 10 i32.add i32.ne @@ -3619,16 +3619,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3641,14 +3641,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3659,10 +3659,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 10 i32.add i32.ne @@ -3674,14 +3674,14 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3692,10 +3692,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 20 i32.add i32.ne @@ -3707,16 +3707,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3729,14 +3729,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3747,10 +3747,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 20 i32.add i32.ne @@ -3762,12 +3762,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3777,16 +3777,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3799,14 +3799,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3816,14 +3816,14 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3834,12 +3834,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3849,16 +3849,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3870,9 +3870,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -3887,14 +3887,14 @@ (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3904,14 +3904,14 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3922,10 +3922,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 10 i32.add i32.ne @@ -3937,16 +3937,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3959,14 +3959,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3977,10 +3977,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 10 i32.add i32.ne @@ -3992,14 +3992,14 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4010,10 +4010,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 20 i32.add i32.ne @@ -4025,16 +4025,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4047,14 +4047,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4065,10 +4065,10 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 + local.get $0 i32.const 20 i32.add i32.ne @@ -4080,12 +4080,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4095,16 +4095,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4117,14 +4117,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4134,14 +4134,14 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 + local.get $1 + local.get $0 + local.get $0 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4152,12 +4152,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4167,16 +4167,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4188,9 +4188,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -4202,26 +4202,26 @@ end ) (func $~lib/map/Map#clear (; 42 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 + local.get $0 i32.const 3 i32.store offset=4 - get_local $0 + local.get $0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 + local.get $0 i32.const 4 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) @@ -4229,40 +4229,40 @@ (local $0 i32) i32.const 24 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash64 (; 44 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) - get_local $0 - i32.wrap/i64 - tee_local $1 + local.get $0 + i32.wrap_i64 + local.tee $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.const 255 @@ -4270,7 +4270,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 16 i32.shr_u i32.const 255 @@ -4278,23 +4278,23 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 24 i32.shr_u i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 255 i32.and i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.const 255 @@ -4302,7 +4302,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 16 i32.shr_u i32.const 255 @@ -4310,7 +4310,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 24 i32.shr_u i32.xor @@ -4318,52 +4318,52 @@ i32.mul ) (func $~lib/map/Map#find (; 45 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=12 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i64.load - get_local $1 + local.get $1 i64.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=12 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/map/Map#has (; 46 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash64 call $~lib/map/Map#find i32.const 0 @@ -4377,102 +4377,102 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 4 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=12 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i64.load i64.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=8 i32.store offset=8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i64.load call $~lib/internal/hash/hash64 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=12 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 16 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 16 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -4480,39 +4480,39 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash64 - tee_local $5 + local.tee $5 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -4521,62 +4521,62 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 4 i32.shl i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i64.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=12 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 49 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash64 call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -4585,62 +4585,62 @@ (func $~lib/map/Map#delete (; 50 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash64 call $~lib/map/Map#find - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=12 i32.const 1 i32.or i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $2 + local.tee $2 i32.const 4 - get_local $2 + local.get $2 i32.gt_u select i32.ge_u - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -4649,14 +4649,14 @@ (local $0 i64) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i64.const 100 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4666,15 +4666,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.wrap/i64 + local.get $1 + local.get $0 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4685,11 +4685,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add i32.ne @@ -4701,16 +4701,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4723,14 +4723,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i64.const 100 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4741,11 +4741,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add i32.ne @@ -4757,15 +4757,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.wrap/i64 + local.get $1 + local.get $0 + local.get $0 + i32.wrap_i64 i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4776,11 +4776,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 20 i32.add i32.ne @@ -4792,16 +4792,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4814,14 +4814,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i64.const 50 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4832,11 +4832,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 20 i32.add i32.ne @@ -4848,12 +4848,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4863,16 +4863,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4885,14 +4885,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i64.const 50 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4902,15 +4902,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.wrap/i64 + local.get $1 + local.get $0 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4921,12 +4921,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4936,16 +4936,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4957,9 +4957,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -4974,14 +4974,14 @@ (local $0 i64) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i64.const 100 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4991,15 +4991,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.wrap/i64 + local.get $1 + local.get $0 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5010,11 +5010,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add i32.ne @@ -5026,16 +5026,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -5048,14 +5048,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i64.const 100 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5066,11 +5066,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add i32.ne @@ -5082,15 +5082,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.wrap/i64 + local.get $1 + local.get $0 + local.get $0 + i32.wrap_i64 i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5101,11 +5101,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 20 i32.add i32.ne @@ -5117,16 +5117,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -5139,14 +5139,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i64.const 50 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5157,11 +5157,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.wrap/i64 + local.get $0 + i32.wrap_i64 i32.const 20 i32.add i32.ne @@ -5173,12 +5173,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -5188,16 +5188,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -5210,14 +5210,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i64.const 50 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -5227,15 +5227,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.wrap/i64 + local.get $1 + local.get $0 + local.get $0 + i32.wrap_i64 i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5246,12 +5246,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -5261,16 +5261,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -5282,9 +5282,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -5296,53 +5296,53 @@ end ) (func $~lib/map/Map#find (; 53 ;) (type $ifii) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 f32.load - get_local $1 + local.get $1 f32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/map/Map#has (; 54 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) - get_local $0 - get_local $1 - get_local $1 - i32.reinterpret/f32 + local.get $0 + local.get $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 call $~lib/map/Map#find i32.const 0 @@ -5356,103 +5356,103 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 f32.load f32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 f32.load - i32.reinterpret/f32 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -5460,40 +5460,40 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 - get_local $1 - i32.reinterpret/f32 + local.get $0 + local.get $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 - tee_local $5 + local.tee $5 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -5502,63 +5502,63 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 f32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 57 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) - get_local $0 - get_local $1 - get_local $1 - i32.reinterpret/f32 + local.get $0 + local.get $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -5567,63 +5567,63 @@ (func $~lib/map/Map#delete (; 58 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 - get_local $1 - i32.reinterpret/f32 + local.get $0 + local.get $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 call $~lib/map/Map#find - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $2 + local.tee $2 i32.const 4 - get_local $2 + local.get $2 i32.gt_u select i32.ge_u - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -5632,14 +5632,14 @@ (local $0 f32) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 f32.const 100 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -5649,15 +5649,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.trunc_s/f32 + local.get $1 + local.get $0 + local.get $0 + i32.trunc_f32_s i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5668,11 +5668,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f32 + local.get $0 + i32.trunc_f32_s i32.const 10 i32.add i32.ne @@ -5684,16 +5684,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -5706,14 +5706,14 @@ unreachable end f32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 f32.const 100 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5724,11 +5724,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f32 + local.get $0 + i32.trunc_f32_s i32.const 10 i32.add i32.ne @@ -5740,15 +5740,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.trunc_s/f32 + local.get $1 + local.get $0 + local.get $0 + i32.trunc_f32_s i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5759,11 +5759,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f32 + local.get $0 + i32.trunc_f32_s i32.const 20 i32.add i32.ne @@ -5775,16 +5775,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -5797,14 +5797,14 @@ unreachable end f32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 f32.const 50 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5815,11 +5815,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f32 + local.get $0 + i32.trunc_f32_s i32.const 20 i32.add i32.ne @@ -5831,12 +5831,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -5846,16 +5846,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -5868,14 +5868,14 @@ unreachable end f32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 f32.const 50 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -5885,15 +5885,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.trunc_s/f32 + local.get $1 + local.get $0 + local.get $0 + i32.trunc_f32_s i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -5904,12 +5904,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -5919,16 +5919,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -5940,9 +5940,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -5954,53 +5954,53 @@ end ) (func $~lib/map/Map#find (; 60 ;) (type $iFii) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=12 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 f64.load - get_local $1 + local.get $1 f64.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=12 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/map/Map#has (; 61 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) - get_local $0 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.get $0 + local.get $1 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 call $~lib/map/Map#find i32.const 0 @@ -6014,103 +6014,103 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 4 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=12 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 f64.load f64.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=8 i32.store offset=8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 f64.load - i64.reinterpret/f64 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=12 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 16 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 16 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -6118,40 +6118,40 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.get $0 + local.get $1 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 - tee_local $5 + local.tee $5 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -6160,63 +6160,63 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 4 i32.shl i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 f64.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=12 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/map/Map#get (; 64 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) - get_local $0 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.get $0 + local.get $1 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -6225,63 +6225,63 @@ (func $~lib/map/Map#delete (; 65 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.get $0 + local.get $1 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 call $~lib/map/Map#find - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=12 i32.const 1 i32.or i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $2 + local.tee $2 i32.const 4 - get_local $2 + local.get $2 i32.gt_u select i32.ge_u - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -6290,14 +6290,14 @@ (local $0 f64) (local $1 i32) call $~lib/map/Map#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 f64.const 100 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -6307,15 +6307,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.trunc_s/f64 + local.get $1 + local.get $0 + local.get $0 + i32.trunc_f64_s i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -6326,11 +6326,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f64 + local.get $0 + i32.trunc_f64_s i32.const 10 i32.add i32.ne @@ -6342,16 +6342,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|0 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -6364,14 +6364,14 @@ unreachable end f64.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 f64.const 100 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -6382,11 +6382,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f64 + local.get $0 + i32.trunc_f64_s i32.const 10 i32.add i32.ne @@ -6398,15 +6398,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.trunc_s/f64 + local.get $1 + local.get $0 + local.get $0 + i32.trunc_f64_s i32.const 20 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -6417,11 +6417,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f64 + local.get $0 + i32.trunc_f64_s i32.const 20 i32.add i32.ne @@ -6433,16 +6433,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|1 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -6455,14 +6455,14 @@ unreachable end f64.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 f64.const 50 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -6473,11 +6473,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#get - get_local $0 - i32.trunc_s/f64 + local.get $0 + i32.trunc_f64_s i32.const 20 i32.add i32.ne @@ -6489,12 +6489,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -6504,16 +6504,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -6526,14 +6526,14 @@ unreachable end f64.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 f64.const 50 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -6543,15 +6543,15 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 - get_local $0 - i32.trunc_s/f64 + local.get $1 + local.get $0 + local.get $0 + i32.trunc_f64_s i32.const 10 i32.add call $~lib/map/Map#set - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -6562,12 +6562,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -6577,16 +6577,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -6598,9 +6598,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/map/Map#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -6613,9 +6613,9 @@ ) (func $start (; 67 ;) (type $v) i32.const 144 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 66ff3e46..bb27ebe6 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -22,7 +22,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -50,41 +50,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -94,22 +94,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -118,20 +118,20 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -142,8 +142,8 @@ (func $~lib/internal/arraybuffer/allocateUnsafe (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -155,267 +155,267 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -426,8 +426,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -437,142 +437,142 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 0 i32.ne i32.eqz if - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $1 + local.set $5 + local.get $4 + local.get $5 + local.get $1 call $~lib/internal/memory/memset end - get_local $3 + local.get $3 ) (func $~lib/map/Map#clear (; 7 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash8 (; 9 ;) (type $ii) (param $0 i32) (result i32) - get_global $~lib/internal/hash/FNV_OFFSET - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.get $0 i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul ) (func $~lib/map/Map#find (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load8_s - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -581,10 +581,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -608,131 +608,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load8_s i32.store8 - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i32.load8_s - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -742,7 +742,7 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -750,39 +750,39 @@ call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -791,65 +791,65 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store8 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -858,17 +858,17 @@ br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable end ) (func $~lib/map/Map#get:size (; 15 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -876,10 +876,10 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -888,60 +888,60 @@ br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -951,19 +951,19 @@ (local $1 i32) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -975,18 +975,18 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -997,11 +997,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -1018,16 +1018,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -1042,16 +1042,16 @@ end block $break|1 i32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -1062,11 +1062,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -1082,18 +1082,18 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -1104,11 +1104,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -1125,16 +1125,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -1149,16 +1149,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -1169,11 +1169,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -1189,12 +1189,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -1207,16 +1207,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -1231,16 +1231,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -1252,18 +1252,18 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -1274,12 +1274,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -1292,16 +1292,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -1314,9 +1314,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -1331,111 +1331,111 @@ end ) (func $~lib/map/Map#clear (; 18 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 19 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#find (; 20 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load8_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -1444,10 +1444,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 i32.const 255 i32.and call $~lib/internal/hash/hash8 @@ -1469,131 +1469,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load8_u i32.store8 - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i32.load8_u - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -1603,45 +1603,45 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 255 i32.and call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1650,82 +1650,82 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store8 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 i32.const 255 i32.and call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable end ) (func $~lib/map/Map#get:size (; 25 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -1733,70 +1733,70 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 i32.const 255 i32.and call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -1806,19 +1806,19 @@ (local $1 i32) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -1830,16 +1830,16 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 255 i32.and i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -1850,11 +1850,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 255 i32.and i32.add @@ -1869,16 +1869,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -1893,16 +1893,16 @@ end block $break|1 i32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -1913,11 +1913,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 255 i32.and i32.add @@ -1931,16 +1931,16 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 + local.get $1 i32.const 255 i32.and i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -1951,11 +1951,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 255 i32.and i32.add @@ -1970,16 +1970,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -1994,16 +1994,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -2014,11 +2014,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 255 i32.and i32.add @@ -2032,12 +2032,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -2050,16 +2050,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -2074,16 +2074,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -2095,16 +2095,16 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 255 i32.and i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -2115,12 +2115,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -2133,16 +2133,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -2155,9 +2155,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -2172,135 +2172,135 @@ end ) (func $~lib/map/Map#clear (; 28 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 29 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash16 (; 30 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 - get_local $1 - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 + local.get $1 + local.get $0 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 8 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 + local.set $1 + local.get $1 ) (func $~lib/map/Map#find (; 31 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load16_s - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -2309,10 +2309,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 32 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2336,131 +2336,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load16_s i32.store16 - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i32.load16_s - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -2470,7 +2470,7 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2478,39 +2478,39 @@ call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -2519,65 +2519,65 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store16 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 35 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2586,17 +2586,17 @@ br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable end ) (func $~lib/map/Map#get:size (; 36 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 37 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -2604,10 +2604,10 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2616,60 +2616,60 @@ br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -2679,19 +2679,19 @@ (local $1 i32) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -2703,18 +2703,18 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -2725,11 +2725,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2746,16 +2746,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -2770,16 +2770,16 @@ end block $break|1 i32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -2790,11 +2790,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2810,18 +2810,18 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -2832,11 +2832,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2853,16 +2853,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -2877,16 +2877,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -2897,11 +2897,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2917,12 +2917,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -2935,16 +2935,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -2959,16 +2959,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -2980,18 +2980,18 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -3002,12 +3002,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -3020,16 +3020,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -3042,9 +3042,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -3059,111 +3059,111 @@ end ) (func $~lib/map/Map#clear (; 39 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 40 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#find (; 41 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load16_u - get_local $1 + local.get $1 i32.const 65535 i32.and i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -3172,10 +3172,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 42 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 i32.const 65535 i32.and call $~lib/internal/hash/hash16 @@ -3197,131 +3197,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load16_u i32.store16 - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i32.load16_u - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -3331,45 +3331,45 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 65535 i32.and call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -3378,82 +3378,82 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store16 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 45 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 i32.const 65535 i32.and call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable end ) (func $~lib/map/Map#get:size (; 46 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 47 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -3461,70 +3461,70 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 i32.const 65535 i32.and call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -3534,19 +3534,19 @@ (local $1 i32) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -3558,16 +3558,16 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 65535 i32.and i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -3578,11 +3578,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 65535 i32.and i32.add @@ -3597,16 +3597,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -3621,16 +3621,16 @@ end block $break|1 i32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -3641,11 +3641,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.const 65535 i32.and i32.add @@ -3659,16 +3659,16 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 + local.get $1 i32.const 65535 i32.and i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -3679,11 +3679,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 65535 i32.and i32.add @@ -3698,16 +3698,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -3722,16 +3722,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -3742,11 +3742,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.const 65535 i32.and i32.add @@ -3760,12 +3760,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -3778,16 +3778,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -3802,16 +3802,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -3823,16 +3823,16 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.const 65535 i32.and i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -3843,12 +3843,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -3861,16 +3861,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -3883,9 +3883,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -3900,151 +3900,151 @@ end ) (func $~lib/map/Map#clear (; 49 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 50 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash32 (; 51 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 - get_local $1 - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 + local.get $1 + local.get $0 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 + local.set $1 + local.get $1 ) (func $~lib/map/Map#find (; 52 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load - get_local $1 + local.get $1 i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -4053,10 +4053,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 53 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end @@ -4076,131 +4076,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load i32.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i32.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -4210,43 +4210,43 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -4255,80 +4255,80 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 56 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable end ) (func $~lib/map/Map#get:size (; 57 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 58 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -4336,68 +4336,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -4407,19 +4407,19 @@ (local $1 i32) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -4431,14 +4431,14 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -4449,11 +4449,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -4466,16 +4466,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -4490,16 +4490,16 @@ end block $break|1 i32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -4510,11 +4510,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -4526,14 +4526,14 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 + local.get $1 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -4544,11 +4544,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -4561,16 +4561,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -4585,16 +4585,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -4605,11 +4605,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -4621,12 +4621,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -4639,16 +4639,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -4663,16 +4663,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -4684,14 +4684,14 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -4702,12 +4702,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -4720,16 +4720,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -4742,9 +4742,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -4759,109 +4759,109 @@ end ) (func $~lib/map/Map#clear (; 60 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 61 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#find (; 62 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load - get_local $1 + local.get $1 i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -4870,10 +4870,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 63 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end @@ -4893,131 +4893,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load i32.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i32.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -5027,43 +5027,43 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -5072,80 +5072,80 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 66 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable end ) (func $~lib/map/Map#get:size (; 67 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 68 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -5153,68 +5153,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -5224,19 +5224,19 @@ (local $1 i32) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -5248,14 +5248,14 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -5266,11 +5266,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -5283,16 +5283,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -5307,16 +5307,16 @@ end block $break|1 i32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -5327,11 +5327,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -5343,14 +5343,14 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 + local.get $1 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -5361,11 +5361,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -5378,16 +5378,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -5402,16 +5402,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -5422,11 +5422,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 + local.get $1 i32.add i32.eq i32.eqz @@ -5438,12 +5438,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -5456,16 +5456,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -5480,16 +5480,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -5501,14 +5501,14 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 + local.get $1 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -5519,12 +5519,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -5537,16 +5537,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -5559,9 +5559,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -5576,197 +5576,197 @@ end ) (func $~lib/map/Map#clear (; 70 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 71 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash64 (; 72 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 - i32.wrap/i64 - set_local $1 - get_local $0 + local.get $0 + i32.wrap_i64 + local.set $1 + local.get $0 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 - get_global $~lib/internal/hash/FNV_OFFSET - set_local $3 - get_local $3 - get_local $1 + i32.wrap_i64 + local.set $2 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $3 + local.get $3 + local.get $1 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $~lib/map/Map#find (; 73 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i64.load - get_local $1 + local.get $1 i64.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -5775,10 +5775,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 74 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.0 end @@ -5799,131 +5799,131 @@ (local $11 i64) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 16 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 16 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i64.load i64.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=8 i32.store offset=8 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i64.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/map/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=12 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 16 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -5933,43 +5933,43 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=8 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -5978,80 +5978,80 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i64.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=12 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 77 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=8 else unreachable end ) (func $~lib/map/Map#get:size (; 78 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 79 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) @@ -6059,68 +6059,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -6130,19 +6130,19 @@ (local $1 i64) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i64.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i64.const 100 i64.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -6154,15 +6154,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -6173,12 +6173,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -6191,16 +6191,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -6215,16 +6215,16 @@ end block $break|1 i64.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i64.const 100 i64.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -6235,12 +6235,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -6252,15 +6252,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -6271,12 +6271,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -6289,16 +6289,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -6313,16 +6313,16 @@ end block $break|2 i64.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i64.const 50 i64.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -6333,12 +6333,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -6350,12 +6350,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -6368,16 +6368,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -6392,16 +6392,16 @@ end block $break|3 i64.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i64.const 50 i64.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -6413,15 +6413,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -6432,12 +6432,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -6450,16 +6450,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -6472,9 +6472,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -6489,109 +6489,109 @@ end ) (func $~lib/map/Map#clear (; 81 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 82 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#find (; 83 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i64.load - get_local $1 + local.get $1 i64.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -6600,10 +6600,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 84 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.0 end @@ -6624,131 +6624,131 @@ (local $11 i64) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 16 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 16 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i64.load i64.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=8 i32.store offset=8 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 i64.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/map/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=12 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 16 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -6758,43 +6758,43 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=8 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -6803,80 +6803,80 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i64.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=12 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 87 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=8 else unreachable end ) (func $~lib/map/Map#get:size (; 88 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 89 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) @@ -6884,68 +6884,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -6955,19 +6955,19 @@ (local $1 i64) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 i64.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i64.const 100 i64.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -6979,15 +6979,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -6998,12 +6998,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -7016,16 +7016,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -7040,16 +7040,16 @@ end block $break|1 i64.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i64.const 100 i64.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7060,12 +7060,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -7077,15 +7077,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7096,12 +7096,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -7114,16 +7114,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -7138,16 +7138,16 @@ end block $break|2 i64.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i64.const 50 i64.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7158,12 +7158,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add i32.eq i32.eqz @@ -7175,12 +7175,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -7193,16 +7193,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -7217,16 +7217,16 @@ end block $break|3 i64.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i64.const 50 i64.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -7238,15 +7238,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.wrap/i64 + local.get $1 + i32.wrap_i64 i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7257,12 +7257,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -7275,16 +7275,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -7297,9 +7297,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -7314,109 +7314,109 @@ end ) (func $~lib/map/Map#clear (; 91 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 92 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#find (; 93 ;) (type $ifii) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 f32.load - get_local $1 + local.get $1 f32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -7425,11 +7425,11 @@ i32.const 0 ) (func $~lib/map/Map#has (; 94 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 - i32.reinterpret/f32 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end @@ -7450,132 +7450,132 @@ (local $11 f32) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 f32.load f32.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 f32.load - set_local $11 - get_local $11 - i32.reinterpret/f32 + local.set $11 + local.get $11 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/map/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=8 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -7585,44 +7585,44 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 - i32.reinterpret/f32 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -7631,81 +7631,81 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 f32.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 97 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 - i32.reinterpret/f32 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable end ) (func $~lib/map/Map#get:size (; 98 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 99 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) @@ -7713,69 +7713,69 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 - i32.reinterpret/f32 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -7785,19 +7785,19 @@ (local $1 f32) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 f32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 f32.const 100 f32.lt i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -7809,15 +7809,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.trunc_s/f32 + local.get $1 + i32.trunc_f32_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7828,12 +7828,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.trunc_s/f32 + local.get $1 + i32.trunc_f32_s i32.add i32.eq i32.eqz @@ -7846,16 +7846,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -7870,16 +7870,16 @@ end block $break|1 f32.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 f32.const 100 f32.lt i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7890,12 +7890,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.trunc_s/f32 + local.get $1 + i32.trunc_f32_s i32.add i32.eq i32.eqz @@ -7907,15 +7907,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 - i32.trunc_s/f32 + local.get $1 + i32.trunc_f32_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7926,12 +7926,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.trunc_s/f32 + local.get $1 + i32.trunc_f32_s i32.add i32.eq i32.eqz @@ -7944,16 +7944,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -7968,16 +7968,16 @@ end block $break|2 f32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 f32.const 50 f32.lt i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -7988,12 +7988,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.trunc_s/f32 + local.get $1 + i32.trunc_f32_s i32.add i32.eq i32.eqz @@ -8005,12 +8005,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -8023,16 +8023,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -8047,16 +8047,16 @@ end block $break|3 f32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 f32.const 50 f32.lt i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -8068,15 +8068,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.trunc_s/f32 + local.get $1 + i32.trunc_f32_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -8087,12 +8087,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -8105,16 +8105,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -8127,9 +8127,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -8144,109 +8144,109 @@ end ) (func $~lib/map/Map#clear (; 101 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 102 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#find (; 103 ;) (type $iFii) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 f64.load - get_local $1 + local.get $1 f64.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -8255,11 +8255,11 @@ i32.const 0 ) (func $~lib/map/Map#has (; 104 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.0 end @@ -8280,132 +8280,132 @@ (local $11 f64) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 16 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 16 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 f64.load f64.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=8 i32.store offset=8 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $9 + local.get $9 f64.load - set_local $11 - get_local $11 - i64.reinterpret/f64 + local.set $11 + local.get $11 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.2 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/map/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=12 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 16 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -8415,44 +8415,44 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.1 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=8 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -8461,81 +8461,81 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 f64.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=12 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/map/Map#get (; 107 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=8 else unreachable end ) (func $~lib/map/Map#get:size (; 108 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/map/Map#delete (; 109 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) @@ -8543,69 +8543,69 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.4 (result i32) - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.4 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=12 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.or i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/map/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/map/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -8615,19 +8615,19 @@ (local $1 f64) i32.const 0 call $~lib/map/Map#constructor - set_local $0 + local.set $0 block $break|0 f64.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 f64.const 100 f64.lt i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -8639,15 +8639,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.trunc_s/f64 + local.get $1 + i32.trunc_f64_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -8658,12 +8658,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.trunc_s/f64 + local.get $1 + i32.trunc_f64_s i32.add i32.eq i32.eqz @@ -8676,16 +8676,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -8700,16 +8700,16 @@ end block $break|1 f64.const 0 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 f64.const 100 f64.lt i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -8720,12 +8720,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 10 - get_local $1 - i32.trunc_s/f64 + local.get $1 + i32.trunc_f64_s i32.add i32.eq i32.eqz @@ -8737,15 +8737,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 20 - get_local $1 - i32.trunc_s/f64 + local.get $1 + i32.trunc_f64_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -8756,12 +8756,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.trunc_s/f64 + local.get $1 + i32.trunc_f64_s i32.add i32.eq i32.eqz @@ -8774,16 +8774,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 100 i32.eq @@ -8798,16 +8798,16 @@ end block $break|2 f64.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 f64.const 50 f64.lt i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -8818,12 +8818,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#get i32.const 20 - get_local $1 - i32.trunc_s/f64 + local.get $1 + i32.trunc_f64_s i32.add i32.eq i32.eqz @@ -8835,12 +8835,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -8853,16 +8853,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -8877,16 +8877,16 @@ end block $break|3 f64.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 f64.const 50 f64.lt i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -8898,15 +8898,15 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 10 - get_local $1 - i32.trunc_s/f64 + local.get $1 + i32.trunc_f64_s i32.add call $~lib/map/Map#set - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -8917,12 +8917,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/map/Map#has i32.eqz i32.eqz @@ -8935,16 +8935,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 50 i32.eq @@ -8957,9 +8957,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 call $~lib/map/Map#get:size i32.const 0 i32.eq @@ -8974,16 +8974,16 @@ end ) (func $start (; 111 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 1581b5e5..71d58817 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -68,7 +68,7 @@ (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) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) @@ -79,198 +79,198 @@ (export "table" (table $0)) (start $start) (func $~lib/math/NativeMath.scalbn (; 30 ;) (type $FiF) (param $0 f64) (param $1 i32) (result f64) - get_local $1 + local.get $1 i32.const 1023 i32.gt_s if (result f64) - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1023 i32.sub - tee_local $1 + local.tee $1 i32.const 1023 i32.gt_s if (result f64) - get_local $1 + local.get $1 i32.const 1023 i32.sub - tee_local $1 + local.tee $1 i32.const 1023 - get_local $1 + local.get $1 i32.const 1023 i32.lt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul else - get_local $0 + local.get $0 end else - get_local $1 + local.get $1 i32.const -1022 i32.lt_s if (result f64) - get_local $0 + local.get $0 f64.const 2.004168360008973e-292 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 969 i32.add - tee_local $1 + local.tee $1 i32.const -1022 i32.lt_s if (result f64) - get_local $1 + local.get $1 i32.const 969 i32.add - tee_local $1 + local.tee $1 i32.const -1022 - get_local $1 + local.get $1 i32.const -1022 i32.gt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 2.004168360008973e-292 f64.mul else - get_local $0 + local.get $0 end else - get_local $0 + local.get $0 end end - get_local $1 - i64.extend_s/i32 + local.get $1 + i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl - f64.reinterpret/i64 + f64.reinterpret_i64 f64.mul ) (func $std/math/ulperr (; 31 ;) (type $FFFF) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) (local $3 i32) (local $4 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne - tee_local $4 - set_local $3 - get_local $1 - get_local $1 + local.tee $4 + local.set $3 + local.get $1 + local.get $1 f64.ne - get_local $3 - get_local $4 + local.get $3 + local.get $4 select if f64.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.eq if - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $0 - get_local $0 + i32.wrap_i64 + local.get $0 + local.get $0 f64.eq i32.and i32.const 0 i32.ne - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and i32.const 0 i32.ne i32.eq if - get_local $2 + local.get $2 return end f64.const inf return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.ne if - get_local $1 + local.get $1 f64.const 0.5 f64.mul - set_local $1 + local.set $1 f64.const 8988465674311579538646525e283 - get_local $0 + local.get $0 f64.copysign - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub - set_local $0 - get_local $1 - i64.reinterpret/f64 + local.set $0 + local.get $1 + i64.reinterpret_f64 i64.const 52 i64.shr_u i64.const 2047 i64.and - i32.wrap/i64 - tee_local $3 + i32.wrap_i64 + local.tee $3 i32.eqz if - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 end - get_local $0 + local.get $0 i32.const 0 - get_local $3 + local.get $3 i32.const -1075 i32.add i32.sub call $~lib/math/NativeMath.scalbn - get_local $2 + local.get $2 f64.add ) (func $std/math/check (; 32 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.eq if i32.const 1 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $std/math/ulperr f64.abs f64.const 1.5 @@ -282,194 +282,194 @@ i32.const 1 ) (func $~lib/math/NativeMathf.scalbn (; 33 ;) (type $fif) (param $0 f32) (param $1 i32) (result f32) - get_local $1 + local.get $1 i32.const 127 i32.gt_s if (result f32) - get_local $0 + local.get $0 f32.const 1701411834604692317316873e14 f32.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 127 i32.sub - tee_local $1 + local.tee $1 i32.const 127 i32.gt_s if (result f32) - get_local $1 + local.get $1 i32.const 127 i32.sub - tee_local $1 + local.tee $1 i32.const 127 - get_local $1 + local.get $1 i32.const 127 i32.lt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f32.const 1701411834604692317316873e14 f32.mul else - get_local $0 + local.get $0 end else - get_local $1 + local.get $1 i32.const -126 i32.lt_s if (result f32) - get_local $0 + local.get $0 f32.const 1.9721522630525295e-31 f32.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 102 i32.add - tee_local $1 + local.tee $1 i32.const -126 i32.lt_s if (result f32) - get_local $1 + local.get $1 i32.const 102 i32.add - tee_local $1 + local.tee $1 i32.const -126 - get_local $1 + local.get $1 i32.const -126 i32.gt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f32.const 1.9721522630525295e-31 f32.mul else - get_local $0 + local.get $0 end else - get_local $0 + local.get $0 end end - get_local $1 + local.get $1 i32.const 127 i32.add i32.const 23 i32.shl - f32.reinterpret/i32 + f32.reinterpret_i32 f32.mul ) (func $std/math/ulperrf (; 34 ;) (type $ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne - tee_local $4 - set_local $3 - get_local $1 - get_local $1 + local.tee $4 + local.set $3 + local.get $1 + local.get $1 f32.ne - get_local $3 - get_local $4 + local.get $3 + local.get $4 select if f32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.eq if - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.eq i32.and i32.const 0 i32.ne - get_local $1 - i32.reinterpret/f32 + local.get $1 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.eq i32.and i32.const 0 i32.ne i32.eq if - get_local $2 + local.get $2 return end f32.const inf return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.ne if - get_local $1 + local.get $1 f32.const 0.5 f32.mul - set_local $1 + local.set $1 f32.const 1701411834604692317316873e14 - get_local $0 + local.get $0 f32.copysign - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.sub - set_local $0 - get_local $1 - i32.reinterpret/f32 + local.set $0 + local.get $1 + i32.reinterpret_f32 i32.const 23 i32.shr_u i32.const 255 i32.and - tee_local $3 + local.tee $3 i32.eqz if - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 end - get_local $0 + local.get $0 i32.const 0 - get_local $3 + local.get $3 i32.const -150 i32.add i32.sub call $~lib/math/NativeMathf.scalbn - get_local $2 + local.get $2 f32.add ) (func $std/math/check (; 35 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.eq if i32.const 1 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $std/math/ulperrf f32.abs f32.const 1.5 @@ -481,58 +481,58 @@ i32.const 1 ) (func $std/math/test_scalbn (; 36 ;) (type $FUNCSIG$ididi) (param $0 f64) (param $1 i32) (param $2 f64) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.scalbn - get_local $2 + local.get $2 f64.const 0 call $std/math/check ) (func $std/math/test_scalbnf (; 37 ;) (type $FUNCSIG$ififi) (param $0 f32) (param $1 i32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.scalbn - get_local $2 + local.get $2 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) - get_local $0 + local.get $0 f64.abs - get_local $1 + local.get $1 f64.const 0 call $std/math/check - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 call $~lib/bindings/Math/abs - get_local $1 + local.get $1 f64.const 0 call $std/math/check - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/math/test_absf (; 39 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) - get_local $0 + local.get $0 f32.abs - get_local $1 + local.get $1 f32.const 0 call $std/math/check ) (func $~lib/math/R (; 40 ;) (type $FF) (param $0 f64) (result f64) - get_local $0 + local.get $0 f64.const 0.16666666666666666 - get_local $0 + local.get $0 f64.const -0.3255658186224009 - get_local $0 + local.get $0 f64.const 0.20121253213486293 - get_local $0 + local.get $0 f64.const -0.04005553450067941 - get_local $0 + local.get $0 f64.const 7.915349942898145e-04 - get_local $0 + local.get $0 f64.const 3.479331075960212e-05 f64.mul f64.add @@ -546,13 +546,13 @@ f64.add f64.mul f64.const 1 - get_local $0 + local.get $0 f64.const -2.403394911734414 - get_local $0 + local.get $0 f64.const 2.0209457602335057 - get_local $0 + local.get $0 f64.const -0.6882839716054533 - get_local $0 + local.get $0 f64.const 0.07703815055590194 f64.mul f64.add @@ -570,28 +570,28 @@ (local $3 f64) (local $4 i32) (local $5 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $4 + i32.wrap_i64 + local.tee $4 i32.const 2147483647 i32.and - tee_local $2 + local.tee $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.get $2 i32.const 1072693248 i32.sub i32.or i32.eqz if - get_local $4 + local.get $4 i32.const 31 i32.shr_u if @@ -602,17 +602,17 @@ return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1012924416 i32.le_u if @@ -620,11 +620,11 @@ return end f64.const 1.5707963267948966 - get_local $0 + local.get $0 f64.const 6.123233995736766e-17 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -633,23 +633,23 @@ f64.sub return end - get_local $4 + local.get $4 i32.const 31 i32.shr_u if f64.const 2 f64.const 1.5707963267948966 f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.add - tee_local $1 + local.tee $1 f64.sqrt - tee_local $0 - get_local $1 + local.tee $0 + local.get $1 call $~lib/math/R - get_local $0 + local.get $0 f64.mul f64.const 6.123233995736766e-17 f64.sub @@ -659,55 +659,55 @@ return end f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.sub - tee_local $1 + local.tee $1 f64.sqrt - set_local $0 - get_local $1 - get_local $0 - i64.reinterpret/f64 + local.set $0 + local.get $1 + local.get $0 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $3 - get_local $3 + f64.reinterpret_i64 + local.tee $3 + local.get $3 f64.mul f64.sub - get_local $0 - get_local $3 + local.get $0 + local.get $3 f64.add f64.div - set_local $5 + local.set $5 f64.const 2 - get_local $3 - get_local $1 + local.get $3 + local.get $1 call $~lib/math/R - get_local $0 + local.get $0 f64.mul - get_local $5 + local.get $5 f64.add f64.add f64.mul ) (func $std/math/test_acos (; 42 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acos - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/acos - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.acos (; 43 ;) (type $ff) (param $0 f32) (result f32) @@ -716,20 +716,20 @@ (local $3 i32) (local $4 i32) (local $5 f32) - get_local $0 - i32.reinterpret/f32 - tee_local $4 + local.get $0 + i32.reinterpret_f32 + local.tee $4 i32.const 2147483647 i32.and - tee_local $3 + local.tee $3 i32.const 1065353216 i32.ge_u if - get_local $3 + local.get $3 i32.const 1065353216 i32.eq if - get_local $4 + local.get $4 i32.const 31 i32.shr_u if @@ -740,17 +740,17 @@ return end f32.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.div return end - get_local $3 + local.get $3 i32.const 1056964608 i32.lt_u if - get_local $3 + local.get $3 i32.const 847249408 i32.le_u if @@ -758,17 +758,17 @@ return end f32.const 1.570796251296997 - get_local $0 + local.get $0 f32.const 7.549789415861596e-08 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f32.mul - tee_local $0 + local.tee $0 f32.const 0.16666586697101593 - get_local $0 + local.get $0 f32.const -0.04274342209100723 - get_local $0 + local.get $0 f32.const -0.008656363002955914 f32.mul f32.add @@ -776,7 +776,7 @@ f32.add f32.mul f32.const 1 - get_local $0 + local.get $0 f32.const -0.7066296339035034 f32.mul f32.add @@ -787,20 +787,20 @@ f32.sub return end - get_local $4 + local.get $4 i32.const 31 i32.shr_u if f32.const 0.5 - get_local $0 + local.get $0 f32.const 0.5 f32.mul f32.add - tee_local $0 + local.tee $0 f32.const 0.16666586697101593 - get_local $0 + local.get $0 f32.const -0.04274342209100723 - get_local $0 + local.get $0 f32.const -0.008656363002955914 f32.mul f32.add @@ -808,19 +808,19 @@ f32.add f32.mul f32.const 1 - get_local $0 + local.get $0 f32.const -0.7066296339035034 f32.mul f32.add f32.div - set_local $1 + local.set $1 f32.const 2 f32.const 1.570796251296997 - get_local $0 + local.get $0 f32.sqrt - tee_local $2 - get_local $1 - get_local $2 + local.tee $2 + local.get $1 + local.get $2 f32.mul f32.const 7.549789415861596e-08 f32.sub @@ -830,35 +830,35 @@ return end f32.const 0.5 - get_local $0 + local.get $0 f32.const 0.5 f32.mul f32.sub - tee_local $0 + local.tee $0 f32.sqrt - set_local $2 - get_local $0 - get_local $2 - i32.reinterpret/f32 + local.set $2 + local.get $0 + local.get $2 + i32.reinterpret_f32 i32.const -4096 i32.and - f32.reinterpret/i32 - tee_local $1 - get_local $1 + f32.reinterpret_i32 + local.tee $1 + local.get $1 f32.mul f32.sub - get_local $2 - get_local $1 + local.get $2 + local.get $1 f32.add f32.div - set_local $5 + local.set $5 f32.const 2 - get_local $1 - get_local $0 + local.get $1 + local.get $0 f32.const 0.16666586697101593 - get_local $0 + local.get $0 f32.const -0.04274342209100723 - get_local $0 + local.get $0 f32.const -0.008656363002955914 f32.mul f32.add @@ -866,23 +866,23 @@ f32.add f32.mul f32.const 1 - get_local $0 + local.get $0 f32.const -0.7066296339035034 f32.mul f32.add f32.div - get_local $2 + local.get $2 f32.mul - get_local $5 + local.get $5 f32.add f32.add f32.mul ) (func $std/math/test_acosf (; 44 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.acos - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.log1p (; 45 ;) (type $FF) (param $0 f64) (result f64) @@ -895,159 +895,159 @@ (local $7 i64) (local $8 f64) i32.const 1 - set_local $2 - get_local $0 - i64.reinterpret/f64 + local.set $2 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $3 + i32.wrap_i64 + local.tee $3 i32.const 1071284858 i32.lt_u - tee_local $4 + local.tee $4 i32.eqz if - get_local $3 + local.get $3 i32.const 31 i32.shr_u - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $3 + local.get $3 i32.const -1074790400 i32.ge_u if - get_local $0 + local.get $0 f64.const -1 f64.eq if - get_local $0 + local.get $0 f64.const 0 f64.div return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 1 i32.shl i32.const 2034237440 i32.lt_u if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i32.const -1076707644 i32.le_u if i32.const 0 - set_local $2 - get_local $0 - set_local $1 + local.set $2 + local.get $0 + local.set $1 end else - get_local $3 + local.get $3 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return end end - get_local $2 + local.get $2 if f64.const 1 - get_local $0 + local.get $0 f64.add - i64.reinterpret/f64 - tee_local $7 + i64.reinterpret_f64 + local.tee $7 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 614242 i32.add - tee_local $4 + local.tee $4 i32.const 20 i32.shr_u i32.const 1023 i32.sub - tee_local $2 + local.tee $2 i32.const 54 i32.lt_s if (result f64) - get_local $7 - f64.reinterpret/i64 - set_local $1 + local.get $7 + f64.reinterpret_i64 + local.set $1 f64.const 1 - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.sub f64.sub - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.const 1 f64.sub f64.sub - get_local $2 + local.get $2 i32.const 2 i32.ge_s select - get_local $1 + local.get $1 f64.div else f64.const 0 end - set_local $6 - get_local $7 + local.set $6 + local.get $7 i64.const 4294967295 i64.and - get_local $4 + local.get $4 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - set_local $1 + local.set $1 end - get_local $1 + local.get $1 f64.const 2 - get_local $1 + local.get $1 f64.add f64.div - tee_local $5 - get_local $5 + local.tee $5 + local.get $5 f64.mul - tee_local $8 - get_local $8 + local.tee $8 + local.get $8 f64.mul - set_local $0 - get_local $5 + local.set $0 + local.get $5 f64.const 0.5 - get_local $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $5 - get_local $8 + local.tee $5 + local.get $8 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -1056,11 +1056,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -1070,19 +1070,19 @@ f64.add f64.add f64.mul - get_local $2 - f64.convert_s/i32 - tee_local $0 + local.get $2 + f64.convert_i32_s + local.tee $0 f64.const 1.9082149292705877e-10 f64.mul - get_local $6 + local.get $6 f64.add f64.add - get_local $5 + local.get $5 f64.sub - get_local $1 + local.get $1 f64.add - get_local $0 + local.get $0 f64.const 0.6931471803691238 f64.mul f64.add @@ -1095,139 +1095,139 @@ (local $5 f64) (local $6 f64) (local $7 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $4 + local.get $0 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 1048576 i32.lt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.const 31 i32.shr_u - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $4 + local.get $4 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $4 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 + i32.wrap_i64 + local.set $1 else - get_local $1 + local.get $1 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1072693248 i32.eq - tee_local $2 + local.tee $2 if - get_local $4 + local.get $4 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if f64.const 0 return end end end - get_local $1 + local.get $1 i32.const 614242 i32.add - tee_local $1 + local.tee $1 i32.const 20 i32.shr_s i32.const 1023 i32.sub - get_local $3 + local.get $3 i32.add - set_local $3 - get_local $4 + local.set $3 + local.get $4 i64.const 4294967295 i64.and - get_local $1 + local.get $1 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $5 + local.tee $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f64.mul - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - set_local $0 - get_local $6 + local.set $0 + local.get $6 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - tee_local $6 - get_local $7 + local.tee $6 + local.get $7 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -1236,11 +1236,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -1250,42 +1250,42 @@ f64.add f64.add f64.mul - get_local $3 - f64.convert_s/i32 - tee_local $0 + local.get $3 + f64.convert_i32_s + local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add - get_local $6 + local.get $6 f64.sub - get_local $5 + local.get $5 f64.add - get_local $0 + local.get $0 f64.const 0.6931471803691238 f64.mul f64.add ) (func $~lib/math/NativeMath.acosh (; 47 ;) (type $FF) (param $0 f64) (result f64) (local $1 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 52 i64.shr_u i64.const 2047 i64.and - tee_local $1 + local.tee $1 i64.const 1024 i64.lt_u if - get_local $0 + local.get $0 f64.const 1 f64.sub - tee_local $0 - get_local $0 - get_local $0 + local.tee $0 + local.get $0 + local.get $0 f64.mul f64.const 2 - get_local $0 + local.get $0 f64.mul f64.add f64.sqrt @@ -1293,17 +1293,17 @@ call $~lib/math/NativeMath.log1p return end - get_local $1 + local.get $1 i64.const 1049 i64.lt_u if f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul f64.const 1 f64.sub @@ -1314,27 +1314,27 @@ call $~lib/math/NativeMath.log return end - get_local $0 + local.get $0 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add ) (func $std/math/test_acosh (; 48 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acosh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/acosh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.log1p (; 49 ;) (type $ff) (param $0 f32) (result f32) @@ -1346,146 +1346,146 @@ (local $6 f32) (local $7 f32) i32.const 1 - set_local $2 - get_local $0 - i32.reinterpret/f32 - tee_local $3 + local.set $2 + local.get $0 + i32.reinterpret_f32 + local.tee $3 i32.const 1054086096 i32.lt_u - tee_local $4 + local.tee $4 i32.eqz if - get_local $3 + local.get $3 i32.const 31 i32.shr_u - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $3 + local.get $3 i32.const -1082130432 i32.ge_u if - get_local $0 + local.get $0 f32.const -1 f32.eq if - get_local $0 + local.get $0 f32.const 0 f32.div return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end - get_local $3 + local.get $3 i32.const 1 i32.shl i32.const 1728053248 i32.lt_u if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i32.const -1097468391 i32.le_u if i32.const 0 - set_local $2 - get_local $0 - set_local $1 + local.set $2 + local.get $0 + local.set $1 end else - get_local $3 + local.get $3 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return end end - get_local $2 + local.get $2 if f32.const 1 - get_local $0 + local.get $0 f32.add - tee_local $1 - i32.reinterpret/f32 + local.tee $1 + i32.reinterpret_f32 i32.const 4913933 i32.add - tee_local $4 + local.tee $4 i32.const 23 i32.shr_u i32.const 127 i32.sub - tee_local $2 + local.tee $2 i32.const 25 i32.lt_s if (result f32) f32.const 1 - get_local $1 - get_local $0 + local.get $1 + local.get $0 f32.sub f32.sub - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.const 1 f32.sub f32.sub - get_local $2 + local.get $2 i32.const 2 i32.ge_s select - get_local $1 + local.get $1 f32.div else f32.const 0 end - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 8388607 i32.and i32.const 1060439283 i32.add - f32.reinterpret/i32 + f32.reinterpret_i32 f32.const 1 f32.sub - set_local $1 + local.set $1 end - get_local $1 + local.get $1 f32.const 2 - get_local $1 + local.get $1 f32.add f32.div - tee_local $5 - get_local $5 + local.tee $5 + local.get $5 f32.mul - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f32.mul - set_local $0 - get_local $5 + local.set $0 + local.get $5 f32.const 0.5 - get_local $1 + local.get $1 f32.mul - get_local $1 + local.get $1 f32.mul - tee_local $5 - get_local $7 + local.tee $5 + local.get $7 f32.const 0.6666666269302368 - get_local $0 + local.get $0 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - get_local $0 + local.get $0 f32.const 0.40000972151756287 - get_local $0 + local.get $0 f32.const 0.24279078841209412 f32.mul f32.add @@ -1493,19 +1493,19 @@ f32.add f32.add f32.mul - get_local $2 - f32.convert_s/i32 - tee_local $0 + local.get $2 + f32.convert_i32_s + local.tee $0 f32.const 9.05800061445916e-06 f32.mul - get_local $6 + local.get $6 f32.add f32.add - get_local $5 + local.get $5 f32.sub - get_local $1 + local.get $1 f32.add - get_local $0 + local.get $0 f32.const 0.6931381225585938 f32.mul f32.add @@ -1517,60 +1517,60 @@ (local $4 f32) (local $5 i32) (local $6 f32) - get_local $0 - i32.reinterpret/f32 - tee_local $1 + local.get $0 + i32.reinterpret_f32 + local.tee $1 i32.const 8388608 i32.lt_u - tee_local $5 + local.tee $5 i32.eqz if - get_local $1 + local.get $1 i32.const 31 i32.shr_u - set_local $5 + local.set $5 end - get_local $5 + local.get $5 if - get_local $1 + local.get $1 i32.const 1 i32.shl i32.eqz if f32.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul f32.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end i32.const -25 - set_local $3 - get_local $0 + local.set $3 + local.get $0 f32.const 33554432 f32.mul - i32.reinterpret/f32 - set_local $1 + i32.reinterpret_f32 + local.set $1 else - get_local $1 + local.get $1 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1065353216 i32.eq if @@ -1579,54 +1579,54 @@ end end end - get_local $1 + local.get $1 i32.const 4913933 i32.add - tee_local $1 + local.tee $1 i32.const 23 i32.shr_s i32.const 127 i32.sub - get_local $3 + local.get $3 i32.add - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 8388607 i32.and i32.const 1060439283 i32.add - f32.reinterpret/i32 + f32.reinterpret_i32 f32.const 1 f32.sub - tee_local $0 + local.tee $0 f32.const 2 - get_local $0 + local.get $0 f32.add f32.div - tee_local $4 - get_local $4 + local.tee $4 + local.get $4 f32.mul - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f32.mul - set_local $2 - get_local $4 + local.set $2 + local.get $4 f32.const 0.5 - get_local $0 + local.get $0 f32.mul - get_local $0 + local.get $0 f32.mul - tee_local $4 - get_local $6 + local.tee $4 + local.get $6 f32.const 0.6666666269302368 - get_local $2 + local.get $2 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - get_local $2 + local.get $2 f32.const 0.40000972151756287 - get_local $2 + local.get $2 f32.const 0.24279078841209412 f32.mul f32.add @@ -1634,37 +1634,37 @@ f32.add f32.add f32.mul - get_local $3 - f32.convert_s/i32 - tee_local $2 + local.get $3 + f32.convert_i32_s + local.tee $2 f32.const 9.05800061445916e-06 f32.mul f32.add - get_local $4 + local.get $4 f32.sub - get_local $0 + local.get $0 f32.add - get_local $2 + local.get $2 f32.const 0.6931381225585938 f32.mul f32.add ) (func $~lib/math/NativeMathf.acosh (; 51 ;) (type $ff) (param $0 f32) (result f32) (local $1 i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $1 + local.tee $1 i32.const 1073741824 i32.lt_u if - get_local $0 + local.get $0 f32.const 1 f32.sub - tee_local $0 - get_local $0 - get_local $0 + local.tee $0 + local.get $0 + local.get $0 f32.const 2 f32.add f32.mul @@ -1673,17 +1673,17 @@ call $~lib/math/NativeMathf.log1p return end - get_local $1 + local.get $1 i32.const 1166016512 i32.lt_u if f32.const 2 - get_local $0 + local.get $0 f32.mul f32.const 1 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f32.mul f32.const 1 f32.sub @@ -1694,16 +1694,16 @@ call $~lib/math/NativeMathf.log return end - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log f32.const 0.6931471824645996 f32.add ) (func $std/math/test_acoshf (; 52 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.acosh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.asin (; 53 ;) (type $FF) (param $0 f64) (result f64) @@ -1711,28 +1711,28 @@ (local $2 i32) (local $3 i32) (local $4 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $3 + i32.wrap_i64 + local.tee $3 i32.const 2147483647 i32.and - tee_local $2 + local.tee $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.get $2 i32.const 1072693248 i32.sub i32.or i32.eqz if - get_local $0 + local.get $0 f64.const 1.5707963267948966 f64.mul f64.const 7.52316384526264e-37 @@ -1740,35 +1740,35 @@ return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1045430272 i32.lt_u - tee_local $3 + local.tee $3 if - get_local $2 + local.get $2 i32.const 1048576 i32.ge_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -1776,26 +1776,26 @@ return end f64.const 0.5 - get_local $0 + local.get $0 f64.abs f64.const 0.5 f64.mul f64.sub - tee_local $1 + local.tee $1 f64.sqrt - set_local $0 - get_local $1 + local.set $0 + local.get $1 call $~lib/math/R - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 1072640819 i32.ge_u if (result f64) f64.const 1.5707963267948966 f64.const 2 - get_local $0 - get_local $0 - get_local $4 + local.get $0 + local.get $0 + local.get $4 f64.mul f64.add f64.mul @@ -1805,24 +1805,24 @@ else f64.const 0.7853981633974483 f64.const 2 - get_local $0 + local.get $0 f64.mul - get_local $4 + local.get $4 f64.mul f64.const 6.123233995736766e-17 f64.const 2 - get_local $1 - get_local $0 - i64.reinterpret/f64 + local.get $1 + local.get $0 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $1 - get_local $1 + f64.reinterpret_i64 + local.tee $1 + local.get $1 f64.mul f64.sub - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add f64.div f64.mul @@ -1830,39 +1830,39 @@ f64.sub f64.const 0.7853981633974483 f64.const 2 - get_local $1 + local.get $1 f64.mul f64.sub f64.sub f64.sub end - set_local $0 - get_local $3 + local.set $0 + local.get $3 i32.const 31 i32.shr_u if - get_local $0 + local.get $0 f64.neg return end - get_local $0 + local.get $0 ) (func $std/math/test_asin (; 54 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asin - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/asin - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.asin (; 55 ;) (type $ff) (param $0 f32) (result f32) @@ -1871,19 +1871,19 @@ (local $3 i32) (local $4 f32) (local $5 f64) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $1 + local.tee $1 i32.const 1065353216 i32.ge_u if - get_local $1 + local.get $1 i32.const 1065353216 i32.eq if - get_local $0 + local.get $0 f32.const 1.5707963705062866 f32.mul f32.const 7.52316384526264e-37 @@ -1891,41 +1891,41 @@ return end f32.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.div return end - get_local $1 + local.get $1 i32.const 1056964608 i32.lt_u if - get_local $1 + local.get $1 i32.const 964689920 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $1 + local.get $1 i32.const 8388608 i32.ge_u else - get_local $3 + local.get $3 end if - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f32.mul - tee_local $0 + local.tee $0 f32.const 0.16666586697101593 - get_local $0 + local.get $0 f32.const -0.04274342209100723 - get_local $0 + local.get $0 f32.const -0.008656363002955914 f32.mul f32.add @@ -1933,7 +1933,7 @@ f32.add f32.mul f32.const 1 - get_local $0 + local.get $0 f32.const -0.7066296339035034 f32.mul f32.add @@ -1943,16 +1943,16 @@ return end f32.const 0.5 - get_local $0 + local.get $0 f32.abs f32.const 0.5 f32.mul f32.sub - tee_local $2 + local.tee $2 f32.const 0.16666586697101593 - get_local $2 + local.get $2 f32.const -0.04274342209100723 - get_local $2 + local.get $2 f32.const -0.008656363002955914 f32.mul f32.add @@ -1960,90 +1960,90 @@ f32.add f32.mul f32.const 1 - get_local $2 + local.get $2 f32.const -0.7066296339035034 f32.mul f32.add f32.div - set_local $4 + local.set $4 f64.const 1.5707963705062866 f64.const 2 - get_local $2 - f64.promote/f32 + local.get $2 + f64.promote_f32 f64.sqrt - tee_local $5 - get_local $5 - get_local $4 - f64.promote/f32 + local.tee $5 + local.get $5 + local.get $4 + f64.promote_f32 f64.mul f64.add f64.mul f64.sub - f32.demote/f64 - get_local $0 + f32.demote_f64 + local.get $0 f32.copysign ) (func $std/math/test_asinf (; 56 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.asin - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.asinh (; 57 ;) (type $FF) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $2 + local.get $0 + i64.reinterpret_f64 + local.tee $2 i64.const 9223372036854775807 i64.and - f64.reinterpret/i64 - set_local $1 - get_local $2 + f64.reinterpret_i64 + local.set $1 + local.get $2 i64.const 52 i64.shr_u i64.const 2047 i64.and - tee_local $2 + local.tee $2 i64.const 1049 i64.ge_u if (result f64) - get_local $1 + local.get $1 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add else - get_local $2 + local.get $2 i64.const 1024 i64.ge_u if (result f64) f64.const 2 - get_local $1 + local.get $1 f64.mul f64.const 1 - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.mul f64.const 1 f64.add f64.sqrt - get_local $1 + local.get $1 f64.add f64.div f64.add call $~lib/math/NativeMath.log else - get_local $2 + local.get $2 i64.const 997 i64.ge_u if (result f64) - get_local $1 - get_local $1 - get_local $1 + local.get $1 + local.get $1 + local.get $1 f64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f64.const 1 f64.add f64.sqrt @@ -2053,80 +2053,80 @@ f64.add call $~lib/math/NativeMath.log1p else - get_local $1 + local.get $1 end end end - get_local $0 + local.get $0 f64.copysign ) (func $std/math/test_asinh (; 58 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asinh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/asinh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.asinh (; 59 ;) (type $ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $2 - f32.reinterpret/i32 - set_local $1 - get_local $2 + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 i32.const 1166016512 i32.ge_u if (result f32) - get_local $1 + local.get $1 call $~lib/math/NativeMathf.log f32.const 0.6931471824645996 f32.add else - get_local $2 + local.get $2 i32.const 1073741824 i32.ge_u if (result f32) f32.const 2 - get_local $1 + local.get $1 f32.mul f32.const 1 - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.mul f32.const 1 f32.add f32.sqrt - get_local $1 + local.get $1 f32.add f32.div f32.add call $~lib/math/NativeMathf.log else - get_local $2 + local.get $2 i32.const 964689920 i32.ge_u if (result f32) - get_local $1 - get_local $1 - get_local $1 + local.get $1 + local.get $1 + local.get $1 f32.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f32.const 1 f32.add f32.sqrt @@ -2136,18 +2136,18 @@ f32.add call $~lib/math/NativeMathf.log1p else - get_local $1 + local.get $1 end end end - get_local $0 + local.get $0 f32.copysign ) (func $std/math/test_asinhf (; 60 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.asinh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.atan (; 61 ;) (type $FF) (param $0 f64) (result f64) @@ -2155,123 +2155,123 @@ (local $2 i32) (local $3 f64) (local $4 f64) - get_local $0 - set_local $4 - get_local $0 - i64.reinterpret/f64 + local.get $0 + local.set $4 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - tee_local $2 + local.tee $2 i32.const 1141899264 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if - get_local $0 + local.get $0 return end f64.const 1.5707963267948966 - get_local $4 + local.get $4 f64.copysign return end - get_local $2 + local.get $2 i32.const 1071382528 i32.lt_u if - get_local $2 + local.get $2 i32.const 1044381696 i32.lt_u if - get_local $0 + local.get $0 return end i32.const -1 - set_local $2 + local.set $2 else - get_local $0 + local.get $0 f64.abs - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 1072889856 i32.lt_u if (result f64) - get_local $2 + local.get $2 i32.const 1072037888 i32.lt_u if (result f64) i32.const 0 - set_local $2 + local.set $2 f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 f64.sub f64.const 2 - get_local $0 + local.get $0 f64.add f64.div else i32.const 1 - set_local $2 - get_local $0 + local.set $2 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.add f64.div end else - get_local $2 + local.get $2 i32.const 1073971200 i32.lt_u if (result f64) i32.const 2 - set_local $2 - get_local $0 + local.set $2 + local.get $0 f64.const 1.5 f64.sub f64.const 1 f64.const 1.5 - get_local $0 + local.get $0 f64.mul f64.add f64.div else i32.const 3 - set_local $2 + local.set $2 f64.const -1 - get_local $0 + local.get $0 f64.div end end - set_local $0 + local.set $0 end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul - set_local $1 - get_local $0 - get_local $3 + local.set $1 + local.get $0 + local.get $3 f64.const 0.3333333333333293 - get_local $1 + local.get $1 f64.const 0.14285714272503466 - get_local $1 + local.get $1 f64.const 0.09090887133436507 - get_local $1 + local.get $1 f64.const 0.06661073137387531 - get_local $1 + local.get $1 f64.const 0.049768779946159324 - get_local $1 + local.get $1 f64.const 0.016285820115365782 f64.mul f64.add @@ -2284,15 +2284,15 @@ f64.mul f64.add f64.mul - get_local $1 + local.get $1 f64.const -0.19999999999876483 - get_local $1 + local.get $1 f64.const -0.11111110405462356 - get_local $1 + local.get $1 f64.const -0.0769187620504483 - get_local $1 + local.get $1 f64.const -0.058335701337905735 - get_local $1 + local.get $1 f64.const -0.036531572744216916 f64.mul f64.add @@ -2305,13 +2305,13 @@ f64.mul f64.add f64.mul - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 0 i32.lt_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub return end @@ -2320,75 +2320,75 @@ block $case3|0 block $case2|0 block $case1|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case1|0 $case2|0 $case3|0 $case4|0 end f64.const 0.4636476090008061 - get_local $1 + local.get $1 f64.const 2.2698777452961687e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end f64.const 0.7853981633974483 - get_local $1 + local.get $1 f64.const 3.061616997868383e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end f64.const 0.982793723247329 - get_local $1 + local.get $1 f64.const 1.3903311031230998e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end f64.const 1.5707963267948966 - get_local $1 + local.get $1 f64.const 6.123233995736766e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 end unreachable end - get_local $3 - get_local $4 + local.get $3 + local.get $4 f64.copysign ) (func $std/math/test_atan (; 62 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/atan - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.atan (; 63 ;) (type $ff) (param $0 f32) (result f32) @@ -2396,136 +2396,136 @@ (local $2 f32) (local $3 f32) (local $4 f32) - get_local $0 - set_local $4 - get_local $0 - i32.reinterpret/f32 + local.get $0 + local.set $4 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $1 + local.tee $1 i32.const 1283457024 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne if - get_local $0 + local.get $0 return end f32.const 1.570796251296997 - get_local $4 + local.get $4 f32.copysign return end - get_local $1 + local.get $1 i32.const 1054867456 i32.lt_u if - get_local $1 + local.get $1 i32.const 964689920 i32.lt_u if - get_local $0 + local.get $0 return end i32.const -1 - set_local $1 + local.set $1 else - get_local $0 + local.get $0 f32.abs - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1066926080 i32.lt_u if (result f32) - get_local $1 + local.get $1 i32.const 1060110336 i32.lt_u if (result f32) i32.const 0 - set_local $1 + local.set $1 f32.const 2 - get_local $0 + local.get $0 f32.mul f32.const 1 f32.sub f32.const 2 - get_local $0 + local.get $0 f32.add f32.div else i32.const 1 - set_local $1 - get_local $0 + local.set $1 + local.get $0 f32.const 1 f32.sub - get_local $0 + local.get $0 f32.const 1 f32.add f32.div end else - get_local $1 + local.get $1 i32.const 1075576832 i32.lt_u if (result f32) i32.const 2 - set_local $1 - get_local $0 + local.set $1 + local.get $0 f32.const 1.5 f32.sub f32.const 1 f32.const 1.5 - get_local $0 + local.get $0 f32.mul f32.add f32.div else i32.const 3 - set_local $1 + local.set $1 f32.const -1 - get_local $0 + local.get $0 f32.div end end - set_local $0 + local.set $0 end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f32.mul - set_local $3 - get_local $0 - get_local $2 + local.set $3 + local.get $0 + local.get $2 f32.const 0.333333283662796 - get_local $3 + local.get $3 f32.const 0.14253635704517365 - get_local $3 + local.get $3 f32.const 0.06168760731816292 f32.mul f32.add f32.mul f32.add f32.mul - get_local $3 + local.get $3 f32.const -0.19999158382415771 - get_local $3 + local.get $3 f32.const -0.106480173766613 f32.mul f32.add f32.mul f32.add f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 i32.lt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 f32.sub return end @@ -2534,64 +2534,64 @@ block $case3|0 block $case2|0 block $case1|0 - get_local $1 + local.get $1 if - get_local $1 + local.get $1 i32.const 1 i32.sub br_table $case1|0 $case2|0 $case3|0 $case4|0 end f32.const 0.46364760398864746 - get_local $2 + local.get $2 f32.const 5.01215824399992e-09 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $2 + local.set $2 br $break|0 end f32.const 0.7853981256484985 - get_local $2 + local.get $2 f32.const 3.774894707930798e-08 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $2 + local.set $2 br $break|0 end f32.const 0.9827936887741089 - get_local $2 + local.get $2 f32.const 3.447321716976148e-08 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $2 + local.set $2 br $break|0 end f32.const 1.570796251296997 - get_local $2 + local.get $2 f32.const 7.549789415861596e-08 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $2 + local.set $2 br $break|0 end unreachable end - get_local $2 - get_local $4 + local.get $2 + local.get $4 f32.copysign ) (func $std/math/test_atanf (; 64 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.atan - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.atanh (; 65 ;) (type $FF) (param $0 f64) (result f64) @@ -2599,104 +2599,104 @@ (local $2 i64) (local $3 i64) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $3 + local.get $0 + i64.reinterpret_f64 + local.tee $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $3 + local.set $2 + local.get $3 i64.const 9223372036854775807 i64.and - f64.reinterpret/i64 - set_local $1 - get_local $2 + f64.reinterpret_i64 + local.set $1 + local.get $2 i64.const 1022 i64.lt_u if (result f64) - get_local $2 + local.get $2 i64.const 991 i64.ge_u if (result f64) f64.const 0.5 f64.const 2 - get_local $1 + local.get $1 f64.mul - tee_local $4 - get_local $4 - get_local $1 + local.tee $4 + local.get $4 + local.get $1 f64.mul f64.const 1 - get_local $1 + local.get $1 f64.sub f64.div f64.add call $~lib/math/NativeMath.log1p f64.mul else - get_local $1 + local.get $1 end else f64.const 0.5 f64.const 2 - get_local $1 + local.get $1 f64.const 1 - get_local $1 + local.get $1 f64.sub f64.div f64.mul call $~lib/math/NativeMath.log1p f64.mul end - get_local $0 + local.get $0 f64.copysign ) (func $std/math/test_atanh (; 66 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atanh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/atanh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.atanh (; 67 ;) (type $ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $2 - f32.reinterpret/i32 - set_local $1 - get_local $2 + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 i32.const 1056964608 i32.lt_u if (result f32) - get_local $2 + local.get $2 i32.const 796917760 i32.ge_u if (result f32) f32.const 0.5 f32.const 2 - get_local $1 + local.get $1 f32.mul f32.const 1 - get_local $1 + local.get $1 f32.const 1 - get_local $1 + local.get $1 f32.sub f32.div f32.add @@ -2704,28 +2704,28 @@ call $~lib/math/NativeMathf.log1p f32.mul else - get_local $1 + local.get $1 end else f32.const 0.5 f32.const 2 - get_local $1 + local.get $1 f32.const 1 - get_local $1 + local.get $1 f32.sub f32.div f32.mul call $~lib/math/NativeMathf.log1p f32.mul end - get_local $0 + local.get $0 f32.copysign ) (func $std/math/test_atanhf (; 68 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.atanh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.atan2 (; 69 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -2735,73 +2735,73 @@ (local $5 i32) (local $6 i64) (local $7 i32) - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne end if - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.add return end - get_local $1 - i64.reinterpret/f64 - tee_local $6 + local.get $1 + i64.reinterpret_f64 + local.tee $6 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $6 - i32.wrap/i64 - set_local $2 - get_local $0 - i64.reinterpret/f64 - tee_local $6 + i32.wrap_i64 + local.set $4 + local.get $6 + i32.wrap_i64 + local.set $2 + local.get $0 + i64.reinterpret_f64 + local.tee $6 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $6 - i32.wrap/i64 - set_local $7 - get_local $4 + i32.wrap_i64 + local.set $5 + local.get $6 + i32.wrap_i64 + local.set $7 + local.get $4 i32.const 1072693248 i32.sub - get_local $2 + local.get $2 i32.or i32.eqz if - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan return end - get_local $4 + local.get $4 i32.const 30 i32.shr_u i32.const 2 i32.and - get_local $5 + local.get $5 i32.const 31 i32.shr_u i32.or - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 2147483647 i32.and - set_local $4 - get_local $7 - get_local $5 + local.set $4 + local.get $7 + local.get $5 i32.const 2147483647 i32.and - tee_local $5 + local.tee $5 i32.or i32.eqz if @@ -2809,18 +2809,18 @@ block $case3|0 block $case2|0 block $case1|0 - get_local $3 + local.get $3 i32.eqz br_if $case1|0 block $tablify|0 - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case1|0 $case2|0 $case3|0 $tablify|0 end br $break|0 end - get_local $0 + local.get $0 return end f64.const 3.141592653589793 @@ -2831,16 +2831,16 @@ end end block $folding-inner0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.or i32.eqz br_if $folding-inner0 - get_local $4 + local.get $4 i32.const 2146435072 i32.eq if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq if @@ -2848,9 +2848,9 @@ block $case3|1 block $case2|1 block $case1|1 - get_local $3 + local.get $3 if - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case1|1 $case2|1 $case3|1 $break|1 @@ -2872,9 +2872,9 @@ block $case3|2 block $case2|2 block $case1|2 - get_local $3 + local.get $3 if - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case1|2 $case2|2 $case3|2 $break|2 @@ -2893,70 +2893,70 @@ end end end - get_local $4 + local.get $4 i32.const 67108864 i32.add - get_local $5 + local.get $5 i32.lt_u - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $5 + local.get $5 i32.const 2146435072 i32.eq end br_if $folding-inner0 - get_local $3 + local.get $3 i32.const 2 i32.and - tee_local $2 + local.tee $2 if (result i32) - get_local $5 + local.get $5 i32.const 67108864 i32.add - get_local $4 + local.get $4 i32.lt_u else - get_local $2 + local.get $2 end if (result f64) f64.const 0 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.div f64.abs call $~lib/math/NativeMath.atan end - set_local $0 + local.set $0 block $break|3 block $case3|3 block $case2|3 block $case1|3 - get_local $3 - tee_local $2 + local.get $3 + local.tee $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case1|3 $case2|3 $case3|3 $break|3 end - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f64.neg return end f64.const 3.141592653589793 - get_local $0 + local.get $0 f64.const 1.2246467991473532e-16 f64.sub f64.sub return end - get_local $0 + local.get $0 f64.const 1.2246467991473532e-16 f64.sub f64.const 3.141592653589793 @@ -2967,29 +2967,29 @@ end f64.const -1.5707963267948966 f64.const 1.5707963267948966 - get_local $3 + local.get $3 i32.const 1 i32.and select ) (func $std/math/test_atan2 (; 70 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.atan2 - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/atan2 - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check else - get_local $5 + local.get $5 end ) (func $~lib/math/NativeMathf.atan2 (; 71 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -2997,72 +2997,72 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne end if - get_local $1 - get_local $0 + local.get $1 + local.get $0 f32.add return end - get_local $0 - i32.reinterpret/f32 - set_local $4 - get_local $1 - i32.reinterpret/f32 - tee_local $5 + local.get $0 + i32.reinterpret_f32 + local.set $4 + local.get $1 + i32.reinterpret_f32 + local.tee $5 i32.const 1065353216 i32.eq if - get_local $0 + local.get $0 call $~lib/math/NativeMathf.atan return end - get_local $5 + local.get $5 i32.const 30 i32.shr_u i32.const 2 i32.and - get_local $4 + local.get $4 i32.const 31 i32.shr_u i32.or - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 2147483647 i32.and - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 2147483647 i32.and - tee_local $4 + local.tee $4 i32.eqz if block $break|0 block $case3|0 block $case2|0 block $case1|0 - get_local $2 + local.get $2 i32.eqz br_if $case1|0 block $tablify|0 - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case1|0 $case2|0 $case3|0 $tablify|0 end br $break|0 end - get_local $0 + local.get $0 return end f32.const 3.1415927410125732 @@ -3073,14 +3073,14 @@ end end block $folding-inner0 - get_local $5 + local.get $5 i32.eqz br_if $folding-inner0 - get_local $5 + local.get $5 i32.const 2139095040 i32.eq if - get_local $4 + local.get $4 i32.const 2139095040 i32.eq if @@ -3088,9 +3088,9 @@ block $case3|1 block $case2|1 block $case1|1 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case1|1 $case2|1 $case3|1 $break|1 @@ -3112,9 +3112,9 @@ block $case3|2 block $case2|2 block $case1|2 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case1|2 $case2|2 $case3|2 $break|2 @@ -3133,70 +3133,70 @@ end end end - get_local $5 + local.get $5 i32.const 218103808 i32.add - get_local $4 + local.get $4 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $4 + local.get $4 i32.const 2139095040 i32.eq end br_if $folding-inner0 - get_local $2 + local.get $2 i32.const 2 i32.and - tee_local $3 + local.tee $3 if (result i32) - get_local $4 + local.get $4 i32.const 218103808 i32.add - get_local $5 + local.get $5 i32.lt_u else - get_local $3 + local.get $3 end if (result f32) f32.const 0 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.div f32.abs call $~lib/math/NativeMathf.atan end - set_local $0 + local.set $0 block $break|3 block $case3|3 block $case2|3 block $case1|3 - get_local $2 - tee_local $3 + local.get $2 + local.tee $3 if - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case1|3 $case2|3 $case3|3 $break|3 end - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f32.neg return end f32.const 3.1415927410125732 - get_local $0 + local.get $0 f32.const -8.742277657347586e-08 f32.sub f32.sub return end - get_local $0 + local.get $0 f32.const -8.742277657347586e-08 f32.sub f32.const 3.1415927410125732 @@ -3207,17 +3207,17 @@ end f32.const -1.5707963705062866 f32.const 1.5707963705062866 - get_local $2 + local.get $2 i32.const 1 i32.and select ) (func $std/math/test_atan2f (; 72 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.atan2 - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.cbrt (; 73 ;) (type $FF) (param $0 f64) (result f64) @@ -3225,117 +3225,117 @@ (local $2 f64) (local $3 i32) (local $4 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $4 + local.get $0 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - tee_local $3 + local.tee $3 i32.const 2146435072 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.add return end - get_local $3 + local.get $3 i32.const 1048576 i32.lt_u if (result i32) - get_local $0 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $4 + i64.reinterpret_f64 + local.tee $4 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i32.const 3 i32.div_u i32.const 696219795 i32.add else - get_local $3 + local.get $3 i32.const 3 i32.div_u i32.const 715094163 i32.add end - set_local $3 - get_local $4 + local.set $3 + local.get $4 i64.const -9223372036854775808 i64.and - get_local $3 - i64.extend_u/i32 + local.get $3 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - tee_local $1 - get_local $1 + f64.reinterpret_i64 + local.tee $1 + local.get $1 f64.mul - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.div f64.mul - set_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $0 + local.get $1 f64.const 1.87595182427177 - get_local $2 + local.get $2 f64.const -1.8849797954337717 - get_local $2 + local.get $2 f64.const 1.6214297201053545 f64.mul f64.add f64.mul f64.add - get_local $2 - get_local $2 + local.get $2 + local.get $2 f64.mul - get_local $2 + local.get $2 f64.mul f64.const -0.758397934778766 - get_local $2 + local.get $2 f64.const 0.14599619288661245 f64.mul f64.add f64.mul f64.add f64.mul - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const 2147483648 i64.add i64.const -1073741824 i64.and - f64.reinterpret/i64 - tee_local $1 - get_local $1 + f64.reinterpret_i64 + local.tee $1 + local.get $1 f64.mul f64.div - set_local $2 - get_local $1 - get_local $1 - get_local $2 - get_local $1 + local.set $2 + local.get $1 + local.get $1 + local.get $2 + local.get $1 f64.sub f64.const 2 - get_local $1 + local.get $1 f64.mul - get_local $2 + local.get $2 f64.add f64.div f64.mul @@ -3343,20 +3343,20 @@ ) (func $std/math/test_cbrt (; 74 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cbrt - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/cbrt - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.cbrt (; 75 ;) (type $ff) (param $0 f32) (result f32) @@ -3366,35 +3366,35 @@ (local $4 f64) (local $5 i32) (local $6 f64) - get_local $0 - i32.reinterpret/f32 - tee_local $5 + local.get $0 + i32.reinterpret_f32 + local.tee $5 i32.const 2147483647 i32.and - tee_local $3 + local.tee $3 i32.const 2139095040 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.add return end - get_local $3 + local.get $3 i32.const 8388608 i32.lt_u if (result i32) - get_local $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f32.const 16777216 f32.mul - i32.reinterpret/f32 - tee_local $5 + i32.reinterpret_f32 + local.tee $5 i32.const 2147483647 i32.and i32.const 3 @@ -3402,88 +3402,88 @@ i32.const 642849266 i32.add else - get_local $3 + local.get $3 i32.const 3 i32.div_u i32.const 709958130 i32.add end - set_local $3 - get_local $3 - get_local $5 + local.set $3 + local.get $3 + local.get $5 i32.const -2147483648 i32.and i32.or - f32.reinterpret/i32 - f64.promote/f32 - tee_local $1 - get_local $1 + f32.reinterpret_i32 + f64.promote_f32 + local.tee $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - set_local $2 - get_local $1 - get_local $0 - f64.promote/f32 - tee_local $4 - get_local $4 + local.set $2 + local.get $1 + local.get $0 + f64.promote_f32 + local.tee $4 + local.get $4 f64.add - tee_local $6 - get_local $2 + local.tee $6 + local.get $2 f64.add f64.mul - get_local $4 - get_local $2 + local.get $4 + local.get $2 f64.add - get_local $2 + local.get $2 f64.add f64.div - tee_local $1 - get_local $6 - get_local $1 - get_local $1 + local.tee $1 + local.get $6 + local.get $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $2 + local.tee $2 f64.add f64.mul - get_local $4 - get_local $2 + local.get $4 + local.get $2 f64.add - get_local $2 + local.get $2 f64.add f64.div - f32.demote/f64 + f32.demote_f64 ) (func $std/math/test_cbrtf (; 76 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.cbrt - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_ceil (; 77 ;) (type $FUNCSIG$iddi) (param $0 f64) (param $1 f64) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.ceil - get_local $1 + local.get $1 f64.const 0 call $std/math/check - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 call $~lib/bindings/Math/ceil - get_local $1 + local.get $1 f64.const 0 call $std/math/check - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/math/test_ceilf (; 78 ;) (type $FUNCSIG$iffi) (param $0 f32) (param $1 f32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.ceil - get_local $1 + local.get $1 f32.const 0 call $std/math/check ) @@ -3497,120 +3497,120 @@ (local $7 i64) (local $8 f64) (local $9 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $7 + local.get $0 + i64.reinterpret_f64 + local.tee $7 i64.const 63 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $7 + i32.wrap_i64 + local.set $6 + local.get $7 i64.const 32 i64.shr_u i64.const 2147483647 i64.and - i32.wrap/i64 - tee_local $4 + i32.wrap_i64 + local.tee $4 i32.const 1078159482 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if - get_local $0 + local.get $0 return end - get_local $6 + local.get $6 if f64.const -1 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end end - get_local $4 + local.get $4 i32.const 1071001154 i32.gt_u if - get_local $0 + local.get $0 i32.const 1 - get_local $6 + local.get $6 i32.const 1 i32.shl i32.sub f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 - get_local $4 + i32.trunc_f64_s + local.get $4 i32.const 1072734898 i32.lt_u select - tee_local $3 - f64.convert_s/i32 - tee_local $1 + local.tee $3 + f64.convert_i32_s + local.tee $1 f64.const 0.6931471803691238 f64.mul f64.sub - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 f64.const 1.9082149292705877e-10 f64.mul - tee_local $1 + local.tee $1 f64.sub - set_local $0 - get_local $2 - get_local $0 + local.set $0 + local.get $2 + local.get $0 f64.sub - get_local $1 + local.get $1 f64.sub - set_local $5 + local.set $5 else - get_local $4 + local.get $4 i32.const 1016070144 i32.lt_u if - get_local $0 + local.get $0 return end end - get_local $0 + local.get $0 f64.const 0.5 - get_local $0 + local.get $0 f64.mul - tee_local $8 + local.tee $8 f64.mul - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.mul - set_local $1 + local.set $1 f64.const 3 f64.const 1 - get_local $2 + local.get $2 f64.const -0.03333333333333313 f64.mul f64.add - get_local $1 + local.get $1 f64.const 1.5873015872548146e-03 - get_local $2 + local.get $2 f64.const -7.93650757867488e-05 f64.mul f64.add - get_local $1 + local.get $1 f64.const 4.008217827329362e-06 - get_local $2 + local.get $2 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -3618,69 +3618,69 @@ f64.add f64.mul f64.add - tee_local $9 - get_local $8 + local.tee $9 + local.get $8 f64.mul f64.sub - set_local $1 - get_local $2 - get_local $9 - get_local $1 + local.set $1 + local.get $2 + local.get $9 + local.get $1 f64.sub f64.const 6 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul f64.sub f64.div f64.mul - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.eqz if - get_local $0 - get_local $0 - get_local $1 + local.get $0 + local.get $0 + local.get $1 f64.mul - get_local $2 + local.get $2 f64.sub f64.sub return end - get_local $0 - get_local $1 - get_local $5 + local.get $0 + local.get $1 + local.get $5 f64.sub f64.mul - get_local $5 + local.get $5 f64.sub - get_local $2 + local.get $2 f64.sub - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.const -1 i32.eq if f64.const 0.5 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub f64.mul f64.const 0.5 f64.sub return end - get_local $3 + local.get $3 i32.const 1 i32.eq if - get_local $0 + local.get $0 f64.const -0.25 f64.lt if f64.const -2 - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.const 0.5 f64.add f64.sub @@ -3689,81 +3689,81 @@ end f64.const 1 f64.const 2 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub f64.mul f64.add return end - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl - f64.reinterpret/i64 - set_local $5 - get_local $3 + f64.reinterpret_i64 + local.set $5 + local.get $3 i32.const 0 i32.lt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $3 + local.get $3 i32.const 56 i32.gt_s end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub f64.const 1 f64.add - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 1024 i32.eq if (result f64) - get_local $2 + local.get $2 f64.const 2 f64.mul f64.const 8988465674311579538646525e283 f64.mul else - get_local $2 - get_local $5 + local.get $2 + local.get $5 f64.mul end f64.const 1 f64.sub return end - get_local $0 + local.get $0 f64.const 1 i64.const 1023 - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.sub i64.const 52 i64.shl - f64.reinterpret/i64 - tee_local $2 + f64.reinterpret_i64 + local.tee $2 f64.sub - get_local $1 + local.get $1 f64.sub f64.const 1 - get_local $1 - get_local $2 + local.get $1 + local.get $2 f64.add f64.sub - get_local $3 + local.get $3 i32.const 20 i32.lt_s select f64.add - get_local $5 + local.get $5 f64.mul ) (func $~lib/math/NativeMath.exp (; 80 ;) (type $FF) (param $0 f64) (result f64) @@ -3774,39 +3774,39 @@ (local $5 f64) (local $6 i32) (local $7 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 31 i32.shr_u - set_local $6 - get_local $1 + local.set $6 + local.get $1 i32.const 2147483647 i32.and - tee_local $1 + local.tee $1 i32.const 1082532651 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end - get_local $0 + local.get $0 f64.const -745.1332191019411 f64.lt if @@ -3814,78 +3814,78 @@ return end end - get_local $1 + local.get $1 i32.const 1071001154 i32.gt_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1072734898 i32.ge_u if (result i32) f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 + i32.trunc_f64_s else i32.const 1 - get_local $6 + local.get $6 i32.const 1 i32.shl i32.sub end - tee_local $3 - f64.convert_s/i32 - tee_local $0 + local.tee $3 + f64.convert_i32_s + local.tee $0 f64.const 0.6931471803691238 f64.mul f64.sub - tee_local $4 - get_local $0 + local.tee $4 + local.get $0 f64.const 1.9082149292705877e-10 f64.mul - tee_local $7 + local.tee $7 f64.sub - set_local $0 + local.set $0 else - get_local $1 + local.get $1 i32.const 1043333120 i32.le_u if f64.const 1 - get_local $0 + local.get $0 f64.add return end - get_local $0 - set_local $4 + local.get $0 + local.set $4 end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.mul - set_local $5 + local.set $5 f64.const 1 - get_local $0 - get_local $0 - get_local $2 + local.get $0 + local.get $0 + local.get $2 f64.const 0.16666666666666602 f64.mul - get_local $5 + local.get $5 f64.const -2.7777777777015593e-03 - get_local $2 + local.get $2 f64.const 6.613756321437934e-05 f64.mul f64.add - get_local $5 + local.get $5 f64.const -1.6533902205465252e-06 - get_local $2 + local.get $2 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -3894,47 +3894,47 @@ f64.mul f64.add f64.sub - tee_local $0 + local.tee $0 f64.mul f64.const 2 - get_local $0 + local.get $0 f64.sub f64.div - get_local $7 + local.get $7 f64.sub - get_local $4 + local.get $4 f64.add f64.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 i32.eqz if - get_local $0 + local.get $0 return end - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/math/NativeMath.scalbn ) (func $~lib/math/NativeMath.cosh (; 81 ;) (type $FF) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $2 - f64.reinterpret/i64 - set_local $0 - get_local $2 + local.tee $2 + f64.reinterpret_i64 + local.set $0 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 1072049730 i32.lt_u if - get_local $1 + local.get $1 i32.const 1045430272 i32.lt_u if @@ -3942,36 +3942,36 @@ return end f64.const 1 - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.mul f64.const 2 f64.const 2 - get_local $0 + local.get $0 f64.mul f64.add f64.div f64.add return end - get_local $1 + local.get $1 i32.const 1082535490 i32.lt_u if f64.const 0.5 - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp - tee_local $0 + local.tee $0 f64.const 1 - get_local $0 + local.get $0 f64.div f64.add f64.mul return end - get_local $0 + local.get $0 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp @@ -3982,20 +3982,20 @@ ) (func $std/math/test_cosh (; 82 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cosh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/cosh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.expm1 (; 83 ;) (type $ff) (param $0 f32) (result f32) @@ -4005,173 +4005,173 @@ (local $4 i32) (local $5 f32) (local $6 f32) - get_local $0 - i32.reinterpret/f32 - tee_local $4 + local.get $0 + i32.reinterpret_f32 + local.tee $4 i32.const 31 i32.shr_u - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 2147483647 i32.and - tee_local $4 + local.tee $4 i32.const 1100331076 i32.ge_u if - get_local $4 + local.get $4 i32.const 2139095040 i32.gt_u if - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 if f32.const -1 return end - get_local $0 + local.get $0 f32.const 88.7216796875 f32.gt if - get_local $0 + local.get $0 f32.const 1701411834604692317316873e14 f32.mul return end end - get_local $4 + local.get $4 i32.const 1051816472 i32.gt_u if - get_local $0 + local.get $0 i32.const 1 - get_local $2 + local.get $2 i32.const 1 i32.shl i32.sub f32.const 1.4426950216293335 - get_local $0 + local.get $0 f32.mul f32.const 0.5 - get_local $0 + local.get $0 f32.copysign f32.add - i32.trunc_s/f32 - get_local $4 + i32.trunc_f32_s + local.get $4 i32.const 1065686418 i32.lt_u select - tee_local $2 - f32.convert_s/i32 - tee_local $1 + local.tee $2 + f32.convert_i32_s + local.tee $1 f32.const 0.6931381225585938 f32.mul f32.sub - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 f32.const 9.05800061445916e-06 f32.mul - tee_local $1 + local.tee $1 f32.sub - set_local $0 - get_local $3 - get_local $0 + local.set $0 + local.get $3 + local.get $0 f32.sub - get_local $1 + local.get $1 f32.sub - set_local $5 + local.set $5 else - get_local $4 + local.get $4 i32.const 855638016 i32.lt_u if (result i32) - get_local $0 + local.get $0 return else i32.const 0 end - set_local $2 + local.set $2 end f32.const 1 - get_local $0 + local.get $0 f32.const 0.5 - get_local $0 + local.get $0 f32.mul - tee_local $6 + local.tee $6 f32.mul - tee_local $3 + local.tee $3 f32.const -0.03333321213722229 - get_local $3 + local.get $3 f32.const 1.5807170420885086e-03 f32.mul f32.add f32.mul f32.add - set_local $1 - get_local $3 - get_local $1 + local.set $1 + local.get $3 + local.get $1 f32.const 3 - get_local $1 - get_local $6 + local.get $1 + local.get $6 f32.mul f32.sub - tee_local $1 + local.tee $1 f32.sub f32.const 6 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul f32.sub f32.div f32.mul - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if - get_local $0 - get_local $0 - get_local $1 + local.get $0 + local.get $0 + local.get $1 f32.mul - get_local $3 + local.get $3 f32.sub f32.sub return end - get_local $0 - get_local $1 - get_local $5 + local.get $0 + local.get $1 + local.get $5 f32.sub f32.mul - get_local $5 + local.get $5 f32.sub - get_local $3 + local.get $3 f32.sub - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const -1 i32.eq if f32.const 0.5 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.sub f32.mul f32.const 0.5 f32.sub return end - get_local $2 + local.get $2 i32.const 1 i32.eq if - get_local $0 + local.get $0 f32.const -0.25 f32.lt if f32.const -2 - get_local $1 - get_local $0 + local.get $1 + local.get $0 f32.const 0.5 f32.add f32.sub @@ -4180,51 +4180,51 @@ end f32.const 1 f32.const 2 - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.sub f32.mul f32.add return end - get_local $2 + local.get $2 i32.const 127 i32.add i32.const 23 i32.shl - f32.reinterpret/i32 - set_local $5 - get_local $2 + f32.reinterpret_i32 + local.set $5 + local.get $2 i32.const 0 i32.lt_s - tee_local $4 + local.tee $4 i32.eqz if - get_local $2 + local.get $2 i32.const 56 i32.gt_s - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.sub f32.const 1 f32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 128 i32.eq if (result f32) - get_local $3 + local.get $3 f32.const 2 f32.mul f32.const 1701411834604692317316873e14 f32.mul else - get_local $3 - get_local $5 + local.get $3 + local.get $5 f32.mul end f32.const 1 @@ -4232,29 +4232,29 @@ return end i32.const 127 - get_local $2 + local.get $2 i32.sub i32.const 23 i32.shl - f32.reinterpret/i32 - set_local $3 - get_local $0 + f32.reinterpret_i32 + local.set $3 + local.get $0 f32.const 1 - get_local $3 + local.get $3 f32.sub - get_local $1 + local.get $1 f32.sub f32.const 1 - get_local $1 - get_local $3 + local.get $1 + local.get $3 f32.add f32.sub - get_local $2 + local.get $2 i32.const 20 i32.lt_s select f32.add - get_local $5 + local.get $5 f32.mul ) (func $~lib/math/NativeMathf.exp (; 84 ;) (type $ff) (param $0 f32) (result f32) @@ -4262,26 +4262,26 @@ (local $2 i32) (local $3 f32) (local $4 f32) - get_local $0 - i32.reinterpret/f32 - tee_local $1 + local.get $0 + i32.reinterpret_f32 + local.tee $1 i32.const 31 i32.shr_u - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 2147483647 i32.and - tee_local $1 + local.tee $1 i32.const 1118743632 i32.ge_u if - get_local $1 + local.get $1 i32.const 1118925336 i32.ge_u if - get_local $2 + local.get $2 if - get_local $1 + local.get $1 i32.const 1120924085 i32.ge_u if @@ -4289,116 +4289,116 @@ return end else - get_local $0 + local.get $0 f32.const 1701411834604692317316873e14 f32.mul return end end end - get_local $1 + local.get $1 i32.const 1051816472 i32.gt_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1065686418 i32.gt_u if (result i32) f32.const 1.4426950216293335 - get_local $0 + local.get $0 f32.mul f32.const 0.5 - get_local $0 + local.get $0 f32.copysign f32.add - i32.trunc_s/f32 + i32.trunc_f32_s else i32.const 1 - get_local $2 + local.get $2 i32.const 1 i32.shl i32.sub end - tee_local $1 - f32.convert_s/i32 - tee_local $0 + local.tee $1 + f32.convert_i32_s + local.tee $0 f32.const 0.693145751953125 f32.mul f32.sub - tee_local $3 - get_local $0 + local.tee $3 + local.get $0 f32.const 1.428606765330187e-06 f32.mul - tee_local $4 + local.tee $4 f32.sub - set_local $0 + local.set $0 else - get_local $1 + local.get $1 i32.const 956301312 i32.gt_u if (result f32) i32.const 0 - set_local $1 - get_local $0 + local.set $1 + local.get $0 else f32.const 1 - get_local $0 + local.get $0 f32.add return end - set_local $3 + local.set $3 end f32.const 1 - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f32.mul - tee_local $0 + local.tee $0 f32.const 0.16666625440120697 - get_local $0 + local.get $0 f32.const -2.7667332906275988e-03 f32.mul f32.add f32.mul f32.sub - tee_local $0 + local.tee $0 f32.mul f32.const 2 - get_local $0 + local.get $0 f32.sub f32.div - get_local $4 + local.get $4 f32.sub - get_local $3 + local.get $3 f32.add f32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.eqz if - get_local $0 + local.get $0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.scalbn ) (func $~lib/math/NativeMathf.cosh (; 85 ;) (type $ff) (param $0 f32) (result f32) (local $1 i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $1 - f32.reinterpret/i32 - set_local $0 - get_local $1 + local.tee $1 + f32.reinterpret_i32 + local.set $0 + local.get $1 i32.const 1060205079 i32.lt_u if - get_local $1 + local.get $1 i32.const 964689920 i32.lt_u if @@ -4406,36 +4406,36 @@ return end f32.const 1 - get_local $0 + local.get $0 call $~lib/math/NativeMathf.expm1 - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f32.mul f32.const 2 f32.const 2 - get_local $0 + local.get $0 f32.mul f32.add f32.div f32.add return end - get_local $1 + local.get $1 i32.const 1118925335 i32.lt_u if f32.const 0.5 - get_local $0 + local.get $0 call $~lib/math/NativeMathf.exp - tee_local $0 + local.tee $0 f32.mul f32.const 0.5 - get_local $0 + local.get $0 f32.div f32.add return end - get_local $0 + local.get $0 f32.const 162.88958740234375 f32.sub call $~lib/math/NativeMathf.exp @@ -4445,83 +4445,83 @@ f32.mul ) (func $std/math/test_coshf (; 86 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.cosh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_exp (; 87 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/exp - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $std/math/test_expf (; 88 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.exp - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_expm1 (; 89 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/expm1 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $std/math/test_expm1f (; 90 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.expm1 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_floor (; 91 ;) (type $FUNCSIG$iddi) (param $0 f64) (param $1 f64) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.floor - get_local $1 + local.get $1 f64.const 0 call $std/math/check - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 call $~lib/bindings/Math/floor - get_local $1 + local.get $1 f64.const 0 call $std/math/check - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/math/test_floorf (; 92 ;) (type $FUNCSIG$iffi) (param $0 f32) (param $1 f32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.floor - get_local $1 + local.get $1 f32.const 0 call $std/math/check ) @@ -4536,192 +4536,192 @@ (local $9 i32) (local $10 i64) (local $11 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $5 - get_local $1 - i64.reinterpret/f64 + local.tee $5 + local.get $1 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $3 + local.tee $3 i64.lt_u if - get_local $5 - set_local $10 - get_local $3 - set_local $5 - get_local $10 - set_local $3 + local.get $5 + local.set $10 + local.get $3 + local.set $5 + local.get $10 + local.set $3 end - get_local $5 + local.get $5 i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $3 - f64.reinterpret/i64 - set_local $1 - get_local $3 + i32.wrap_i64 + local.set $6 + local.get $3 + f64.reinterpret_i64 + local.set $1 + local.get $3 i64.const 52 i64.shr_u - i32.wrap/i64 - tee_local $8 + i32.wrap_i64 + local.tee $8 i32.const 2047 i32.eq if - get_local $1 + local.get $1 return end - get_local $5 - f64.reinterpret/i64 - set_local $0 - get_local $6 + local.get $5 + f64.reinterpret_i64 + local.set $0 + local.get $6 i32.const 2047 i32.eq - tee_local $9 + local.tee $9 i32.eqz if - get_local $3 + local.get $3 i64.const 0 i64.eq - set_local $9 + local.set $9 end - get_local $9 + local.get $9 if - get_local $0 + local.get $0 return end - get_local $6 - get_local $8 + local.get $6 + local.get $8 i32.sub i32.const 64 i32.gt_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end f64.const 1 - set_local $7 - get_local $6 + local.set $7 + local.get $6 i32.const 1533 i32.gt_s if (result f64) f64.const 5260135901548373507240989e186 - set_local $7 - get_local $1 + local.set $7 + local.get $1 f64.const 1.90109156629516e-211 f64.mul - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 1.90109156629516e-211 f64.mul else - get_local $8 + local.get $8 i32.const 573 i32.lt_s if (result f64) f64.const 1.90109156629516e-211 - set_local $7 - get_local $1 + local.set $7 + local.get $1 f64.const 5260135901548373507240989e186 f64.mul - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 5260135901548373507240989e186 f64.mul else - get_local $0 + local.get $0 end end - tee_local $0 - get_local $0 - get_local $0 + local.tee $0 + local.get $0 + local.get $0 f64.const 134217729 f64.mul - tee_local $2 + local.tee $2 f64.sub - get_local $2 + local.get $2 f64.add - tee_local $2 + local.tee $2 f64.sub - set_local $4 - get_local $2 - get_local $2 + local.set $4 + local.get $2 + local.get $2 f64.mul - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - tee_local $0 + local.tee $0 f64.sub f64.const 2 - get_local $2 + local.get $2 f64.mul - get_local $4 + local.get $4 f64.add - get_local $4 + local.get $4 f64.mul f64.add - set_local $11 - get_local $1 - get_local $1 - get_local $1 + local.set $11 + local.get $1 + local.get $1 + local.get $1 f64.const 134217729 f64.mul - tee_local $2 + local.tee $2 f64.sub - get_local $2 + local.get $2 f64.add - tee_local $2 + local.tee $2 f64.sub - set_local $4 - get_local $7 - get_local $2 - get_local $2 + local.set $4 + local.get $7 + local.get $2 + local.get $2 f64.mul - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.mul - tee_local $1 + local.tee $1 f64.sub f64.const 2 - get_local $2 + local.get $2 f64.mul - get_local $4 + local.get $4 f64.add - get_local $4 + local.get $4 f64.mul f64.add - get_local $11 + local.get $11 f64.add - get_local $1 + local.get $1 f64.add - get_local $0 + local.get $0 f64.add f64.sqrt f64.mul ) (func $std/math/test_hypot (; 94 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.hypot - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/hypot - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check else - get_local $5 + local.get $5 end ) (func $~lib/math/NativeMathf.hypot (; 95 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -4730,145 +4730,145 @@ (local $4 i32) (local $5 f32) (local $6 f64) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $3 - get_local $1 - i32.reinterpret/f32 + local.tee $3 + local.get $1 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $2 + local.tee $2 i32.lt_u if - get_local $3 - set_local $4 - get_local $2 - set_local $3 - get_local $4 - set_local $2 + local.get $3 + local.set $4 + local.get $2 + local.set $3 + local.get $4 + local.set $2 end - get_local $3 - f32.reinterpret/i32 - set_local $0 - get_local $2 - f32.reinterpret/i32 - set_local $1 - get_local $2 + 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 - get_local $1 + local.get $1 return end - get_local $3 + local.get $3 i32.const 2139095040 i32.ge_u - tee_local $4 + local.tee $4 i32.eqz if - get_local $2 + local.get $2 i32.eqz - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.sub i32.const 209715200 i32.ge_u - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add return end f32.const 1 - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 1568669696 i32.ge_u if (result f32) f32.const 1237940039285380274899124e3 - set_local $5 - get_local $1 + local.set $5 + local.get $1 f32.const 8.077935669463161e-28 f32.mul - set_local $1 - get_local $0 + local.set $1 + local.get $0 f32.const 8.077935669463161e-28 f32.mul else - get_local $2 + local.get $2 i32.const 562036736 i32.lt_u if (result f32) f32.const 8.077935669463161e-28 - set_local $5 - get_local $1 + local.set $5 + local.get $1 f32.const 1237940039285380274899124e3 f32.mul - set_local $1 - get_local $0 + local.set $1 + local.get $0 f32.const 1237940039285380274899124e3 f32.mul else - get_local $0 + local.get $0 end end - set_local $0 - get_local $5 - get_local $0 - f64.promote/f32 - tee_local $6 - get_local $6 + local.set $0 + local.get $5 + local.get $0 + f64.promote_f32 + local.tee $6 + local.get $6 f64.mul - get_local $1 - f64.promote/f32 - tee_local $6 - get_local $6 + local.get $1 + f64.promote_f32 + local.tee $6 + local.get $6 f64.mul f64.add - f32.demote/f64 + f32.demote_f64 f32.sqrt f32.mul ) (func $std/math/test_hypotf (; 96 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.hypot - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_log (; 97 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/log - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $std/math/test_logf (; 98 ;) (type $FUNCSIG$iffi) (param $0 f32) (param $1 f32) (param $2 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log - get_local $1 + local.get $1 f32.const 0 call $std/math/check ) @@ -4882,160 +4882,160 @@ (local $7 f64) (local $8 f64) (local $9 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $5 + local.get $0 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $2 + i32.wrap_i64 + local.tee $2 i32.const 1048576 i32.lt_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $2 + local.get $2 i32.const 31 i32.shr_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $5 + local.get $5 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $5 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if f64.const 0 return end end end - get_local $2 + local.get $2 i32.const 614242 i32.add - tee_local $2 + local.tee $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - get_local $4 + local.get $4 i32.add - set_local $4 - get_local $5 + local.set $4 + local.get $5 i64.const 4294967295 i64.and - get_local $2 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $1 + local.tee $1 f64.const 2 - get_local $1 + local.get $1 f64.add f64.div - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - tee_local $8 - get_local $8 + local.tee $8 + local.get $8 f64.mul - set_local $0 - get_local $4 - f64.convert_s/i32 - tee_local $6 + local.set $0 + local.get $4 + f64.convert_i32_s + local.tee $6 f64.const 0.30102999566361177 f64.mul - set_local $9 - get_local $6 + local.set $9 + local.get $6 f64.const 3.694239077158931e-13 f64.mul - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.const 0.5 - get_local $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $6 + local.tee $6 f64.sub - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $1 + f64.reinterpret_i64 + local.tee $1 f64.sub - get_local $6 + local.get $6 f64.sub - get_local $7 - get_local $6 - get_local $8 + local.get $7 + local.get $6 + local.get $8 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -5044,11 +5044,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -5059,47 +5059,47 @@ f64.add f64.mul f64.add - tee_local $0 - get_local $1 + local.tee $0 + local.get $1 f64.add f64.const 2.5082946711645275e-11 f64.mul f64.add - get_local $0 + local.get $0 f64.const 0.4342944818781689 f64.mul f64.add - get_local $9 - get_local $9 - get_local $1 + local.get $9 + local.get $9 + local.get $1 f64.const 0.4342944818781689 f64.mul - tee_local $1 + local.tee $1 f64.add - tee_local $0 + local.tee $0 f64.sub - get_local $1 + local.get $1 f64.add f64.add - get_local $0 + local.get $0 f64.add ) (func $std/math/test_log10 (; 100 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log10 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/log10 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.log10 (; 101 ;) (type $ff) (param $0 f32) (result f32) @@ -5111,60 +5111,60 @@ (local $6 f32) (local $7 f32) (local $8 f32) - get_local $0 - i32.reinterpret/f32 - tee_local $1 + local.get $0 + i32.reinterpret_f32 + local.tee $1 i32.const 8388608 i32.lt_u - tee_local $4 + local.tee $4 i32.eqz if - get_local $1 + local.get $1 i32.const 31 i32.shr_u - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $1 + local.get $1 i32.const 1 i32.shl i32.eqz if f32.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul f32.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end i32.const -25 - set_local $2 - get_local $0 + local.set $2 + local.get $0 f32.const 33554432 f32.mul - i32.reinterpret/f32 - set_local $1 + i32.reinterpret_f32 + local.set $1 else - get_local $1 + local.get $1 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1065353216 i32.eq if @@ -5173,71 +5173,71 @@ end end end - get_local $1 + local.get $1 i32.const 4913933 i32.add - tee_local $1 + local.tee $1 i32.const 23 i32.shr_u i32.const 127 i32.sub - get_local $2 + local.get $2 i32.add - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388607 i32.and i32.const 1060439283 i32.add - f32.reinterpret/i32 + f32.reinterpret_i32 f32.const 1 f32.sub - tee_local $0 + local.tee $0 f32.const 2 - get_local $0 + local.get $0 f32.add f32.div - tee_local $5 - get_local $5 + local.tee $5 + local.get $5 f32.mul - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f32.mul - set_local $3 - get_local $2 - f32.convert_s/i32 - tee_local $8 + local.set $3 + local.get $2 + f32.convert_i32_s + local.tee $8 f32.const 7.903415166765626e-07 f32.mul - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.const 0.5 - get_local $0 + local.get $0 f32.mul - get_local $0 + local.get $0 f32.mul - tee_local $0 + local.tee $0 f32.sub - i32.reinterpret/f32 + i32.reinterpret_f32 i32.const -4096 i32.and - f32.reinterpret/i32 - tee_local $7 + f32.reinterpret_i32 + local.tee $7 f32.sub - get_local $0 + local.get $0 f32.sub - get_local $5 - get_local $0 - get_local $6 + local.get $5 + local.get $0 + local.get $6 f32.const 0.6666666269302368 - get_local $3 + local.get $3 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - get_local $3 + local.get $3 f32.const 0.40000972151756287 - get_local $3 + local.get $3 f32.const 0.24279078841209412 f32.mul f32.add @@ -5246,55 +5246,55 @@ f32.add f32.mul f32.add - tee_local $0 - get_local $7 + local.tee $0 + local.get $7 f32.add f32.const -3.168997136526741e-05 f32.mul f32.add - get_local $0 + local.get $0 f32.const 0.434326171875 f32.mul f32.add - get_local $7 + local.get $7 f32.const 0.434326171875 f32.mul f32.add - get_local $8 + local.get $8 f32.const 0.3010292053222656 f32.mul f32.add ) (func $std/math/test_log10f (; 102 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log10 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_log1p (; 103 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log1p - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/log1p - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $std/math/test_log1pf (; 104 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log1p - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.log2 (; 105 ;) (type $FF) (param $0 f64) (result f64) @@ -5306,151 +5306,151 @@ (local $6 f64) (local $7 f64) (local $8 f64) - get_local $0 - i64.reinterpret/f64 - tee_local $5 + local.get $0 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $2 + i32.wrap_i64 + local.tee $2 i32.const 1048576 i32.lt_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $2 + local.get $2 i32.const 31 i32.shr_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $5 + local.get $5 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end i32.const -54 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - tee_local $5 + i64.reinterpret_f64 + local.tee $5 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i64.const 32 i64.shl i64.const 0 i64.eq - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if f64.const 0 return end end end - get_local $2 + local.get $2 i32.const 614242 i32.add - tee_local $2 + local.tee $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - get_local $4 + local.get $4 i32.add - set_local $4 - get_local $5 + local.set $4 + local.get $5 i64.const 4294967295 i64.and - get_local $2 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 1 f64.sub - tee_local $1 + local.tee $1 f64.const 2 - get_local $1 + local.get $1 f64.add f64.div - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f64.mul - tee_local $7 - get_local $7 + local.tee $7 + local.get $7 f64.mul - set_local $0 - get_local $1 - get_local $1 + local.set $0 + local.get $1 + local.get $1 f64.const 0.5 - get_local $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.mul - tee_local $1 + local.tee $1 f64.sub - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 + f64.reinterpret_i64 + local.tee $8 f64.sub - get_local $1 + local.get $1 f64.sub - get_local $6 - get_local $1 - get_local $7 + local.get $6 + local.get $1 + local.get $7 f64.const 0.6666666666666735 - get_local $0 + local.get $0 f64.const 0.2857142874366239 - get_local $0 + local.get $0 f64.const 0.1818357216161805 - get_local $0 + local.get $0 f64.const 0.14798198605116586 f64.mul f64.add @@ -5459,11 +5459,11 @@ f64.mul f64.add f64.mul - get_local $0 + local.get $0 f64.const 0.3999999999940942 - get_local $0 + local.get $0 f64.const 0.22222198432149784 - get_local $0 + local.get $0 f64.const 0.15313837699209373 f64.mul f64.add @@ -5474,51 +5474,51 @@ f64.add f64.mul f64.add - tee_local $0 - get_local $8 + local.tee $0 + local.get $8 f64.add f64.const 1.6751713164886512e-10 f64.mul - get_local $0 + local.get $0 f64.const 1.4426950407214463 f64.mul f64.add - set_local $6 - get_local $4 - f64.convert_s/i32 - tee_local $7 - get_local $8 + local.set $6 + local.get $4 + f64.convert_i32_s + local.tee $7 + local.get $8 f64.const 1.4426950407214463 f64.mul - tee_local $1 + local.tee $1 f64.add - set_local $0 - get_local $6 - get_local $7 - get_local $0 + local.set $0 + local.get $6 + local.get $7 + local.get $0 f64.sub - get_local $1 + local.get $1 f64.add f64.add - get_local $0 + local.get $0 f64.add ) (func $std/math/test_log2 (; 106 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log2 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/log2 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.log2 (; 107 ;) (type $ff) (param $0 f32) (result f32) @@ -5529,60 +5529,60 @@ (local $5 f32) (local $6 f32) (local $7 f32) - get_local $0 - i32.reinterpret/f32 - tee_local $1 + local.get $0 + i32.reinterpret_f32 + local.tee $1 i32.const 8388608 i32.lt_u - tee_local $4 + local.tee $4 i32.eqz if - get_local $1 + local.get $1 i32.const 31 i32.shr_u - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $1 + local.get $1 i32.const 1 i32.shl i32.eqz if f32.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul f32.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end i32.const -25 - set_local $2 - get_local $0 + local.set $2 + local.get $0 f32.const 33554432 f32.mul - i32.reinterpret/f32 - set_local $1 + i32.reinterpret_f32 + local.set $1 else - get_local $1 + local.get $1 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1065353216 i32.eq if @@ -5591,66 +5591,66 @@ end end end - get_local $1 + local.get $1 i32.const 4913933 i32.add - tee_local $1 + local.tee $1 i32.const 23 i32.shr_u i32.const 127 i32.sub - get_local $2 + local.get $2 i32.add - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388607 i32.and i32.const 1060439283 i32.add - f32.reinterpret/i32 + f32.reinterpret_i32 f32.const 1 f32.sub - tee_local $0 + local.tee $0 f32.const 2 - get_local $0 + local.get $0 f32.add f32.div - tee_local $5 - get_local $5 + local.tee $5 + local.get $5 f32.mul - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 f32.mul - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 f32.const 0.5 - get_local $0 + local.get $0 f32.mul - get_local $0 + local.get $0 f32.mul - tee_local $0 + local.tee $0 f32.sub - i32.reinterpret/f32 + i32.reinterpret_f32 i32.const -4096 i32.and - f32.reinterpret/i32 - tee_local $7 + f32.reinterpret_i32 + local.tee $7 f32.sub - get_local $0 + local.get $0 f32.sub - get_local $5 - get_local $0 - get_local $6 + local.get $5 + local.get $0 + local.get $6 f32.const 0.6666666269302368 - get_local $3 + local.get $3 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - get_local $3 + local.get $3 f32.const 0.40000972151756287 - get_local $3 + local.get $3 f32.const 0.24279078841209412 f32.mul f32.add @@ -5659,83 +5659,83 @@ f32.add f32.mul f32.add - tee_local $0 - get_local $7 + local.tee $0 + local.get $7 f32.add f32.const -1.7605285393074155e-04 f32.mul - get_local $0 + local.get $0 f32.const 1.44287109375 f32.mul f32.add - get_local $7 + local.get $7 f32.const 1.44287109375 f32.mul f32.add - get_local $2 - f32.convert_s/i32 + local.get $2 + f32.convert_i32_s f32.add ) (func $std/math/test_log2f (; 108 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log2 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_max (; 109 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.max - get_local $2 + local.get $2 f64.const 0 call $std/math/check - tee_local $3 + local.tee $3 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/max - get_local $2 + local.get $2 f64.const 0 call $std/math/check - set_local $3 + local.set $3 end - get_local $3 + local.get $3 ) (func $std/math/test_maxf (; 110 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.max - get_local $2 + local.get $2 f32.const 0 call $std/math/check ) (func $std/math/test_min (; 111 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.min - get_local $2 + local.get $2 f64.const 0 call $std/math/check - tee_local $3 + local.tee $3 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/min - get_local $2 + local.get $2 f64.const 0 call $std/math/check - set_local $3 + local.set $3 end - get_local $3 + local.get $3 ) (func $std/math/test_minf (; 112 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.min - get_local $2 + local.get $2 f32.const 0 call $std/math/check ) @@ -5748,223 +5748,223 @@ (local $7 i64) (local $8 i64) (local $9 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $2 + local.get $0 + i64.reinterpret_f64 + local.tee $2 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $4 - get_local $1 - i64.reinterpret/f64 - tee_local $3 + local.set $4 + local.get $1 + i64.reinterpret_f64 + local.tee $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i64.const 63 i64.shr_u - set_local $8 - get_local $3 + local.set $8 + local.get $3 i64.const 1 i64.shl - tee_local $7 + local.tee $7 i64.const 0 i64.eq - tee_local $6 + local.tee $6 i32.eqz if - get_local $4 + local.get $4 i64.const 2047 i64.eq - set_local $6 + local.set $6 end - get_local $6 + local.get $6 i32.eqz if - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne - set_local $6 + local.set $6 end - get_local $6 + local.get $6 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.div return end block $folding-inner0 - get_local $2 + local.get $2 i64.const 1 i64.shl - tee_local $9 - get_local $7 + local.tee $9 + local.get $7 i64.le_u if - get_local $7 - get_local $9 + local.get $7 + local.get $9 i64.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i64.eqz if (result i64) - get_local $2 + local.get $2 i64.const 0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i64.const 12 i64.shl i64.clz i64.sub - tee_local $4 + local.tee $4 i64.sub i64.const 1 i64.add i64.shl else - get_local $2 + local.get $2 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i64.eqz if (result i64) - get_local $3 + local.get $3 i64.const 0 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.const 12 i64.shl i64.clz i64.sub - tee_local $5 + local.tee $5 i64.sub i64.const 1 i64.add i64.shl else - get_local $3 + local.get $3 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $3 + local.set $3 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.gt_s if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if (result i64) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq br_if $folding-inner0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub else - get_local $2 + local.get $2 end i64.const 1 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 1 i64.sub - set_local $4 + local.set $4 br $continue|0 end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq br_if $folding-inner0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i64.const 11 i64.shl i64.clz - tee_local $3 + local.tee $3 i64.shl - set_local $2 - get_local $4 - get_local $3 + local.set $2 + local.get $4 + local.get $3 i64.sub - tee_local $4 + local.tee $4 i64.const 0 i64.gt_s if (result i64) - get_local $2 + local.get $2 i64.const 4503599627370496 i64.sub - get_local $4 + local.get $4 i64.const 52 i64.shl i64.or else - get_local $2 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shr_u end - get_local $8 + local.get $8 i64.const 63 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 return end f64.const 0 - get_local $0 + local.get $0 f64.mul ) (func $std/math/test_mod (; 114 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.mod - get_local $2 + local.get $2 f64.const 0 call $std/math/check - tee_local $3 + local.tee $3 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $std/math/mod - get_local $2 + local.get $2 f64.const 0 call $std/math/check - set_local $3 + local.set $3 end - get_local $3 + local.get $3 ) (func $~lib/math/NativeMathf.mod (; 115 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) @@ -5974,199 +5974,199 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 - i32.reinterpret/f32 - tee_local $2 + local.get $0 + i32.reinterpret_f32 + local.tee $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $3 - get_local $1 - i32.reinterpret/f32 - tee_local $4 + local.set $3 + local.get $1 + i32.reinterpret_f32 + local.tee $4 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const -2147483648 i32.and - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 1 i32.shl - tee_local $7 + local.tee $7 i32.eqz - tee_local $5 + local.tee $5 i32.eqz if - get_local $3 + local.get $3 i32.const 255 i32.eq - set_local $5 + local.set $5 end - get_local $5 + local.get $5 i32.eqz if - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne - set_local $5 + local.set $5 end - get_local $5 + local.get $5 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f32.div return end block $folding-inner0 - get_local $2 + local.get $2 i32.const 1 i32.shl - tee_local $5 - get_local $7 + local.tee $5 + local.get $7 i32.le_u if - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 if (result i32) - get_local $2 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $2 + local.get $2 i32.const 1 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - tee_local $3 + local.tee $3 i32.sub i32.shl end - set_local $2 - get_local $6 + local.set $2 + local.get $6 if (result i32) - get_local $4 + local.get $4 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $4 + local.get $4 i32.const 1 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.const 9 i32.shl i32.clz i32.sub - tee_local $6 + local.tee $6 i32.sub i32.shl end - set_local $4 + local.set $4 loop $continue|0 - get_local $3 - get_local $6 + local.get $3 + local.get $6 i32.gt_s if - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.ge_u if (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.eq br_if $folding-inner0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.sub else - get_local $2 + local.get $2 end i32.const 1 i32.shl - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $continue|0 end end - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.ge_u if - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.eq br_if $folding-inner0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.sub - set_local $2 + local.set $2 end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.const 8 i32.shl i32.clz - tee_local $5 + local.tee $5 i32.shl - set_local $2 - get_local $3 - get_local $5 + local.set $2 + local.get $3 + local.get $5 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.gt_s if (result i32) - get_local $2 + local.get $2 i32.const 8388608 i32.sub - get_local $3 + local.get $3 i32.const 23 i32.shl i32.or else - get_local $2 + local.get $2 i32.const 1 - get_local $3 + local.get $3 i32.sub i32.shr_u end - get_local $8 + local.get $8 i32.or - f32.reinterpret/i32 + f32.reinterpret_i32 return end f32.const 0 - get_local $0 + local.get $0 f32.mul ) (func $std/math/test_modf (; 116 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.mod - get_local $2 + local.get $2 f32.const 0 call $std/math/check ) @@ -6191,171 +6191,171 @@ (local $19 f64) (local $20 i32) (local $21 i32) - get_local $0 - i64.reinterpret/f64 - tee_local $17 + local.get $0 + i64.reinterpret_f64 + local.tee $17 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $18 - get_local $17 - i32.wrap/i64 - set_local $20 - get_local $18 + i32.wrap_i64 + local.set $18 + local.get $17 + i32.wrap_i64 + local.set $20 + local.get $18 i32.const 2147483647 i32.and - set_local $5 - get_local $1 - i64.reinterpret/f64 - tee_local $17 + local.set $5 + local.get $1 + i64.reinterpret_f64 + local.tee $17 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $13 + i32.wrap_i64 + local.tee $13 i32.const 2147483647 i32.and - set_local $11 - get_local $11 - get_local $17 - i32.wrap/i64 - tee_local $21 + local.set $11 + local.get $11 + local.get $17 + i32.wrap_i64 + local.tee $21 i32.or i32.eqz if f64.const 1 return end - get_local $5 + local.get $5 i32.const 2146435072 i32.gt_s - tee_local $4 + local.tee $4 i32.eqz if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq - tee_local $4 + local.tee $4 if - get_local $20 + local.get $20 i32.const 0 i32.ne - set_local $4 + local.set $4 end end - get_local $4 + local.get $4 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.gt_s - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.eq - tee_local $4 + local.tee $4 if - get_local $21 + local.get $21 i32.const 0 i32.ne - set_local $4 + local.set $4 end end - get_local $4 + local.get $4 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end - get_local $18 + local.get $18 i32.const 0 i32.lt_s if - get_local $11 + local.get $11 i32.const 1128267776 i32.ge_s if (result i32) i32.const 2 else - get_local $11 + local.get $11 i32.const 1072693248 i32.ge_s if (result i32) - get_local $21 - get_local $11 - get_local $11 + local.get $21 + local.get $11 + local.get $11 i32.const 20 i32.shr_s i32.const 1023 i32.sub - tee_local $12 + local.tee $12 i32.const 20 i32.gt_s - tee_local $4 + local.tee $4 select - tee_local $7 + local.tee $7 i32.const 52 i32.const 20 - get_local $4 + local.get $4 select - get_local $12 + local.get $12 i32.sub - tee_local $9 + local.tee $9 i32.shr_s - set_local $4 + local.set $4 i32.const 2 - get_local $4 + local.get $4 i32.const 1 i32.and i32.sub i32.const 0 - get_local $4 - get_local $9 + local.get $4 + local.get $9 i32.shl - get_local $7 + local.get $7 i32.eq select else i32.const 0 end end - set_local $15 + local.set $15 end - get_local $21 + local.get $21 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.eq if - get_local $5 + local.get $5 i32.const 1072693248 i32.sub - get_local $20 + local.get $20 i32.or if - get_local $5 + local.get $5 i32.const 1072693248 i32.ge_s if - get_local $13 + local.get $13 i32.const 0 i32.lt_s if f64.const 0 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 return else f64.const 0 - get_local $1 + local.get $1 f64.neg - get_local $13 + local.get $13 i32.const 0 i32.ge_s select @@ -6368,184 +6368,184 @@ end unreachable end - get_local $11 + local.get $11 i32.const 1072693248 i32.eq if - get_local $13 + local.get $13 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 return end f64.const 1 - get_local $0 + local.get $0 f64.div return end - get_local $13 + local.get $13 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul return end - get_local $13 + local.get $13 i32.const 1071644672 i32.eq if - get_local $18 + local.get $18 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f64.sqrt return end end end - get_local $0 + local.get $0 f64.abs - set_local $2 - get_local $20 + local.set $2 + local.get $20 i32.eqz if - get_local $5 + local.get $5 i32.eqz - tee_local $4 + local.tee $4 i32.eqz if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz if - get_local $5 + local.get $5 i32.const 1072693248 i32.eq - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if f64.const 1 - get_local $2 + local.get $2 f64.div - get_local $2 - get_local $13 + local.get $2 + local.get $13 i32.const 0 i32.lt_s select - set_local $2 - get_local $18 + local.set $2 + local.get $18 i32.const 0 i32.lt_s if (result f64) - get_local $5 + local.get $5 i32.const 1072693248 i32.sub - get_local $15 + local.get $15 i32.or if (result f64) - get_local $2 + local.get $2 f64.neg - get_local $2 - get_local $15 + local.get $2 + local.get $15 i32.const 1 i32.eq select else - get_local $2 - get_local $2 + local.get $2 + local.get $2 f64.sub - tee_local $14 - get_local $14 + local.tee $14 + local.get $14 f64.div end else - get_local $2 + local.get $2 end return end end f64.const 1 - set_local $10 - get_local $18 + local.set $10 + local.get $18 i32.const 0 i32.lt_s if - get_local $15 + local.get $15 i32.eqz if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub - tee_local $14 - get_local $14 + local.tee $14 + local.get $14 f64.div return end f64.const -1 f64.const 1 - get_local $15 + local.get $15 i32.const 1 i32.eq select - set_local $10 + local.set $10 end - get_local $11 + local.get $11 i32.const 1105199104 i32.gt_s if (result f64) - get_local $11 + local.get $11 i32.const 1139802112 i32.gt_s if - get_local $5 + local.get $5 i32.const 1072693247 i32.le_s if f64.const inf f64.const 0 - get_local $13 + local.get $13 i32.const 0 i32.lt_s select return end - get_local $5 + local.get $5 i32.const 1072693248 i32.ge_s if f64.const inf f64.const 0 - get_local $13 + local.get $13 i32.const 0 i32.gt_s select return end end - get_local $5 + local.get $5 i32.const 1072693247 i32.lt_s if - get_local $13 + local.get $13 i32.const 0 i32.lt_s if (result f64) - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -6553,21 +6553,21 @@ end return end - get_local $5 + local.get $5 i32.const 1072693248 i32.gt_s if - get_local $13 + local.get $13 i32.const 0 i32.gt_s if (result f64) - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -6575,168 +6575,168 @@ end return end - get_local $2 + local.get $2 f64.const 1 f64.sub - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul f64.const 0.5 - get_local $3 + local.get $3 f64.const 0.3333333333333333 - get_local $3 + local.get $3 f64.const 0.25 f64.mul f64.sub f64.mul f64.sub f64.mul - set_local $0 + local.set $0 f64.const 1.4426950216293335 - get_local $3 + local.get $3 f64.mul - tee_local $16 - get_local $3 + local.tee $16 + local.get $3 f64.const 1.9259629911266175e-08 f64.mul - get_local $0 + local.get $0 f64.const 1.4426950408889634 f64.mul f64.sub - tee_local $6 + local.tee $6 f64.add - set_local $8 - get_local $6 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $6 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 - get_local $16 + f64.reinterpret_i64 + local.tee $8 + local.get $16 f64.sub f64.sub else i32.const 0 - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 1048576 i32.lt_s if (result i32) - get_local $2 + local.get $2 f64.const 9007199254740992 f64.mul - tee_local $2 - i64.reinterpret/f64 + local.tee $2 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 + i32.wrap_i64 + local.set $5 i32.const -53 else i32.const 0 end - get_local $5 + local.get $5 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 1048575 i32.and - tee_local $9 + local.tee $9 i32.const 1072693248 i32.or - set_local $5 - get_local $9 + local.set $5 + local.get $9 i32.const 235662 i32.le_s if (result i32) i32.const 0 else - get_local $9 + local.get $9 i32.const 767610 i32.lt_s if (result i32) i32.const 1 else - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const -1048576 i32.add - set_local $5 + local.set $5 i32.const 0 end end - set_local $12 - get_local $2 - i64.reinterpret/f64 + local.set $12 + local.get $2 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $5 - i64.extend_s/i32 + local.get $5 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - tee_local $2 + f64.reinterpret_i64 + local.tee $2 f64.const 1.5 f64.const 1 - get_local $12 + local.get $12 select - tee_local $0 + local.tee $0 f64.sub - tee_local $16 + local.tee $16 f64.const 1 - get_local $2 - get_local $0 + local.get $2 + local.get $0 f64.add f64.div - tee_local $6 + local.tee $6 f64.mul - set_local $14 - get_local $2 - get_local $5 + local.set $14 + local.get $2 + local.get $5 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - get_local $12 + local.get $12 i32.const 18 i32.shl i32.add - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - tee_local $8 - get_local $0 + f64.reinterpret_i64 + local.tee $8 + local.get $0 f64.sub f64.sub - set_local $2 - get_local $14 - get_local $14 + local.set $2 + local.get $14 + local.get $14 f64.mul - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul f64.const 0.5999999999999946 - get_local $3 + local.get $3 f64.const 0.4285714285785502 - get_local $3 + local.get $3 f64.const 0.33333332981837743 - get_local $3 + local.get $3 f64.const 0.272728123808534 - get_local $3 + local.get $3 f64.const 0.23066074577556175 - get_local $3 + local.get $3 f64.const 0.20697501780033842 f64.mul f64.add @@ -6749,300 +6749,300 @@ f64.mul f64.add f64.mul - set_local $19 - get_local $6 - get_local $16 - get_local $14 - i64.reinterpret/f64 + local.set $19 + local.get $6 + local.get $16 + local.get $14 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $6 - get_local $8 + f64.reinterpret_i64 + local.tee $6 + local.get $8 f64.mul f64.sub - get_local $6 - get_local $2 + local.get $6 + local.get $2 f64.mul f64.sub f64.mul - set_local $0 + local.set $0 f64.const 3 - get_local $6 - get_local $6 + local.get $6 + local.get $6 f64.mul - tee_local $3 + local.tee $3 f64.add - get_local $19 - get_local $0 - get_local $6 - get_local $14 + local.get $19 + local.get $0 + local.get $6 + local.get $14 f64.add f64.mul f64.add - tee_local $19 + local.tee $19 f64.add - set_local $8 - get_local $19 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $19 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 + f64.reinterpret_i64 + local.tee $8 f64.const 3 f64.sub - get_local $3 + local.get $3 f64.sub f64.sub - set_local $2 - get_local $6 - get_local $8 + local.set $2 + local.get $6 + local.get $8 f64.mul - tee_local $16 - get_local $0 - get_local $8 + local.tee $16 + local.get $0 + local.get $8 f64.mul - get_local $2 - get_local $14 + local.get $2 + local.get $14 f64.mul f64.add - tee_local $6 + local.tee $6 f64.add - set_local $0 - get_local $6 - get_local $0 - i64.reinterpret/f64 + local.set $0 + local.get $6 + local.get $0 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $0 - get_local $16 + f64.reinterpret_i64 + local.tee $0 + local.get $16 f64.sub f64.sub - set_local $6 + local.set $6 f64.const 0.9617967009544373 - get_local $0 + local.get $0 f64.mul - tee_local $19 + local.tee $19 f64.const -7.028461650952758e-09 - get_local $0 + local.get $0 f64.mul - get_local $6 + local.get $6 f64.const 0.9617966939259756 f64.mul f64.add f64.const 1.350039202129749e-08 f64.const 0 - get_local $12 + local.get $12 select f64.add - tee_local $2 + local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - get_local $12 + local.get $12 select - tee_local $0 + local.tee $0 f64.add - get_local $7 - f64.convert_s/i32 - tee_local $3 + local.get $7 + f64.convert_i32_s + local.tee $3 f64.add - set_local $8 - get_local $2 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $2 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 - get_local $3 + f64.reinterpret_i64 + local.tee $8 + local.get $3 f64.sub - get_local $0 + local.get $0 f64.sub - get_local $19 + local.get $19 f64.sub f64.sub end - set_local $2 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $2 + local.get $1 + local.get $1 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $0 + f64.reinterpret_i64 + local.tee $0 f64.sub - get_local $8 + local.get $8 f64.mul - get_local $1 - get_local $2 + local.get $1 + local.get $2 f64.mul f64.add - tee_local $6 - get_local $0 - get_local $8 + local.tee $6 + local.get $0 + local.get $8 f64.mul - tee_local $0 + local.tee $0 f64.add - tee_local $2 - i64.reinterpret/f64 - tee_local $17 - i32.wrap/i64 - set_local $4 + local.tee $2 + i64.reinterpret_f64 + local.tee $17 + i32.wrap_i64 + local.set $4 block $folding-inner1 block $folding-inner0 - get_local $17 + local.get $17 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $9 + i32.wrap_i64 + local.tee $9 i32.const 1083179008 i32.ge_s if - get_local $9 + local.get $9 i32.const 1083179008 i32.sub - get_local $4 + local.get $4 i32.or br_if $folding-inner0 - get_local $6 + local.get $6 f64.const 8.008566259537294e-17 f64.add - get_local $2 - get_local $0 + local.get $2 + local.get $0 f64.sub f64.gt br_if $folding-inner0 else - get_local $9 + local.get $9 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_s if - get_local $9 + local.get $9 i32.const -1064252416 i32.sub - get_local $4 + local.get $4 i32.or br_if $folding-inner1 - get_local $6 - get_local $2 - get_local $0 + local.get $6 + local.get $2 + local.get $0 f64.sub f64.le br_if $folding-inner1 end end - get_local $9 + local.get $9 i32.const 2147483647 i32.and - tee_local $4 + local.tee $4 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $12 + local.set $12 i32.const 0 - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.const 1071644672 i32.gt_s if i32.const 1048576 - get_local $12 + local.get $12 i32.const 1 i32.add i32.shr_s - get_local $9 + local.get $9 i32.add - tee_local $7 + local.tee $7 i32.const 2147483647 i32.and i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $12 + local.set $12 i32.const 1048575 - get_local $12 + local.get $12 i32.shr_s i32.const -1 i32.xor - get_local $7 + local.get $7 i32.and - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $3 - get_local $7 + f64.reinterpret_i64 + local.set $3 + local.get $7 i32.const 1048575 i32.and i32.const 1048576 i32.or i32.const 20 - get_local $12 + local.get $12 i32.sub i32.shr_s - set_local $7 + local.set $7 i32.const 0 - get_local $7 + local.get $7 i32.sub - get_local $7 - get_local $9 + local.get $7 + local.get $9 i32.const 0 i32.lt_s select - set_local $7 - get_local $0 - get_local $3 + local.set $7 + local.get $0 + local.get $3 f64.sub - set_local $0 + local.set $0 end - get_local $6 - get_local $0 + local.get $6 + local.get $0 f64.add - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $3 + f64.reinterpret_i64 + local.tee $3 f64.const 0.6931471824645996 f64.mul - tee_local $16 - get_local $6 - get_local $3 - get_local $0 + local.tee $16 + local.get $6 + local.get $3 + local.get $0 f64.sub f64.sub f64.const 0.6931471805599453 f64.mul - get_local $3 + local.get $3 f64.const -1.904654299957768e-09 f64.mul f64.add - tee_local $6 + local.tee $6 f64.add - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.mul - set_local $3 - get_local $10 + local.set $3 + local.get $10 f64.const 1 - get_local $2 - get_local $2 - get_local $3 + local.get $2 + local.get $2 + local.get $3 f64.const 0.16666666666666602 - get_local $3 + local.get $3 f64.const -2.7777777777015593e-03 - get_local $3 + local.get $3 f64.const 6.613756321437934e-05 - get_local $3 + local.get $3 f64.const -1.6533902205465252e-06 - get_local $3 + local.get $3 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -7054,67 +7054,67 @@ f64.add f64.mul f64.sub - tee_local $8 + local.tee $8 f64.mul - get_local $8 + local.get $8 f64.const 2 f64.sub f64.div - get_local $6 - get_local $2 - get_local $16 + local.get $6 + local.get $2 + local.get $16 f64.sub f64.sub - tee_local $0 - get_local $2 - get_local $0 + local.tee $0 + local.get $2 + local.get $0 f64.mul f64.add f64.sub - get_local $2 + local.get $2 f64.sub f64.sub - tee_local $2 - i64.reinterpret/f64 + local.tee $2 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - get_local $7 + i32.wrap_i64 + local.get $7 i32.const 20 i32.shl i32.add - tee_local $9 + local.tee $9 i32.const 20 i32.shr_s i32.const 0 i32.le_s if (result f64) - get_local $2 - get_local $7 + local.get $2 + local.get $7 call $~lib/math/NativeMath.scalbn else - get_local $2 - i64.reinterpret/f64 + local.get $2 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $9 - i64.extend_s/i32 + local.get $9 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 end f64.mul return end - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -7122,22 +7122,22 @@ ) (func $std/math/test_pow (; 118 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.pow - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/pow - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check else - get_local $5 + local.get $5 end ) (func $~lib/math/NativeMathf.pow (; 119 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -7157,71 +7157,71 @@ (local $15 f32) (local $16 f32) (local $17 f32) - get_local $0 - i32.reinterpret/f32 - tee_local $7 + local.get $0 + i32.reinterpret_f32 + local.tee $7 i32.const 2147483647 i32.and - set_local $6 - get_local $1 - i32.reinterpret/f32 - tee_local $14 + local.set $6 + local.get $1 + i32.reinterpret_f32 + local.tee $14 i32.const 2147483647 i32.and - tee_local $13 + local.tee $13 i32.eqz if f32.const 1 return end - get_local $6 + local.get $6 i32.const 2139095040 i32.gt_s - tee_local $5 + local.tee $5 i32.eqz if - get_local $13 + local.get $13 i32.const 2139095040 i32.gt_s - set_local $5 + local.set $5 end - get_local $5 + local.get $5 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add return end - get_local $7 + local.get $7 i32.const 0 i32.lt_s if - get_local $13 + local.get $13 i32.const 1266679808 i32.ge_s if (result i32) i32.const 2 else - get_local $13 + local.get $13 i32.const 1065353216 i32.ge_s if (result i32) - get_local $13 + local.get $13 i32.const 150 - get_local $13 + local.get $13 i32.const 23 i32.shr_s i32.sub - tee_local $5 + local.tee $5 i32.shr_s - tee_local $8 - get_local $5 + local.tee $8 + local.get $5 i32.shl - get_local $13 + local.get $13 i32.eq if (result i32) i32.const 2 - get_local $8 + local.get $8 i32.const 1 i32.and i32.sub @@ -7232,37 +7232,37 @@ i32.const 0 end end - set_local $4 + local.set $4 end - get_local $13 + local.get $13 i32.const 2139095040 i32.eq if - get_local $6 + local.get $6 i32.const 1065353216 i32.eq if f32.const nan:0x400000 return else - get_local $6 + local.get $6 i32.const 1065353216 i32.gt_s if - get_local $14 + local.get $14 i32.const 0 i32.lt_s if f32.const 0 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 return else f32.const 0 - get_local $1 + local.get $1 f32.neg - get_local $14 + local.get $14 i32.const 0 i32.ge_s select @@ -7272,150 +7272,150 @@ end unreachable end - get_local $13 + local.get $13 i32.const 1065353216 i32.eq if - get_local $14 + local.get $14 i32.const 0 i32.lt_s if f32.const 1 - get_local $0 + local.get $0 f32.div - set_local $0 + local.set $0 end - get_local $0 + local.get $0 return end - get_local $14 + local.get $14 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul return end - get_local $14 + local.get $14 i32.const 1056964608 i32.eq if - get_local $7 + local.get $7 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f32.sqrt return end end - get_local $0 + local.get $0 f32.abs - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 2139095040 i32.eq - tee_local $5 + local.tee $5 i32.eqz if - get_local $6 + local.get $6 i32.eqz - set_local $5 + local.set $5 end - get_local $5 + local.get $5 i32.eqz if - get_local $6 + local.get $6 i32.const 1065353216 i32.eq - set_local $5 + local.set $5 end - get_local $5 + local.get $5 if f32.const 1 - get_local $2 + local.get $2 f32.div - get_local $2 - get_local $14 + local.get $2 + local.get $14 i32.const 0 i32.lt_s select - set_local $2 - get_local $7 + local.set $2 + local.get $7 i32.const 0 i32.lt_s if (result f32) - get_local $6 + local.get $6 i32.const 1065353216 i32.sub - get_local $4 + local.get $4 i32.or if (result f32) - get_local $2 + local.get $2 f32.neg - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.const 1 i32.eq select else - get_local $2 - get_local $2 + local.get $2 + local.get $2 f32.sub - tee_local $9 - get_local $9 + local.tee $9 + local.get $9 f32.div end else - get_local $2 + local.get $2 end return end f32.const 1 - set_local $10 - get_local $7 + local.set $10 + local.get $7 i32.const 0 i32.lt_s if - get_local $4 + local.get $4 i32.eqz if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub - tee_local $9 - get_local $9 + local.tee $9 + local.get $9 f32.div return end f32.const -1 f32.const 1 - get_local $4 + local.get $4 i32.const 1 i32.eq select - set_local $10 + local.set $10 end - get_local $13 + local.get $13 i32.const 1291845632 i32.gt_s if (result f32) - get_local $6 + local.get $6 i32.const 1065353208 i32.lt_s if - get_local $14 + local.get $14 i32.const 0 i32.lt_s if (result f32) - get_local $10 + local.get $10 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul else - get_local $10 + local.get $10 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -7423,21 +7423,21 @@ end return end - get_local $6 + local.get $6 i32.const 1065353223 i32.gt_s if - get_local $14 + local.get $14 i32.const 0 i32.gt_s if (result f32) - get_local $10 + local.get $10 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul else - get_local $10 + local.get $10 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -7445,126 +7445,126 @@ end return end - get_local $2 + local.get $2 f32.const 1 f32.sub - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f32.mul f32.const 0.5 - get_local $3 + local.get $3 f32.const 0.3333333432674408 - get_local $3 + local.get $3 f32.const 0.25 f32.mul f32.sub f32.mul f32.sub f32.mul - set_local $0 + local.set $0 f32.const 1.44268798828125 - get_local $3 + local.get $3 f32.mul - tee_local $15 - get_local $3 + local.tee $15 + local.get $3 f32.const 7.052607543300837e-06 f32.mul - get_local $0 + local.get $0 f32.const 1.4426950216293335 f32.mul f32.sub - tee_local $16 + local.tee $16 f32.add - i32.reinterpret/f32 - set_local $5 - get_local $16 - get_local $5 + i32.reinterpret_f32 + local.set $5 + local.get $16 + local.get $5 i32.const -4096 i32.and - f32.reinterpret/i32 - tee_local $12 - get_local $15 + f32.reinterpret_i32 + local.tee $12 + local.get $15 f32.sub f32.sub else i32.const 0 - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 8388608 i32.lt_s if (result i32) - get_local $2 + local.get $2 f32.const 16777216 f32.mul - i32.reinterpret/f32 - set_local $6 + i32.reinterpret_f32 + local.set $6 i32.const -24 else i32.const 0 end - get_local $6 + local.get $6 i32.const 23 i32.shr_s i32.const 127 i32.sub i32.add - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 8388607 i32.and - tee_local $8 + local.tee $8 i32.const 1065353216 i32.or - set_local $6 - get_local $8 + local.set $6 + local.get $8 i32.const 1885297 i32.le_s if (result i32) i32.const 0 else - get_local $8 + local.get $8 i32.const 6140887 i32.lt_s if (result i32) i32.const 1 else - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 8388608 i32.sub - set_local $6 + local.set $6 i32.const 0 end end - set_local $7 - get_local $6 - f32.reinterpret/i32 - tee_local $2 + local.set $7 + local.get $6 + f32.reinterpret_i32 + local.tee $2 f32.const 1.5 f32.const 1 - get_local $7 + local.get $7 select - tee_local $0 + local.tee $0 f32.sub - tee_local $15 + local.tee $15 f32.const 1 - get_local $2 - get_local $0 + local.get $2 + local.get $0 f32.add f32.div - tee_local $16 + local.tee $16 f32.mul - tee_local $11 - i32.reinterpret/f32 + local.tee $11 + i32.reinterpret_f32 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $3 - get_local $2 - get_local $6 + f32.reinterpret_i32 + local.set $3 + local.get $2 + local.get $6 i32.const 1 i32.shr_s i32.const -4096 @@ -7573,32 +7573,32 @@ i32.or i32.const 4194304 i32.add - get_local $7 + local.get $7 i32.const 21 i32.shl i32.add - f32.reinterpret/i32 - tee_local $12 - get_local $0 + f32.reinterpret_i32 + local.tee $12 + local.get $0 f32.sub f32.sub - set_local $2 - get_local $11 - get_local $11 + local.set $2 + local.get $11 + local.get $11 f32.mul - tee_local $9 - get_local $9 + local.tee $9 + local.get $9 f32.mul f32.const 0.6000000238418579 - get_local $9 + local.get $9 f32.const 0.4285714328289032 - get_local $9 + local.get $9 f32.const 0.3333333432674408 - get_local $9 + local.get $9 f32.const 0.2727281153202057 - get_local $9 + local.get $9 f32.const 0.23066075146198273 - get_local $9 + local.get $9 f32.const 0.20697501301765442 f32.mul f32.add @@ -7611,283 +7611,283 @@ f32.mul f32.add f32.mul - set_local $17 + local.set $17 f32.const 3 - get_local $3 - get_local $3 + local.get $3 + local.get $3 f32.mul - tee_local $9 + local.tee $9 f32.add - get_local $17 - get_local $16 - get_local $15 - get_local $3 - get_local $12 + local.get $17 + local.get $16 + local.get $15 + local.get $3 + local.get $12 f32.mul f32.sub - get_local $3 - get_local $2 + local.get $3 + local.get $2 f32.mul f32.sub f32.mul - tee_local $0 - get_local $3 - get_local $11 + local.tee $0 + local.get $3 + local.get $11 f32.add f32.mul f32.add - tee_local $17 + local.tee $17 f32.add - i32.reinterpret/f32 - set_local $5 - get_local $17 - get_local $5 + i32.reinterpret_f32 + local.set $5 + local.get $17 + local.get $5 i32.const -4096 i32.and - f32.reinterpret/i32 - tee_local $12 + f32.reinterpret_i32 + local.tee $12 f32.const 3 f32.sub - get_local $9 + local.get $9 f32.sub f32.sub - set_local $2 - get_local $3 - get_local $12 + local.set $2 + local.get $3 + local.get $12 f32.mul - tee_local $15 - get_local $0 - get_local $12 + local.tee $15 + local.get $0 + local.get $12 f32.mul - get_local $2 - get_local $11 + local.get $2 + local.get $11 f32.mul f32.add - tee_local $16 + local.tee $16 f32.add - i32.reinterpret/f32 - set_local $5 - get_local $16 - get_local $5 + i32.reinterpret_f32 + local.set $5 + local.get $16 + local.get $5 i32.const -4096 i32.and - f32.reinterpret/i32 - tee_local $0 - get_local $15 + f32.reinterpret_i32 + local.tee $0 + local.get $15 f32.sub f32.sub - set_local $11 + local.set $11 f32.const 0.9619140625 - get_local $0 + local.get $0 f32.mul - tee_local $17 + local.tee $17 f32.const -1.1736857413779944e-04 - get_local $0 + local.get $0 f32.mul - get_local $11 + local.get $11 f32.const 0.9617967009544373 f32.mul f32.add f32.const 1.5632208487659227e-06 f32.const 0 - get_local $7 + local.get $7 select f32.add - tee_local $2 + local.tee $2 f32.add f32.const 0.5849609375 f32.const 0 - get_local $7 + local.get $7 select - tee_local $0 + local.tee $0 f32.add - get_local $4 - f32.convert_s/i32 - tee_local $3 + local.get $4 + f32.convert_i32_s + local.tee $3 f32.add - i32.reinterpret/f32 - set_local $5 - get_local $2 - get_local $5 + i32.reinterpret_f32 + local.set $5 + local.get $2 + local.get $5 i32.const -4096 i32.and - f32.reinterpret/i32 - tee_local $12 - get_local $3 + f32.reinterpret_i32 + local.tee $12 + local.get $3 f32.sub - get_local $0 + local.get $0 f32.sub - get_local $17 + local.get $17 f32.sub f32.sub end - set_local $2 + local.set $2 block $folding-inner1 - get_local $1 - get_local $1 - i32.reinterpret/f32 - i32.const -4096 - i32.and - f32.reinterpret/i32 - tee_local $0 - f32.sub - get_local $12 - f32.mul - get_local $1 - get_local $2 - f32.mul - f32.add - tee_local $11 - get_local $0 - get_local $12 - f32.mul - tee_local $0 - f32.add - tee_local $2 - i32.reinterpret/f32 - tee_local $8 - i32.const 1124073472 - i32.gt_s - br_if $folding-inner1 block $folding-inner0 - get_local $8 + local.get $1 + local.get $1 + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $0 + f32.sub + local.get $12 + f32.mul + local.get $1 + local.get $2 + f32.mul + f32.add + local.tee $11 + local.get $0 + local.get $12 + f32.mul + local.tee $0 + f32.add + local.tee $2 + 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 - get_local $11 + local.get $11 f32.const 4.299566569443414e-08 f32.add - get_local $2 - get_local $0 + local.get $2 + local.get $0 f32.sub f32.gt - br_if $folding-inner1 + br_if $folding-inner0 else - get_local $8 + local.get $8 i32.const 2147483647 i32.and i32.const 1125515264 i32.gt_s if - br $folding-inner0 + br $folding-inner1 else - get_local $8 + local.get $8 i32.const -1021968384 i32.eq if - get_local $11 - get_local $2 - get_local $0 + local.get $11 + local.get $2 + local.get $0 f32.sub f32.le - br_if $folding-inner0 + br_if $folding-inner1 end end end - get_local $8 + local.get $8 i32.const 2147483647 i32.and - tee_local $5 + local.tee $5 i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $7 + local.set $7 i32.const 0 - set_local $4 - get_local $5 + local.set $4 + local.get $5 i32.const 1056964608 i32.gt_s if i32.const 8388608 - get_local $7 + local.get $7 i32.const 1 i32.add i32.shr_s - get_local $8 + local.get $8 i32.add - tee_local $4 + local.tee $4 i32.const 2147483647 i32.and i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $7 + local.set $7 i32.const 8388607 - get_local $7 + local.get $7 i32.shr_s i32.const -1 i32.xor - get_local $4 + local.get $4 i32.and - f32.reinterpret/i32 - set_local $3 - get_local $4 + f32.reinterpret_i32 + local.set $3 + local.get $4 i32.const 8388607 i32.and i32.const 8388608 i32.or i32.const 23 - get_local $7 + local.get $7 i32.sub i32.shr_s - set_local $4 + local.set $4 i32.const 0 - get_local $4 + local.get $4 i32.sub - get_local $4 - get_local $8 + local.get $4 + local.get $8 i32.const 0 i32.lt_s select - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 f32.sub - set_local $0 + local.set $0 end - get_local $11 - get_local $0 + local.get $11 + local.get $0 f32.add - i32.reinterpret/f32 + i32.reinterpret_f32 i32.const -32768 i32.and - f32.reinterpret/i32 - tee_local $3 + f32.reinterpret_i32 + local.tee $3 f32.const 0.693145751953125 f32.mul - tee_local $15 - get_local $11 - get_local $3 - get_local $0 + local.tee $15 + local.get $11 + local.get $3 + local.get $0 f32.sub f32.sub f32.const 0.6931471824645996 f32.mul - get_local $3 + local.get $3 f32.const 1.4286065379565116e-06 f32.mul f32.add - tee_local $16 + local.tee $16 f32.add - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f32.mul - set_local $3 - get_local $10 + local.set $3 + local.get $10 f32.const 1 - get_local $2 - get_local $2 - get_local $3 + local.get $2 + local.get $2 + local.get $3 f32.const 0.1666666716337204 - get_local $3 + local.get $3 f32.const -2.7777778450399637e-03 - get_local $3 + local.get $3 f32.const 6.61375597701408e-05 - get_local $3 + local.get $3 f32.const -1.6533901998627698e-06 - get_local $3 + local.get $3 f32.const 4.138136944220605e-08 f32.mul f32.add @@ -7899,104 +7899,104 @@ f32.add f32.mul f32.sub - tee_local $12 + local.tee $12 f32.mul - get_local $12 + local.get $12 f32.const 2 f32.sub f32.div - get_local $16 - get_local $2 - get_local $15 + local.get $16 + local.get $2 + local.get $15 f32.sub f32.sub - tee_local $0 - get_local $2 - get_local $0 + local.tee $0 + local.get $2 + local.get $0 f32.mul f32.add f32.sub - get_local $2 + local.get $2 f32.sub f32.sub - tee_local $2 - i32.reinterpret/f32 - get_local $4 + local.tee $2 + i32.reinterpret_f32 + local.get $4 i32.const 23 i32.shl i32.add - tee_local $8 + local.tee $8 i32.const 23 i32.shr_s i32.const 0 i32.le_s if (result f32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 call $~lib/math/NativeMathf.scalbn else - get_local $8 - f32.reinterpret/i32 + local.get $8 + f32.reinterpret_i32 end f32.mul return end - get_local $10 - f32.const 1.0000000031710769e-30 + local.get $10 + f32.const 1000000015047466219876688e6 f32.mul - f32.const 1.0000000031710769e-30 + f32.const 1000000015047466219876688e6 f32.mul return end - get_local $10 - f32.const 1000000015047466219876688e6 + local.get $10 + f32.const 1.0000000031710769e-30 f32.mul - f32.const 1000000015047466219876688e6 + f32.const 1.0000000031710769e-30 f32.mul ) (func $std/math/test_powf (; 120 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.pow - get_local $2 - get_local $3 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/splitMix32 (; 121 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 1831565813 i32.add - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i32.const 15 i32.shr_u i32.xor - get_local $0 + local.get $0 i32.const 1 i32.or i32.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i32.const 61 i32.or - get_local $0 + local.get $0 i32.const 7 i32.shr_u - get_local $0 + local.get $0 i32.xor i32.mul - get_local $0 + local.get $0 i32.add i32.xor - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i32.const 14 i32.shr_u i32.xor ) (func $~lib/math/NativeMath.seedRandom (; 122 ;) (type $Iv) (param $0 i64) (local $1 i64) - get_local $0 + local.get $0 i64.eqz if i32.const 0 @@ -8007,62 +8007,62 @@ unreachable end i32.const 1 - set_global $~lib/math/random_seeded - get_local $0 + global.set $~lib/math/random_seeded + local.get $0 i64.const 33 i64.shr_u - get_local $0 + local.get $0 i64.xor i64.const -49064778989728563 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor i64.const -4265267296055464877 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor - set_global $~lib/math/random_state0_64 - get_global $~lib/math/random_state0_64 + global.set $~lib/math/random_state0_64 + global.get $~lib/math/random_state0_64 i64.const -1 i64.xor - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor i64.const -49064778989728563 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor i64.const -4265267296055464877 i64.mul - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 i64.const 33 i64.shr_u i64.xor - set_global $~lib/math/random_state1_64 - get_local $0 - i32.wrap/i64 + global.set $~lib/math/random_state1_64 + local.get $0 + i32.wrap_i64 call $~lib/math/splitMix32 - set_global $~lib/math/random_state0_32 - get_global $~lib/math/random_state0_32 + global.set $~lib/math/random_state0_32 + global.get $~lib/math/random_state0_32 call $~lib/math/splitMix32 - set_global $~lib/math/random_state1_32 + global.set $~lib/math/random_state1_32 ) (func $~lib/math/NativeMath.random (; 123 ;) (type $F) (result f64) (local $0 i64) (local $1 i64) - get_global $~lib/math/random_seeded + global.get $~lib/math/random_seeded i32.eqz if i32.const 0 @@ -8072,44 +8072,44 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/random_state0_64 - set_local $0 - get_global $~lib/math/random_state1_64 - tee_local $1 - set_global $~lib/math/random_state0_64 - get_local $1 - get_local $0 + 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 $1 + local.get $0 i64.const 23 i64.shl - get_local $0 + local.get $0 i64.xor - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 i64.const 17 i64.shr_u i64.xor i64.xor - get_local $1 + local.get $1 i64.const 26 i64.shr_u i64.xor - tee_local $0 - set_global $~lib/math/random_state1_64 - get_local $0 - get_local $1 + 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.reinterpret_i64 f64.const 1 f64.sub ) (func $~lib/math/NativeMathf.random (; 124 ;) (type $f) (result f32) (local $0 i32) (local $1 i32) - get_global $~lib/math/random_seeded + global.get $~lib/math/random_seeded i32.eqz if i32.const 0 @@ -8119,25 +8119,25 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/random_state0_32 - tee_local $0 - get_global $~lib/math/random_state1_32 + global.get $~lib/math/random_state0_32 + local.tee $0 + global.get $~lib/math/random_state1_32 i32.xor - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.const 26 i32.rotl i32.xor - get_local $1 + local.get $1 i32.const 9 i32.shl i32.xor - set_global $~lib/math/random_state0_32 - get_local $1 + global.set $~lib/math/random_state0_32 + local.get $1 i32.const 13 i32.rotl - set_global $~lib/math/random_state1_32 - get_local $0 + global.set $~lib/math/random_state1_32 + local.get $0 i32.const -1640531525 i32.mul i32.const 5 @@ -8148,29 +8148,29 @@ i32.shr_u i32.const 1065353216 i32.or - f32.reinterpret/i32 + f32.reinterpret_i32 f32.const 1 f32.sub ) (func $std/math/test_round (; 125 ;) (type $FUNCSIG$iddi) (param $0 f64) (param $1 f64) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 0.5 f64.add f64.floor - get_local $0 + local.get $0 f64.copysign - get_local $1 + local.get $1 f64.const 0 call $std/math/check ) (func $std/math/test_roundf (; 126 ;) (type $FUNCSIG$iffi) (param $0 f32) (param $1 f32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 0.5 f32.add f32.floor - get_local $0 + local.get $0 f32.copysign - get_local $1 + local.get $1 f32.const 0 call $std/math/check ) @@ -8178,42 +8178,42 @@ (local $2 i32) f64.const 1 f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.const 0 f64.lt select - get_local $0 + local.get $0 f64.const 0 f64.gt select - get_local $1 + local.get $1 f64.const 0 call $std/math/check - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 call $~lib/bindings/Math/sign - get_local $1 + local.get $1 f64.const 0 call $std/math/check - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/math/test_signf (; 128 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) f32.const 1 f32.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.const 0 f32.lt select - get_local $0 + local.get $0 f32.const 0 f32.gt select - get_local $1 + local.get $1 f32.const 0 call $std/math/check ) @@ -8226,282 +8226,282 @@ (local $7 i32) (local $8 f64) (local $9 i32) - get_local $0 - i64.reinterpret/f64 - tee_local $2 + local.get $0 + i64.reinterpret_f64 + local.tee $2 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $3 - get_local $1 - i64.reinterpret/f64 - tee_local $4 + local.set $3 + local.get $1 + i64.reinterpret_f64 + local.tee $4 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $6 - get_local $2 + local.set $6 + local.get $2 i64.const 63 i64.shr_u - i32.wrap/i64 - set_local $9 + i32.wrap_i64 + local.set $9 block (result i32) - get_local $4 + local.get $4 i64.const 1 i64.shl i64.const 0 i64.eq - tee_local $5 + local.tee $5 i32.eqz if - get_local $3 + local.get $3 i64.const 2047 i64.eq - set_local $5 + local.set $5 end - get_local $5 + local.get $5 i32.eqz end if (result i32) - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne else - get_local $5 + local.get $5 end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.div return end - get_local $2 + local.get $2 i64.const 1 i64.shl i64.const 0 i64.eq if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 i64.eqz if (result i64) - get_local $2 + local.get $2 i64.const 0 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i64.const 12 i64.shl i64.clz i64.sub - tee_local $3 + local.tee $3 i64.sub i64.const 1 i64.add i64.shl else - get_local $2 + local.get $2 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i64.eqz if (result i64) - get_local $4 + local.get $4 i64.const 0 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i64.const 12 i64.shl i64.clz i64.sub - tee_local $6 + local.tee $6 i64.sub i64.const 1 i64.add i64.shl else - get_local $4 + local.get $4 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $4 + local.set $4 block $break|0 - get_local $3 - get_local $6 + local.get $3 + local.get $6 i64.lt_s if - get_local $3 + local.get $3 i64.const 1 i64.add - get_local $6 + local.get $6 i64.eq br_if $break|0 - get_local $0 + local.get $0 return end loop $continue|1 - get_local $3 - get_local $6 + local.get $3 + local.get $6 i64.gt_s if - get_local $2 - get_local $4 + local.get $2 + local.get $4 i64.ge_u if - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 - get_local $2 - get_local $4 + local.set $7 + local.get $2 + local.get $4 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $2 - get_local $7 + local.set $2 + local.get $7 i32.const 1 i32.shl - set_local $7 - get_local $3 + local.set $7 + local.get $3 i64.const 1 i64.sub - set_local $3 + local.set $3 br $continue|1 end end block (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i64.ge_u if - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 - get_local $2 - get_local $4 + local.set $7 + local.get $2 + local.get $4 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 0 i64.eq end if i64.const -60 - set_local $3 + local.set $3 else - get_local $3 - get_local $2 + local.get $3 + local.get $2 i64.const 11 i64.shl i64.clz - tee_local $4 + local.tee $4 i64.sub - set_local $3 - get_local $2 - get_local $4 + local.set $3 + local.get $2 + local.get $4 i64.shl - set_local $2 + local.set $2 end end - get_local $1 + local.get $1 f64.abs - set_local $1 - get_local $3 + local.set $1 + local.get $3 i64.const 0 i64.gt_s if (result i64) - get_local $2 + local.get $2 i64.const 4503599627370496 i64.sub - get_local $3 + local.get $3 i64.const 52 i64.shl i64.or else - get_local $2 + local.get $2 i64.const 0 - get_local $3 + local.get $3 i64.sub i64.const 1 i64.add i64.shr_u end - f64.reinterpret/i64 - tee_local $0 - get_local $0 + f64.reinterpret_i64 + local.tee $0 + local.get $0 f64.add - set_local $8 - get_local $0 - get_local $1 + local.set $8 + local.get $0 + local.get $1 f64.sub - get_local $0 - get_local $3 - get_local $6 + local.get $0 + local.get $3 + local.get $6 i64.eq - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $3 + local.get $3 i64.const 1 i64.add - get_local $6 + local.get $6 i64.eq - tee_local $5 + local.tee $5 if (result i32) - get_local $8 - get_local $1 + local.get $8 + local.get $1 f64.gt - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $8 - get_local $1 + local.get $8 + local.get $1 f64.eq - tee_local $5 + local.tee $5 if (result i32) - get_local $7 + local.get $7 i32.const 1 i32.and else - get_local $5 + local.get $5 end end else - get_local $5 + local.get $5 end end select - set_local $0 - get_local $0 + local.set $0 + local.get $0 f64.neg - get_local $0 - get_local $9 + local.get $0 + local.get $9 select ) (func $std/math/test_rem (; 130 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.rem - get_local $2 + local.get $2 f64.const 0 call $std/math/check ) @@ -8514,270 +8514,270 @@ (local $7 i32) (local $8 f32) (local $9 i32) - get_local $0 - i32.reinterpret/f32 - tee_local $2 + local.get $0 + i32.reinterpret_f32 + local.tee $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $3 - get_local $1 - i32.reinterpret/f32 - tee_local $5 + local.set $3 + local.get $1 + i32.reinterpret_f32 + local.tee $5 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 31 i32.shr_u - set_local $9 + local.set $9 block (result i32) - get_local $5 + local.get $5 i32.const 1 i32.shl i32.eqz - tee_local $4 + local.tee $4 i32.eqz if - get_local $3 + local.get $3 i32.const 255 i32.eq - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz end if (result i32) - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne else - get_local $4 + local.get $4 end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f32.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl i32.eqz if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 if (result i32) - get_local $2 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $2 + local.get $2 i32.const 1 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - tee_local $3 + local.tee $3 i32.sub i32.shl end - set_local $2 - get_local $6 + local.set $2 + local.get $6 if (result i32) - get_local $5 + local.get $5 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $5 + local.get $5 i32.const 1 - get_local $6 - get_local $5 + local.get $6 + local.get $5 i32.const 9 i32.shl i32.clz i32.sub - tee_local $6 + local.tee $6 i32.sub i32.shl end - set_local $5 + local.set $5 block $break|0 - get_local $3 - get_local $6 + local.get $3 + local.get $6 i32.lt_s if - get_local $3 + local.get $3 i32.const 1 i32.add - get_local $6 + local.get $6 i32.eq br_if $break|0 - get_local $0 + local.get $0 return end loop $continue|1 - get_local $3 - get_local $6 + local.get $3 + local.get $6 i32.gt_s if - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.ge_u if - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 - get_local $2 - get_local $5 + local.set $7 + local.get $2 + local.get $5 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $2 - get_local $7 + local.set $2 + local.get $7 i32.const 1 i32.shl - set_local $7 - get_local $3 + local.set $7 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $continue|1 end end block (result i32) - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.ge_u if - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 - get_local $2 - get_local $5 + local.set $7 + local.get $2 + local.get $5 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.eqz end if i32.const -30 - set_local $3 + local.set $3 else - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.const 8 i32.shl i32.clz - tee_local $4 + local.tee $4 i32.sub - set_local $3 - get_local $2 - get_local $4 + local.set $3 + local.get $2 + local.get $4 i32.shl - set_local $2 + local.set $2 end end - get_local $1 + local.get $1 f32.abs - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.const 0 i32.gt_s if (result i32) - get_local $2 + local.get $2 i32.const 8388608 i32.sub - get_local $3 + local.get $3 i32.const 23 i32.shl i32.or else - get_local $2 + local.get $2 i32.const 1 - get_local $3 + local.get $3 i32.sub i32.shr_u end - f32.reinterpret/i32 - tee_local $0 - get_local $0 + f32.reinterpret_i32 + local.tee $0 + local.get $0 f32.add - set_local $8 - get_local $0 - get_local $1 + local.set $8 + local.get $0 + local.get $1 f32.sub - get_local $0 - get_local $3 - get_local $6 + local.get $0 + local.get $3 + local.get $6 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $3 + local.get $3 i32.const 1 i32.add - get_local $6 + local.get $6 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $8 - get_local $1 + local.get $8 + local.get $1 f32.gt - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $8 - get_local $1 + local.get $8 + local.get $1 f32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $7 + local.get $7 i32.const 1 i32.and else - get_local $4 + local.get $4 end end else - get_local $4 + local.get $4 end end select - set_local $0 - get_local $0 + local.set $0 + local.get $0 f32.neg - get_local $0 - get_local $9 + local.get $0 + local.get $9 select ) (func $std/math/test_remf (; 132 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.rem - get_local $2 + local.get $2 f32.const 0 call $std/math/check ) @@ -8786,47 +8786,47 @@ (local $2 f64) (local $3 i32) (local $4 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $4 - f64.reinterpret/i64 - set_local $1 + local.tee $4 + f64.reinterpret_i64 + local.set $1 f64.const 0.5 - get_local $0 + local.get $0 f64.copysign - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $3 + i32.wrap_i64 + local.tee $3 i32.const 1082535490 i32.lt_u if - get_local $1 + local.get $1 call $~lib/math/NativeMath.expm1 - set_local $1 - get_local $3 + local.set $1 + local.get $3 i32.const 1072693248 i32.lt_u if - get_local $3 + local.get $3 i32.const 1045430272 i32.lt_u if - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 f64.const 2 - get_local $1 + local.get $1 f64.mul - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.mul - get_local $1 + local.get $1 f64.const 1 f64.add f64.div @@ -8834,10 +8834,10 @@ f64.mul return end - get_local $2 - get_local $1 - get_local $1 - get_local $1 + local.get $2 + local.get $1 + local.get $1 + local.get $1 f64.const 1 f64.add f64.div @@ -8846,9 +8846,9 @@ return end f64.const 2 - get_local $2 + local.get $2 f64.mul - get_local $1 + local.get $1 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp @@ -8860,63 +8860,63 @@ ) (func $std/math/test_sinh (; 134 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.sinh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/sinh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.sinh (; 135 ;) (type $ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 f32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $2 - f32.reinterpret/i32 - set_local $1 + local.tee $2 + f32.reinterpret_i32 + local.set $1 f32.const 0.5 - get_local $0 + local.get $0 f32.copysign - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1118925335 i32.lt_u if - get_local $1 + local.get $1 call $~lib/math/NativeMathf.expm1 - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1065353216 i32.lt_u if - get_local $2 + local.get $2 i32.const 964689920 i32.lt_u if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 f32.const 2 - get_local $1 + local.get $1 f32.mul - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.mul - get_local $1 + local.get $1 f32.const 1 f32.add f32.div @@ -8924,10 +8924,10 @@ f32.mul return end - get_local $3 - get_local $1 - get_local $1 - get_local $1 + local.get $3 + local.get $1 + local.get $1 + local.get $1 f32.const 1 f32.add f32.div @@ -8936,9 +8936,9 @@ return end f32.const 2 - get_local $3 + local.get $3 f32.mul - get_local $1 + local.get $1 f32.const 162.88958740234375 f32.sub call $~lib/math/NativeMathf.exp @@ -8949,70 +8949,70 @@ f32.mul ) (func $std/math/test_sinhf (; 136 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.sinh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_sqrt (; 137 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 f64.sqrt - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/sqrt - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $std/math/test_sqrtf (; 138 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 f32.sqrt - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $~lib/math/NativeMath.tanh (; 139 ;) (type $FF) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - tee_local $3 - f64.reinterpret/i64 - set_local $1 - get_local $3 + local.tee $3 + f64.reinterpret_i64 + local.set $1 + local.get $3 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $2 + i32.wrap_i64 + local.tee $2 i32.const 1071748074 i32.gt_u if - get_local $2 + local.get $2 i32.const 1077149696 i32.gt_u if (result f64) f64.const 1 f64.const 0 - get_local $1 + local.get $1 f64.div f64.sub else f64.const 1 f64.const 2 f64.const 2 - get_local $1 + local.get $1 f64.mul call $~lib/math/NativeMath.expm1 f64.const 2 @@ -9020,91 +9020,91 @@ f64.div f64.sub end - set_local $1 + local.set $1 else - get_local $2 + local.get $2 i32.const 1070618798 i32.gt_u if f64.const 2 - get_local $1 + local.get $1 f64.mul call $~lib/math/NativeMath.expm1 - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f64.const 2 f64.add f64.div - set_local $1 + local.set $1 else - get_local $2 + local.get $2 i32.const 1048576 i32.ge_u if f64.const -2 - get_local $1 + local.get $1 f64.mul call $~lib/math/NativeMath.expm1 - tee_local $1 + local.tee $1 f64.neg - get_local $1 + local.get $1 f64.const 2 f64.add f64.div - set_local $1 + local.set $1 end end end - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.copysign ) (func $std/math/test_tanh (; 140 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.tanh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 call $~lib/bindings/Math/tanh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.tanh (; 141 ;) (type $ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - tee_local $2 - f32.reinterpret/i32 - set_local $1 - get_local $2 + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 i32.const 1057791828 i32.gt_u if - get_local $2 + local.get $2 i32.const 1092616192 i32.gt_u if (result f32) f32.const 1 f32.const 0 - get_local $1 + local.get $1 f32.div f32.add else f32.const 1 f32.const 2 f32.const 2 - get_local $1 + local.get $1 f32.mul call $~lib/math/NativeMathf.expm1 f32.const 2 @@ -9112,83 +9112,83 @@ f32.div f32.sub end - set_local $1 + local.set $1 else - get_local $2 + local.get $2 i32.const 1048757624 i32.gt_u if f32.const 2 - get_local $1 + local.get $1 f32.mul call $~lib/math/NativeMathf.expm1 - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f32.const 2 f32.add f32.div - set_local $1 + local.set $1 else - get_local $2 + local.get $2 i32.const 8388608 i32.ge_u if f32.const -2 - get_local $1 + local.get $1 f32.mul call $~lib/math/NativeMathf.expm1 - tee_local $1 + local.tee $1 f32.neg - get_local $1 + local.get $1 f32.const 2 f32.add f32.div - set_local $1 + local.set $1 end end end - get_local $1 - get_local $0 + local.get $1 + local.get $0 f32.copysign ) (func $std/math/test_tanhf (; 142 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.tanh - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $std/math/check ) (func $std/math/test_trunc (; 143 ;) (type $FUNCSIG$iddi) (param $0 f64) (param $1 f64) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.trunc - get_local $1 + local.get $1 f64.const 0 call $std/math/check - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 call $~lib/bindings/Math/trunc - get_local $1 + local.get $1 f64.const 0 call $std/math/check - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/math/test_truncf (; 144 ;) (type $FUNCSIG$iffi) (param $0 f32) (param $1 f32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.trunc - get_local $1 + local.get $1 f32.const 0 call $std/math/check ) (func $~lib/math/NativeMath.imul (; 145 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.sub f64.const 0 f64.ne @@ -9196,35 +9196,35 @@ f64.const 0 return end - get_local $0 + local.get $0 f64.const 4294967296 - get_local $0 + local.get $0 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 - get_local $1 + i64.trunc_f64_s + i32.wrap_i64 + local.get $1 f64.const 4294967296 - get_local $1 + local.get $1 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 + i64.trunc_f64_s + i32.wrap_i64 i32.mul - f64.convert_s/i32 + f64.convert_i32_s ) (func $~lib/math/ipow64 (; 146 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64) (local $2 i64) (local $3 i32) i64.const 1 - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 i32.lt_s if @@ -9234,13 +9234,13 @@ block $break|0 block $case2|0 block $case1|0 - get_local $1 + local.get $1 if - get_local $1 + local.get $1 i32.const 1 i32.eq br_if $case1|0 - get_local $1 + local.get $1 i32.const 2 i32.eq br_if $case2|0 @@ -9249,19 +9249,19 @@ i64.const 1 return end - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 i64.mul return end i32.const 32 - get_local $1 + local.get $1 i32.clz i32.sub - tee_local $3 + local.tee $3 i32.const 6 i32.le_s if @@ -9271,241 +9271,241 @@ block $case3|1 block $case2|1 block $case1|1 - get_local $3 + local.get $3 i32.const 6 i32.ne if - get_local $3 + local.get $3 i32.const 5 i32.eq br_if $case1|1 block $tablify|0 - get_local $3 + local.get $3 i32.const 1 i32.sub br_table $case5|1 $case4|1 $case3|1 $case2|1 $tablify|0 end br $break|1 end - get_local $0 + local.get $0 i64.const 1 - get_local $1 + local.get $1 i32.const 1 i32.and select - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i64.mul - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.and select - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i64.mul - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.and select - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i64.mul - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.and select - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i64.mul - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.and select - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i64.mul - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.and select - set_local $2 + local.set $2 end - get_local $2 + local.get $2 return end loop $continue|2 - get_local $1 + local.get $1 i32.const 0 i32.gt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i64.mul - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.and select - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 br $continue|2 end end - get_local $2 + local.get $2 ) (func $~lib/math/ipow32f (; 147 ;) (type $fif) (param $0 f32) (param $1 i32) (result f32) (local $2 f32) (local $3 i32) - get_local $1 + local.get $1 i32.const 31 i32.shr_s - tee_local $3 - get_local $1 - get_local $3 + local.tee $3 + local.get $1 + local.get $3 i32.add i32.xor - set_local $1 + local.set $1 f32.const 1 - set_local $2 + local.set $2 loop $continue|0 - get_local $1 + local.get $1 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 f32.const 1 - get_local $1 + local.get $1 i32.const 1 i32.and select f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 f32.mul - set_local $0 + local.set $0 br $continue|0 end end - get_local $3 + local.get $3 if f32.const 1 - get_local $2 + local.get $2 f32.div - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $~lib/math/ipow64f (; 148 ;) (type $FiF) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) (local $3 i32) - get_local $1 + local.get $1 i32.const 31 i32.shr_s - tee_local $3 - get_local $1 - get_local $3 + local.tee $3 + local.get $1 + local.get $3 i32.add i32.xor - set_local $1 + local.set $1 f64.const 1 - set_local $2 + local.set $2 loop $continue|0 - get_local $1 + local.get $1 if - get_local $2 - get_local $0 + local.get $2 + local.get $0 f64.const 1 - get_local $1 + local.get $1 i32.const 1 i32.and select f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 f64.mul - set_local $0 + local.set $0 br $continue|0 end end - get_local $3 + local.get $3 if f64.const 1 - get_local $2 + local.get $2 f64.div - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $start (; 149 ;) (type $v) (local $0 f64) @@ -9513,7 +9513,7 @@ (local $2 i32) (local $3 i32) f64.const 2.718281828459045 - get_global $~lib/bindings/Math/E + global.get $~lib/bindings/Math/E f64.const 0 call $std/math/check i32.eqz @@ -9526,7 +9526,7 @@ unreachable end f64.const 0.6931471805599453 - get_global $~lib/bindings/Math/LN2 + global.get $~lib/bindings/Math/LN2 f64.const 0 call $std/math/check i32.eqz @@ -9539,7 +9539,7 @@ unreachable end f64.const 2.302585092994046 - get_global $~lib/bindings/Math/LN10 + global.get $~lib/bindings/Math/LN10 f64.const 0 call $std/math/check i32.eqz @@ -9552,7 +9552,7 @@ unreachable end f64.const 1.4426950408889634 - get_global $~lib/bindings/Math/LOG2E + global.get $~lib/bindings/Math/LOG2E f64.const 0 call $std/math/check i32.eqz @@ -9565,7 +9565,7 @@ unreachable end f64.const 3.141592653589793 - get_global $~lib/bindings/Math/PI + global.get $~lib/bindings/Math/PI f64.const 0 call $std/math/check i32.eqz @@ -9578,7 +9578,7 @@ unreachable end f64.const 0.7071067811865476 - get_global $~lib/bindings/Math/SQRT1_2 + global.get $~lib/bindings/Math/SQRT1_2 f64.const 0 call $std/math/check i32.eqz @@ -9591,7 +9591,7 @@ unreachable end f64.const 1.4142135623730951 - get_global $~lib/bindings/Math/SQRT2 + global.get $~lib/bindings/Math/SQRT2 f64.const 0 call $std/math/check i32.eqz @@ -9604,8 +9604,8 @@ unreachable end f32.const 2.7182817459106445 - get_global $~lib/bindings/Math/E - f32.demote/f64 + global.get $~lib/bindings/Math/E + f32.demote_f64 f32.const 0 call $std/math/check i32.eqz @@ -9618,8 +9618,8 @@ unreachable end f32.const 0.6931471824645996 - get_global $~lib/bindings/Math/LN2 - f32.demote/f64 + global.get $~lib/bindings/Math/LN2 + f32.demote_f64 f32.const 0 call $std/math/check i32.eqz @@ -9632,8 +9632,8 @@ unreachable end f32.const 2.3025851249694824 - get_global $~lib/bindings/Math/LN10 - f32.demote/f64 + global.get $~lib/bindings/Math/LN10 + f32.demote_f64 f32.const 0 call $std/math/check i32.eqz @@ -9646,8 +9646,8 @@ unreachable end f32.const 1.4426950216293335 - get_global $~lib/bindings/Math/LOG2E - f32.demote/f64 + global.get $~lib/bindings/Math/LOG2E + f32.demote_f64 f32.const 0 call $std/math/check i32.eqz @@ -9660,8 +9660,8 @@ unreachable end f32.const 3.1415927410125732 - get_global $~lib/bindings/Math/PI - f32.demote/f64 + global.get $~lib/bindings/Math/PI + f32.demote_f64 f32.const 0 call $std/math/check i32.eqz @@ -9674,8 +9674,8 @@ unreachable end f32.const 0.7071067690849304 - get_global $~lib/bindings/Math/SQRT1_2 - f32.demote/f64 + global.get $~lib/bindings/Math/SQRT1_2 + f32.demote_f64 f32.const 0 call $std/math/check i32.eqz @@ -9688,8 +9688,8 @@ unreachable end f32.const 1.4142135381698608 - get_global $~lib/bindings/Math/SQRT2 - f32.demote/f64 + global.get $~lib/bindings/Math/SQRT2 + f32.demote_f64 f32.const 0 call $std/math/check i32.eqz @@ -31422,31 +31422,31 @@ unreachable end call $~lib/bindings/Math/random - i64.reinterpret/f64 + i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom loop $repeat|0 - get_local $2 - f64.convert_s/i32 + local.get $2 + f64.convert_i32_s f64.const 1e6 f64.lt if call $~lib/math/NativeMath.random - tee_local $0 + local.tee $0 f64.const 0 f64.ge - tee_local $3 + local.tee $3 if (result i32) - get_local $0 + local.get $0 f64.const 1 f64.lt else - get_local $3 + local.get $3 end if - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 else i32.const 0 @@ -31460,33 +31460,33 @@ end end call $~lib/bindings/Math/random - i64.reinterpret/f64 + i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom i32.const 0 - set_local $2 + local.set $2 loop $repeat|1 - get_local $2 - f64.convert_s/i32 + local.get $2 + f64.convert_i32_s f64.const 1e6 f64.lt if call $~lib/math/NativeMathf.random - tee_local $1 + local.tee $1 f32.const 0 f32.ge - tee_local $3 + local.tee $3 if (result i32) - get_local $1 + local.get $1 f32.const 1 f32.lt else - get_local $3 + local.get $3 end if - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|1 else i32.const 0 @@ -38240,8 +38240,8 @@ f32.const nan:0x400000 i32.const 1 call $~lib/math/ipow32f - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f32.eq if i32.const 0 @@ -38254,8 +38254,8 @@ f32.const nan:0x400000 i32.const -1 call $~lib/math/ipow32f - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f32.eq if i32.const 0 @@ -38268,8 +38268,8 @@ f32.const nan:0x400000 i32.const 2 call $~lib/math/ipow32f - tee_local $1 - get_local $1 + local.tee $1 + local.get $1 f32.eq if i32.const 0 @@ -38451,8 +38451,8 @@ f64.const nan:0x8000000000000 i32.const 1 call $~lib/math/ipow64f - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.eq if i32.const 0 @@ -38465,8 +38465,8 @@ f64.const nan:0x8000000000000 i32.const -1 call $~lib/math/ipow64f - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.eq if i32.const 0 @@ -38479,8 +38479,8 @@ f64.const nan:0x8000000000000 i32.const 2 call $~lib/math/ipow64f - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.eq if i32.const 0 diff --git a/tests/compiler/std/math.untouched.wat b/tests/compiler/std/math.untouched.wat index c24aa0e3..06c64872 100644 --- a/tests/compiler/std/math.untouched.wat +++ b/tests/compiler/std/math.untouched.wat @@ -63,7 +63,7 @@ (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) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/math/js i32 (i32.const 1)) (global $std/math/INEXACT i32 (i32.const 1)) @@ -102,13 +102,13 @@ (export "table" (table $0)) (start $start) (func $~lib/builtins/isNaN (; 30 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne ) (func $~lib/builtins/isFinite (; 31 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.eq @@ -116,25 +116,25 @@ (func $std/math/eulp (; 32 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i64) (local $2 i32) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 52 i64.shr_u i64.const 2047 i64.and - i32.wrap/i64 - set_local $2 - get_local $2 + i32.wrap_i64 + local.set $2 + local.get $2 i32.eqz if - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 1023 i32.sub i32.const 52 @@ -144,133 +144,133 @@ (local $2 f64) (local $3 i32) (local $4 i32) - get_local $0 - set_local $2 - get_local $1 + local.get $0 + local.set $2 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - tee_local $3 + local.tee $3 i32.const 1023 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - set_local $1 + local.set $1 end else - get_local $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.const 53 i32.sub i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.add i32.const 53 i32.sub - tee_local $3 + local.tee $3 i32.const -1022 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - set_local $1 + local.set $1 end end end - get_local $2 + local.get $2 i64.const 1023 - get_local $1 - i64.extend_s/i32 + local.get $1 + i64.extend_i32_s i64.add i64.const 52 i64.shl - f64.reinterpret/i64 + f64.reinterpret_i64 f64.mul ) (func $std/math/ulperr (; 34 ;) (type $FFFF) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) (local $3 i32) - get_local $0 + local.get $0 call $~lib/builtins/isNaN - tee_local $3 + local.tee $3 if (result i32) - get_local $1 + local.get $1 call $~lib/builtins/isNaN else - get_local $3 + local.get $3 end if f64.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.eq if block $~lib/math/NativeMath.signbit|inlined.2 (result i32) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $0 - get_local $0 + i32.wrap_i64 + local.get $0 + local.get $0 f64.eq i32.and end i32.const 0 i32.ne block $~lib/math/NativeMath.signbit|inlined.3 (result i32) - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -278,58 +278,58 @@ i32.ne i32.eq if - get_local $2 + local.get $2 return end f64.const inf return end - get_local $0 + local.get $0 call $~lib/builtins/isFinite i32.eqz if f64.const 8988465674311579538646525e283 - get_local $0 + local.get $0 f64.copysign - set_local $0 - get_local $1 + local.set $0 + local.get $1 f64.const 0.5 f64.mul - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub i32.const 0 - get_local $1 + local.get $1 call $std/math/eulp i32.sub call $~lib/math/NativeMath.scalbn - get_local $2 + local.get $2 f64.add ) (func $std/math/check (; 35 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.eq if i32.const 1 return end - get_local $1 + local.get $1 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 call $~lib/builtins/isNaN return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $std/math/ulperr - set_local $4 - get_local $4 + local.set $4 + local.get $4 f64.abs f64.const 1.5 f64.ge @@ -340,13 +340,13 @@ i32.const 1 ) (func $~lib/builtins/isNaN (; 36 ;) (type $fi) (param $0 f32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne ) (func $~lib/builtins/isFinite (; 37 ;) (type $fi) (param $0 f32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.eq @@ -354,24 +354,24 @@ (func $std/math/eulpf (; 38 ;) (type $fi) (param $0 f32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 127 i32.sub i32.const 23 @@ -381,130 +381,130 @@ (local $2 f32) (local $3 i32) (local $4 i32) - get_local $0 - set_local $2 - get_local $1 + local.get $0 + local.set $2 + local.get $1 i32.const 127 i32.gt_s if - get_local $2 + local.get $2 f32.const 1701411834604692317316873e14 f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 127 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 127 i32.gt_s if - get_local $2 + local.get $2 f32.const 1701411834604692317316873e14 f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 127 i32.sub - tee_local $3 + local.tee $3 i32.const 127 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - set_local $1 + local.set $1 end else - get_local $1 + local.get $1 i32.const -126 i32.lt_s if - get_local $2 + local.get $2 f32.const 1.1754943508222875e-38 f32.const 16777216 f32.mul f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 126 i32.const 24 i32.sub i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const -126 i32.lt_s if - get_local $2 + local.get $2 f32.const 1.1754943508222875e-38 f32.const 16777216 f32.mul f32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 126 i32.add i32.const 24 i32.sub - tee_local $3 + local.tee $3 i32.const -126 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - set_local $1 + local.set $1 end end end - get_local $2 + local.get $2 i32.const 127 - get_local $1 + local.get $1 i32.add i32.const 23 i32.shl - f32.reinterpret/i32 + f32.reinterpret_i32 f32.mul ) (func $std/math/ulperrf (; 40 ;) (type $ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) (local $3 i32) - get_local $0 + local.get $0 call $~lib/builtins/isNaN - tee_local $3 + local.tee $3 if (result i32) - get_local $1 + local.get $1 call $~lib/builtins/isNaN else - get_local $3 + local.get $3 end if f32.const 0 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.eq if block $~lib/math/NativeMathf.signbit|inlined.2 (result i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.eq i32.and end i32.const 0 i32.ne block $~lib/math/NativeMathf.signbit|inlined.3 (result i32) - get_local $1 - i32.reinterpret/f32 + local.get $1 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.eq i32.and end @@ -512,58 +512,58 @@ i32.ne i32.eq if - get_local $2 + local.get $2 return end f32.const inf return end - get_local $0 + local.get $0 call $~lib/builtins/isFinite i32.eqz if f32.const 1701411834604692317316873e14 - get_local $0 + local.get $0 f32.copysign - set_local $0 - get_local $1 + local.set $0 + local.get $1 f32.const 0.5 f32.mul - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.sub i32.const 0 - get_local $1 + local.get $1 call $std/math/eulpf i32.sub call $~lib/math/NativeMathf.scalbn - get_local $2 + local.get $2 f32.add ) (func $std/math/check (; 41 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.eq if i32.const 1 return end - get_local $1 + local.get $1 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 call $~lib/builtins/isNaN return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $std/math/ulperrf - set_local $4 - get_local $4 + local.set $4 + local.get $4 f32.abs f32.const 1.5 f32.ge @@ -574,76 +574,76 @@ i32.const 1 ) (func $std/math/test_scalbn (; 42 ;) (type $FiFFii) (param $0 f64) (param $1 i32) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.scalbn - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $std/math/test_scalbnf (; 43 ;) (type $fiffii) (param $0 f32) (param $1 i32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.scalbn - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $std/math/test_abs (; 44 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) block $~lib/math/NativeMath.abs|inlined.0 (result f64) - get_local $0 + local.get $0 f64.abs end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/abs - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_absf (; 45 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) block $~lib/math/NativeMathf.abs|inlined.0 (result f32) - get_local $0 + local.get $0 f32.abs end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/R (; 46 ;) (type $FF) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) - get_local $0 + local.get $0 f64.const 0.16666666666666666 - get_local $0 + local.get $0 f64.const -0.3255658186224009 - get_local $0 + local.get $0 f64.const 0.20121253213486293 - get_local $0 + local.get $0 f64.const -0.04005553450067941 - get_local $0 + local.get $0 f64.const 7.915349942898145e-04 - get_local $0 + local.get $0 f64.const 3.479331075960212e-05 f64.mul f64.add @@ -656,15 +656,15 @@ f64.mul f64.add f64.mul - set_local $1 + local.set $1 f64.const 1 - get_local $0 + local.get $0 f64.const -2.403394911734414 - get_local $0 + local.get $0 f64.const 2.0209457602335057 - get_local $0 + local.get $0 f64.const -0.6882839716054533 - get_local $0 + local.get $0 f64.const 0.07703815055590194 f64.mul f64.add @@ -674,9 +674,9 @@ f64.add f64.mul f64.add - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 f64.div ) (func $~lib/math/NativeMath.acos (; 47 ;) (type $FF) (param $0 f64) (result f64) @@ -688,33 +688,33 @@ (local $6 f64) (local $7 f64) (local $8 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - set_local $3 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.set $3 + local.get $2 i32.const 1072693248 i32.sub - get_local $3 + local.get $3 i32.or i32.const 0 i32.eq if - get_local $1 + local.get $1 i32.const 31 i32.shr_u if @@ -722,7 +722,7 @@ f64.const 1.5707963267948966 f64.mul f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add return end @@ -730,32 +730,32 @@ return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1012924416 i32.le_u if f64.const 1.5707963267948966 f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add return end f64.const 1.5707963267948966 - get_local $0 + local.get $0 f64.const 6.123233995736766e-17 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -764,123 +764,123 @@ f64.sub return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.add - set_local $6 - get_local $6 + local.set $6 + local.get $6 f64.sqrt - set_local $4 - get_local $6 + local.set $4 + local.get $6 call $~lib/math/R - get_local $4 + local.get $4 f64.mul f64.const 6.123233995736766e-17 f64.sub - set_local $5 + local.set $5 f64.const 2 f64.const 1.5707963267948966 - get_local $4 - get_local $5 + local.get $4 + local.get $5 f64.add f64.sub f64.mul return end f64.const 0.5 - get_local $0 + local.get $0 f64.const 0.5 f64.mul f64.sub - set_local $6 - get_local $6 + local.set $6 + local.get $6 f64.sqrt - set_local $4 - get_local $4 - i64.reinterpret/f64 + local.set $4 + local.get $4 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $7 - get_local $6 - get_local $7 - get_local $7 + f64.reinterpret_i64 + local.set $7 + local.get $6 + local.get $7 + local.get $7 f64.mul f64.sub - get_local $4 - get_local $7 + local.get $4 + local.get $7 f64.add f64.div - set_local $8 - get_local $6 + local.set $8 + local.get $6 call $~lib/math/R - get_local $4 + local.get $4 f64.mul - get_local $8 + local.get $8 f64.add - set_local $5 + local.set $5 f64.const 2 - get_local $7 - get_local $5 + local.get $7 + local.get $5 f64.add f64.mul ) (func $std/math/test_acos (; 48 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acos - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/acos - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/Rf (; 49 ;) (type $ff) (param $0 f32) (result f32) (local $1 f32) (local $2 f32) - get_local $0 + local.get $0 f32.const 0.16666586697101593 - get_local $0 + local.get $0 f32.const -0.04274342209100723 - get_local $0 + local.get $0 f32.const -0.008656363002955914 f32.mul f32.add f32.mul f32.add f32.mul - set_local $1 + local.set $1 f32.const 1 - get_local $0 + local.get $0 f32.const -0.7066296339035034 f32.mul f32.add - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 f32.div ) (func $~lib/math/NativeMathf.acos (; 50 ;) (type $ff) (param $0 f32) (result f32) @@ -891,22 +891,22 @@ (local $5 f32) (local $6 f32) (local $7 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1065353216 i32.ge_u if - get_local $2 + local.get $2 i32.const 1065353216 i32.eq if - get_local $1 + local.get $1 i32.const 31 i32.shr_u if @@ -921,17 +921,17 @@ return end f32.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.div return end - get_local $2 + local.get $2 i32.const 1056964608 i32.lt_u if - get_local $2 + local.get $2 i32.const 847249408 i32.le_u if @@ -941,11 +941,11 @@ return end f32.const 1.570796251296997 - get_local $0 + local.get $0 f32.const 7.549789415861596e-08 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f32.mul call $~lib/math/Rf f32.mul @@ -954,81 +954,81 @@ f32.sub return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if f32.const 0.5 - get_local $0 + local.get $0 f32.const 0.5 f32.mul f32.add - set_local $3 - get_local $3 + local.set $3 + local.get $3 f32.sqrt - set_local $5 - get_local $3 + local.set $5 + local.get $3 call $~lib/math/Rf - get_local $5 + local.get $5 f32.mul f32.const 7.549789415861596e-08 f32.sub - set_local $4 + local.set $4 f32.const 2 f32.const 1.570796251296997 - get_local $5 - get_local $4 + local.get $5 + local.get $4 f32.add f32.sub f32.mul return end f32.const 0.5 - get_local $0 + local.get $0 f32.const 0.5 f32.mul f32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 f32.sqrt - set_local $5 - get_local $5 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.set $5 + local.get $5 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $6 - get_local $3 - get_local $6 - get_local $6 + f32.reinterpret_i32 + local.set $6 + local.get $3 + local.get $6 + local.get $6 f32.mul f32.sub - get_local $5 - get_local $6 + local.get $5 + local.get $6 f32.add f32.div - set_local $7 - get_local $3 + local.set $7 + local.get $3 call $~lib/math/Rf - get_local $5 + local.get $5 f32.mul - get_local $7 + local.get $7 f32.add - set_local $4 + local.set $4 f32.const 2 - get_local $6 - get_local $4 + local.get $6 + local.get $4 f32.add f32.mul ) (func $std/math/test_acosf (; 51 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.acos - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.log1p (; 52 ;) (type $FF) (param $0 f64) (result f64) @@ -1047,53 +1047,53 @@ (local $13 f64) (local $14 f64) (local $15 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 1 - set_local $3 + local.set $3 f64.const 0 - set_local $4 + local.set $4 f64.const 0 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 1071284858 i32.lt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $2 + local.get $2 i32.const -1074790400 i32.ge_u if - get_local $0 + local.get $0 f64.const -1 f64.eq if - get_local $0 + local.get $0 f64.const 0 f64.div return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl i32.const 1017118720 @@ -1101,145 +1101,145 @@ i32.shl i32.lt_u if - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 i32.const -1076707644 i32.le_u if i32.const 0 - set_local $3 + local.set $3 f64.const 0 - set_local $4 - get_local $0 - set_local $5 + local.set $4 + local.get $0 + local.set $5 end else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return end end - get_local $3 + local.get $3 if f64.const 1 - get_local $0 + local.get $0 f64.add - i64.reinterpret/f64 - set_local $1 - get_local $1 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $6 + i32.wrap_i64 + local.set $6 + local.get $6 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 20 i32.shr_u i32.const 1023 i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 54 i32.lt_s if - get_local $1 - f64.reinterpret/i64 - set_local $7 - get_local $3 + local.get $1 + f64.reinterpret_i64 + local.set $7 + local.get $3 i32.const 2 i32.ge_s if (result f64) f64.const 1 - get_local $7 - get_local $0 + local.get $7 + local.get $0 f64.sub f64.sub else - get_local $0 - get_local $7 + local.get $0 + local.get $7 f64.const 1 f64.sub f64.sub end - set_local $4 - get_local $4 - get_local $7 + local.set $4 + local.get $4 + local.get $7 f64.div - set_local $4 + local.set $4 else f64.const 0 - set_local $4 + local.set $4 end - get_local $6 + local.get $6 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $6 - get_local $6 - i64.extend_u/i32 + local.set $6 + local.get $6 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 + local.set $1 + local.get $1 + f64.reinterpret_i64 f64.const 1 f64.sub - set_local $5 + local.set $5 end f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $8 - get_local $5 + local.set $8 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f64.mul - set_local $10 - get_local $10 - get_local $10 + local.set $10 + local.get $10 + local.get $10 f64.mul - set_local $11 - get_local $11 + local.set $11 + local.get $11 f64.const 0.3999999999940942 - get_local $11 + local.get $11 f64.const 0.22222198432149784 - get_local $11 + local.get $11 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $12 - get_local $10 + local.set $12 + local.get $10 f64.const 0.6666666666666735 - get_local $11 + local.get $11 f64.const 0.2857142874366239 - get_local $11 + local.get $11 f64.const 0.1818357216161805 - get_local $11 + local.get $11 f64.const 0.14798198605116586 f64.mul f64.add @@ -1248,30 +1248,30 @@ f64.mul f64.add f64.mul - set_local $13 - get_local $13 - get_local $12 + local.set $13 + local.get $13 + local.get $12 f64.add - set_local $14 - get_local $3 - f64.convert_s/i32 - set_local $15 - get_local $9 - get_local $8 - get_local $14 + local.set $14 + local.get $3 + f64.convert_i32_s + local.set $15 + local.get $9 + local.get $8 + local.get $14 f64.add f64.mul - get_local $15 + local.get $15 f64.const 1.9082149292705877e-10 f64.mul - get_local $4 + local.get $4 f64.add f64.add - get_local $8 + local.get $8 f64.sub - get_local $5 + local.get $5 f64.add - get_local $15 + local.get $15 f64.const 0.6931471803691238 f64.mul f64.add @@ -1290,88 +1290,88 @@ (local $11 f64) (local $12 f64) (local $13 i32) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -1379,81 +1379,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -1462,60 +1462,60 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $3 - set_local $13 - get_local $7 - get_local $6 - get_local $12 + local.set $12 + local.get $3 + local.set $13 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul - get_local $13 - f64.convert_s/i32 + local.get $13 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul f64.add - get_local $6 + local.get $6 f64.sub - get_local $5 + local.get $5 f64.add - get_local $13 - f64.convert_s/i32 + local.get $13 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add ) (func $~lib/math/NativeMath.acosh (; 54 ;) (type $FF) (param $0 f64) (result f64) (local $1 i64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i64.const 1023 i64.const 1 i64.add i64.lt_u if - get_local $0 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.sub f64.mul f64.const 2 - get_local $0 + local.get $0 f64.const 1 f64.sub f64.mul @@ -1525,19 +1525,19 @@ call $~lib/math/NativeMath.log1p return end - get_local $1 + local.get $1 i64.const 1023 i64.const 26 i64.add i64.lt_u if f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f64.mul f64.const 1 f64.sub @@ -1548,36 +1548,36 @@ call $~lib/math/NativeMath.log return end - get_local $0 + local.get $0 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add ) (func $std/math/test_acosh (; 55 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.acosh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/acosh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.log1p (; 56 ;) (type $ff) (param $0 f32) (result f32) @@ -1595,48 +1595,48 @@ (local $12 f32) (local $13 f32) (local $14 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 f32.const 0 - set_local $2 + local.set $2 f32.const 0 - set_local $3 + local.set $3 i32.const 1 - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 1054086096 i32.lt_u - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $1 + local.get $1 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i32.const -1082130432 i32.ge_u if - get_local $0 + local.get $0 f32.const -1 f32.eq if - get_local $0 + local.get $0 f32.const 0 f32.div return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end - get_local $1 + local.get $1 i32.const 1 i32.shl i32.const 864026624 @@ -1644,150 +1644,150 @@ i32.shl i32.lt_u if - get_local $0 + local.get $0 return end - get_local $1 + local.get $1 i32.const -1097468391 i32.le_u if i32.const 0 - set_local $4 + local.set $4 f32.const 0 - set_local $2 - get_local $0 - set_local $3 + local.set $2 + local.get $0 + local.set $3 end else - get_local $1 + local.get $1 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return end end - get_local $4 + local.get $4 if f32.const 1 - get_local $0 + local.get $0 f32.add - set_local $6 - get_local $6 - i32.reinterpret/f32 - set_local $5 - get_local $5 + local.set $6 + local.get $6 + i32.reinterpret_f32 + local.set $5 + local.get $5 i32.const 1065353216 i32.const 1060439283 i32.sub i32.add - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 23 i32.shr_u i32.const 127 i32.sub - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 25 i32.lt_s if - get_local $4 + local.get $4 i32.const 2 i32.ge_s if (result f32) f32.const 1 - get_local $6 - get_local $0 + local.get $6 + local.get $0 f32.sub f32.sub else - get_local $0 - get_local $6 + local.get $0 + local.get $6 f32.const 1 f32.sub f32.sub end - set_local $2 - get_local $2 - get_local $6 + local.set $2 + local.get $2 + local.get $6 f32.div - set_local $2 + local.set $2 else f32.const 0 - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i32.const 8388607 i32.and i32.const 1060439283 i32.add - set_local $5 - get_local $5 - f32.reinterpret/i32 + local.set $5 + local.get $5 + f32.reinterpret_i32 f32.const 1 f32.sub - set_local $3 + local.set $3 end - get_local $3 + local.get $3 f32.const 2 - get_local $3 + local.get $3 f32.add f32.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f32.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f32.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f32.const 0.40000972151756287 - get_local $9 + local.get $9 f32.const 0.24279078841209412 f32.mul f32.add f32.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f32.const 0.6666666269302368 - get_local $9 + local.get $9 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f32.add - set_local $12 + local.set $12 f32.const 0.5 - get_local $3 + local.get $3 f32.mul - get_local $3 + local.get $3 f32.mul - set_local $13 - get_local $4 - f32.convert_s/i32 - set_local $14 - get_local $7 - get_local $13 - get_local $12 + 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 - get_local $14 + local.get $14 f32.const 9.05800061445916e-06 f32.mul - get_local $2 + local.get $2 f32.add f32.add - get_local $13 + local.get $13 f32.sub - get_local $3 + local.get $3 f32.add - get_local $14 + local.get $14 f32.const 0.6931381225585938 f32.mul f32.add @@ -1805,67 +1805,67 @@ (local $10 f32) (local $11 f32) (local $12 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 i32.const 0 - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388608 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $1 + local.get $1 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i32.const 1 i32.shl i32.const 0 i32.eq if f32.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul f32.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end - get_local $2 + local.get $2 i32.const 25 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 f32.const 33554432 f32.mul - set_local $0 - get_local $0 - i32.reinterpret/f32 - set_local $1 + local.set $0 + local.get $0 + i32.reinterpret_f32 + local.set $1 else - get_local $1 + local.get $1 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1065353216 i32.eq if @@ -1874,90 +1874,90 @@ end end end - get_local $1 + local.get $1 i32.const 1065353216 i32.const 1060439283 i32.sub i32.add - set_local $1 - get_local $2 - get_local $1 + local.set $1 + local.get $2 + local.get $1 i32.const 23 i32.shr_s i32.const 127 i32.sub i32.add - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388607 i32.and i32.const 1060439283 i32.add - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $0 f32.const 1 f32.sub - set_local $4 - get_local $4 + local.set $4 + local.get $4 f32.const 2 - get_local $4 + local.get $4 f32.add f32.div - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f32.mul - set_local $6 - get_local $6 - get_local $6 + local.set $6 + local.get $6 + local.get $6 f32.mul - set_local $7 - get_local $7 + local.set $7 + local.get $7 f32.const 0.40000972151756287 - get_local $7 + local.get $7 f32.const 0.24279078841209412 f32.mul f32.add f32.mul - set_local $8 - get_local $6 + local.set $8 + local.get $6 f32.const 0.6666666269302368 - get_local $7 + local.get $7 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - set_local $9 - get_local $9 - get_local $8 + local.set $9 + local.get $9 + local.get $8 f32.add - set_local $10 + local.set $10 f32.const 0.5 - get_local $4 + local.get $4 f32.mul - get_local $4 + local.get $4 f32.mul - set_local $11 - get_local $2 - f32.convert_s/i32 - set_local $12 - get_local $5 - get_local $11 - get_local $10 + local.set $11 + local.get $2 + f32.convert_i32_s + local.set $12 + local.get $5 + local.get $11 + local.get $10 f32.add f32.mul - get_local $12 + local.get $12 f32.const 9.05800061445916e-06 f32.mul f32.add - get_local $11 + local.get $11 f32.sub - get_local $4 + local.get $4 f32.add - get_local $12 + local.get $12 f32.const 0.6931381225585938 f32.mul f32.add @@ -1966,14 +1966,14 @@ (local $1 i32) (local $2 i32) (local $3 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1065353216 i32.const 1 i32.const 23 @@ -1981,13 +1981,13 @@ i32.add i32.lt_u if - get_local $0 + local.get $0 f32.const 1 f32.sub - set_local $3 - get_local $3 - get_local $3 - get_local $3 + local.set $3 + local.get $3 + local.get $3 + local.get $3 f32.const 2 f32.add f32.mul @@ -1996,7 +1996,7 @@ call $~lib/math/NativeMathf.log1p return end - get_local $2 + local.get $2 i32.const 1065353216 i32.const 12 i32.const 23 @@ -2005,12 +2005,12 @@ i32.lt_u if f32.const 2 - get_local $0 + local.get $0 f32.mul f32.const 1 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 f32.mul f32.const 1 f32.sub @@ -2021,17 +2021,17 @@ call $~lib/math/NativeMathf.log return end - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log f32.const 0.6931471824645996 f32.add ) (func $std/math/test_acoshf (; 59 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.acosh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.asin (; 60 ;) (type $FF) (param $0 f64) (result f64) @@ -2043,70 +2043,70 @@ (local $6 f64) (local $7 f64) (local $8 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1072693248 i32.ge_u if - get_local $0 - i64.reinterpret/f64 - i32.wrap/i64 - set_local $3 - get_local $2 + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.set $3 + local.get $2 i32.const 1072693248 i32.sub - get_local $3 + local.get $3 i32.or i32.const 0 i32.eq if - get_local $0 + local.get $0 f64.const 1.5707963267948966 f64.mul f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add return end f64.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.div return end - get_local $2 + local.get $2 i32.const 1071644672 i32.lt_u if - get_local $2 + local.get $2 i32.const 1045430272 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $2 + local.get $2 i32.const 1048576 i32.ge_u else - get_local $3 + local.get $3 end if - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f64.mul call $~lib/math/R f64.mul @@ -2114,62 +2114,62 @@ return end f64.const 0.5 - get_local $0 + local.get $0 f64.abs f64.const 0.5 f64.mul f64.sub - set_local $4 - get_local $4 + local.set $4 + local.get $4 f64.sqrt - set_local $5 - get_local $4 + local.set $5 + local.get $4 call $~lib/math/R - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 1072640819 i32.ge_u if f64.const 1.5707963267948966 f64.const 2 - get_local $5 - get_local $5 - get_local $6 + local.get $5 + local.get $5 + local.get $6 f64.mul f64.add f64.mul f64.const 6.123233995736766e-17 f64.sub f64.sub - set_local $0 + local.set $0 else - get_local $5 - i64.reinterpret/f64 + local.get $5 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $7 - get_local $4 - get_local $7 - get_local $7 + f64.reinterpret_i64 + local.set $7 + local.get $4 + local.get $7 + local.get $7 f64.mul f64.sub - get_local $5 - get_local $7 + local.get $5 + local.get $7 f64.add f64.div - set_local $8 + local.set $8 f64.const 0.5 f64.const 1.5707963267948966 f64.mul f64.const 2 - get_local $5 + local.get $5 f64.mul - get_local $6 + local.get $6 f64.mul f64.const 6.123233995736766e-17 f64.const 2 - get_local $8 + local.get $8 f64.mul f64.sub f64.sub @@ -2177,48 +2177,48 @@ f64.const 1.5707963267948966 f64.mul f64.const 2 - get_local $7 + local.get $7 f64.mul f64.sub f64.sub f64.sub - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 + local.get $0 f64.neg return end - get_local $0 + local.get $0 ) (func $std/math/test_asin (; 61 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asin - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/asin - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.asin (; 62 ;) (type $ff) (param $0 f32) (result f32) @@ -2227,22 +2227,22 @@ (local $3 i32) (local $4 f32) (local $5 f64) - get_local $0 - set_local $1 - get_local $0 - i32.reinterpret/f32 + local.get $0 + local.set $1 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1065353216 i32.ge_u if - get_local $2 + local.get $2 i32.const 1065353216 i32.eq if - get_local $0 + local.get $0 f32.const 1.5707963705062866 f32.mul f32.const 7.52316384526264e-37 @@ -2250,35 +2250,35 @@ return end f32.const 0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.div return end - get_local $2 + local.get $2 i32.const 1056964608 i32.lt_u if - get_local $2 + local.get $2 i32.const 964689920 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $2 + local.get $2 i32.const 8388608 i32.ge_u else - get_local $3 + local.get $3 end if - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f32.mul call $~lib/math/Rf f32.mul @@ -2286,108 +2286,108 @@ return end f32.const 0.5 - get_local $0 + local.get $0 f32.abs f32.const 0.5 f32.mul f32.sub - set_local $4 - get_local $4 - f64.promote/f32 + local.set $4 + local.get $4 + f64.promote_f32 f64.sqrt - set_local $5 + local.set $5 f32.const 1.5707963705062866 - f64.promote/f32 + f64.promote_f32 f32.const 2 - f64.promote/f32 - get_local $5 - get_local $5 - get_local $4 + f64.promote_f32 + local.get $5 + local.get $5 + local.get $4 call $~lib/math/Rf - f64.promote/f32 + f64.promote_f32 f64.mul f64.add f64.mul f64.sub - f32.demote/f64 - set_local $0 - get_local $0 - get_local $1 + f32.demote_f64 + local.set $0 + local.get $0 + local.get $1 f32.copysign ) (func $std/math/test_asinf (; 63 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.asin - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.asinh (; 64 ;) (type $FF) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i64.const 9223372036854775807 i64.and - f64.reinterpret/i64 - set_local $3 - get_local $2 + f64.reinterpret_i64 + local.set $3 + local.get $2 i64.const 1023 i64.const 26 i64.add i64.ge_u if - get_local $3 + local.get $3 call $~lib/math/NativeMath.log f64.const 0.6931471805599453 f64.add - set_local $3 + local.set $3 else - get_local $2 + local.get $2 i64.const 1023 i64.const 1 i64.add i64.ge_u if f64.const 2 - get_local $3 + local.get $3 f64.mul f64.const 1 - get_local $3 - get_local $3 + local.get $3 + local.get $3 f64.mul f64.const 1 f64.add f64.sqrt - get_local $3 + local.get $3 f64.add f64.div f64.add call $~lib/math/NativeMath.log - set_local $3 + local.set $3 else - get_local $2 + local.get $2 i64.const 1023 i64.const 26 i64.sub i64.ge_u if - get_local $3 - get_local $3 - get_local $3 + local.get $3 + local.get $3 + local.get $3 f64.mul - get_local $3 - get_local $3 + local.get $3 + local.get $3 f64.mul f64.const 1 f64.add @@ -2397,53 +2397,53 @@ f64.div f64.add call $~lib/math/NativeMath.log1p - set_local $3 + local.set $3 end end end - get_local $3 - get_local $0 + local.get $3 + local.get $0 f64.copysign ) (func $std/math/test_asinh (; 65 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.asinh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/asinh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.asinh (; 66 ;) (type $ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $2 - get_local $1 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 + local.get $1 i32.const 1065353216 i32.const 12 i32.const 23 @@ -2451,13 +2451,13 @@ i32.add i32.ge_u if - get_local $2 + local.get $2 call $~lib/math/NativeMathf.log f32.const 0.6931471824645996 f32.add - set_local $2 + local.set $2 else - get_local $1 + local.get $1 i32.const 1065353216 i32.const 1 i32.const 23 @@ -2466,23 +2466,23 @@ i32.ge_u if f32.const 2 - get_local $2 + local.get $2 f32.mul f32.const 1 - get_local $2 - get_local $2 + local.get $2 + local.get $2 f32.mul f32.const 1 f32.add f32.sqrt - get_local $2 + local.get $2 f32.add f32.div f32.add call $~lib/math/NativeMathf.log - set_local $2 + local.set $2 else - get_local $1 + local.get $1 i32.const 1065353216 i32.const 12 i32.const 23 @@ -2490,12 +2490,12 @@ i32.sub i32.ge_u if - get_local $2 - get_local $2 - get_local $2 + local.get $2 + local.get $2 + local.get $2 f32.mul - get_local $2 - get_local $2 + local.get $2 + local.get $2 f32.mul f32.const 1 f32.add @@ -2505,20 +2505,20 @@ f32.div f32.add call $~lib/math/NativeMathf.log1p - set_local $2 + local.set $2 end end end - get_local $2 - get_local $0 + local.get $2 + local.get $0 f32.copysign ) (func $std/math/test_asinhf (; 67 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.asinh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.atan (; 68 ;) (type $FF) (param $0 f64) (result f64) @@ -2531,133 +2531,133 @@ (local $7 f64) (local $8 f64) (local $9 i32) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $0 - set_local $2 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $0 + local.set $2 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1141899264 i32.ge_u if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 return end f64.const 1.5707963267948966 f32.const 7.52316384526264e-37 - f64.promote/f32 + f64.promote_f32 f64.add - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 f64.copysign return end - get_local $1 + local.get $1 i32.const 1071382528 i32.lt_u if - get_local $1 + local.get $1 i32.const 1044381696 i32.lt_u if - get_local $0 + local.get $0 return end i32.const -1 - set_local $4 + local.set $4 else - get_local $0 + local.get $0 f64.abs - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1072889856 i32.lt_u if - get_local $1 + local.get $1 i32.const 1072037888 i32.lt_u if i32.const 0 - set_local $4 + local.set $4 f64.const 2 - get_local $0 + local.get $0 f64.mul f64.const 1 f64.sub f64.const 2 - get_local $0 + local.get $0 f64.add f64.div - set_local $0 + local.set $0 else i32.const 1 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 1 f64.sub - get_local $0 + local.get $0 f64.const 1 f64.add f64.div - set_local $0 + local.set $0 end else - get_local $1 + local.get $1 i32.const 1073971200 i32.lt_u if i32.const 2 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f64.const 1.5 f64.sub f64.const 1 f64.const 1.5 - get_local $0 + local.get $0 f64.mul f64.add f64.div - set_local $0 + local.set $0 else i32.const 3 - set_local $4 + local.set $4 f64.const -1 - get_local $0 + local.get $0 f64.div - set_local $0 + local.set $0 end end end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - set_local $3 - get_local $3 - get_local $3 + local.set $3 + local.get $3 + local.get $3 f64.mul - set_local $5 - get_local $3 + local.set $5 + local.get $3 f64.const 0.3333333333333293 - get_local $5 + local.get $5 f64.const 0.14285714272503466 - get_local $5 + local.get $5 f64.const 0.09090887133436507 - get_local $5 + local.get $5 f64.const 0.06661073137387531 - get_local $5 + local.get $5 f64.const 0.049768779946159324 - get_local $5 + local.get $5 f64.const 0.016285820115365782 f64.mul f64.add @@ -2670,16 +2670,16 @@ f64.mul f64.add f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const -0.19999999999876483 - get_local $5 + local.get $5 f64.const -0.11111110405462356 - get_local $5 + local.get $5 f64.const -0.0769187620504483 - get_local $5 + local.get $5 f64.const -0.058335701337905735 - get_local $5 + local.get $5 f64.const -0.036531572744216916 f64.mul f64.add @@ -2690,19 +2690,19 @@ f64.mul f64.add f64.mul - set_local $7 - get_local $0 - get_local $6 - get_local $7 + local.set $7 + local.get $0 + local.get $6 + local.get $7 f64.add f64.mul - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 0 i32.lt_s if - get_local $0 - get_local $8 + local.get $0 + local.get $8 f64.sub return end @@ -2712,21 +2712,21 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $4 - set_local $9 - get_local $9 + local.get $4 + local.set $9 + local.get $9 i32.const 0 i32.eq br_if $case0|0 - get_local $9 + local.get $9 i32.const 1 i32.eq br_if $case1|0 - get_local $9 + local.get $9 i32.const 2 i32.eq br_if $case2|0 - get_local $9 + local.get $9 i32.const 3 i32.eq br_if $case3|0 @@ -2734,13 +2734,13 @@ end block f64.const 0.4636476090008061 - get_local $8 + local.get $8 f64.const 2.2698777452961687e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -2748,13 +2748,13 @@ end block f64.const 0.7853981633974483 - get_local $8 + local.get $8 f64.const 3.061616997868383e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -2762,13 +2762,13 @@ end block f64.const 0.982793723247329 - get_local $8 + local.get $8 f64.const 1.3903311031230998e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -2776,13 +2776,13 @@ end block f64.const 1.5707963267948966 - get_local $8 + local.get $8 f64.const 6.123233995736766e-17 f64.sub - get_local $0 + local.get $0 f64.sub f64.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -2790,35 +2790,35 @@ end unreachable end - get_local $3 - get_local $2 + local.get $3 + local.get $2 f64.copysign ) (func $std/math/test_atan (; 69 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/atan - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.atan (; 70 ;) (type $ff) (param $0 f32) (result f32) @@ -2831,150 +2831,150 @@ (local $7 f32) (local $8 f32) (local $9 i32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $0 - set_local $2 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $0 + local.set $2 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1283457024 i32.ge_u if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 return end f32.const 1.570796251296997 f32.const 7.52316384526264e-37 f32.add - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 f32.copysign return end - get_local $1 + local.get $1 i32.const 1054867456 i32.lt_u if - get_local $1 + local.get $1 i32.const 964689920 i32.lt_u if - get_local $0 + local.get $0 return end i32.const -1 - set_local $4 + local.set $4 else - get_local $0 + local.get $0 f32.abs - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1066926080 i32.lt_u if - get_local $1 + local.get $1 i32.const 1060110336 i32.lt_u if i32.const 0 - set_local $4 + local.set $4 f32.const 2 - get_local $0 + local.get $0 f32.mul f32.const 1 f32.sub f32.const 2 - get_local $0 + local.get $0 f32.add f32.div - set_local $0 + local.set $0 else i32.const 1 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f32.const 1 f32.sub - get_local $0 + local.get $0 f32.const 1 f32.add f32.div - set_local $0 + local.set $0 end else - get_local $1 + local.get $1 i32.const 1075576832 i32.lt_u if i32.const 2 - set_local $4 - get_local $0 + local.set $4 + local.get $0 f32.const 1.5 f32.sub f32.const 1 f32.const 1.5 - get_local $0 + local.get $0 f32.mul f32.add f32.div - set_local $0 + local.set $0 else i32.const 3 - set_local $4 + local.set $4 f32.const -1 - get_local $0 + local.get $0 f32.div - set_local $0 + local.set $0 end end end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul - set_local $3 - get_local $3 - get_local $3 + local.set $3 + local.get $3 + local.get $3 f32.mul - set_local $5 - get_local $3 + local.set $5 + local.get $3 f32.const 0.333333283662796 - get_local $5 + local.get $5 f32.const 0.14253635704517365 - get_local $5 + local.get $5 f32.const 0.06168760731816292 f32.mul f32.add f32.mul f32.add f32.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f32.const -0.19999158382415771 - get_local $5 + local.get $5 f32.const -0.106480173766613 f32.mul f32.add f32.mul - set_local $7 - get_local $0 - get_local $6 - get_local $7 + local.set $7 + local.get $0 + local.get $6 + local.get $7 f32.add f32.mul - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 0 i32.lt_s if - get_local $0 - get_local $8 + local.get $0 + local.get $8 f32.sub return end @@ -2984,21 +2984,21 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $4 - set_local $9 - get_local $9 + local.get $4 + local.set $9 + local.get $9 i32.const 0 i32.eq br_if $case0|0 - get_local $9 + local.get $9 i32.const 1 i32.eq br_if $case1|0 - get_local $9 + local.get $9 i32.const 2 i32.eq br_if $case2|0 - get_local $9 + local.get $9 i32.const 3 i32.eq br_if $case3|0 @@ -3006,13 +3006,13 @@ end block f32.const 0.46364760398864746 - get_local $8 + local.get $8 f32.const 5.01215824399992e-09 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -3020,13 +3020,13 @@ end block f32.const 0.7853981256484985 - get_local $8 + local.get $8 f32.const 3.774894707930798e-08 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -3034,13 +3034,13 @@ end block f32.const 0.9827936887741089 - get_local $8 + local.get $8 f32.const 3.447321716976148e-08 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -3048,13 +3048,13 @@ end block f32.const 1.570796251296997 - get_local $8 + local.get $8 f32.const 7.549789415861596e-08 f32.sub - get_local $0 + local.get $0 f32.sub f32.sub - set_local $3 + local.set $3 br $break|0 unreachable end @@ -3062,16 +3062,16 @@ end unreachable end - get_local $3 - get_local $2 + local.get $3 + local.get $2 f32.copysign ) (func $std/math/test_atanf (; 71 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.atan - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.atanh (; 72 ;) (type $FF) (param $0 f64) (result f64) @@ -3079,33 +3079,33 @@ (local $2 i64) (local $3 i64) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i64.const 63 i64.shr_u - set_local $3 - get_local $1 + local.set $3 + local.get $1 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $4 - get_local $2 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $4 + local.get $2 i64.const 1023 i64.const 1 i64.sub i64.lt_u if - get_local $2 + local.get $2 i64.const 1023 i64.const 32 i64.sub @@ -3113,80 +3113,80 @@ if f64.const 0.5 f64.const 2 - get_local $4 + local.get $4 f64.mul f64.const 2 - get_local $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.mul f64.const 1 - get_local $4 + local.get $4 f64.sub f64.div f64.add call $~lib/math/NativeMath.log1p f64.mul - set_local $4 + local.set $4 end else f64.const 0.5 f64.const 2 - get_local $4 + local.get $4 f64.const 1 - get_local $4 + local.get $4 f64.sub f64.div f64.mul call $~lib/math/NativeMath.log1p f64.mul - set_local $4 + local.set $4 end - get_local $4 - get_local $0 + local.get $4 + local.get $0 f64.copysign ) (func $std/math/test_atanh (; 73 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.atanh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/atanh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.atanh (; 74 ;) (type $ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $2 - get_local $1 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 + local.get $1 i32.const 1065353216 i32.const 1 i32.const 23 @@ -3194,7 +3194,7 @@ i32.sub i32.lt_u if - get_local $1 + local.get $1 i32.const 1065353216 i32.const 32 i32.const 23 @@ -3204,43 +3204,43 @@ if f32.const 0.5 f32.const 2 - get_local $2 + local.get $2 f32.mul f32.const 1 - get_local $2 + local.get $2 f32.const 1 - get_local $2 + local.get $2 f32.sub f32.div f32.add f32.mul call $~lib/math/NativeMathf.log1p f32.mul - set_local $2 + local.set $2 end else f32.const 0.5 f32.const 2 - get_local $2 + local.get $2 f32.const 1 - get_local $2 + local.get $2 f32.sub f32.div f32.mul call $~lib/math/NativeMathf.log1p f32.mul - set_local $2 + local.set $2 end - get_local $2 - get_local $0 + local.get $2 + local.get $0 f32.copysign ) (func $std/math/test_atanhf (; 75 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.atanh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.atan2 (; 76 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -3252,77 +3252,77 @@ (local $7 i32) (local $8 i32) (local $9 f64) - get_local $1 + local.get $1 call $~lib/builtins/isNaN - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 + local.get $0 call $~lib/builtins/isNaN end if - get_local $1 - get_local $0 + local.get $1 + local.get $0 f64.add return end - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $3 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $3 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $3 - i32.wrap/i64 - set_local $5 - get_local $0 - i64.reinterpret/f64 - set_local $3 - get_local $3 + i32.wrap_i64 + local.set $4 + local.get $3 + i32.wrap_i64 + local.set $5 + local.get $0 + i64.reinterpret_f64 + local.set $3 + local.get $3 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $3 - i32.wrap/i64 - set_local $7 - get_local $4 + i32.wrap_i64 + local.set $6 + local.get $3 + i32.wrap_i64 + local.set $7 + local.get $4 i32.const 1072693248 i32.sub - get_local $5 + local.get $5 i32.or i32.const 0 i32.eq if - get_local $0 + local.get $0 call $~lib/math/NativeMath.atan return end - get_local $6 + local.get $6 i32.const 31 i32.shr_u i32.const 1 i32.and - get_local $4 + local.get $4 i32.const 30 i32.shr_u i32.const 2 i32.and i32.or - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 2147483647 i32.and - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2147483647 i32.and - set_local $6 - get_local $6 - get_local $7 + local.set $6 + local.get $6 + local.get $7 i32.or i32.const 0 i32.eq @@ -3332,64 +3332,64 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|0 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|0 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|0 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|0 br $break|0 end end - get_local $0 + local.get $0 return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg return end end - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.or i32.const 0 i32.eq if - get_local $8 + local.get $8 i32.const 1 i32.and if (result f64) - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg f64.const 2 f64.div else - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.const 2 f64.div end return end - get_local $4 + local.get $4 i32.const 2146435072 i32.eq if - get_local $6 + local.get $6 i32.const 2146435072 i32.eq if @@ -3398,46 +3398,46 @@ block $case2|1 block $case1|1 block $case0|1 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|1 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|1 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|1 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|1 br $break|1 end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.const 4 f64.div return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg f64.const 4 f64.div return end f64.const 3 - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.mul f64.const 4 f64.div return end f64.const -3 - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.mul f64.const 4 f64.div @@ -3449,21 +3449,21 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|2 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|2 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|2 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|2 @@ -3475,115 +3475,115 @@ f64.const -0 return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI return end - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg return end end end - get_local $4 + local.get $4 i32.const 64 i32.const 20 i32.shl i32.add - get_local $6 + local.get $6 i32.lt_u - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $6 + local.get $6 i32.const 2146435072 i32.eq end if - get_local $8 + local.get $8 i32.const 1 i32.and if (result f64) - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.neg f64.const 2 f64.div else - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.const 2 f64.div end return end - get_local $8 + local.get $8 i32.const 2 i32.and - tee_local $2 + local.tee $2 if (result i32) - get_local $6 + local.get $6 i32.const 64 i32.const 20 i32.shl i32.add - get_local $4 + local.get $4 i32.lt_u else - get_local $2 + local.get $2 end if f64.const 0 - set_local $9 + local.set $9 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.div f64.abs call $~lib/math/NativeMath.atan - set_local $9 + local.set $9 end block $break|3 block $case3|3 block $case2|3 block $case1|3 block $case0|3 - get_local $8 - set_local $2 - get_local $2 + local.get $8 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|3 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|3 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|3 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|3 br $break|3 end - get_local $9 + local.get $9 return end - get_local $9 + local.get $9 f64.neg return end - get_global $~lib/math/NativeMath.PI - get_local $9 + global.get $~lib/math/NativeMath.PI + local.get $9 f64.const 1.2246467991473532e-16 f64.sub f64.sub return end - get_local $9 + local.get $9 f64.const 1.2246467991473532e-16 f64.sub - get_global $~lib/math/NativeMath.PI + global.get $~lib/math/NativeMath.PI f64.sub return end @@ -3592,31 +3592,31 @@ ) (func $std/math/test_atan2 (; 77 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.atan2 - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/atan2 - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check end else - get_local $5 + local.get $5 end ) (func $~lib/math/NativeMathf.atan2 (; 78 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -3625,56 +3625,56 @@ (local $4 i32) (local $5 i32) (local $6 f32) - get_local $1 + local.get $1 call $~lib/builtins/isNaN - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 + local.get $0 call $~lib/builtins/isNaN end if - get_local $1 - get_local $0 + local.get $1 + local.get $0 f32.add return end - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $0 - i32.reinterpret/f32 - set_local $4 - get_local $3 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $0 + i32.reinterpret_f32 + local.set $4 + local.get $3 i32.const 1065353216 i32.eq if - get_local $0 + local.get $0 call $~lib/math/NativeMathf.atan return end - get_local $4 + local.get $4 i32.const 31 i32.shr_u i32.const 1 i32.and - get_local $3 + local.get $3 i32.const 30 i32.shr_u i32.const 2 i32.and i32.or - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 2147483647 i32.and - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 2147483647 i32.and - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 0 i32.eq if @@ -3683,28 +3683,28 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $5 - set_local $2 - get_local $2 + local.get $5 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|0 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|0 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|0 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|0 br $break|0 end end - get_local $0 + local.get $0 return end f32.const 3.1415927410125732 @@ -3715,11 +3715,11 @@ return end end - get_local $3 + local.get $3 i32.const 0 i32.eq if - get_local $5 + local.get $5 i32.const 1 i32.and if (result f32) @@ -3734,11 +3734,11 @@ end return end - get_local $3 + local.get $3 i32.const 2139095040 i32.eq if - get_local $4 + local.get $4 i32.const 2139095040 i32.eq if @@ -3747,21 +3747,21 @@ block $case2|1 block $case1|1 block $case0|1 - get_local $5 - set_local $2 - get_local $2 + local.get $5 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|1 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|1 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|1 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|1 @@ -3798,21 +3798,21 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $5 - set_local $2 - get_local $2 + local.get $5 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|2 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|2 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|2 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|2 @@ -3833,23 +3833,23 @@ end end end - get_local $3 + local.get $3 i32.const 26 i32.const 23 i32.shl i32.add - get_local $4 + local.get $4 i32.lt_u - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $4 + local.get $4 i32.const 2139095040 i32.eq end if - get_local $5 + local.get $5 i32.const 1 i32.and if (result f32) @@ -3864,72 +3864,72 @@ end return end - get_local $5 + local.get $5 i32.const 2 i32.and - tee_local $2 + local.tee $2 if (result i32) - get_local $4 + local.get $4 i32.const 26 i32.const 23 i32.shl i32.add - get_local $3 + local.get $3 i32.lt_u else - get_local $2 + local.get $2 end if f32.const 0 - set_local $6 + local.set $6 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.div f32.abs call $~lib/math/NativeMathf.atan - set_local $6 + local.set $6 end block $break|3 block $case3|3 block $case2|3 block $case1|3 block $case0|3 - get_local $5 - set_local $2 - get_local $2 + local.get $5 + local.set $2 + local.get $2 i32.const 0 i32.eq br_if $case0|3 - get_local $2 + local.get $2 i32.const 1 i32.eq br_if $case1|3 - get_local $2 + local.get $2 i32.const 2 i32.eq br_if $case2|3 - get_local $2 + local.get $2 i32.const 3 i32.eq br_if $case3|3 br $break|3 end - get_local $6 + local.get $6 return end - get_local $6 + local.get $6 f32.neg return end f32.const 3.1415927410125732 - get_local $6 + local.get $6 f32.const -8.742277657347586e-08 f32.sub f32.sub return end - get_local $6 + local.get $6 f32.const -8.742277657347586e-08 f32.sub f32.const 3.1415927410125732 @@ -3940,12 +3940,12 @@ f32.const 0 ) (func $std/math/test_atan2f (; 79 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.atan2 - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $~lib/math/NativeMath.cbrt (; 80 ;) (type $FF) (param $0 f64) (result f64) @@ -3954,169 +3954,169 @@ (local $3 f64) (local $4 f64) (local $5 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.add return end - get_local $2 + local.get $2 i32.const 1048576 i32.lt_u if - get_local $0 + local.get $0 f64.const 18014398509481984 f64.mul - i64.reinterpret/f64 - set_local $1 - get_local $1 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 + i32.wrap_i64 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.eq if - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 i32.const 3 i32.div_u i32.const 696219795 i32.add - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const 3 i32.div_u i32.const 715094163 i32.add - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i64.const 1 i64.const 63 i64.shl i64.and - set_local $1 - get_local $1 - get_local $2 - i64.extend_u/i32 + local.set $1 + local.get $1 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $3 - get_local $3 - get_local $3 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $3 + local.get $3 + local.get $3 f64.mul - get_local $3 - get_local $0 + local.get $3 + local.get $0 f64.div f64.mul - set_local $4 - get_local $3 + local.set $4 + local.get $3 f64.const 1.87595182427177 - get_local $4 + local.get $4 f64.const -1.8849797954337717 - get_local $4 + local.get $4 f64.const 1.6214297201053545 f64.mul f64.add f64.mul f64.add - get_local $4 - get_local $4 + local.get $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.mul f64.const -0.758397934778766 - get_local $4 + local.get $4 f64.const 0.14599619288661245 f64.mul f64.add f64.mul f64.add f64.mul - set_local $3 - get_local $3 - i64.reinterpret/f64 + local.set $3 + local.get $3 + i64.reinterpret_f64 i64.const 2147483648 i64.add i64.const -1073741824 i64.and - f64.reinterpret/i64 - set_local $3 - get_local $3 - get_local $3 + f64.reinterpret_i64 + local.set $3 + local.get $3 + local.get $3 f64.mul - set_local $5 - get_local $0 - get_local $5 + local.set $5 + local.get $0 + local.get $5 f64.div - set_local $4 - get_local $4 - get_local $3 + local.set $4 + local.get $4 + local.get $3 f64.sub f64.const 2 - get_local $3 + local.get $3 f64.mul - get_local $4 + local.get $4 f64.add f64.div - set_local $4 - get_local $3 - get_local $3 - get_local $4 + local.set $4 + local.get $3 + local.get $3 + local.get $4 f64.mul f64.add - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $std/math/test_cbrt (; 81 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cbrt - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/cbrt - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.cbrt (; 82 ;) (type $ff) (param $0 f32) (result f32) @@ -4124,162 +4124,162 @@ (local $2 i32) (local $3 f64) (local $4 f64) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 2139095040 i32.ge_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.add return end - get_local $2 + local.get $2 i32.const 8388608 i32.lt_u if - get_local $2 + local.get $2 i32.const 0 i32.eq if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f32.const 16777216 f32.mul - i32.reinterpret/f32 - set_local $1 - get_local $1 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 3 i32.div_u i32.const 642849266 i32.add - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const 3 i32.div_u i32.const 709958130 i32.add - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const -2147483648 i32.and - set_local $1 - get_local $1 - get_local $2 + local.set $1 + local.get $1 + local.get $2 i32.or - set_local $1 - get_local $1 - f32.reinterpret/i32 - f64.promote/f32 - set_local $3 - get_local $3 - get_local $3 + local.set $1 + local.get $1 + f32.reinterpret_i32 + f64.promote_f32 + local.set $3 + local.get $3 + local.get $3 f64.mul - get_local $3 + local.get $3 f64.mul - set_local $4 - get_local $3 - get_local $0 - f64.promote/f32 - get_local $0 - f64.promote/f32 + local.set $4 + local.get $3 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 f64.add - get_local $4 + local.get $4 f64.add f64.mul - get_local $0 - f64.promote/f32 - get_local $4 + local.get $0 + f64.promote_f32 + local.get $4 f64.add - get_local $4 + local.get $4 f64.add f64.div - set_local $3 - get_local $3 - get_local $3 + local.set $3 + local.get $3 + local.get $3 f64.mul - get_local $3 + local.get $3 f64.mul - set_local $4 - get_local $3 - get_local $0 - f64.promote/f32 - get_local $0 - f64.promote/f32 + local.set $4 + local.get $3 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 f64.add - get_local $4 + local.get $4 f64.add f64.mul - get_local $0 - f64.promote/f32 - get_local $4 + local.get $0 + f64.promote_f32 + local.get $4 f64.add - get_local $4 + local.get $4 f64.add f64.div - set_local $3 - get_local $3 - f32.demote/f64 + local.set $3 + local.get $3 + f32.demote_f64 ) (func $std/math/test_cbrtf (; 83 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.cbrt - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_ceil (; 84 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) block $~lib/math/NativeMath.ceil|inlined.0 (result f64) - get_local $0 + local.get $0 f64.ceil end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/ceil - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_ceilf (; 85 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) block $~lib/math/NativeMathf.ceil|inlined.0 (result f32) - get_local $0 + local.get $0 f32.ceil end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.expm1 (; 86 ;) (type $FF) (param $0 f64) (result f64) @@ -4299,130 +4299,130 @@ (local $14 f64) (local $15 f64) (local $16 i32) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u i64.const 2147483647 i64.and - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i64.const 63 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $2 + i32.wrap_i64 + local.set $4 + local.get $2 i32.const 1078159482 i32.ge_u if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 if f64.const -1 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end end f64.const 0 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 1071001154 i32.gt_u if i32.const 1 - get_local $4 + local.get $4 i32.const 1 i32.shl i32.sub f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 - get_local $2 + i32.trunc_f64_s + local.get $2 i32.const 1072734898 i32.lt_u select - set_local $3 - get_local $3 - f64.convert_s/i32 - set_local $6 - get_local $0 - get_local $6 + local.set $3 + local.get $3 + f64.convert_i32_s + local.set $6 + local.get $0 + local.get $6 f64.const 0.6931471803691238 f64.mul f64.sub - set_local $7 - get_local $6 + local.set $7 + local.get $6 f64.const 1.9082149292705877e-10 f64.mul - set_local $8 - get_local $7 - get_local $8 + local.set $8 + local.get $7 + local.get $8 f64.sub - set_local $0 - get_local $7 - get_local $0 + local.set $0 + local.get $7 + local.get $0 f64.sub - get_local $8 + local.get $8 f64.sub - set_local $5 + local.set $5 else - get_local $2 + local.get $2 i32.const 1016070144 i32.lt_u if - get_local $0 + local.get $0 return end end f64.const 0.5 - get_local $0 + local.get $0 f64.mul - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 f64.mul - set_local $10 - get_local $10 - get_local $10 + local.set $10 + local.get $10 + local.get $10 f64.mul - set_local $11 + local.set $11 f64.const 1 - get_local $10 + local.get $10 f64.const -0.03333333333333313 f64.mul f64.add - get_local $11 + local.get $11 f64.const 1.5873015872548146e-03 - get_local $10 + local.get $10 f64.const -7.93650757867488e-05 f64.mul f64.add - get_local $11 + local.get $11 f64.const 4.008217827329362e-06 - get_local $10 + local.get $10 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -4430,74 +4430,74 @@ f64.add f64.mul f64.add - set_local $12 + local.set $12 f64.const 3 - get_local $12 - get_local $9 + local.get $12 + local.get $9 f64.mul f64.sub - set_local $6 - get_local $10 - get_local $12 - get_local $6 + local.set $6 + local.get $10 + local.get $12 + local.get $6 f64.sub f64.const 6 - get_local $0 - get_local $6 + local.get $0 + local.get $6 f64.mul f64.sub f64.div f64.mul - set_local $13 - get_local $3 + local.set $13 + local.get $3 i32.const 0 i32.eq if - get_local $0 - get_local $0 - get_local $13 + local.get $0 + local.get $0 + local.get $13 f64.mul - get_local $10 + local.get $10 f64.sub f64.sub return end - get_local $0 - get_local $13 - get_local $5 + local.get $0 + local.get $13 + local.get $5 f64.sub f64.mul - get_local $5 + local.get $5 f64.sub - set_local $13 - get_local $13 - get_local $10 + local.set $13 + local.get $13 + local.get $10 f64.sub - set_local $13 - get_local $3 + local.set $13 + local.get $3 i32.const -1 i32.eq if f64.const 0.5 - get_local $0 - get_local $13 + local.get $0 + local.get $13 f64.sub f64.mul f64.const 0.5 f64.sub return end - get_local $3 + local.get $3 i32.const 1 i32.eq if - get_local $0 + local.get $0 f64.const -0.25 f64.lt if f64.const -2 - get_local $13 - get_local $0 + local.get $13 + local.get $0 f64.const 0.5 f64.add f64.sub @@ -4506,94 +4506,94 @@ end f64.const 1 f64.const 2 - get_local $0 - get_local $13 + local.get $0 + local.get $13 f64.sub f64.mul f64.add return end i64.const 1023 - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.add i64.const 52 i64.shl - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $14 - get_local $3 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $14 + local.get $3 i32.const 0 i32.lt_s - tee_local $16 + local.tee $16 if (result i32) - get_local $16 + local.get $16 else - get_local $3 + local.get $3 i32.const 56 i32.gt_s end if - get_local $0 - get_local $13 + local.get $0 + local.get $13 f64.sub f64.const 1 f64.add - set_local $15 - get_local $3 + local.set $15 + local.get $3 i32.const 1024 i32.eq if - get_local $15 + local.get $15 f64.const 2 f64.mul f64.const 8988465674311579538646525e283 f64.mul - set_local $15 + local.set $15 else - get_local $15 - get_local $14 + local.get $15 + local.get $14 f64.mul - set_local $15 + local.set $15 end - get_local $15 + local.get $15 f64.const 1 f64.sub return end i64.const 1023 - get_local $3 - i64.extend_s/i32 + local.get $3 + i64.extend_i32_s i64.sub i64.const 52 i64.shl - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $15 - get_local $3 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $15 + local.get $3 i32.const 20 i32.lt_s if f64.const 1 - get_local $15 + local.get $15 f64.sub - get_local $13 + local.get $13 f64.sub - set_local $15 + local.set $15 else f64.const 1 - get_local $13 - get_local $15 + local.get $13 + local.get $15 f64.add f64.sub - set_local $15 + local.set $15 end - get_local $0 - get_local $15 + local.get $0 + local.get $15 f64.add - get_local $14 + local.get $14 f64.mul ) (func $~lib/math/NativeMath.exp (; 87 ;) (type $FF) (param $0 f64) (result f64) @@ -4606,40 +4606,40 @@ (local $7 f64) (local $8 f64) (local $9 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $1 - get_local $1 + i32.wrap_i64 + local.set $1 + local.get $1 i32.const 31 i32.shr_u - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1082532651 i32.ge_u if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 return end - get_local $0 + local.get $0 f64.const 709.782712893384 f64.gt if - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul return end - get_local $0 + local.get $0 f64.const -745.1332191019411 f64.lt if @@ -4648,85 +4648,85 @@ end end f64.const 0 - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.const 1071001154 i32.gt_u if - get_local $1 + local.get $1 i32.const 1072734898 i32.ge_u if f64.const 1.4426950408889634 - get_local $0 + local.get $0 f64.mul f64.const 0.5 - get_local $0 + local.get $0 f64.copysign f64.add - i32.trunc_s/f64 - set_local $5 + i32.trunc_f64_s + local.set $5 else i32.const 1 - get_local $2 + local.get $2 i32.const 1 i32.shl i32.sub - set_local $5 + local.set $5 end - get_local $0 - get_local $5 - f64.convert_s/i32 + local.get $0 + local.get $5 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.sub - set_local $3 - get_local $5 - f64.convert_s/i32 + local.set $3 + local.get $5 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul - set_local $4 - get_local $3 - get_local $4 + local.set $4 + local.get $3 + local.get $4 f64.sub - set_local $0 + local.set $0 else - get_local $1 + local.get $1 i32.const 1043333120 i32.gt_u if - get_local $0 - set_local $3 + local.get $0 + local.set $3 else f64.const 1 - get_local $0 + local.get $0 f64.add return end end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul - set_local $6 - get_local $6 - get_local $6 + local.set $6 + local.get $6 + local.get $6 f64.mul - set_local $7 - get_local $0 - get_local $6 + local.set $7 + local.get $0 + local.get $6 f64.const 0.16666666666666602 f64.mul - get_local $7 + local.get $7 f64.const -2.7777777777015593e-03 - get_local $6 + local.get $6 f64.const 6.613756321437934e-05 f64.mul f64.add - get_local $7 + local.get $7 f64.const -1.6533902205465252e-06 - get_local $6 + local.get $6 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -4735,30 +4735,30 @@ f64.mul f64.add f64.sub - set_local $8 + local.set $8 f64.const 1 - get_local $0 - get_local $8 + local.get $0 + local.get $8 f64.mul f64.const 2 - get_local $8 + local.get $8 f64.sub f64.div - get_local $4 + local.get $4 f64.sub - get_local $3 + local.get $3 f64.add f64.add - set_local $9 - get_local $5 + local.set $9 + local.get $5 i32.const 0 i32.eq if - get_local $9 + local.get $9 return end - get_local $9 - get_local $5 + local.get $9 + local.get $5 call $~lib/math/NativeMath.scalbn ) (func $~lib/math/NativeMath.cosh (; 88 ;) (type $FF) (param $0 f64) (result f64) @@ -4766,26 +4766,26 @@ (local $2 i32) (local $3 f64) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $1 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 - get_local $2 + i32.wrap_i64 + local.set $2 + local.get $2 i32.const 1072049730 i32.lt_u if - get_local $2 + local.get $2 i32.const 1072693248 i32.const 26 i32.const 20 @@ -4796,33 +4796,33 @@ f64.const 1 return end - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 - set_local $3 + local.set $3 f64.const 1 - get_local $3 - get_local $3 + local.get $3 + local.get $3 f64.mul f64.const 2 f64.const 2 - get_local $3 + local.get $3 f64.mul f64.add f64.div f64.add return end - get_local $2 + local.get $2 i32.const 1082535490 i32.lt_u if - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp - set_local $3 + local.set $3 f64.const 0.5 - get_local $3 + local.get $3 f64.const 1 - get_local $3 + local.get $3 f64.div f64.add f64.mul @@ -4836,48 +4836,48 @@ i32.add i32.const 20 i32.shl - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $4 - get_local $0 + f64.reinterpret_i64 + local.set $4 + local.get $0 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp - get_local $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.mul end - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $std/math/test_cosh (; 89 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.cosh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/cosh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.expm1 (; 90 ;) (type $ff) (param $0 f32) (result f32) @@ -4896,189 +4896,189 @@ (local $13 f32) (local $14 f32) (local $15 i32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 31 i32.shr_u - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1100331076 i32.ge_u if - get_local $2 + local.get $2 i32.const 2139095040 i32.gt_u if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 if f32.const -1 return end - get_local $0 + local.get $0 f32.const 88.7216796875 f32.gt if - get_local $0 + local.get $0 f32.const 1701411834604692317316873e14 f32.mul - set_local $0 - get_local $0 + local.set $0 + local.get $0 return end end f32.const 0 - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 1051816472 i32.gt_u if i32.const 1 - get_local $3 + local.get $3 i32.const 1 i32.shl i32.sub f32.const 1.4426950216293335 - get_local $0 + local.get $0 f32.mul f32.const 0.5 - get_local $0 + local.get $0 f32.copysign f32.add - i32.trunc_s/f32 - get_local $2 + i32.trunc_f32_s + local.get $2 i32.const 1065686418 i32.lt_u select - set_local $6 - get_local $6 - f32.convert_s/i32 - set_local $5 - get_local $0 - get_local $5 + 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 - set_local $7 - get_local $5 + local.set $7 + local.get $5 f32.const 9.05800061445916e-06 f32.mul - set_local $8 - get_local $7 - get_local $8 + local.set $8 + local.get $7 + local.get $8 f32.sub - set_local $0 - get_local $7 - get_local $0 + local.set $0 + local.get $7 + local.get $0 f32.sub - get_local $8 + local.get $8 f32.sub - set_local $4 + local.set $4 else - get_local $2 + local.get $2 i32.const 855638016 i32.lt_u if - get_local $0 + local.get $0 return else i32.const 0 - set_local $6 + local.set $6 end end f32.const 0.5 - get_local $0 + local.get $0 f32.mul - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 f32.mul - set_local $10 + local.set $10 f32.const 1 - get_local $10 + local.get $10 f32.const -0.03333321213722229 - get_local $10 + local.get $10 f32.const 1.5807170420885086e-03 f32.mul f32.add f32.mul f32.add - set_local $11 + local.set $11 f32.const 3 - get_local $11 - get_local $9 + local.get $11 + local.get $9 f32.mul f32.sub - set_local $5 - get_local $10 - get_local $11 - get_local $5 + local.set $5 + local.get $10 + local.get $11 + local.get $5 f32.sub f32.const 6 - get_local $0 - get_local $5 + local.get $0 + local.get $5 f32.mul f32.sub f32.div f32.mul - set_local $12 - get_local $6 + local.set $12 + local.get $6 i32.const 0 i32.eq if - get_local $0 - get_local $0 - get_local $12 + local.get $0 + local.get $0 + local.get $12 f32.mul - get_local $10 + local.get $10 f32.sub f32.sub return end - get_local $0 - get_local $12 - get_local $4 + local.get $0 + local.get $12 + local.get $4 f32.sub f32.mul - get_local $4 + local.get $4 f32.sub - set_local $12 - get_local $12 - get_local $10 + local.set $12 + local.get $12 + local.get $10 f32.sub - set_local $12 - get_local $6 + local.set $12 + local.get $6 i32.const -1 i32.eq if f32.const 0.5 - get_local $0 - get_local $12 + local.get $0 + local.get $12 f32.sub f32.mul f32.const 0.5 f32.sub return end - get_local $6 + local.get $6 i32.const 1 i32.eq if - get_local $0 + local.get $0 f32.const -0.25 f32.lt if f32.const -2 - get_local $12 - get_local $0 + local.get $12 + local.get $0 f32.const 0.5 f32.add f32.sub @@ -5087,92 +5087,92 @@ end f32.const 1 f32.const 2 - get_local $0 - get_local $12 + local.get $0 + local.get $12 f32.sub f32.mul f32.add return end i32.const 127 - get_local $6 + local.get $6 i32.add i32.const 23 i32.shl - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $13 - get_local $6 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $13 + local.get $6 i32.const 0 i32.lt_s - tee_local $15 + local.tee $15 if (result i32) - get_local $15 + local.get $15 else - get_local $6 + local.get $6 i32.const 56 i32.gt_s end if - get_local $0 - get_local $12 + local.get $0 + local.get $12 f32.sub f32.const 1 f32.add - set_local $14 - get_local $6 + local.set $14 + local.get $6 i32.const 128 i32.eq if - get_local $14 + local.get $14 f32.const 2 f32.mul f32.const 1701411834604692317316873e14 f32.mul - set_local $14 + local.set $14 else - get_local $14 - get_local $13 + local.get $14 + local.get $13 f32.mul - set_local $14 + local.set $14 end - get_local $14 + local.get $14 f32.const 1 f32.sub return end i32.const 127 - get_local $6 + local.get $6 i32.sub i32.const 23 i32.shl - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $14 - get_local $6 + 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 - get_local $14 + local.get $14 f32.sub - get_local $12 + local.get $12 f32.sub - set_local $14 + local.set $14 else f32.const 1 - get_local $12 - get_local $14 + local.get $12 + local.get $14 f32.add f32.sub - set_local $14 + local.set $14 end - get_local $0 - get_local $14 + local.get $0 + local.get $14 f32.add - get_local $13 + local.get $13 f32.mul ) (func $~lib/math/NativeMathf.exp (; 91 ;) (type $ff) (param $0 f32) (result f32) @@ -5184,34 +5184,34 @@ (local $6 f32) (local $7 f32) (local $8 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 31 i32.shr_u - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1118743632 i32.ge_u if - get_local $1 + local.get $1 i32.const 1118925336 i32.ge_u if - get_local $2 + local.get $2 i32.eqz if - get_local $0 + local.get $0 f32.const 1701411834604692317316873e14 f32.mul return else - get_local $1 + local.get $1 i32.const 1120924085 i32.ge_u if @@ -5221,122 +5221,122 @@ end end end - get_local $1 + local.get $1 i32.const 1051816472 i32.gt_u if - get_local $1 + local.get $1 i32.const 1065686418 i32.gt_u if f32.const 1.4426950216293335 - get_local $0 + local.get $0 f32.mul f32.const 0.5 - get_local $0 + local.get $0 f32.copysign f32.add - i32.trunc_s/f32 - set_local $5 + i32.trunc_f32_s + local.set $5 else i32.const 1 - get_local $2 + local.get $2 i32.const 1 i32.shl i32.sub - set_local $5 + local.set $5 end - get_local $0 - get_local $5 - f32.convert_s/i32 + local.get $0 + local.get $5 + f32.convert_i32_s f32.const 0.693145751953125 f32.mul f32.sub - set_local $3 - get_local $5 - f32.convert_s/i32 + local.set $3 + local.get $5 + f32.convert_i32_s f32.const 1.428606765330187e-06 f32.mul - set_local $4 - get_local $3 - get_local $4 + local.set $4 + local.get $3 + local.get $4 f32.sub - set_local $0 + local.set $0 else - get_local $1 + local.get $1 i32.const 956301312 i32.gt_u if i32.const 0 - set_local $5 - get_local $0 - set_local $3 + local.set $5 + local.get $0 + local.set $3 f32.const 0 - set_local $4 + local.set $4 else f32.const 1 - get_local $0 + local.get $0 f32.add return end end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 f32.const 0.16666625440120697 - get_local $6 + local.get $6 f32.const -2.7667332906275988e-03 f32.mul f32.add f32.mul f32.sub - set_local $7 + local.set $7 f32.const 1 - get_local $0 - get_local $7 + local.get $0 + local.get $7 f32.mul f32.const 2 - get_local $7 + local.get $7 f32.sub f32.div - get_local $4 + local.get $4 f32.sub - get_local $3 + local.get $3 f32.add f32.add - set_local $8 - get_local $5 + local.set $8 + local.get $5 i32.const 0 i32.eq if - get_local $8 + local.get $8 return end - get_local $8 - get_local $5 + local.get $8 + local.get $5 call $~lib/math/NativeMathf.scalbn ) (func $~lib/math/NativeMathf.cosh (; 92 ;) (type $ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $0 - get_local $1 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $1 i32.const 1060205079 i32.lt_u if - get_local $1 + local.get $1 i32.const 1065353216 i32.const 12 i32.const 23 @@ -5347,34 +5347,34 @@ f32.const 1 return end - get_local $0 + local.get $0 call $~lib/math/NativeMathf.expm1 - set_local $2 + local.set $2 f32.const 1 - get_local $2 - get_local $2 + local.get $2 + local.get $2 f32.mul f32.const 2 f32.const 2 - get_local $2 + local.get $2 f32.mul f32.add f32.div f32.add return end - get_local $1 + local.get $1 i32.const 1118925335 i32.lt_u if - get_local $0 + local.get $0 call $~lib/math/NativeMathf.exp - set_local $2 + local.set $2 f32.const 0.5 - get_local $2 + local.get $2 f32.mul f32.const 0.5 - get_local $2 + local.get $2 f32.div f32.add return @@ -5387,133 +5387,133 @@ i32.add i32.const 23 i32.shl - f32.reinterpret/i32 - set_local $2 - get_local $0 + f32.reinterpret_i32 + local.set $2 + local.get $0 f32.const 162.88958740234375 f32.sub call $~lib/math/NativeMathf.exp - get_local $2 + local.get $2 f32.mul - get_local $2 + local.get $2 f32.mul end ) (func $std/math/test_coshf (; 93 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.cosh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_exp (; 94 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.exp - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/exp - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_expf (; 95 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.exp - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_expm1 (; 96 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.expm1 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/expm1 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_expm1f (; 97 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.expm1 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_floor (; 98 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) block $~lib/math/NativeMath.floor|inlined.0 (result f64) - get_local $0 + local.get $0 f64.floor end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/floor - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_floorf (; 99 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) block $~lib/math/NativeMathf.floor|inlined.0 (result f32) - get_local $0 + local.get $0 f32.floor end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.hypot (; 100 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -5531,219 +5531,219 @@ (local $13 f64) (local $14 f64) (local $15 f64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $2 i64.const 9223372036854775807 i64.and - set_local $2 - get_local $3 + local.set $2 + local.get $3 i64.const 9223372036854775807 i64.and - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i64.lt_u if - get_local $2 - set_local $4 - get_local $3 - set_local $2 - get_local $4 - set_local $3 + local.get $2 + local.set $4 + local.get $3 + local.set $2 + local.get $4 + local.set $3 end - get_local $2 + local.get $2 i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $3 + i32.wrap_i64 + local.set $5 + local.get $3 i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $3 - f64.reinterpret/i64 - set_local $1 - get_local $6 + i32.wrap_i64 + local.set $6 + local.get $3 + f64.reinterpret_i64 + local.set $1 + local.get $6 i32.const 2047 i32.eq if - get_local $1 + local.get $1 return end - get_local $2 - f64.reinterpret/i64 - set_local $0 - get_local $5 + local.get $2 + f64.reinterpret_i64 + local.set $0 + local.get $5 i32.const 2047 i32.eq - tee_local $7 + local.tee $7 if (result i32) - get_local $7 + local.get $7 else - get_local $3 + local.get $3 i64.const 0 i64.eq end if - get_local $0 + local.get $0 return end - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.sub i32.const 64 i32.gt_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end f64.const 1 - set_local $8 - get_local $5 + local.set $8 + local.get $5 i32.const 1023 i32.const 510 i32.add i32.gt_s if f64.const 5260135901548373507240989e186 - set_local $8 - get_local $0 + local.set $8 + local.get $0 f64.const 1.90109156629516e-211 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 f64.const 1.90109156629516e-211 f64.mul - set_local $1 + local.set $1 else - get_local $6 + local.get $6 i32.const 1023 i32.const 450 i32.sub i32.lt_s if f64.const 1.90109156629516e-211 - set_local $8 - get_local $0 + local.set $8 + local.get $0 f64.const 5260135901548373507240989e186 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 f64.const 5260135901548373507240989e186 f64.mul - set_local $1 + local.set $1 end end - get_local $0 + local.get $0 f64.const 134217729 f64.mul - set_local $9 - get_local $0 - get_local $9 + local.set $9 + local.get $0 + local.get $9 f64.sub - get_local $9 + local.get $9 f64.add - set_local $10 - get_local $0 - get_local $10 + local.set $10 + local.get $0 + local.get $10 f64.sub - set_local $11 - get_local $0 - get_local $0 + local.set $11 + local.get $0 + local.get $0 f64.mul - set_local $12 - get_local $10 - get_local $10 + local.set $12 + local.get $10 + local.get $10 f64.mul - get_local $12 + local.get $12 f64.sub f64.const 2 - get_local $10 + local.get $10 f64.mul - get_local $11 + local.get $11 f64.add - get_local $11 + local.get $11 f64.mul f64.add - set_local $13 - get_local $1 + local.set $13 + local.get $1 f64.const 134217729 f64.mul - set_local $9 - get_local $1 - get_local $9 + local.set $9 + local.get $1 + local.get $9 f64.sub - get_local $9 + local.get $9 f64.add - set_local $10 - get_local $1 - get_local $10 + local.set $10 + local.get $1 + local.get $10 f64.sub - set_local $11 - get_local $1 - get_local $1 + local.set $11 + local.get $1 + local.get $1 f64.mul - set_local $14 - get_local $10 - get_local $10 + local.set $14 + local.get $10 + local.get $10 f64.mul - get_local $14 + local.get $14 f64.sub f64.const 2 - get_local $10 + local.get $10 f64.mul - get_local $11 + local.get $11 f64.add - get_local $11 + local.get $11 f64.mul f64.add - set_local $15 - get_local $8 - get_local $15 - get_local $13 + local.set $15 + local.get $8 + local.get $15 + local.get $13 f64.add - get_local $14 + local.get $14 f64.add - get_local $12 + local.get $12 f64.add f64.sqrt f64.mul ) (func $std/math/test_hypot (; 101 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.hypot - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/hypot - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check end else - get_local $5 + local.get $5 end ) (func $~lib/math/NativeMathf.hypot (; 102 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -5751,65 +5751,65 @@ (local $3 i32) (local $4 i32) (local $5 f32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + 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 - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 2147483647 i32.and - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.lt_u if - get_local $2 - set_local $4 - get_local $3 - set_local $2 - get_local $4 - set_local $3 + local.get $2 + local.set $4 + local.get $3 + local.set $2 + local.get $4 + local.set $3 end - get_local $2 - f32.reinterpret/i32 - set_local $0 - get_local $3 - f32.reinterpret/i32 - set_local $1 - get_local $3 + local.get $2 + f32.reinterpret_i32 + local.set $0 + local.get $3 + f32.reinterpret_i32 + local.set $1 + local.get $3 i32.const 255 i32.const 23 i32.shl i32.eq if - get_local $1 + local.get $1 return end - get_local $2 + local.get $2 i32.const 255 i32.const 23 i32.shl i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $3 + local.get $3 i32.const 0 i32.eq end - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub i32.const 25 i32.const 23 @@ -5817,14 +5817,14 @@ i32.ge_u end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add return end f32.const 1 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 127 i32.const 60 i32.add @@ -5833,17 +5833,17 @@ i32.ge_u if f32.const 1237940039285380274899124e3 - set_local $5 - get_local $0 + local.set $5 + local.get $0 f32.const 8.077935669463161e-28 f32.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 f32.const 8.077935669463161e-28 f32.mul - set_local $1 + local.set $1 else - get_local $3 + local.get $3 i32.const 127 i32.const 60 i32.sub @@ -5852,75 +5852,75 @@ i32.lt_u if f32.const 8.077935669463161e-28 - set_local $5 - get_local $0 + local.set $5 + local.get $0 f32.const 1237940039285380274899124e3 f32.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 f32.const 1237940039285380274899124e3 f32.mul - set_local $1 + local.set $1 end end - get_local $5 - get_local $0 - f64.promote/f32 - get_local $0 - f64.promote/f32 + local.get $5 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 f64.mul - get_local $1 - f64.promote/f32 - get_local $1 - f64.promote/f32 + local.get $1 + f64.promote_f32 + local.get $1 + f64.promote_f32 f64.mul f64.add - f32.demote/f64 + f32.demote_f64 f32.sqrt f32.mul ) (func $std/math/test_hypotf (; 103 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.hypot - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $std/math/test_log (; 104 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/log - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_logf (; 105 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.log10 (; 106 ;) (type $FF) (param $0 f64) (result f64) @@ -5942,88 +5942,88 @@ (local $16 f64) (local $17 f64) (local $18 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -6031,81 +6031,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -6114,103 +6114,103 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $5 - get_local $6 + local.set $12 + local.get $5 + local.get $6 f64.sub - set_local $13 - get_local $13 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $13 + local.get $13 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const -4294967296 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $13 - get_local $5 - get_local $13 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $13 + local.get $5 + local.get $13 f64.sub - get_local $6 + local.get $6 f64.sub - get_local $7 - get_local $6 - get_local $12 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul f64.add - set_local $14 - get_local $13 + local.set $14 + local.get $13 f64.const 0.4342944818781689 f64.mul - set_local $15 - get_local $3 - f64.convert_s/i32 - set_local $16 - get_local $16 + local.set $15 + local.get $3 + f64.convert_i32_s + local.set $16 + local.get $16 f64.const 0.30102999566361177 f64.mul - set_local $17 - get_local $16 + local.set $17 + local.get $16 f64.const 3.694239077158931e-13 f64.mul - get_local $14 - get_local $13 + local.get $14 + local.get $13 f64.add f64.const 2.5082946711645275e-11 f64.mul f64.add - get_local $14 + local.get $14 f64.const 0.4342944818781689 f64.mul f64.add - set_local $18 - get_local $17 - get_local $15 + local.set $18 + local.get $17 + local.get $15 f64.add - set_local $9 - get_local $18 - get_local $17 - get_local $9 + local.set $9 + local.get $18 + local.get $17 + local.get $9 f64.sub - get_local $15 + local.get $15 f64.add f64.add - set_local $18 - get_local $18 - get_local $9 + local.set $18 + local.get $18 + local.get $9 f64.add ) (func $std/math/test_log10 (; 107 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log10 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/log10 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.log10 (; 108 ;) (type $ff) (param $0 f32) (result f32) @@ -6228,67 +6228,67 @@ (local $12 f32) (local $13 f32) (local $14 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 i32.const 0 - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388608 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $1 + local.get $1 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i32.const 1 i32.shl i32.const 0 i32.eq if f32.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul f32.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end - get_local $2 + local.get $2 i32.const 25 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 f32.const 33554432 f32.mul - set_local $0 - get_local $0 - i32.reinterpret/f32 - set_local $1 + local.set $0 + local.get $0 + i32.reinterpret_f32 + local.set $1 else - get_local $1 + local.get $1 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1065353216 i32.eq if @@ -6297,165 +6297,165 @@ end end end - get_local $1 + local.get $1 i32.const 1065353216 i32.const 1060439283 i32.sub i32.add - set_local $1 - get_local $2 - get_local $1 + local.set $1 + local.get $2 + local.get $1 i32.const 23 i32.shr_u i32.const 127 i32.sub i32.add - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388607 i32.and i32.const 1060439283 i32.add - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $0 f32.const 1 f32.sub - set_local $4 - get_local $4 + local.set $4 + local.get $4 f32.const 2 - get_local $4 + local.get $4 f32.add f32.div - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f32.mul - set_local $6 - get_local $6 - get_local $6 + local.set $6 + local.get $6 + local.get $6 f32.mul - set_local $7 - get_local $7 + local.set $7 + local.get $7 f32.const 0.40000972151756287 - get_local $7 + local.get $7 f32.const 0.24279078841209412 f32.mul f32.add f32.mul - set_local $8 - get_local $6 + local.set $8 + local.get $6 f32.const 0.6666666269302368 - get_local $7 + local.get $7 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - set_local $9 - get_local $9 - get_local $8 + local.set $9 + local.get $9 + local.get $8 f32.add - set_local $10 + local.set $10 f32.const 0.5 - get_local $4 + local.get $4 f32.mul - get_local $4 + local.get $4 f32.mul - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 f32.sub - set_local $12 - get_local $12 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.set $12 + local.get $12 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const -4096 i32.and - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $12 - get_local $4 - get_local $12 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $12 + local.get $4 + local.get $12 f32.sub - get_local $11 + local.get $11 f32.sub - get_local $5 - get_local $11 - get_local $10 + local.get $5 + local.get $11 + local.get $10 f32.add f32.mul f32.add - set_local $13 - get_local $2 - f32.convert_s/i32 - set_local $14 - get_local $14 + local.set $13 + local.get $2 + f32.convert_i32_s + local.set $14 + local.get $14 f32.const 7.903415166765626e-07 f32.mul - get_local $13 - get_local $12 + local.get $13 + local.get $12 f32.add f32.const -3.168997136526741e-05 f32.mul f32.add - get_local $13 + local.get $13 f32.const 0.434326171875 f32.mul f32.add - get_local $12 + local.get $12 f32.const 0.434326171875 f32.mul f32.add - get_local $14 + local.get $14 f32.const 0.3010292053222656 f32.mul f32.add ) (func $std/math/test_log10f (; 109 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log10 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_log1p (; 110 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log1p - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/log1p - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_log1pf (; 111 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log1p - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.log2 (; 112 ;) (type $FF) (param $0 f64) (result f64) @@ -6476,88 +6476,88 @@ (local $15 f64) (local $16 f64) (local $17 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 i32.const 0 - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048576 i32.lt_u - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $2 + local.get $2 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i64.const 1 i64.shl i64.const 0 i64.eq if f64.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul f64.div return end - get_local $2 + local.get $2 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.div return end - get_local $3 + local.get $3 i32.const 54 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 f64.const 18014398509481984 f64.mul - set_local $0 - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $0 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 + i32.wrap_i64 + local.set $2 else - get_local $2 + local.get $2 i32.const 2146435072 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $2 + local.get $2 i32.const 1072693248 i32.eq - tee_local $4 + local.tee $4 if (result i32) - get_local $1 + local.get $1 i64.const 32 i64.shl i64.const 0 i64.eq else - get_local $4 + local.get $4 end if f64.const 0 @@ -6565,81 +6565,81 @@ end end end - get_local $2 + local.get $2 i32.const 1072693248 i32.const 1072079006 i32.sub i32.add - set_local $2 - get_local $3 - get_local $2 + local.set $2 + local.get $3 + local.get $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 i32.add - set_local $2 - get_local $2 - i64.extend_u/i32 + local.set $2 + local.get $2 + i64.extend_i32_u i64.const 32 i64.shl - get_local $1 + local.get $1 i64.const 4294967295 i64.and i64.or - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $0 + local.get $0 f64.const 1 f64.sub - set_local $5 + local.set $5 f64.const 0.5 - get_local $5 + local.get $5 f64.mul - get_local $5 + local.get $5 f64.mul - set_local $6 - get_local $5 + local.set $6 + local.get $5 f64.const 2 - get_local $5 + local.get $5 f64.add f64.div - set_local $7 - get_local $7 - get_local $7 + local.set $7 + local.get $7 + local.get $7 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.mul - set_local $9 - get_local $9 + local.set $9 + local.get $9 f64.const 0.3999999999940942 - get_local $9 + local.get $9 f64.const 0.22222198432149784 - get_local $9 + local.get $9 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - set_local $10 - get_local $8 + local.set $10 + local.get $8 f64.const 0.6666666666666735 - get_local $9 + local.get $9 f64.const 0.2857142874366239 - get_local $9 + local.get $9 f64.const 0.1818357216161805 - get_local $9 + local.get $9 f64.const 0.14798198605116586 f64.mul f64.add @@ -6648,97 +6648,97 @@ f64.mul f64.add f64.mul - set_local $11 - get_local $11 - get_local $10 + local.set $11 + local.get $11 + local.get $10 f64.add - set_local $12 - get_local $5 - get_local $6 + local.set $12 + local.get $5 + local.get $6 f64.sub - set_local $13 - get_local $13 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.set $13 + local.get $13 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const -4294967296 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $13 - get_local $5 - get_local $13 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $13 + local.get $5 + local.get $13 f64.sub - get_local $6 + local.get $6 f64.sub - get_local $7 - get_local $6 - get_local $12 + local.get $7 + local.get $6 + local.get $12 f64.add f64.mul f64.add - set_local $14 - get_local $13 + local.set $14 + local.get $13 f64.const 1.4426950407214463 f64.mul - set_local $15 - get_local $14 - get_local $13 + local.set $15 + local.get $14 + local.get $13 f64.add f64.const 1.6751713164886512e-10 f64.mul - get_local $14 + local.get $14 f64.const 1.4426950407214463 f64.mul f64.add - set_local $16 - get_local $3 - f64.convert_s/i32 - set_local $17 - get_local $17 - get_local $15 + local.set $16 + local.get $3 + f64.convert_i32_s + local.set $17 + local.get $17 + local.get $15 f64.add - set_local $9 - get_local $16 - get_local $17 - get_local $9 + local.set $9 + local.get $16 + local.get $17 + local.get $9 f64.sub - get_local $15 + local.get $15 f64.add f64.add - set_local $16 - get_local $9 - set_local $15 - get_local $16 - get_local $15 + local.set $16 + local.get $9 + local.set $15 + local.get $16 + local.get $15 f64.add ) (func $std/math/test_log2 (; 113 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.log2 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/log2 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.log2 (; 114 ;) (type $ff) (param $0 f32) (result f32) @@ -6757,67 +6757,67 @@ (local $13 i32) (local $14 f32) (local $15 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 i32.const 0 - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388608 i32.lt_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $1 + local.get $1 i32.const 31 i32.shr_u end if - get_local $1 + local.get $1 i32.const 1 i32.shl i32.const 0 i32.eq if f32.const -1 - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul f32.div return end - get_local $1 + local.get $1 i32.const 31 i32.shr_u if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub f32.const 0 f32.div return end - get_local $2 + local.get $2 i32.const 25 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 f32.const 33554432 f32.mul - set_local $0 - get_local $0 - i32.reinterpret/f32 - set_local $1 + local.set $0 + local.get $0 + i32.reinterpret_f32 + local.set $1 else - get_local $1 + local.get $1 i32.const 2139095040 i32.ge_u if - get_local $0 + local.get $0 return else - get_local $1 + local.get $1 i32.const 1065353216 i32.eq if @@ -6826,208 +6826,208 @@ end end end - get_local $1 + local.get $1 i32.const 1065353216 i32.const 1060439283 i32.sub i32.add - set_local $1 - get_local $2 - get_local $1 + local.set $1 + local.get $2 + local.get $1 i32.const 23 i32.shr_u i32.const 127 i32.sub i32.add - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 8388607 i32.and i32.const 1060439283 i32.add - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $0 - get_local $0 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $0 f32.const 1 f32.sub - set_local $4 - get_local $4 + local.set $4 + local.get $4 f32.const 2 - get_local $4 + local.get $4 f32.add f32.div - set_local $5 - get_local $5 - get_local $5 + local.set $5 + local.get $5 + local.get $5 f32.mul - set_local $6 - get_local $6 - get_local $6 + local.set $6 + local.get $6 + local.get $6 f32.mul - set_local $7 - get_local $7 + local.set $7 + local.get $7 f32.const 0.40000972151756287 - get_local $7 + local.get $7 f32.const 0.24279078841209412 f32.mul f32.add f32.mul - set_local $8 - get_local $6 + local.set $8 + local.get $6 f32.const 0.6666666269302368 - get_local $7 + local.get $7 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - set_local $9 - get_local $9 - get_local $8 + local.set $9 + local.get $9 + local.get $8 f32.add - set_local $10 + local.set $10 f32.const 0.5 - get_local $4 + local.get $4 f32.mul - get_local $4 + local.get $4 f32.mul - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 f32.sub - set_local $12 - get_local $12 - i32.reinterpret/f32 - set_local $13 - get_local $13 + local.set $12 + local.get $12 + i32.reinterpret_f32 + local.set $13 + local.get $13 i32.const -4096 i32.and - set_local $13 - get_local $13 - f32.reinterpret/i32 - set_local $12 - get_local $4 - get_local $12 + local.set $13 + local.get $13 + f32.reinterpret_i32 + local.set $12 + local.get $4 + local.get $12 f32.sub - get_local $11 + local.get $11 f32.sub - get_local $5 - get_local $11 - get_local $10 + local.get $5 + local.get $11 + local.get $10 f32.add f32.mul f32.add - set_local $14 - get_local $2 - f32.convert_s/i32 - set_local $15 - get_local $14 - get_local $12 + local.set $14 + local.get $2 + f32.convert_i32_s + local.set $15 + local.get $14 + local.get $12 f32.add f32.const -1.7605285393074155e-04 f32.mul - get_local $14 + local.get $14 f32.const 1.44287109375 f32.mul f32.add - get_local $12 + local.get $12 f32.const 1.44287109375 f32.mul f32.add - get_local $15 + local.get $15 f32.add ) (func $std/math/test_log2f (; 115 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.log2 - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_max (; 116 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) block $~lib/math/NativeMath.max|inlined.0 (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.max end - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/max - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check end else - get_local $5 + local.get $5 end ) (func $std/math/test_maxf (; 117 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) block $~lib/math/NativeMathf.max|inlined.0 (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.max end - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $std/math/test_min (; 118 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) block $~lib/math/NativeMath.min|inlined.0 (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.min end - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/min - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check end else - get_local $5 + local.get $5 end ) (func $std/math/test_minf (; 119 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) block $~lib/math/NativeMathf.min|inlined.0 (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.min end - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $~lib/math/NativeMath.mod (; 120 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -7041,278 +7041,278 @@ (local $9 f64) (local $10 i64) (local $11 i64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 + 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 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i64.const 63 i64.shr_u - set_local $6 - get_local $3 + local.set $6 + local.get $3 i64.const 1 i64.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i64.const 0 i64.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i64.const 2047 i64.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f64.div return end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i64.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i64.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i64.const 12 i64.shl i64.clz i64.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i64.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.const 12 i64.shl i64.clz i64.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i64.const 0 - get_local $5 + local.get $5 i64.sub i64.const 1 i64.add i64.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 1 i64.const 52 i64.shl i64.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 1 i64.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 11 i64.shl i64.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i64.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 0 i64.gt_s if - get_local $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i64.const 63 i64.shl i64.or - set_local $2 - get_local $2 - f64.reinterpret/i64 + local.set $2 + local.get $2 + f64.reinterpret_i64 ) (func $std/math/test_mod (; 121 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.mod - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $std/math/mod - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check end else - get_local $5 + local.get $5 end ) (func $~lib/math/NativeMathf.mod (; 122 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -7326,256 +7326,256 @@ (local $9 f32) (local $10 i32) (local $11 i32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + local.get $0 + i32.reinterpret_f32 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const -2147483648 i32.and - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.const 1 i32.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.const 0 i32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i32.const 255 i32.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f32.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i32.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i32.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i32.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.const 9 i32.shl i32.clz i32.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 0 - get_local $5 + local.get $5 i32.sub i32.const 1 i32.add i32.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.const 23 i32.shl i32.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 8 i32.shl i32.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i32.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 0 i32.gt_s if - get_local $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.or - set_local $2 - get_local $2 - f32.reinterpret/i32 + local.set $2 + local.get $2 + f32.reinterpret_i32 ) (func $std/math/test_modf (; 123 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.mod - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $~lib/math/NativeMath.pow (; 124 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -7619,38 +7619,38 @@ (local $39 f64) (local $40 f64) (local $41 i32) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 - get_local $2 - i32.wrap/i64 - set_local $4 - get_local $1 - i64.reinterpret/f64 - set_local $2 - get_local $2 + i32.wrap_i64 + local.set $3 + local.get $2 + i32.wrap_i64 + local.set $4 + local.get $1 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $2 - i32.wrap/i64 - set_local $6 - get_local $3 + i32.wrap_i64 + local.set $5 + local.get $2 + i32.wrap_i64 + local.set $6 + local.get $3 i32.const 2147483647 i32.and - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 2147483647 i32.and - set_local $8 - get_local $8 - get_local $6 + local.set $8 + local.get $8 + local.get $6 i32.or i32.const 0 i32.eq @@ -7658,126 +7658,126 @@ f64.const 1 return end - get_local $7 + local.get $7 i32.const 2146435072 i32.gt_s - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $4 + local.get $4 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.gt_s end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $6 + local.get $6 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end i32.const 0 - set_local $10 - get_local $3 + local.set $10 + local.get $3 i32.const 0 i32.lt_s if - get_local $8 + local.get $8 i32.const 1128267776 i32.ge_s if i32.const 2 - set_local $10 + local.set $10 else - get_local $8 + local.get $8 i32.const 1072693248 i32.ge_s if - get_local $8 + local.get $8 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 - get_local $11 + local.set $11 + local.get $11 i32.const 20 i32.gt_s - set_local $9 + local.set $9 i32.const 52 i32.const 20 - get_local $9 + local.get $9 select - get_local $11 + local.get $11 i32.sub - set_local $12 - get_local $6 - get_local $8 - get_local $9 + local.set $12 + local.get $6 + local.get $8 + local.get $9 select - set_local $13 - get_local $13 - get_local $12 + local.set $13 + local.get $13 + local.get $12 i32.shr_s - set_local $14 - get_local $14 - get_local $12 + local.set $14 + local.get $14 + local.get $12 i32.shl - get_local $13 + local.get $13 i32.eq if i32.const 2 - get_local $14 + local.get $14 i32.const 1 i32.and i32.sub - set_local $10 + local.set $10 end end end end - get_local $6 + local.get $6 i32.const 0 i32.eq if - get_local $8 + local.get $8 i32.const 2146435072 i32.eq if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $4 + local.get $4 i32.or i32.const 0 i32.eq @@ -7785,27 +7785,27 @@ f64.const nan:0x8000000000000 return else - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) - get_local $1 + local.get $1 else f64.const 0 end return else - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) f64.const 0 else - get_local $1 + local.get $1 f64.neg end return @@ -7815,158 +7815,158 @@ unreachable unreachable end - get_local $8 + local.get $8 i32.const 1072693248 i32.eq if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 return end f64.const 1 - get_local $0 + local.get $0 f64.div return end - get_local $5 + local.get $5 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul return end - get_local $5 + local.get $5 i32.const 1071644672 i32.eq if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f64.sqrt return end end end - get_local $0 + local.get $0 f64.abs - set_local $15 - get_local $4 + local.set $15 + local.get $4 i32.const 0 i32.eq if - get_local $7 + local.get $7 i32.const 0 i32.eq - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq end - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 1072693248 i32.eq end if - get_local $15 - set_local $16 - get_local $5 + local.get $15 + local.set $16 + local.get $5 i32.const 0 i32.lt_s if f64.const 1 - get_local $16 + local.get $16 f64.div - set_local $16 + local.set $16 end - get_local $3 + local.get $3 i32.const 0 i32.lt_s if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $10 + local.get $10 i32.or i32.const 0 i32.eq if - get_local $16 - get_local $16 + local.get $16 + local.get $16 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div - set_local $16 + local.set $16 else - get_local $10 + local.get $10 i32.const 1 i32.eq if - get_local $16 + local.get $16 f64.neg - set_local $16 + local.set $16 end end end - get_local $16 + local.get $16 return end end f64.const 1 - set_local $18 - get_local $3 + local.set $18 + local.get $3 i32.const 0 i32.lt_s if - get_local $10 + local.get $10 i32.const 0 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div return end - get_local $10 + local.get $10 i32.const 1 i32.eq if f64.const -1 - set_local $18 + local.set $18 end end - get_local $8 + local.get $8 i32.const 1105199104 i32.gt_s if - get_local $8 + local.get $8 i32.const 1139802112 i32.gt_s if - get_local $7 + local.get $7 i32.const 1072693247 i32.le_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) @@ -7980,11 +7980,11 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) @@ -7999,21 +7999,21 @@ return end end - get_local $7 + local.get $7 i32.const 1072693247 i32.lt_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -8021,21 +8021,21 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.gt_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -8043,205 +8043,205 @@ end return end - get_local $15 + local.get $15 f64.const 1 f64.sub - set_local $24 - get_local $24 - get_local $24 + local.set $24 + local.get $24 + local.get $24 f64.mul f64.const 0.5 - get_local $24 + local.get $24 f64.const 0.3333333333333333 - get_local $24 + local.get $24 f64.const 0.25 f64.mul f64.sub f64.mul f64.sub f64.mul - set_local $27 + local.set $27 f64.const 1.4426950216293335 - get_local $24 + local.get $24 f64.mul - set_local $25 - get_local $24 + local.set $25 + local.get $24 f64.const 1.9259629911266175e-08 f64.mul - get_local $27 + local.get $27 f64.const 1.4426950408889634 f64.mul f64.sub - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $26 - get_local $19 - get_local $25 + f64.reinterpret_i64 + local.set $19 + local.get $26 + local.get $19 + local.get $25 f64.sub f64.sub - set_local $20 + local.set $20 else i32.const 0 - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.lt_s if - get_local $15 + local.get $15 f64.const 9007199254740992 f64.mul - set_local $15 - get_local $29 + local.set $15 + local.get $29 i32.const 53 i32.sub - set_local $29 - get_local $15 - i64.reinterpret/f64 + local.set $29 + local.get $15 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $7 + i32.wrap_i64 + local.set $7 end - get_local $29 - get_local $7 + local.get $29 + local.get $7 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048575 i32.and - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 1072693248 i32.or - set_local $7 - get_local $28 + local.set $7 + local.get $28 i32.const 235662 i32.le_s if i32.const 0 - set_local $11 + local.set $11 else - get_local $28 + local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - set_local $11 + local.set $11 else i32.const 0 - set_local $11 - get_local $29 + local.set $11 + local.get $29 i32.const 1 i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.sub - set_local $7 + local.set $7 end end - get_local $15 - i64.reinterpret/f64 + local.get $15 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $15 + f64.reinterpret_i64 + local.set $15 f64.const 1.5 f64.const 1 - get_local $11 + local.get $11 select - set_local $35 - get_local $15 - get_local $35 + local.set $35 + local.get $15 + local.get $35 f64.sub - set_local $25 + local.set $25 f64.const 1 - get_local $15 - get_local $35 + local.get $15 + local.get $35 f64.add f64.div - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.mul - set_local $17 - get_local $17 - set_local $31 - get_local $31 - i64.reinterpret/f64 + local.set $17 + local.get $17 + local.set $31 + local.get $31 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $31 - get_local $7 + f64.reinterpret_i64 + local.set $31 + local.get $7 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - get_local $11 + local.get $11 i32.const 18 i32.shl i32.add - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $33 - get_local $15 - get_local $33 - get_local $35 + f64.reinterpret_i64 + local.set $33 + local.get $15 + local.get $33 + local.get $35 f64.sub f64.sub - set_local $34 - get_local $26 - get_local $25 - get_local $31 - get_local $33 + local.set $34 + local.get $26 + local.get $25 + local.get $31 + local.get $33 f64.mul f64.sub - get_local $31 - get_local $34 + local.get $31 + local.get $34 f64.mul f64.sub f64.mul - set_local $32 - get_local $17 - get_local $17 + local.set $32 + local.get $17 + local.get $17 f64.mul - set_local $30 - get_local $30 - get_local $30 + local.set $30 + local.get $30 + local.get $30 f64.mul f64.const 0.5999999999999946 - get_local $30 + local.get $30 f64.const 0.4285714285785502 - get_local $30 + local.get $30 f64.const 0.33333332981837743 - get_local $30 + local.get $30 f64.const 0.272728123808534 - get_local $30 + local.get $30 f64.const 0.23066074577556175 - get_local $30 + local.get $30 f64.const 0.20697501780033842 f64.mul f64.add @@ -8254,184 +8254,184 @@ f64.mul f64.add f64.mul - set_local $23 - get_local $23 - get_local $32 - get_local $31 - get_local $17 + local.set $23 + local.get $23 + local.get $32 + local.get $31 + local.get $17 f64.add f64.mul f64.add - set_local $23 - get_local $31 - get_local $31 + local.set $23 + local.get $31 + local.get $31 f64.mul - set_local $30 + local.set $30 f64.const 3 - get_local $30 + local.get $30 f64.add - get_local $23 + local.get $23 f64.add - set_local $33 - get_local $33 - i64.reinterpret/f64 + local.set $33 + local.get $33 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $33 - get_local $23 - get_local $33 + f64.reinterpret_i64 + local.set $33 + local.get $23 + local.get $33 f64.const 3 f64.sub - get_local $30 + local.get $30 f64.sub f64.sub - set_local $34 - get_local $31 - get_local $33 + local.set $34 + local.get $31 + local.get $33 f64.mul - set_local $25 - get_local $32 - get_local $33 + local.set $25 + local.get $32 + local.get $33 f64.mul - get_local $34 - get_local $17 + local.get $34 + local.get $17 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $21 - get_local $21 - i64.reinterpret/f64 + local.set $21 + local.get $21 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $21 - get_local $26 - get_local $21 - get_local $25 + f64.reinterpret_i64 + local.set $21 + local.get $26 + local.get $21 + local.get $25 f64.sub f64.sub - set_local $22 + local.set $22 f64.const 0.9617967009544373 - get_local $21 + local.get $21 f64.mul - set_local $36 + local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - get_local $11 + local.get $11 select - set_local $37 + local.set $37 f64.const -7.028461650952758e-09 - get_local $21 + local.get $21 f64.mul - get_local $22 + local.get $22 f64.const 0.9617966939259756 f64.mul f64.add - get_local $37 + local.get $37 f64.add - set_local $38 - get_local $29 - f64.convert_s/i32 - set_local $24 + local.set $38 + local.get $29 + f64.convert_i32_s + local.set $24 f64.const 0.5849624872207642 f64.const 0 - get_local $11 + local.get $11 select - set_local $39 - get_local $36 - get_local $38 + local.set $39 + local.get $36 + local.get $38 f64.add - get_local $39 + local.get $39 f64.add - get_local $24 + local.get $24 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $38 - get_local $19 - get_local $24 + f64.reinterpret_i64 + local.set $19 + local.get $38 + local.get $19 + local.get $24 f64.sub - get_local $39 + local.get $39 f64.sub - get_local $36 + local.get $36 f64.sub f64.sub - set_local $20 + local.set $20 end - get_local $1 - set_local $40 - get_local $40 - i64.reinterpret/f64 + local.get $1 + local.set $40 + local.get $40 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $40 - get_local $1 - get_local $40 + f64.reinterpret_i64 + local.set $40 + local.get $1 + local.get $40 f64.sub - get_local $19 + local.get $19 f64.mul - get_local $1 - get_local $20 + local.get $1 + local.get $20 f64.mul f64.add - set_local $22 - get_local $40 - get_local $19 + local.set $22 + local.get $40 + local.get $19 f64.mul - set_local $21 - get_local $22 - get_local $21 + local.set $21 + local.get $22 + local.get $21 f64.add - set_local $16 - get_local $16 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.set $16 + local.get $16 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $2 - i32.wrap/i64 - set_local $41 - get_local $28 + i32.wrap_i64 + local.set $28 + local.get $2 + i32.wrap_i64 + local.set $41 + local.get $28 i32.const 1083179008 i32.ge_s if - get_local $28 + local.get $28 i32.const 1083179008 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - get_local $22 + local.get $22 f64.const 8.008566259537294e-17 f64.add - get_local $16 - get_local $21 + local.get $16 + local.get $21 f64.sub f64.gt if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 @@ -8439,34 +8439,34 @@ return end else - get_local $28 + local.get $28 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_s if - get_local $28 + local.get $28 i32.const -1064252416 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul return end - get_local $22 - get_local $16 - get_local $21 + local.get $22 + local.get $16 + local.get $21 f64.sub f64.le if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -8475,126 +8475,126 @@ end end end - get_local $28 + local.get $28 i32.const 2147483647 i32.and - set_local $41 - get_local $41 + local.set $41 + local.get $41 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 i32.const 0 - set_local $29 - get_local $41 + local.set $29 + local.get $41 i32.const 1071644672 i32.gt_s if - get_local $28 + local.get $28 i32.const 1048576 - get_local $11 + local.get $11 i32.const 1 i32.add i32.shr_s i32.add - set_local $29 - get_local $29 + local.set $29 + local.get $29 i32.const 2147483647 i32.and i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 f64.const 0 - set_local $24 - get_local $29 + local.set $24 + local.get $29 i32.const 1048575 - get_local $11 + local.get $11 i32.shr_s i32.const -1 i32.xor i32.and - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $24 - get_local $29 + f64.reinterpret_i64 + local.set $24 + local.get $29 i32.const 1048575 i32.and i32.const 1048576 i32.or i32.const 20 - get_local $11 + local.get $11 i32.sub i32.shr_s - set_local $29 - get_local $28 + local.set $29 + local.get $28 i32.const 0 i32.lt_s if i32.const 0 - get_local $29 + local.get $29 i32.sub - set_local $29 + local.set $29 end - get_local $21 - get_local $24 + local.get $21 + local.get $24 f64.sub - set_local $21 + local.set $21 end - get_local $22 - get_local $21 + local.get $22 + local.get $21 f64.add - set_local $24 - get_local $24 - i64.reinterpret/f64 + local.set $24 + local.get $24 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $24 - get_local $24 + f64.reinterpret_i64 + local.set $24 + local.get $24 f64.const 0.6931471824645996 f64.mul - set_local $25 - get_local $22 - get_local $24 - get_local $21 + local.set $25 + local.get $22 + local.get $24 + local.get $21 f64.sub f64.sub f64.const 0.6931471805599453 f64.mul - get_local $24 + local.get $24 f64.const -1.904654299957768e-09 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $16 - get_local $26 - get_local $16 - get_local $25 + local.set $16 + local.get $26 + local.get $16 + local.get $25 f64.sub f64.sub - set_local $27 - get_local $16 - get_local $16 + local.set $27 + local.get $16 + local.get $16 f64.mul - set_local $24 - get_local $16 - get_local $24 + local.set $24 + local.get $16 + local.get $24 f64.const 0.16666666666666602 - get_local $24 + local.get $24 f64.const -2.7777777777015593e-03 - get_local $24 + local.get $24 f64.const 6.613756321437934e-05 - get_local $24 + local.get $24 f64.const -1.6533902205465252e-06 - get_local $24 + local.get $24 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -8606,93 +8606,93 @@ f64.add f64.mul f64.sub - set_local $19 - get_local $16 - get_local $19 + local.set $19 + local.get $16 + local.get $19 f64.mul - get_local $19 + local.get $19 f64.const 2 f64.sub f64.div - get_local $27 - get_local $16 - get_local $27 + local.get $27 + local.get $16 + local.get $27 f64.mul f64.add f64.sub - set_local $23 + local.set $23 f64.const 1 - get_local $23 - get_local $16 + local.get $23 + local.get $16 f64.sub f64.sub - set_local $16 - get_local $16 - i64.reinterpret/f64 + local.set $16 + local.get $16 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $28 - get_local $29 + i32.wrap_i64 + local.set $28 + local.get $28 + local.get $29 i32.const 20 i32.shl i32.add - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 20 i32.shr_s i32.const 0 i32.le_s if - get_local $16 - get_local $29 + local.get $16 + local.get $29 call $~lib/math/NativeMath.scalbn - set_local $16 + local.set $16 else - get_local $16 - i64.reinterpret/f64 + local.get $16 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $28 - i64.extend_s/i32 + local.get $28 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $16 + f64.reinterpret_i64 + local.set $16 end - get_local $18 - get_local $16 + local.get $18 + local.get $16 f64.mul ) (func $std/math/test_pow (; 125 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.pow - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check - tee_local $5 + local.tee $5 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/bindings/Math/pow - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check end else - get_local $5 + local.get $5 end ) (func $~lib/math/NativeMathf.pow (; 126 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -8731,123 +8731,123 @@ (local $34 f32) (local $35 f32) (local $36 i32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + 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 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 2147483647 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.eq if f32.const 1 return end - get_local $4 + local.get $4 i32.const 2139095040 i32.gt_s - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $5 + local.get $5 i32.const 2139095040 i32.gt_s end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add return end i32.const 0 - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.const 0 i32.lt_s if - get_local $5 + local.get $5 i32.const 1266679808 i32.ge_s if i32.const 2 - set_local $7 + local.set $7 else - get_local $5 + local.get $5 i32.const 1065353216 i32.ge_s if - get_local $5 + local.get $5 i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $9 + local.set $9 i32.const 23 - get_local $9 + local.get $9 i32.sub - set_local $6 - get_local $5 - get_local $6 + local.set $6 + local.get $5 + local.get $6 i32.shr_s - set_local $8 - get_local $8 - get_local $6 + local.set $8 + local.get $8 + local.get $6 i32.shl - get_local $5 + local.get $5 i32.eq if i32.const 2 - get_local $8 + local.get $8 i32.const 1 i32.and i32.sub - set_local $7 + local.set $7 end end end end - get_local $5 + local.get $5 i32.const 2139095040 i32.eq if - get_local $4 + local.get $4 i32.const 1065353216 i32.eq if f32.const nan:0x400000 return else - get_local $4 + local.get $4 i32.const 1065353216 i32.gt_s if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if (result f32) - get_local $1 + local.get $1 else f32.const 0 end return else - get_local $3 + local.get $3 i32.const 0 i32.ge_s if (result f32) f32.const 0 else - get_local $1 + local.get $1 f32.neg end return @@ -8857,158 +8857,158 @@ unreachable unreachable end - get_local $5 + local.get $5 i32.const 1065353216 i32.eq if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if (result f32) - get_local $0 + local.get $0 else f32.const 1 - get_local $0 + local.get $0 f32.div end return end - get_local $3 + local.get $3 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul return end - get_local $3 + local.get $3 i32.const 1056964608 i32.eq if - get_local $2 + local.get $2 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f32.sqrt return end end - get_local $0 + local.get $0 f32.abs - set_local $10 - get_local $4 + local.set $10 + local.get $4 i32.const 2139095040 i32.eq - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $4 + local.get $4 i32.const 0 i32.eq end - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $4 + local.get $4 i32.const 1065353216 i32.eq end if - get_local $10 - set_local $11 - get_local $3 + local.get $10 + local.set $11 + local.get $3 i32.const 0 i32.lt_s if f32.const 1 - get_local $11 + local.get $11 f32.div - set_local $11 + local.set $11 end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $4 + local.get $4 i32.const 1065353216 i32.sub - get_local $7 + local.get $7 i32.or i32.const 0 i32.eq if - get_local $11 - get_local $11 + local.get $11 + local.get $11 f32.sub - set_local $12 - get_local $12 - get_local $12 + local.set $12 + local.get $12 + local.get $12 f32.div - set_local $11 + local.set $11 else - get_local $7 + local.get $7 i32.const 1 i32.eq if - get_local $11 + local.get $11 f32.neg - set_local $11 + local.set $11 end end end - get_local $11 + local.get $11 return end f32.const 1 - set_local $13 - get_local $2 + local.set $13 + local.get $2 i32.const 0 i32.lt_s if - get_local $7 + local.get $7 i32.const 0 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.sub - set_local $12 - get_local $12 - get_local $12 + local.set $12 + local.get $12 + local.get $12 f32.div return end - get_local $7 + local.get $7 i32.const 1 i32.eq if f32.const -1 - set_local $13 + local.set $13 end end - get_local $5 + local.get $5 i32.const 1291845632 i32.gt_s if - get_local $4 + local.get $4 i32.const 1065353208 i32.lt_s if - get_local $3 + local.get $3 i32.const 0 i32.lt_s if (result f32) - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul else - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -9016,21 +9016,21 @@ end return end - get_local $4 + local.get $4 i32.const 1065353223 i32.gt_s if - get_local $3 + local.get $3 i32.const 0 i32.gt_s if (result f32) - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul else - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -9038,199 +9038,199 @@ end return end - get_local $10 + local.get $10 f32.const 1 f32.sub - set_local $18 - get_local $18 - get_local $18 + local.set $18 + local.get $18 + local.get $18 f32.mul f32.const 0.5 - get_local $18 + local.get $18 f32.const 0.3333333432674408 - get_local $18 + local.get $18 f32.const 0.25 f32.mul f32.sub f32.mul f32.sub f32.mul - set_local $21 + local.set $21 f32.const 1.44268798828125 - get_local $18 + local.get $18 f32.mul - set_local $19 - get_local $18 + local.set $19 + local.get $18 f32.const 7.052607543300837e-06 f32.mul - get_local $21 + local.get $21 f32.const 1.4426950216293335 f32.mul f32.sub - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.add - set_local $14 - get_local $14 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $14 + local.get $14 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $14 - get_local $20 - get_local $14 - get_local $19 + f32.reinterpret_i32 + local.set $14 + local.get $20 + local.get $14 + local.get $19 f32.sub f32.sub - set_local $15 + local.set $15 else i32.const 0 - set_local $24 - get_local $4 + local.set $24 + local.get $4 i32.const 8388608 i32.lt_s if - get_local $10 + local.get $10 f32.const 16777216 f32.mul - set_local $10 - get_local $24 + local.set $10 + local.get $24 i32.const 24 i32.sub - set_local $24 - get_local $10 - i32.reinterpret/f32 - set_local $4 + local.set $24 + local.get $10 + i32.reinterpret_f32 + local.set $4 end - get_local $24 - get_local $4 + local.get $24 + local.get $4 i32.const 23 i32.shr_s i32.const 127 i32.sub i32.add - set_local $24 - get_local $4 + local.set $24 + local.get $4 i32.const 8388607 i32.and - set_local $8 - get_local $8 + local.set $8 + local.get $8 i32.const 1065353216 i32.or - set_local $4 - get_local $8 + local.set $4 + local.get $8 i32.const 1885297 i32.le_s if i32.const 0 - set_local $9 + local.set $9 else - get_local $8 + local.get $8 i32.const 6140887 i32.lt_s if i32.const 1 - set_local $9 + local.set $9 else i32.const 0 - set_local $9 - get_local $24 + local.set $9 + local.get $24 i32.const 1 i32.add - set_local $24 - get_local $4 + local.set $24 + local.get $4 i32.const 8388608 i32.sub - set_local $4 + local.set $4 end end - get_local $4 - f32.reinterpret/i32 - set_local $10 + local.get $4 + f32.reinterpret_i32 + local.set $10 f32.const 1.5 f32.const 1 - get_local $9 + local.get $9 select - set_local $30 - get_local $10 - get_local $30 + local.set $30 + local.get $10 + local.get $30 f32.sub - set_local $19 + local.set $19 f32.const 1 - get_local $10 - get_local $30 + local.get $10 + local.get $30 f32.add f32.div - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.mul - set_local $17 - get_local $17 - set_local $26 - get_local $26 - i32.reinterpret/f32 - set_local $25 - get_local $25 + 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 - set_local $26 - get_local $4 + 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 - set_local $25 - get_local $25 + local.set $25 + local.get $25 i32.const 4194304 i32.add - get_local $9 + local.get $9 i32.const 21 i32.shl i32.add - f32.reinterpret/i32 - set_local $28 - get_local $10 - get_local $28 - get_local $30 + f32.reinterpret_i32 + local.set $28 + local.get $10 + local.get $28 + local.get $30 f32.sub f32.sub - set_local $29 - get_local $20 - get_local $19 - get_local $26 - get_local $28 + local.set $29 + local.get $20 + local.get $19 + local.get $26 + local.get $28 f32.mul f32.sub - get_local $26 - get_local $29 + local.get $26 + local.get $29 f32.mul f32.sub f32.mul - set_local $27 - get_local $17 - get_local $17 + local.set $27 + local.get $17 + local.get $17 f32.mul - set_local $12 - get_local $12 - get_local $12 + local.set $12 + local.get $12 + local.get $12 f32.mul f32.const 0.6000000238418579 - get_local $12 + local.get $12 f32.const 0.4285714328289032 - get_local $12 + local.get $12 f32.const 0.3333333432674408 - get_local $12 + local.get $12 f32.const 0.2727281153202057 - get_local $12 + local.get $12 f32.const 0.23066075146198273 - get_local $12 + local.get $12 f32.const 0.20697501301765442 f32.mul f32.add @@ -9243,178 +9243,178 @@ f32.mul f32.add f32.mul - set_local $16 - get_local $16 - get_local $27 - get_local $26 - get_local $17 + local.set $16 + local.get $16 + local.get $27 + local.get $26 + local.get $17 f32.add f32.mul f32.add - set_local $16 - get_local $26 - get_local $26 + local.set $16 + local.get $26 + local.get $26 f32.mul - set_local $12 + local.set $12 f32.const 3 - get_local $12 + local.get $12 f32.add - get_local $16 + local.get $16 f32.add - set_local $28 - get_local $28 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $28 + local.get $28 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $28 - get_local $16 - get_local $28 + f32.reinterpret_i32 + local.set $28 + local.get $16 + local.get $28 f32.const 3 f32.sub - get_local $12 + local.get $12 f32.sub f32.sub - set_local $29 - get_local $26 - get_local $28 + local.set $29 + local.get $26 + local.get $28 f32.mul - set_local $19 - get_local $27 - get_local $28 + local.set $19 + local.get $27 + local.get $28 f32.mul - get_local $29 - get_local $17 + local.get $29 + local.get $17 f32.mul f32.add - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.add - set_local $22 - get_local $22 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $22 + local.get $22 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $22 - get_local $20 - get_local $22 - get_local $19 + f32.reinterpret_i32 + local.set $22 + local.get $20 + local.get $22 + local.get $19 f32.sub f32.sub - set_local $23 + local.set $23 f32.const 0.9619140625 - get_local $22 + local.get $22 f32.mul - set_local $31 + local.set $31 f32.const 1.5632208487659227e-06 f32.const 0 - get_local $9 + local.get $9 select - set_local $32 + local.set $32 f32.const -1.1736857413779944e-04 - get_local $22 + local.get $22 f32.mul - get_local $23 + local.get $23 f32.const 0.9617967009544373 f32.mul f32.add - get_local $32 + local.get $32 f32.add - set_local $33 - get_local $24 - f32.convert_s/i32 - set_local $18 + local.set $33 + local.get $24 + f32.convert_i32_s + local.set $18 f32.const 0.5849609375 f32.const 0 - get_local $9 + local.get $9 select - set_local $34 - get_local $31 - get_local $33 + local.set $34 + local.get $31 + local.get $33 f32.add - get_local $34 + local.get $34 f32.add - get_local $18 + local.get $18 f32.add - set_local $14 - get_local $14 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $14 + local.get $14 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $14 - get_local $33 - get_local $14 - get_local $18 + f32.reinterpret_i32 + local.set $14 + local.get $33 + local.get $14 + local.get $18 f32.sub - get_local $34 + local.get $34 f32.sub - get_local $31 + local.get $31 f32.sub f32.sub - set_local $15 + local.set $15 end - get_local $1 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.get $1 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -4096 i32.and - f32.reinterpret/i32 - set_local $35 - get_local $1 - get_local $35 + f32.reinterpret_i32 + local.set $35 + local.get $1 + local.get $35 f32.sub - get_local $14 + local.get $14 f32.mul - get_local $1 - get_local $15 + local.get $1 + local.get $15 f32.mul f32.add - set_local $23 - get_local $35 - get_local $14 + local.set $23 + local.get $35 + local.get $14 f32.mul - set_local $22 - get_local $23 - get_local $22 + local.set $22 + local.get $23 + local.get $22 f32.add - set_local $11 - get_local $11 - i32.reinterpret/f32 - set_local $8 - get_local $8 + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $8 + local.get $8 i32.const 1124073472 i32.gt_s if - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 f32.mul return else - get_local $8 + local.get $8 i32.const 1124073472 i32.eq if - get_local $23 + local.get $23 f32.const 4.299566569443414e-08 f32.add - get_local $11 - get_local $22 + local.get $11 + local.get $22 f32.sub f32.gt if - get_local $13 + local.get $13 f32.const 1000000015047466219876688e6 f32.mul f32.const 1000000015047466219876688e6 @@ -9422,30 +9422,30 @@ return end else - get_local $8 + local.get $8 i32.const 2147483647 i32.and i32.const 1125515264 i32.gt_s if - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 f32.mul return else - get_local $8 + local.get $8 i32.const -1021968384 i32.eq if - get_local $23 - get_local $11 - get_local $22 + local.get $23 + local.get $11 + local.get $22 f32.sub f32.le if - get_local $13 + local.get $13 f32.const 1.0000000031710769e-30 f32.mul f32.const 1.0000000031710769e-30 @@ -9456,123 +9456,123 @@ end end end - get_local $8 + local.get $8 i32.const 2147483647 i32.and - set_local $36 - get_local $36 + local.set $36 + local.get $36 i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $9 + local.set $9 i32.const 0 - set_local $24 - get_local $36 + local.set $24 + local.get $36 i32.const 1056964608 i32.gt_s if - get_local $8 + local.get $8 i32.const 8388608 - get_local $9 + local.get $9 i32.const 1 i32.add i32.shr_s i32.add - set_local $24 - get_local $24 + local.set $24 + local.get $24 i32.const 2147483647 i32.and i32.const 23 i32.shr_s i32.const 127 i32.sub - set_local $9 - get_local $24 + local.set $9 + local.get $24 i32.const 8388607 - get_local $9 + local.get $9 i32.shr_s i32.const -1 i32.xor i32.and - f32.reinterpret/i32 - set_local $18 - get_local $24 + f32.reinterpret_i32 + local.set $18 + local.get $24 i32.const 8388607 i32.and i32.const 8388608 i32.or i32.const 23 - get_local $9 + local.get $9 i32.sub i32.shr_s - set_local $24 - get_local $8 + local.set $24 + local.get $8 i32.const 0 i32.lt_s if i32.const 0 - get_local $24 + local.get $24 i32.sub - set_local $24 + local.set $24 end - get_local $22 - get_local $18 + local.get $22 + local.get $18 f32.sub - set_local $22 + local.set $22 end - get_local $23 - get_local $22 + local.get $23 + local.get $22 f32.add - set_local $18 - get_local $18 - i32.reinterpret/f32 - set_local $25 - get_local $25 + local.set $18 + local.get $18 + i32.reinterpret_f32 + local.set $25 + local.get $25 i32.const -32768 i32.and - f32.reinterpret/i32 - set_local $18 - get_local $18 + f32.reinterpret_i32 + local.set $18 + local.get $18 f32.const 0.693145751953125 f32.mul - set_local $19 - get_local $23 - get_local $18 - get_local $22 + local.set $19 + local.get $23 + local.get $18 + local.get $22 f32.sub f32.sub f32.const 0.6931471824645996 f32.mul - get_local $18 + local.get $18 f32.const 1.4286065379565116e-06 f32.mul f32.add - set_local $20 - get_local $19 - get_local $20 + local.set $20 + local.get $19 + local.get $20 f32.add - set_local $11 - get_local $20 - get_local $11 - get_local $19 + local.set $11 + local.get $20 + local.get $11 + local.get $19 f32.sub f32.sub - set_local $21 - get_local $11 - get_local $11 + local.set $21 + local.get $11 + local.get $11 f32.mul - set_local $18 - get_local $11 - get_local $18 + local.set $18 + local.get $11 + local.get $18 f32.const 0.1666666716337204 - get_local $18 + local.get $18 f32.const -2.7777778450399637e-03 - get_local $18 + local.get $18 f32.const 6.61375597701408e-05 - get_local $18 + local.get $18 f32.const -1.6533901998627698e-06 - get_local $18 + local.get $18 f32.const 4.138136944220605e-08 f32.mul f32.add @@ -9584,130 +9584,130 @@ f32.add f32.mul f32.sub - set_local $14 - get_local $11 - get_local $14 + local.set $14 + local.get $11 + local.get $14 f32.mul - get_local $14 + local.get $14 f32.const 2 f32.sub f32.div - get_local $21 - get_local $11 - get_local $21 + local.get $21 + local.get $11 + local.get $21 f32.mul f32.add f32.sub - set_local $16 + local.set $16 f32.const 1 - get_local $16 - get_local $11 + local.get $16 + local.get $11 f32.sub f32.sub - set_local $11 - get_local $11 - i32.reinterpret/f32 - set_local $8 - get_local $8 - get_local $24 + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $8 + local.get $8 + local.get $24 i32.const 23 i32.shl i32.add - set_local $8 - get_local $8 + local.set $8 + local.get $8 i32.const 23 i32.shr_s i32.const 0 i32.le_s if - get_local $11 - get_local $24 + local.get $11 + local.get $24 call $~lib/math/NativeMathf.scalbn - set_local $11 + local.set $11 else - get_local $8 - f32.reinterpret/i32 - set_local $11 + local.get $8 + f32.reinterpret_i32 + local.set $11 end - get_local $13 - get_local $11 + local.get $13 + local.get $11 f32.mul ) (func $std/math/test_powf (; 127 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.pow - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $~lib/math/murmurHash3 (; 128 ;) (type $II) (param $0 i64) (result i64) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i64.const 33 i64.shr_u i64.xor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i64.const -49064778989728563 i64.mul - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i64.const 33 i64.shr_u i64.xor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i64.const -4265267296055464877 i64.mul - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i64.const 33 i64.shr_u i64.xor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/math/splitMix32 (; 129 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 1831565813 i32.add - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i32.const 15 i32.shr_u i32.xor - get_local $0 + local.get $0 i32.const 1 i32.or i32.mul - set_local $0 - get_local $0 - get_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 i32.const 7 i32.shr_u i32.xor - get_local $0 + local.get $0 i32.const 61 i32.or i32.mul i32.add i32.xor - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i32.const 14 i32.shr_u i32.xor ) (func $~lib/math/NativeMath.seedRandom (; 130 ;) (type $Iv) (param $0 i64) - get_local $0 + local.get $0 i64.eqz if i32.const 0 @@ -9718,28 +9718,28 @@ unreachable end i32.const 1 - set_global $~lib/math/random_seeded - get_local $0 + global.set $~lib/math/random_seeded + local.get $0 call $~lib/math/murmurHash3 - set_global $~lib/math/random_state0_64 - get_global $~lib/math/random_state0_64 + global.set $~lib/math/random_state0_64 + global.get $~lib/math/random_state0_64 i64.const -1 i64.xor call $~lib/math/murmurHash3 - set_global $~lib/math/random_state1_64 - get_local $0 - i32.wrap/i64 + global.set $~lib/math/random_state1_64 + local.get $0 + i32.wrap_i64 call $~lib/math/splitMix32 - set_global $~lib/math/random_state0_32 - get_global $~lib/math/random_state0_32 + global.set $~lib/math/random_state0_32 + global.get $~lib/math/random_state0_32 call $~lib/math/splitMix32 - set_global $~lib/math/random_state1_32 + global.set $~lib/math/random_state1_32 ) (func $~lib/math/NativeMath.random (; 131 ;) (type $F) (result f64) (local $0 i64) (local $1 i64) (local $2 i64) - get_global $~lib/math/random_seeded + global.get $~lib/math/random_seeded i32.eqz if i32.const 0 @@ -9749,46 +9749,46 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/random_state0_64 - set_local $0 - get_global $~lib/math/random_state1_64 - set_local $1 - get_local $1 - set_global $~lib/math/random_state0_64 - get_local $0 - get_local $0 + 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 - set_local $0 - get_local $0 - get_local $0 + local.set $0 + local.get $0 + local.get $0 i64.const 17 i64.shr_u i64.xor - set_local $0 - get_local $0 - get_local $1 + local.set $0 + local.get $0 + local.get $1 i64.xor - set_local $0 - get_local $0 - get_local $1 + local.set $0 + local.get $0 + local.get $1 i64.const 26 i64.shr_u i64.xor - set_local $0 - get_local $0 - set_global $~lib/math/random_state1_64 - get_local $1 - get_local $0 + 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 - set_local $2 - get_local $2 - f64.reinterpret/i64 + local.set $2 + local.get $2 + f64.reinterpret_i64 f64.const 1 f64.sub ) @@ -9796,7 +9796,7 @@ (local $0 i32) (local $1 i32) (local $2 i32) - get_global $~lib/math/random_seeded + global.get $~lib/math/random_seeded i32.eqz if i32.const 0 @@ -9806,140 +9806,140 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/random_state0_32 - set_local $0 - get_global $~lib/math/random_state1_32 - set_local $1 - get_local $0 + global.get $~lib/math/random_state0_32 + local.set $0 + global.get $~lib/math/random_state1_32 + local.set $1 + local.get $0 i32.const -1640531525 i32.mul i32.const 5 i32.rotl i32.const 5 i32.mul - set_local $2 - get_local $1 - get_local $0 + local.set $2 + local.get $1 + local.get $0 i32.xor - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 26 i32.rotl - get_local $1 + local.get $1 i32.xor - get_local $1 + local.get $1 i32.const 9 i32.shl i32.xor - set_global $~lib/math/random_state0_32 - get_local $1 + global.set $~lib/math/random_state0_32 + local.get $1 i32.const 13 i32.rotl - set_global $~lib/math/random_state1_32 - get_local $2 + global.set $~lib/math/random_state1_32 + local.get $2 i32.const 9 i32.shr_u i32.const 127 i32.const 23 i32.shl i32.or - f32.reinterpret/i32 + f32.reinterpret_i32 f32.const 1 f32.sub ) (func $std/math/test_round (; 133 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) block $~lib/math/NativeMath.round|inlined.0 (result f64) - get_local $0 + local.get $0 f64.const 0.5 f64.add f64.floor - get_local $0 + local.get $0 f64.copysign end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_roundf (; 134 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) block $~lib/math/NativeMathf.round|inlined.0 (result f32) - get_local $0 + local.get $0 f32.const 0.5 f32.add f32.floor - get_local $0 + local.get $0 f32.copysign end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_sign (; 135 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) block $~lib/math/NativeMath.sign|inlined.0 (result f64) - get_local $0 + local.get $0 f64.const 0 f64.gt if (result f64) f64.const 1 else - get_local $0 + local.get $0 f64.const 0 f64.lt if (result f64) f64.const -1 else - get_local $0 + local.get $0 end end br $~lib/math/NativeMath.sign|inlined.0 end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/sign - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_signf (; 136 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) block $~lib/math/NativeMathf.sign|inlined.0 (result f32) - get_local $0 + local.get $0 f32.const 0 f32.gt if (result f32) f32.const 1 else - get_local $0 + local.get $0 f32.const 0 f32.lt if (result f32) f32.const -1 else - get_local $0 + local.get $0 end end br $~lib/math/NativeMathf.sign|inlined.0 end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.rem (; 137 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -9954,223 +9954,223 @@ (local $10 i32) (local $11 i64) (local $12 f64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 + 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 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i64.const 63 i64.shr_u - i32.wrap/i64 - set_local $6 - get_local $3 + i32.wrap_i64 + local.set $6 + local.get $3 i64.const 1 i64.shl i64.const 0 i64.eq - tee_local $7 + local.tee $7 if (result i32) - get_local $7 + local.get $7 else - get_local $4 + local.get $4 i64.const 2047 i64.eq end - tee_local $7 + local.tee $7 if (result i32) - get_local $7 + local.get $7 else - get_local $1 + local.get $1 call $~lib/builtins/isNaN end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - set_local $8 - get_local $8 - get_local $8 + local.set $8 + local.get $8 + local.get $8 f64.div return end - get_local $2 + local.get $2 i64.const 1 i64.shl i64.const 0 i64.eq if - get_local $0 + local.get $0 return end - get_local $2 - set_local $9 - get_local $4 + local.get $2 + local.set $9 + local.get $4 i64.eqz if - get_local $4 - get_local $9 + local.get $4 + local.get $9 i64.const 12 i64.shl i64.clz i64.sub - set_local $4 - get_local $9 + local.set $4 + local.get $9 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shl - set_local $9 + local.set $9 else - get_local $9 + local.get $9 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $9 - get_local $9 + local.set $9 + local.get $9 i64.const 1 i64.const 52 i64.shl i64.or - set_local $9 + local.set $9 end - get_local $5 + local.get $5 i64.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.const 12 i64.shl i64.clz i64.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i64.const 0 - get_local $5 + local.get $5 i64.sub i64.const 1 i64.add i64.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 1 i64.const 52 i64.shl i64.or - set_local $3 + local.set $3 end i32.const 0 - set_local $10 + local.set $10 block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.lt_s if - get_local $4 + local.get $4 i64.const 1 i64.add - get_local $5 + local.get $5 i64.eq if br $break|0 end - get_local $0 + local.get $0 return end block $break|1 loop $continue|1 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.gt_s if block - get_local $9 - get_local $3 + local.get $9 + local.get $3 i64.ge_u if - get_local $9 - get_local $3 + local.get $9 + local.get $3 i64.sub - set_local $9 - get_local $10 + local.set $9 + local.get $10 i32.const 1 i32.add - set_local $10 + local.set $10 end - get_local $9 + local.get $9 i64.const 1 i64.shl - set_local $9 - get_local $10 + local.set $9 + local.get $10 i32.const 1 i32.shl - set_local $10 - get_local $4 + local.set $10 + local.get $4 i64.const 1 i64.sub - set_local $4 + local.set $4 end br $continue|1 end end end - get_local $9 - get_local $3 + local.get $9 + local.get $3 i64.ge_u if - get_local $9 - get_local $3 + local.get $9 + local.get $3 i64.sub - set_local $9 - get_local $10 + local.set $9 + local.get $10 i32.const 1 i32.add - set_local $10 + local.set $10 end - get_local $9 + local.get $9 i64.const 0 i64.eq if i64.const -60 - set_local $4 + local.set $4 else - get_local $9 + local.get $9 i64.const 11 i64.shl i64.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i64.sub - set_local $4 - get_local $9 - get_local $11 + local.set $4 + local.get $9 + local.get $11 i64.shl - set_local $9 + local.set $9 end br $break|0 unreachable @@ -10178,100 +10178,100 @@ unreachable unreachable end - get_local $4 + local.get $4 i64.const 0 i64.gt_s if - get_local $9 + local.get $9 i64.const 1 i64.const 52 i64.shl i64.sub - set_local $9 - get_local $9 - get_local $4 + local.set $9 + local.get $9 + local.get $4 i64.const 52 i64.shl i64.or - set_local $9 + local.set $9 else - get_local $9 + local.get $9 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shr_u - set_local $9 + local.set $9 end - get_local $9 - f64.reinterpret/i64 - set_local $0 - get_local $1 + local.get $9 + f64.reinterpret_i64 + local.set $0 + local.get $1 f64.abs - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 f64.add - set_local $12 - get_local $4 - get_local $5 + local.set $12 + local.get $4 + local.get $5 i64.eq - tee_local $7 + local.tee $7 if (result i32) - get_local $7 + local.get $7 else - get_local $4 + local.get $4 i64.const 1 i64.add - get_local $5 + local.get $5 i64.eq - tee_local $7 + local.tee $7 if (result i32) - get_local $12 - get_local $1 + local.get $12 + local.get $1 f64.gt - tee_local $7 + local.tee $7 if (result i32) - get_local $7 + local.get $7 else - get_local $12 - get_local $1 + local.get $12 + local.get $1 f64.eq - tee_local $7 + local.tee $7 if (result i32) - get_local $10 + local.get $10 i32.const 1 i32.and else - get_local $7 + local.get $7 end end else - get_local $7 + local.get $7 end end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.sub - set_local $0 + local.set $0 end - get_local $6 + local.get $6 if (result f64) - get_local $0 + local.get $0 f64.neg else - get_local $0 + local.get $0 end ) (func $std/math/test_rem (; 138 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.rem - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $~lib/math/NativeMathf.rem (; 139 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -10284,222 +10284,222 @@ (local $8 i32) (local $9 i32) (local $10 f32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + local.get $0 + i32.reinterpret_f32 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 31 i32.shr_u - set_local $6 - get_local $2 - set_local $7 - get_local $3 + local.set $6 + local.get $2 + local.set $7 + local.get $3 i32.const 1 i32.shl i32.const 0 i32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i32.const 255 i32.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 + local.get $1 call $~lib/builtins/isNaN end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul f32.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl i32.const 0 i32.eq if - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i32.eqz if - get_local $4 - get_local $7 + local.get $4 + local.get $7 i32.const 9 i32.shl i32.clz i32.sub - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shl - set_local $7 + local.set $7 else - get_local $7 + local.get $7 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.const 1 i32.const 23 i32.shl i32.or - set_local $7 + local.set $7 end - get_local $5 + local.get $5 i32.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.const 9 i32.shl i32.clz i32.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 0 - get_local $5 + local.get $5 i32.sub i32.const 1 i32.add i32.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.const 23 i32.shl i32.or - set_local $3 + local.set $3 end i32.const 0 - set_local $9 + local.set $9 block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.lt_s if - get_local $4 + local.get $4 i32.const 1 i32.add - get_local $5 + local.get $5 i32.eq if br $break|0 end - get_local $0 + local.get $0 return end block $break|1 loop $continue|1 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.gt_s if block - get_local $7 - get_local $3 + local.get $7 + local.get $3 i32.ge_u if - get_local $7 - get_local $3 + local.get $7 + local.get $3 i32.sub - set_local $7 - get_local $9 + local.set $7 + local.get $9 i32.const 1 i32.add - set_local $9 + local.set $9 end - get_local $7 + local.get $7 i32.const 1 i32.shl - set_local $7 - get_local $9 + local.set $7 + local.get $9 i32.const 1 i32.shl - set_local $9 - get_local $4 + local.set $9 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 end br $continue|1 end end end - get_local $7 - get_local $3 + local.get $7 + local.get $3 i32.ge_u if - get_local $7 - get_local $3 + local.get $7 + local.get $3 i32.sub - set_local $7 - get_local $9 + local.set $7 + local.get $9 i32.const 1 i32.add - set_local $9 + local.set $9 end - get_local $7 + local.get $7 i32.const 0 i32.eq if i32.const -30 - set_local $4 + local.set $4 else - get_local $7 + local.get $7 i32.const 8 i32.shl i32.clz - set_local $8 - get_local $4 - get_local $8 + local.set $8 + local.get $4 + local.get $8 i32.sub - set_local $4 - get_local $7 - get_local $8 + local.set $4 + local.get $7 + local.get $8 i32.shl - set_local $7 + local.set $7 end br $break|0 unreachable @@ -10507,100 +10507,100 @@ unreachable unreachable end - get_local $4 + local.get $4 i32.const 0 i32.gt_s if - get_local $7 + local.get $7 i32.const 1 i32.const 23 i32.shl i32.sub - set_local $7 - get_local $7 - get_local $4 + local.set $7 + local.get $7 + local.get $4 i32.const 23 i32.shl i32.or - set_local $7 + local.set $7 else - get_local $7 + local.get $7 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shr_u - set_local $7 + local.set $7 end - get_local $7 - f32.reinterpret/i32 - set_local $0 - get_local $1 + local.get $7 + f32.reinterpret_i32 + local.set $0 + local.get $1 f32.abs - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 f32.add - set_local $10 - get_local $4 - get_local $5 + local.set $10 + local.get $4 + local.get $5 i32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i32.const 1 i32.add - get_local $5 + local.get $5 i32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $10 - get_local $1 + local.get $10 + local.get $1 f32.gt - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $10 - get_local $1 + local.get $10 + local.get $1 f32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $9 + local.get $9 i32.const 1 i32.and else - get_local $8 + local.get $8 end end else - get_local $8 + local.get $8 end end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.sub - set_local $0 + local.set $0 end - get_local $6 + local.get $6 if (result f32) - get_local $0 + local.get $0 f32.neg else - get_local $0 + local.get $0 end ) (func $std/math/test_remf (; 140 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.rem - get_local $2 - get_local $3 - get_local $4 + local.get $2 + local.get $3 + local.get $4 call $std/math/check ) (func $~lib/math/NativeMath.sinh (; 141 ;) (type $FF) (param $0 f64) (result f64) @@ -10610,35 +10610,35 @@ (local $4 f64) (local $5 f64) (local $6 f64) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $2 - get_local $1 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $2 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 + i32.wrap_i64 + local.set $3 f64.const 0.5 - get_local $0 + local.get $0 f64.copysign - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 1082535490 i32.lt_u if - get_local $2 + local.get $2 call $~lib/math/NativeMath.expm1 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1072693248 i32.lt_u if - get_local $3 + local.get $3 i32.const 1072693248 i32.const 26 i32.const 20 @@ -10646,17 +10646,17 @@ i32.sub i32.lt_u if - get_local $0 + local.get $0 return end - get_local $5 + local.get $5 f64.const 2 - get_local $4 + local.get $4 f64.mul - get_local $4 - get_local $4 + local.get $4 + local.get $4 f64.mul - get_local $4 + local.get $4 f64.const 1 f64.add f64.div @@ -10664,10 +10664,10 @@ f64.mul return end - get_local $5 - get_local $4 - get_local $4 - get_local $4 + local.get $5 + local.get $4 + local.get $4 + local.get $4 f64.const 1 f64.add f64.div @@ -10676,7 +10676,7 @@ return end f64.const 2 - get_local $5 + local.get $5 f64.mul block $~lib/math/expo2|inlined.1 (result f64) i32.const 1023 @@ -10686,49 +10686,49 @@ i32.add i32.const 20 i32.shl - i64.extend_u/i32 + i64.extend_i32_u i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $6 - get_local $2 + f64.reinterpret_i64 + local.set $6 + local.get $2 f64.const 1416.0996898839683 f64.sub call $~lib/math/NativeMath.exp - get_local $6 + local.get $6 f64.mul - get_local $6 + local.get $6 f64.mul end f64.mul - set_local $4 - get_local $4 + local.set $4 + local.get $4 ) (func $std/math/test_sinh (; 142 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.sinh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/sinh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.sinh (; 143 ;) (type $ff) (param $0 f32) (result f32) @@ -10737,30 +10737,30 @@ (local $3 f32) (local $4 f32) (local $5 f32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 i32.const 2147483647 i32.and - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $2 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 f32.const 0.5 - get_local $0 + local.get $0 f32.copysign - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 1118925335 i32.lt_u if - get_local $2 + local.get $2 call $~lib/math/NativeMathf.expm1 - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1065353216 i32.lt_u if - get_local $1 + local.get $1 i32.const 1065353216 i32.const 12 i32.const 23 @@ -10768,17 +10768,17 @@ i32.sub i32.lt_u if - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 f32.const 2 - get_local $3 + local.get $3 f32.mul - get_local $3 - get_local $3 + local.get $3 + local.get $3 f32.mul - get_local $3 + local.get $3 f32.const 1 f32.add f32.div @@ -10786,10 +10786,10 @@ f32.mul return end - get_local $4 - get_local $3 - get_local $3 - get_local $3 + local.get $4 + local.get $3 + local.get $3 + local.get $3 f32.const 1 f32.add f32.div @@ -10798,7 +10798,7 @@ return end f32.const 2 - get_local $4 + local.get $4 f32.mul block $~lib/math/expo2f|inlined.1 (result f32) i32.const 127 @@ -10808,66 +10808,66 @@ i32.add i32.const 23 i32.shl - f32.reinterpret/i32 - set_local $5 - get_local $2 + f32.reinterpret_i32 + local.set $5 + local.get $2 f32.const 162.88958740234375 f32.sub call $~lib/math/NativeMathf.exp - get_local $5 + local.get $5 f32.mul - get_local $5 + local.get $5 f32.mul end f32.mul - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $std/math/test_sinhf (; 144 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.sinh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_sqrt (; 145 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) block $~lib/math/NativeMath.sqrt|inlined.0 (result f64) - get_local $0 + local.get $0 f64.sqrt end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/sqrt - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_sqrtf (; 146 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) block $~lib/math/NativeMathf.sqrt|inlined.0 (result f32) - get_local $0 + local.get $0 f32.sqrt end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.tanh (; 147 ;) (type $FF) (param $0 f64) (result f64) @@ -10875,256 +10875,256 @@ (local $2 f64) (local $3 i32) (local $4 f64) - get_local $0 - i64.reinterpret/f64 - set_local $1 - get_local $1 + local.get $0 + i64.reinterpret_f64 + local.set $1 + local.get $1 i64.const 9223372036854775807 i64.and - set_local $1 - get_local $1 - f64.reinterpret/i64 - set_local $2 - get_local $1 + local.set $1 + local.get $1 + f64.reinterpret_i64 + local.set $2 + local.get $1 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 - get_local $3 + i32.wrap_i64 + local.set $3 + local.get $3 i32.const 1071748074 i32.gt_u if - get_local $3 + local.get $3 i32.const 1077149696 i32.gt_u if f64.const 1 f64.const 0 - get_local $2 + local.get $2 f64.div f64.sub - set_local $4 + local.set $4 else f64.const 2 - get_local $2 + local.get $2 f64.mul call $~lib/math/NativeMath.expm1 - set_local $4 + local.set $4 f64.const 1 f64.const 2 - get_local $4 + local.get $4 f64.const 2 f64.add f64.div f64.sub - set_local $4 + local.set $4 end else - get_local $3 + local.get $3 i32.const 1070618798 i32.gt_u if f64.const 2 - get_local $2 + local.get $2 f64.mul call $~lib/math/NativeMath.expm1 - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f64.const 2 f64.add f64.div - set_local $4 + local.set $4 else - get_local $3 + local.get $3 i32.const 1048576 i32.ge_u if f64.const -2 - get_local $2 + local.get $2 f64.mul call $~lib/math/NativeMath.expm1 - set_local $4 - get_local $4 + local.set $4 + local.get $4 f64.neg - get_local $4 + local.get $4 f64.const 2 f64.add f64.div - set_local $4 + local.set $4 else - get_local $2 - set_local $4 + local.get $2 + local.set $4 end end end - get_local $4 - get_local $0 + local.get $4 + local.get $0 f64.copysign ) (func $std/math/test_tanh (; 148 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.tanh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/tanh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $~lib/math/NativeMathf.tanh (; 149 ;) (type $ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) - get_local $0 - i32.reinterpret/f32 - set_local $1 - get_local $1 + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 i32.const 2147483647 i32.and - set_local $1 - get_local $1 - f32.reinterpret/i32 - set_local $2 - get_local $1 + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 + local.get $1 i32.const 1057791828 i32.gt_u if - get_local $1 + local.get $1 i32.const 1092616192 i32.gt_u if f32.const 1 f32.const 0 - get_local $2 + local.get $2 f32.div f32.add - set_local $3 + local.set $3 else f32.const 2 - get_local $2 + local.get $2 f32.mul call $~lib/math/NativeMathf.expm1 - set_local $3 + local.set $3 f32.const 1 f32.const 2 - get_local $3 + local.get $3 f32.const 2 f32.add f32.div f32.sub - set_local $3 + local.set $3 end else - get_local $1 + local.get $1 i32.const 1048757624 i32.gt_u if f32.const 2 - get_local $2 + local.get $2 f32.mul call $~lib/math/NativeMathf.expm1 - set_local $3 - get_local $3 - get_local $3 + local.set $3 + local.get $3 + local.get $3 f32.const 2 f32.add f32.div - set_local $3 + local.set $3 else - get_local $1 + local.get $1 i32.const 8388608 i32.ge_u if f32.const -2 - get_local $2 + local.get $2 f32.mul call $~lib/math/NativeMathf.expm1 - set_local $3 - get_local $3 + local.set $3 + local.get $3 f32.neg - get_local $3 + local.get $3 f32.const 2 f32.add f32.div - set_local $3 + local.set $3 else - get_local $2 - set_local $3 + local.get $2 + local.set $3 end end end - get_local $3 - get_local $0 + local.get $3 + local.get $0 f32.copysign ) (func $std/math/test_tanhf (; 150 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.tanh - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $std/math/test_trunc (; 151 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 i32) block $~lib/math/NativeMath.trunc|inlined.0 (result f64) - get_local $0 + local.get $0 f64.trunc end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check - tee_local $4 + local.tee $4 if (result i32) - get_global $std/math/js + global.get $std/math/js i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $4 + local.get $4 else - get_local $0 + local.get $0 call $~lib/bindings/Math/trunc - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check end else - get_local $4 + local.get $4 end ) (func $std/math/test_truncf (; 152 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) block $~lib/math/NativeMathf.trunc|inlined.0 (result f32) - get_local $0 + local.get $0 f32.trunc end - get_local $1 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 call $std/math/check ) (func $~lib/math/NativeMath.imul (; 153 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add call $~lib/builtins/isFinite i32.eqz @@ -11132,36 +11132,36 @@ f64.const 0 return end - get_local $0 + local.get $0 f64.const 4294967296 - get_local $0 + local.get $0 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 - get_local $1 + i64.trunc_f64_s + i32.wrap_i64 + local.get $1 f64.const 4294967296 - get_local $1 + local.get $1 f64.const 2.3283064365386963e-10 f64.mul f64.floor f64.mul f64.sub - i64.trunc_s/f64 - i32.wrap/i64 + i64.trunc_f64_s + i32.wrap_i64 i32.mul - f64.convert_s/i32 + f64.convert_i32_s ) (func $~lib/math/ipow64 (; 154 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64) (local $2 i64) (local $3 i32) (local $4 i32) i64.const 1 - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 i32.lt_s if @@ -11172,17 +11172,17 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $1 - set_local $3 - get_local $3 + local.get $1 + local.set $3 + local.get $3 i32.const 0 i32.eq br_if $case0|0 - get_local $3 + local.get $3 i32.const 1 i32.eq br_if $case1|0 - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case2|0 @@ -11191,20 +11191,20 @@ i64.const 1 return end - get_local $0 + local.get $0 return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 i64.mul return end i32.const 32 - get_local $1 + local.get $1 i32.clz i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 6 i32.le_s if @@ -11215,278 +11215,278 @@ block $case2|1 block $case1|1 block $case0|1 - get_local $3 - set_local $4 - get_local $4 + local.get $3 + local.set $4 + local.get $4 i32.const 6 i32.eq br_if $case0|1 - get_local $4 + local.get $4 i32.const 5 i32.eq br_if $case1|1 - get_local $4 + local.get $4 i32.const 4 i32.eq br_if $case2|1 - get_local $4 + local.get $4 i32.const 3 i32.eq br_if $case3|1 - get_local $4 + local.get $4 i32.const 2 i32.eq br_if $case4|1 - get_local $4 + local.get $4 i32.const 1 i32.eq br_if $case5|1 br $break|1 end block - get_local $1 + local.get $1 i32.const 1 i32.and if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i64.mul - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end end block - get_local $1 + local.get $1 i32.const 1 i32.and if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i64.mul - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end end block - get_local $1 + local.get $1 i32.const 1 i32.and if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i64.mul - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end end block - get_local $1 + local.get $1 i32.const 1 i32.and if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i64.mul - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end end block - get_local $1 + local.get $1 i32.const 1 i32.and if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i64.mul - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end end - get_local $1 + local.get $1 i32.const 1 i32.and if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i64.mul - set_local $2 + local.set $2 end end - get_local $2 + local.get $2 return end block $break|2 loop $continue|2 - get_local $1 + local.get $1 i32.const 0 i32.gt_s if block - get_local $1 + local.get $1 i32.const 1 i32.and if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i64.mul - set_local $2 + local.set $2 end - get_local $1 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 i64.mul - set_local $0 + local.set $0 end br $continue|2 end end end - get_local $2 + local.get $2 ) (func $~lib/math/ipow32f (; 155 ;) (type $fif) (param $0 f32) (param $1 i32) (result f32) (local $2 i32) (local $3 f32) - get_local $1 + local.get $1 i32.const 31 i32.shr_s - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.add - get_local $2 + local.get $2 i32.xor - set_local $1 + local.set $1 f32.const 1 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $1 + local.get $1 if block - get_local $3 - get_local $0 + local.get $3 + local.get $0 f32.const 1 - get_local $1 + local.get $1 i32.const 1 i32.and select f32.mul - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 f32.mul - set_local $0 + local.set $0 end br $continue|0 end end end - get_local $2 + local.get $2 if (result f32) f32.const 1 - get_local $3 + local.get $3 f32.div else - get_local $3 + local.get $3 end ) (func $~lib/math/ipow64f (; 156 ;) (type $FiF) (param $0 f64) (param $1 i32) (result f64) (local $2 i32) (local $3 f64) - get_local $1 + local.get $1 i32.const 31 i32.shr_s - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.add - get_local $2 + local.get $2 i32.xor - set_local $1 + local.set $1 f64.const 1 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $1 + local.get $1 if block - get_local $3 - get_local $0 + local.get $3 + local.get $0 f64.const 1 - get_local $1 + local.get $1 i32.const 1 i32.and select f64.mul - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 1 i32.shr_s - set_local $1 - get_local $0 - get_local $0 + local.set $1 + local.get $0 + local.get $0 f64.mul - set_local $0 + local.set $0 end br $continue|0 end end end - get_local $2 + local.get $2 if (result f64) f64.const 1 - get_local $3 + local.get $3 f64.div else - get_local $3 + local.get $3 end ) (func $start (; 157 ;) (type $v) @@ -11495,8 +11495,8 @@ (local $2 i32) (local $3 i64) (local $4 f32) - get_global $~lib/math/NativeMath.E - get_global $~lib/math/NativeMath.E + global.get $~lib/math/NativeMath.E + global.get $~lib/math/NativeMath.E f64.eq i32.eqz if @@ -11507,8 +11507,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.E - get_global $~lib/math/NativeMathf.E + global.get $~lib/math/NativeMathf.E + global.get $~lib/math/NativeMathf.E f32.eq i32.eqz if @@ -11519,8 +11519,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMath.E - get_global $~lib/bindings/Math/E + global.get $~lib/math/NativeMath.E + global.get $~lib/bindings/Math/E f64.const 0 i32.const 0 call $std/math/check @@ -11533,8 +11533,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMath.LN2 - get_global $~lib/bindings/Math/LN2 + global.get $~lib/math/NativeMath.LN2 + global.get $~lib/bindings/Math/LN2 f64.const 0 i32.const 0 call $std/math/check @@ -11547,8 +11547,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMath.LN10 - get_global $~lib/bindings/Math/LN10 + global.get $~lib/math/NativeMath.LN10 + global.get $~lib/bindings/Math/LN10 f64.const 0 i32.const 0 call $std/math/check @@ -11561,8 +11561,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMath.LOG2E - get_global $~lib/bindings/Math/LOG2E + global.get $~lib/math/NativeMath.LOG2E + global.get $~lib/bindings/Math/LOG2E f64.const 0 i32.const 0 call $std/math/check @@ -11575,8 +11575,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMath.PI - get_global $~lib/bindings/Math/PI + global.get $~lib/math/NativeMath.PI + global.get $~lib/bindings/Math/PI f64.const 0 i32.const 0 call $std/math/check @@ -11589,8 +11589,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMath.SQRT1_2 - get_global $~lib/bindings/Math/SQRT1_2 + global.get $~lib/math/NativeMath.SQRT1_2 + global.get $~lib/bindings/Math/SQRT1_2 f64.const 0 i32.const 0 call $std/math/check @@ -11603,8 +11603,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMath.SQRT2 - get_global $~lib/bindings/Math/SQRT2 + global.get $~lib/math/NativeMath.SQRT2 + global.get $~lib/bindings/Math/SQRT2 f64.const 0 i32.const 0 call $std/math/check @@ -11617,9 +11617,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.E - get_global $~lib/bindings/Math/E - f32.demote/f64 + global.get $~lib/math/NativeMathf.E + global.get $~lib/bindings/Math/E + f32.demote_f64 f32.const 0 i32.const 0 call $std/math/check @@ -11632,9 +11632,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.LN2 - get_global $~lib/bindings/Math/LN2 - f32.demote/f64 + global.get $~lib/math/NativeMathf.LN2 + global.get $~lib/bindings/Math/LN2 + f32.demote_f64 f32.const 0 i32.const 0 call $std/math/check @@ -11647,9 +11647,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.LN10 - get_global $~lib/bindings/Math/LN10 - f32.demote/f64 + global.get $~lib/math/NativeMathf.LN10 + global.get $~lib/bindings/Math/LN10 + f32.demote_f64 f32.const 0 i32.const 0 call $std/math/check @@ -11662,9 +11662,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.LOG2E - get_global $~lib/bindings/Math/LOG2E - f32.demote/f64 + global.get $~lib/math/NativeMathf.LOG2E + global.get $~lib/bindings/Math/LOG2E + f32.demote_f64 f32.const 0 i32.const 0 call $std/math/check @@ -11677,9 +11677,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.PI - get_global $~lib/bindings/Math/PI - f32.demote/f64 + global.get $~lib/math/NativeMathf.PI + global.get $~lib/bindings/Math/PI + f32.demote_f64 f32.const 0 i32.const 0 call $std/math/check @@ -11692,9 +11692,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.SQRT1_2 - get_global $~lib/bindings/Math/SQRT1_2 - f32.demote/f64 + global.get $~lib/math/NativeMathf.SQRT1_2 + global.get $~lib/bindings/Math/SQRT1_2 + f32.demote_f64 f32.const 0 i32.const 0 call $std/math/check @@ -11707,9 +11707,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/math/NativeMathf.SQRT2 - get_global $~lib/bindings/Math/SQRT2 - f32.demote/f64 + global.get $~lib/math/NativeMathf.SQRT2 + global.get $~lib/bindings/Math/SQRT2 + f32.demote_f64 f32.const 0 i32.const 0 call $std/math/check @@ -12013,8 +12013,8 @@ i32.const 2147483647 f64.const inf f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/OVERFLOW + global.get $std/math/INEXACT + global.get $std/math/OVERFLOW i32.or call $std/math/test_scalbn i32.eqz @@ -12122,8 +12122,8 @@ i32.const -1074 f64.const 5e-324 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_scalbn i32.eqz @@ -12139,8 +12139,8 @@ i32.const -1073 f64.const 5e-324 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_scalbn i32.eqz @@ -12156,8 +12156,8 @@ i32.const -1024 f64.const 2.781342323134007e-309 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_scalbn i32.eqz @@ -12460,8 +12460,8 @@ i32.const 2147483647 f32.const inf f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/OVERFLOW + global.get $std/math/INEXACT + global.get $std/math/OVERFLOW i32.or call $std/math/test_scalbnf i32.eqz @@ -12569,8 +12569,8 @@ i32.const -149 f32.const 1.401298464324817e-45 f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_scalbnf i32.eqz @@ -12586,8 +12586,8 @@ i32.const -148 f32.const 1.401298464324817e-45 f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_scalbnf i32.eqz @@ -12603,8 +12603,8 @@ i32.const -128 f32.const 1.4693693398263237e-39 f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_scalbnf i32.eqz @@ -13097,7 +13097,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13111,7 +13111,7 @@ f64.const 4.345239849338305 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13125,7 +13125,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13139,7 +13139,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13153,7 +13153,7 @@ f64.const 9.267056966972586 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13167,7 +13167,7 @@ f64.const 0.6619858980995045 f64.const 0.8473310828433507 f64.const -0.41553276777267456 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13181,7 +13181,7 @@ f64.const -0.4066039223853553 f64.const 1.989530071088669 f64.const 0.4973946213722229 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13195,7 +13195,7 @@ f64.const 0.5617597462207241 f64.const 0.9742849645674904 f64.const -0.4428897500038147 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13209,7 +13209,7 @@ f64.const 0.7741522965913037 f64.const 0.6854215158636222 f64.const -0.12589527666568756 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13223,7 +13223,7 @@ f64.const -0.6787637026394024 f64.const 2.316874138205964 f64.const -0.17284949123859406 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13237,7 +13237,7 @@ f64.const 0 f64.const 1.5707963267948966 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13251,7 +13251,7 @@ f64.const -1 f64.const 3.141592653589793 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13279,7 +13279,7 @@ f64.const 1.0000000000000002 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13293,7 +13293,7 @@ f64.const -1.0000000000000002 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13307,7 +13307,7 @@ f64.const inf f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13322,7 +13322,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acos i32.eqz if @@ -13350,7 +13350,7 @@ f64.const -0.5309227209592985 f64.const 2.1304853799705463 f64.const 0.1391008496284485 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13364,7 +13364,7 @@ f64.const 0.4939556746399746 f64.const 1.0541629875851946 f64.const 0.22054767608642578 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acos i32.eqz if @@ -13378,7 +13378,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13392,7 +13392,7 @@ f32.const 4.345239639282227 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13406,7 +13406,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13420,7 +13420,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13434,7 +13434,7 @@ f32.const 9.267057418823242 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13448,7 +13448,7 @@ f32.const 0.6619858741760254 f32.const 0.8473311066627502 f32.const -0.13588131964206696 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13462,7 +13462,7 @@ f32.const -0.40660393238067627 f32.const 1.989530086517334 f32.const 0.03764917701482773 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13476,7 +13476,7 @@ f32.const 0.5617597699165344 f32.const 0.9742849469184875 f32.const 0.18443739414215088 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13490,7 +13490,7 @@ f32.const 0.7741522789001465 f32.const 0.6854215264320374 f32.const -0.29158344864845276 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13504,7 +13504,7 @@ f32.const -0.6787636876106262 f32.const 2.3168740272521973 f32.const -0.3795364499092102 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13518,7 +13518,7 @@ f32.const 0 f32.const 1.5707963705062866 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13532,7 +13532,7 @@ f32.const -1 f32.const 3.1415927410125732 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13560,7 +13560,7 @@ f32.const 1.0000001192092896 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13574,7 +13574,7 @@ f32.const -1.0000001192092896 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13588,7 +13588,7 @@ f32.const inf f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13603,7 +13603,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosf i32.eqz if @@ -13631,7 +13631,7 @@ f32.const 0.49965065717697144 f32.const 1.0476008653640747 f32.const -0.21161814033985138 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13645,7 +13645,7 @@ f32.const -0.5051405429840088 f32.const 2.1003410816192627 f32.const -0.20852705836296082 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13659,7 +13659,7 @@ f32.const -0.5189794898033142 f32.const 2.116452932357788 f32.const -0.14600826799869537 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosf i32.eqz if @@ -13673,7 +13673,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13687,7 +13687,7 @@ f64.const 4.345239849338305 f64.const 2.1487163980597503 f64.const -0.291634738445282 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosh i32.eqz if @@ -13701,7 +13701,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13715,7 +13715,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13729,7 +13729,7 @@ f64.const 9.267056966972586 f64.const 2.91668914109908 f64.const -0.24191908538341522 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosh i32.eqz if @@ -13743,7 +13743,7 @@ f64.const 0.6619858980995045 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13757,7 +13757,7 @@ f64.const -0.4066039223853553 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13771,7 +13771,7 @@ f64.const 0.5617597462207241 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13785,7 +13785,7 @@ f64.const 0.7741522965913037 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13799,7 +13799,7 @@ f64.const -0.6787637026394024 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13855,7 +13855,7 @@ f64.const 0.9999923706054688 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13869,7 +13869,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13883,7 +13883,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13898,7 +13898,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acosh i32.eqz if @@ -13912,7 +13912,7 @@ f64.const 1.1060831199926429 f64.const 0.4566373404384803 f64.const -0.29381608963012695 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosh i32.eqz if @@ -13926,7 +13926,7 @@ f64.const 1.1089809557628658 f64.const 0.4627246859959428 f64.const -0.3990095555782318 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosh i32.eqz if @@ -13940,7 +13940,7 @@ f64.const 1.1169429159875521 f64.const 0.47902433134075284 f64.const -0.321674108505249 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acosh i32.eqz if @@ -13954,7 +13954,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -13968,7 +13968,7 @@ f32.const 4.345239639282227 f32.const 2.148716449737549 f32.const 0.4251045286655426 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acoshf i32.eqz if @@ -13982,7 +13982,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -13996,7 +13996,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14010,7 +14010,7 @@ f32.const 9.267057418823242 f32.const 2.916689157485962 f32.const -0.1369788944721222 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_acoshf i32.eqz if @@ -14024,7 +14024,7 @@ f32.const 0.6619858741760254 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14038,7 +14038,7 @@ f32.const -0.40660393238067627 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14052,7 +14052,7 @@ f32.const 0.5617597699165344 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14066,7 +14066,7 @@ f32.const 0.7741522789001465 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14080,7 +14080,7 @@ f32.const -0.6787636876106262 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14136,7 +14136,7 @@ f32.const 0.9999923706054688 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14150,7 +14150,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14164,7 +14164,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14179,7 +14179,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14193,7 +14193,7 @@ f32.const -1125899906842624 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_acoshf i32.eqz if @@ -14207,7 +14207,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14221,7 +14221,7 @@ f64.const 4.345239849338305 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14235,7 +14235,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14249,7 +14249,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14263,7 +14263,7 @@ f64.const 9.267056966972586 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14277,7 +14277,7 @@ f64.const 0.6619858980995045 f64.const 0.7234652439515459 f64.const -0.13599912822246552 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14291,7 +14291,7 @@ f64.const -0.4066039223853553 f64.const -0.41873374429377225 f64.const -0.09264230728149414 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14305,7 +14305,7 @@ f64.const 0.5617597462207241 f64.const 0.5965113622274062 f64.const -0.10864213854074478 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14319,7 +14319,7 @@ f64.const 0.7741522965913037 f64.const 0.8853748109312743 f64.const -0.4256366193294525 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14333,7 +14333,7 @@ f64.const -0.6787637026394024 f64.const -0.7460778114110673 f64.const 0.13986606895923615 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14347,7 +14347,7 @@ f64.const 1 f64.const 1.5707963267948966 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14361,7 +14361,7 @@ f64.const -1 f64.const -1.5707963267948966 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14403,7 +14403,7 @@ f64.const 1.0000000000000002 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14417,7 +14417,7 @@ f64.const -1.0000000000000002 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14431,7 +14431,7 @@ f64.const inf f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14446,7 +14446,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asin i32.eqz if @@ -14474,7 +14474,7 @@ f64.const 0.5073043929119148 f64.const 0.5320538997772349 f64.const -0.16157317161560059 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asin i32.eqz if @@ -14488,7 +14488,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14502,7 +14502,7 @@ f32.const 4.345239639282227 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14516,7 +14516,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14530,7 +14530,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14544,7 +14544,7 @@ f32.const 9.267057418823242 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14558,7 +14558,7 @@ f32.const 0.6619858741760254 f32.const 0.7234652042388916 f32.const -0.1307632476091385 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14572,7 +14572,7 @@ f32.const -0.40660393238067627 f32.const -0.41873374581336975 f32.const 0.3161141574382782 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14586,7 +14586,7 @@ f32.const 0.5617597699165344 f32.const 0.5965113639831543 f32.const -0.4510819613933563 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14600,7 +14600,7 @@ f32.const 0.7741522789001465 f32.const 0.8853747844696045 f32.const 0.02493886835873127 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14614,7 +14614,7 @@ f32.const -0.6787636876106262 f32.const -0.7460777759552002 f32.const 0.2515012323856354 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14628,7 +14628,7 @@ f32.const 1 f32.const 1.5707963705062866 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14642,7 +14642,7 @@ f32.const -1 f32.const -1.5707963705062866 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14684,7 +14684,7 @@ f32.const 1.0000001192092896 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14698,7 +14698,7 @@ f32.const -1.0000001192092896 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14712,7 +14712,7 @@ f32.const inf f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14727,7 +14727,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_asinf i32.eqz if @@ -14755,7 +14755,7 @@ f32.const 0.5004770159721375 f32.const 0.5241496562957764 f32.const -0.29427099227905273 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinf i32.eqz if @@ -14769,7 +14769,7 @@ f64.const -8.06684839057968 f64.const -2.784729878387861 f64.const -0.4762189984321594 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14783,7 +14783,7 @@ f64.const 4.345239849338305 f64.const 2.175213389013164 f64.const -0.02728751301765442 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14797,7 +14797,7 @@ f64.const -8.38143342755525 f64.const -2.822706083697696 f64.const 0.20985257625579834 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14811,7 +14811,7 @@ f64.const -6.531673581913484 f64.const -2.575619446591922 f64.const 0.3113134205341339 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14825,7 +14825,7 @@ f64.const 9.267056966972586 f64.const 2.9225114951048674 f64.const 0.4991756081581116 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14839,7 +14839,7 @@ f64.const 0.6619858980995045 f64.const 0.6212462762707166 f64.const -0.4697347581386566 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14853,7 +14853,7 @@ f64.const -0.4066039223853553 f64.const -0.39615990393192035 f64.const -0.40814438462257385 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14867,7 +14867,7 @@ f64.const 0.5617597462207241 f64.const 0.5357588870255474 f64.const 0.3520713150501251 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14881,7 +14881,7 @@ f64.const 0.7741522965913037 f64.const 0.7123571263197349 f64.const 0.13371451199054718 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14895,7 +14895,7 @@ f64.const -0.6787637026394024 f64.const -0.635182348903198 f64.const 0.04749670997262001 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinh i32.eqz if @@ -14981,7 +14981,7 @@ f32.const -8.066848754882812 f32.const -2.7847299575805664 f32.const -0.14418013393878937 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -14995,7 +14995,7 @@ f32.const 4.345239639282227 f32.const 2.17521333694458 f32.const -0.020796965807676315 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15009,7 +15009,7 @@ f32.const -8.381433486938477 f32.const -2.8227059841156006 f32.const 0.44718533754348755 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15023,7 +15023,7 @@ f32.const -6.531673431396484 f32.const -2.5756194591522217 f32.const -0.14822272956371307 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15037,7 +15037,7 @@ f32.const 9.267057418823242 f32.const 2.922511577606201 f32.const 0.14270681142807007 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15051,7 +15051,7 @@ f32.const 0.6619858741760254 f32.const 0.6212462782859802 f32.const 0.3684912919998169 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15065,7 +15065,7 @@ f32.const -0.40660393238067627 f32.const -0.39615991711616516 f32.const -0.13170306384563446 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15079,7 +15079,7 @@ f32.const 0.5617597699165344 f32.const 0.535758912563324 f32.const 0.08184859901666641 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15093,7 +15093,7 @@ f32.const 0.7741522789001465 f32.const 0.7123571038246155 f32.const -0.14270737767219543 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15107,7 +15107,7 @@ f32.const -0.6787636876106262 f32.const -0.6351823210716248 f32.const 0.2583143711090088 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_asinhf i32.eqz if @@ -15193,7 +15193,7 @@ f64.const -8.06684839057968 f64.const -1.4474613762633468 f64.const 0.14857111871242523 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15207,7 +15207,7 @@ f64.const 4.345239849338305 f64.const 1.344597927114538 f64.const -0.08170335739850998 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15221,7 +15221,7 @@ f64.const -8.38143342755525 f64.const -1.4520463463295539 f64.const -0.07505480200052261 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15235,7 +15235,7 @@ f64.const -6.531673581913484 f64.const -1.4188758658752532 f64.const -0.057633496820926666 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15249,7 +15249,7 @@ f64.const 9.267056966972586 f64.const 1.463303145448706 f64.const 0.1606956422328949 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15263,7 +15263,7 @@ f64.const 0.6619858980995045 f64.const 0.5847550670238325 f64.const 0.4582556486129761 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15277,7 +15277,7 @@ f64.const -0.4066039223853553 f64.const -0.3861864177552131 f64.const -0.2574281692504883 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15291,7 +15291,7 @@ f64.const 0.5617597462207241 f64.const 0.5118269531628881 f64.const -0.11444277316331863 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15305,7 +15305,7 @@ f64.const 0.7741522965913037 f64.const 0.6587802431653822 f64.const -0.11286488175392151 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15319,7 +15319,7 @@ f64.const -0.6787637026394024 f64.const -0.5963307826973472 f64.const -0.2182842344045639 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15361,7 +15361,7 @@ f64.const 1 f64.const 0.7853981633974483 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15375,7 +15375,7 @@ f64.const -1 f64.const -0.7853981633974483 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15389,7 +15389,7 @@ f64.const inf f64.const 1.5707963267948966 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15404,7 +15404,7 @@ f64.neg f64.const -1.5707963267948966 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15432,7 +15432,7 @@ f64.const 0.6929821535674624 f64.const 0.6060004555152562 f64.const -0.17075790464878082 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan i32.eqz if @@ -15446,7 +15446,7 @@ f32.const -8.066848754882812 f32.const -1.4474613666534424 f32.const 0.12686480581760406 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15460,7 +15460,7 @@ f32.const 4.345239639282227 f32.const 1.3445979356765747 f32.const 0.16045434772968292 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15474,7 +15474,7 @@ f32.const -8.381433486938477 f32.const -1.4520463943481445 f32.const -0.39581751823425293 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15488,7 +15488,7 @@ f32.const -6.531673431396484 f32.const -1.418875813484192 f32.const 0.410570353269577 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15502,7 +15502,7 @@ f32.const 9.267057418823242 f32.const 1.4633032083511353 f32.const 0.48403501510620117 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15516,7 +15516,7 @@ f32.const 0.6619858741760254 f32.const 0.5847550630569458 f32.const 0.2125193476676941 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15530,7 +15530,7 @@ f32.const -0.40660393238067627 f32.const -0.386186420917511 f32.const 0.18169628083705902 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15544,7 +15544,7 @@ f32.const 0.5617597699165344 f32.const 0.5118269920349121 f32.const 0.3499770760536194 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15558,7 +15558,7 @@ f32.const 0.7741522789001465 f32.const 0.6587802171707153 f32.const -0.2505330741405487 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15572,7 +15572,7 @@ f32.const -0.6787636876106262 f32.const -0.5963307619094849 f32.const 0.17614826560020447 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15614,7 +15614,7 @@ f32.const 1 f32.const 0.7853981852531433 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15628,7 +15628,7 @@ f32.const -1 f32.const -0.7853981852531433 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15642,7 +15642,7 @@ f32.const inf f32.const 1.5707963705062866 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15657,7 +15657,7 @@ f32.neg f32.const -1.5707963705062866 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanf i32.eqz if @@ -15685,7 +15685,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15699,7 +15699,7 @@ f64.const 4.345239849338305 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15713,7 +15713,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15727,7 +15727,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15741,7 +15741,7 @@ f64.const 9.267056966972586 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15755,7 +15755,7 @@ f64.const 0.6619858980995045 f64.const 0.7963404371347943 f64.const 0.21338365972042084 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanh i32.eqz if @@ -15769,7 +15769,7 @@ f64.const -0.4066039223853553 f64.const -0.43153570730602897 f64.const -0.4325666129589081 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanh i32.eqz if @@ -15783,7 +15783,7 @@ f64.const 0.5617597462207241 f64.const 0.6354006111644578 f64.const -0.06527865678071976 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanh i32.eqz if @@ -15797,7 +15797,7 @@ f64.const 0.7741522965913037 f64.const 1.0306085575277995 f64.const 0.14632052183151245 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanh i32.eqz if @@ -15811,7 +15811,7 @@ f64.const -0.6787637026394024 f64.const -0.8268179645205255 f64.const 0.1397128701210022 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanh i32.eqz if @@ -15839,7 +15839,7 @@ f64.const inf f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15854,7 +15854,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15896,7 +15896,7 @@ f64.const 1 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_atanh i32.eqz if @@ -15911,7 +15911,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_atanh i32.eqz if @@ -15925,7 +15925,7 @@ f64.const 1.0000152587890625 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15939,7 +15939,7 @@ f64.const -1.0000152587890625 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -15953,7 +15953,7 @@ f64.const 1.3552527156068805e-20 f64.const 1.3552527156068805e-20 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanh i32.eqz if @@ -15967,7 +15967,7 @@ f64.const 9.332636185032189e-302 f64.const 9.332636185032189e-302 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanh i32.eqz if @@ -15981,8 +15981,8 @@ f64.const 5.562684646268003e-309 f64.const 5.562684646268003e-309 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atanh i32.eqz @@ -15997,8 +15997,8 @@ f64.const -5.562684646268003e-309 f64.const -5.562684646268003e-309 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atanh i32.eqz @@ -16013,7 +16013,7 @@ f64.const 8988465674311579538646525e283 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanh i32.eqz if @@ -16027,7 +16027,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16041,7 +16041,7 @@ f32.const 4.345239639282227 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16055,7 +16055,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16069,7 +16069,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16083,7 +16083,7 @@ f32.const 9.267057418823242 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16097,7 +16097,7 @@ f32.const 0.6619858741760254 f32.const 0.7963404059410095 f32.const 0.19112196564674377 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanhf i32.eqz if @@ -16111,7 +16111,7 @@ f32.const -0.40660393238067627 f32.const -0.4315357208251953 f32.const -0.05180925130844116 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanhf i32.eqz if @@ -16125,7 +16125,7 @@ f32.const 0.5617597699165344 f32.const 0.635400652885437 f32.const 0.11911056190729141 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanhf i32.eqz if @@ -16139,7 +16139,7 @@ f32.const 0.7741522789001465 f32.const 1.0306085348129272 f32.const 0.1798270344734192 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanhf i32.eqz if @@ -16153,7 +16153,7 @@ f32.const -0.6787636876106262 f32.const -0.8268179297447205 f32.const 0.11588983237743378 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanhf i32.eqz if @@ -16181,7 +16181,7 @@ f32.const inf f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16196,7 +16196,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16238,7 +16238,7 @@ f32.const 1 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_atanhf i32.eqz if @@ -16253,7 +16253,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_atanhf i32.eqz if @@ -16267,7 +16267,7 @@ f32.const 1.0000152587890625 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16281,7 +16281,7 @@ f32.const -1.0000152587890625 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16295,7 +16295,7 @@ f32.const 1.3552527156068805e-20 f32.const 1.3552527156068805e-20 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanhf i32.eqz if @@ -16309,7 +16309,7 @@ f32.const 7.888609052210118e-31 f32.const 7.888609052210118e-31 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atanhf i32.eqz if @@ -16323,8 +16323,8 @@ f32.const 2.938735877055719e-39 f32.const 2.938735877055719e-39 f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atanhf i32.eqz @@ -16339,8 +16339,8 @@ f32.const -2.938735877055719e-39 f32.const -2.938735877055719e-39 f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atanhf i32.eqz @@ -16355,7 +16355,7 @@ f32.const 1701411834604692317316873e14 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_atanhf i32.eqz if @@ -16370,7 +16370,7 @@ f64.const 4.535662560676869 f64.const -1.0585895402489023 f64.const 0.09766263514757156 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16385,7 +16385,7 @@ f64.const -8.88799136300345 f64.const 2.6868734126013067 f64.const 0.35833948850631714 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16400,7 +16400,7 @@ f64.const -2.763607337379588 f64.const -1.889300091849528 f64.const -0.46235957741737366 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16415,7 +16415,7 @@ f64.const 4.567535276842744 f64.const -0.9605469021111489 f64.const -0.21524477005004883 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16430,7 +16430,7 @@ f64.const 4.811392084359796 f64.const 1.0919123946142109 f64.const 0.3894443213939667 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16445,7 +16445,7 @@ f64.const 0.6620717923376739 f64.const -1.468508500616424 f64.const -0.448591411113739 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16460,7 +16460,7 @@ f64.const 0.05215452675006225 f64.const 1.5641600512601268 f64.const 0.3784842789173126 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16475,7 +16475,7 @@ f64.const 7.67640268511754 f64.const -0.10281658910678508 f64.const -0.13993260264396667 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16490,7 +16490,7 @@ f64.const 2.0119025790324803 f64.const 0.29697974004493516 f64.const 0.44753071665763855 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16505,7 +16505,7 @@ f64.const 0.03223983060263804 f64.const -1.5131612053303916 f64.const 0.39708876609802246 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16535,7 +16535,7 @@ f64.const -0 f64.const 3.141592653589793 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16550,7 +16550,7 @@ f64.const -1 f64.const 3.141592653589793 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16566,7 +16566,7 @@ f64.neg f64.const 3.141592653589793 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16626,7 +16626,7 @@ f64.const -0 f64.const -3.141592653589793 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16641,7 +16641,7 @@ f64.const -1 f64.const -3.141592653589793 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16657,7 +16657,7 @@ f64.neg f64.const -3.141592653589793 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16702,7 +16702,7 @@ f64.const 0 f64.const -1.5707963267948966 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16717,7 +16717,7 @@ f64.const -0 f64.const -1.5707963267948966 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16732,7 +16732,7 @@ f64.const 0 f64.const 1.5707963267948966 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16747,7 +16747,7 @@ f64.const -0 f64.const 1.5707963267948966 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16793,7 +16793,7 @@ f64.neg f64.const -3.141592653589793 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16809,7 +16809,7 @@ f64.neg f64.const 3.141592653589793 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16824,7 +16824,7 @@ f64.const 0 f64.const 1.5707963267948966 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16840,7 +16840,7 @@ f64.const 0 f64.const -1.5707963267948966 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16855,7 +16855,7 @@ f64.const inf f64.const 0.7853981633974483 f64.const -0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16871,7 +16871,7 @@ f64.neg f64.const 2.356194490192345 f64.const -0.20682445168495178 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16887,7 +16887,7 @@ f64.const inf f64.const -0.7853981633974483 f64.const 0.27576595544815063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16904,7 +16904,7 @@ f64.neg f64.const -2.356194490192345 f64.const 0.20682445168495178 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16919,8 +16919,8 @@ f64.const 1 f64.const 1.1125369292536007e-308 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atan2 i32.eqz @@ -16936,8 +16936,8 @@ f64.const 8988465674311579538646525e283 f64.const 1.1125369292536007e-308 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atan2 i32.eqz @@ -16953,8 +16953,8 @@ f64.const 8988465674311579538646525e283 f64.const 1.668805393880401e-308 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atan2 i32.eqz @@ -16970,7 +16970,7 @@ f64.const -8988465674311579538646525e283 f64.const 3.141592653589793 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2 i32.eqz if @@ -16985,7 +16985,7 @@ f32.const 4.535662651062012 f32.const -1.0585895776748657 f32.const -0.22352588176727295 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17000,7 +17000,7 @@ f32.const -8.887990951538086 f32.const 2.686873435974121 f32.const 0.09464472532272339 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17015,7 +17015,7 @@ f32.const -2.7636072635650635 f32.const -1.8893001079559326 f32.const -0.21941901743412018 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17030,7 +17030,7 @@ f32.const 4.567535400390625 f32.const -0.9605468511581421 f32.const 0.46015575528144836 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17045,7 +17045,7 @@ f32.const 4.811392307281494 f32.const 1.0919123888015747 f32.const -0.05708503723144531 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17060,7 +17060,7 @@ f32.const 0.6620717644691467 f32.const -1.4685084819793701 f32.const 0.19611206650733948 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17075,7 +17075,7 @@ f32.const 0.052154526114463806 f32.const 1.5641601085662842 f32.const 0.48143187165260315 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17090,7 +17090,7 @@ f32.const 7.676402568817139 f32.const -0.10281659662723541 f32.const -0.4216274917125702 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17105,7 +17105,7 @@ f32.const 2.0119025707244873 f32.const 0.29697975516319275 f32.const 0.2322007566690445 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17120,7 +17120,7 @@ f32.const 0.03223983198404312 f32.const -1.5131611824035645 f32.const 0.16620726883411407 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17150,7 +17150,7 @@ f32.const -0 f32.const 3.1415927410125732 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17165,7 +17165,7 @@ f32.const -1 f32.const 3.1415927410125732 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17181,7 +17181,7 @@ f32.neg f32.const 3.1415927410125732 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17241,7 +17241,7 @@ f32.const -0 f32.const -3.1415927410125732 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17256,7 +17256,7 @@ f32.const -1 f32.const -3.1415927410125732 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17272,7 +17272,7 @@ f32.neg f32.const -3.1415927410125732 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17317,7 +17317,7 @@ f32.const 0 f32.const -1.5707963705062866 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17332,7 +17332,7 @@ f32.const -0 f32.const -1.5707963705062866 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17347,7 +17347,7 @@ f32.const 0 f32.const 1.5707963705062866 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17362,7 +17362,7 @@ f32.const -0 f32.const 1.5707963705062866 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17408,7 +17408,7 @@ f32.neg f32.const -3.1415927410125732 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17424,7 +17424,7 @@ f32.neg f32.const 3.1415927410125732 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17439,7 +17439,7 @@ f32.const 0 f32.const 1.5707963705062866 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17455,7 +17455,7 @@ f32.const 0 f32.const -1.5707963705062866 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17470,7 +17470,7 @@ f32.const inf f32.const 0.7853981852531433 f32.const 0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17486,7 +17486,7 @@ f32.neg f32.const 2.356194496154785 f32.const 0.02500828728079796 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17502,7 +17502,7 @@ f32.const inf f32.const -0.7853981852531433 f32.const -0.3666777014732361 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17519,7 +17519,7 @@ f32.neg f32.const -2.356194496154785 f32.const -0.02500828728079796 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_atan2f i32.eqz if @@ -17534,8 +17534,8 @@ f32.const 1 f32.const 5.877471754111438e-39 f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atan2f i32.eqz @@ -17551,8 +17551,8 @@ f32.const 1701411834604692317316873e14 f32.const 5.877471754111438e-39 f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_atan2f i32.eqz @@ -17567,7 +17567,7 @@ f64.const -8.06684839057968 f64.const -2.0055552545020245 f64.const 0.46667951345443726 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17581,7 +17581,7 @@ f64.const 4.345239849338305 f64.const 1.6318162410515635 f64.const -0.08160271495580673 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17595,7 +17595,7 @@ f64.const -8.38143342755525 f64.const -2.031293910673361 f64.const -0.048101816326379776 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17609,7 +17609,7 @@ f64.const -6.531673581913484 f64.const -1.8692820012204925 f64.const 0.08624018728733063 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17623,7 +17623,7 @@ f64.const 9.267056966972586 f64.const 2.100457720859702 f64.const -0.2722989022731781 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17637,7 +17637,7 @@ f64.const 0.6619858980995045 f64.const 0.8715311470455973 f64.const 0.4414918124675751 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17651,7 +17651,7 @@ f64.const -0.4066039223853553 f64.const -0.740839030300223 f64.const 0.016453813761472702 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17665,7 +17665,7 @@ f64.const 0.5617597462207241 f64.const 0.8251195400559286 f64.const 0.30680638551712036 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17679,7 +17679,7 @@ f64.const 0.7741522965913037 f64.const 0.9182102478959914 f64.const 0.06543998420238495 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17693,7 +17693,7 @@ f64.const -0.6787637026394024 f64.const -0.8788326906580094 f64.const -0.2016713172197342 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrt i32.eqz if @@ -17849,7 +17849,7 @@ f32.const -8.066848754882812 f32.const -2.0055553913116455 f32.const -0.44719240069389343 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17863,7 +17863,7 @@ f32.const 4.345239639282227 f32.const 1.6318162679672241 f32.const 0.44636252522468567 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17877,7 +17877,7 @@ f32.const -8.381433486938477 f32.const -2.0312938690185547 f32.const 0.19483426213264465 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17891,7 +17891,7 @@ f32.const -6.531673431396484 f32.const -1.8692820072174072 f32.const -0.17075514793395996 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17905,7 +17905,7 @@ f32.const 9.267057418823242 f32.const 2.1004576683044434 f32.const -0.36362043023109436 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17919,7 +17919,7 @@ f32.const 0.6619858741760254 f32.const 0.8715311288833618 f32.const -0.12857209146022797 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17933,7 +17933,7 @@ f32.const -0.40660393238067627 f32.const -0.7408390641212463 f32.const -0.4655757546424866 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17947,7 +17947,7 @@ f32.const 0.5617597699165344 f32.const 0.8251195549964905 f32.const 0.05601907894015312 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17961,7 +17961,7 @@ f32.const 0.7741522789001465 f32.const 0.9182102680206299 f32.const 0.45498204231262207 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -17975,7 +17975,7 @@ f32.const -0.6787636876106262 f32.const -0.8788326978683472 f32.const -0.22978967428207397 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cbrtf i32.eqz if @@ -18131,7 +18131,7 @@ f64.const -8.06684839057968 f64.const -8 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18145,7 +18145,7 @@ f64.const 4.345239849338305 f64.const 5 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18159,7 +18159,7 @@ f64.const -8.38143342755525 f64.const -8 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18173,7 +18173,7 @@ f64.const -6.531673581913484 f64.const -6 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18187,7 +18187,7 @@ f64.const 9.267056966972586 f64.const 10 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18201,7 +18201,7 @@ f64.const 0.6619858980995045 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18215,7 +18215,7 @@ f64.const -0.4066039223853553 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18229,7 +18229,7 @@ f64.const 0.5617597462207241 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18243,7 +18243,7 @@ f64.const 0.7741522965913037 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18257,7 +18257,7 @@ f64.const -0.6787637026394024 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18371,7 +18371,7 @@ f64.const 0.5 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18385,7 +18385,7 @@ f64.const -0.5 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18399,7 +18399,7 @@ f64.const 1.0000152587890625 f64.const 2 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18413,7 +18413,7 @@ f64.const -1.0000152587890625 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18427,7 +18427,7 @@ f64.const 0.9999923706054688 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18441,7 +18441,7 @@ f64.const -0.9999923706054688 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18455,7 +18455,7 @@ f64.const 7.888609052210118e-31 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18469,7 +18469,7 @@ f64.const -7.888609052210118e-31 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18583,7 +18583,7 @@ f64.const 0.5 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18597,7 +18597,7 @@ f64.const -0.5 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18611,7 +18611,7 @@ f64.const 1.0000152587890625 f64.const 2 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18625,7 +18625,7 @@ f64.const -1.0000152587890625 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18639,7 +18639,7 @@ f64.const 0.9999923706054688 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18653,7 +18653,7 @@ f64.const -0.9999923706054688 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18667,7 +18667,7 @@ f64.const 7.888609052210118e-31 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18681,7 +18681,7 @@ f64.const -7.888609052210118e-31 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18795,7 +18795,7 @@ f64.const 0.5 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18809,7 +18809,7 @@ f64.const -0.5 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18823,7 +18823,7 @@ f64.const 1.0000152587890625 f64.const 2 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18837,7 +18837,7 @@ f64.const -1.0000152587890625 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18851,7 +18851,7 @@ f64.const 0.9999923706054688 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18865,7 +18865,7 @@ f64.const -0.9999923706054688 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18879,7 +18879,7 @@ f64.const 7.888609052210118e-31 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18893,7 +18893,7 @@ f64.const -7.888609052210118e-31 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceil i32.eqz if @@ -18907,7 +18907,7 @@ f32.const -8.066848754882812 f32.const -8 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -18921,7 +18921,7 @@ f32.const 4.345239639282227 f32.const 5 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -18935,7 +18935,7 @@ f32.const -8.381433486938477 f32.const -8 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -18949,7 +18949,7 @@ f32.const -6.531673431396484 f32.const -6 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -18963,7 +18963,7 @@ f32.const 9.267057418823242 f32.const 10 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -18977,7 +18977,7 @@ f32.const 0.6619858741760254 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -18991,7 +18991,7 @@ f32.const -0.40660393238067627 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19005,7 +19005,7 @@ f32.const 0.5617597699165344 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19019,7 +19019,7 @@ f32.const 0.7741522789001465 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19033,7 +19033,7 @@ f32.const -0.6787636876106262 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19147,7 +19147,7 @@ f32.const 0.5 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19161,7 +19161,7 @@ f32.const -0.5 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19175,7 +19175,7 @@ f32.const 1.0000152587890625 f32.const 2 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19189,7 +19189,7 @@ f32.const -1.0000152587890625 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19203,7 +19203,7 @@ f32.const 0.9999923706054688 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19217,7 +19217,7 @@ f32.const -0.9999923706054688 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19231,7 +19231,7 @@ f32.const 7.888609052210118e-31 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19245,7 +19245,7 @@ f32.const -7.888609052210118e-31 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19359,7 +19359,7 @@ f32.const 0.5 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19373,7 +19373,7 @@ f32.const -0.5 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19387,7 +19387,7 @@ f32.const 1.0000152587890625 f32.const 2 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19401,7 +19401,7 @@ f32.const -1.0000152587890625 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19415,7 +19415,7 @@ f32.const 0.9999923706054688 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19429,7 +19429,7 @@ f32.const -0.9999923706054688 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19443,7 +19443,7 @@ f32.const 7.888609052210118e-31 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19457,7 +19457,7 @@ f32.const -7.888609052210118e-31 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19571,7 +19571,7 @@ f32.const 0.5 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19585,7 +19585,7 @@ f32.const -0.5 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19599,7 +19599,7 @@ f32.const 1.0000152587890625 f32.const 2 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19613,7 +19613,7 @@ f32.const -1.0000152587890625 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19627,7 +19627,7 @@ f32.const 0.9999923706054688 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19641,7 +19641,7 @@ f32.const -0.9999923706054688 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19655,7 +19655,7 @@ f32.const 7.888609052210118e-31 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19669,7 +19669,7 @@ f32.const -7.888609052210118e-31 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_ceilf i32.eqz if @@ -19683,7 +19683,7 @@ f64.const -8.06684839057968 f64.const 1593.5209938862329 f64.const -0.38098856806755066 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19697,7 +19697,7 @@ f64.const 4.345239849338305 f64.const 38.56174928426729 f64.const -0.2712278366088867 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19711,7 +19711,7 @@ f64.const -8.38143342755525 f64.const 2182.630979595893 f64.const 0.0817827582359314 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19725,7 +19725,7 @@ f64.const -6.531673581913484 f64.const 343.273849250879 f64.const -0.429940402507782 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19739,7 +19739,7 @@ f64.const 9.267056966972586 f64.const 5291.779170005587 f64.const -0.1592995822429657 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19753,7 +19753,7 @@ f64.const 0.6619858980995045 f64.const 1.2272321957342842 f64.const 0.23280741274356842 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19767,7 +19767,7 @@ f64.const -0.4066039223853553 f64.const 1.083808541871197 f64.const -0.3960916996002197 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19781,7 +19781,7 @@ f64.const 0.5617597462207241 f64.const 1.1619803583175077 f64.const 0.37748390436172485 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19795,7 +19795,7 @@ f64.const 0.7741522965913037 f64.const 1.3149236876276706 f64.const 0.43587008118629456 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19809,7 +19809,7 @@ f64.const -0.6787637026394024 f64.const 1.2393413245934533 f64.const 0.10201606154441833 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_cosh i32.eqz if @@ -19894,7 +19894,7 @@ f32.const -8.066848754882812 f32.const 1593.5216064453125 f32.const 0.26242581009864807 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -19908,7 +19908,7 @@ f32.const 4.345239639282227 f32.const 38.56174087524414 f32.const -0.08168885856866837 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -19922,7 +19922,7 @@ f32.const -8.381433486938477 f32.const 2182.631103515625 f32.const -0.02331414446234703 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -19936,7 +19936,7 @@ f32.const -6.531673431396484 f32.const 343.2738037109375 f32.const 0.20081493258476257 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -19950,7 +19950,7 @@ f32.const 9.267057418823242 f32.const 5291.78173828125 f32.const 0.36286723613739014 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -19964,7 +19964,7 @@ f32.const 0.6619858741760254 f32.const 1.2272322177886963 f32.const 0.32777416706085205 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -19978,7 +19978,7 @@ f32.const -0.40660393238067627 f32.const 1.0838085412979126 f32.const -0.039848703891038895 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -19992,7 +19992,7 @@ f32.const 0.5617597699165344 f32.const 1.161980390548706 f32.const 0.15274477005004883 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -20006,7 +20006,7 @@ f32.const 0.7741522789001465 f32.const 1.314923644065857 f32.const -0.2387111485004425 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -20020,7 +20020,7 @@ f32.const -0.6787636876106262 f32.const 1.2393412590026855 f32.const -0.45791932940483093 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_coshf i32.eqz if @@ -20105,7 +20105,7 @@ f64.const -8.06684839057968 f64.const 3.137706068161745e-04 f64.const -0.2599197328090668 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20119,7 +20119,7 @@ f64.const 4.345239849338305 f64.const 77.11053017112141 f64.const -0.02792675793170929 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20133,7 +20133,7 @@ f64.const -8.38143342755525 f64.const 2.290813384916323e-04 f64.const -0.24974334239959717 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20147,7 +20147,7 @@ f64.const -6.531673581913484 f64.const 1.4565661260931588e-03 f64.const -0.4816822409629822 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20161,7 +20161,7 @@ f64.const 9.267056966972586 f64.const 10583.558245524993 f64.const 0.17696762084960938 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20175,7 +20175,7 @@ f64.const 0.6619858980995045 f64.const 1.9386384525571998 f64.const -0.4964246451854706 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20189,7 +20189,7 @@ f64.const -0.4066039223853553 f64.const 0.6659078892838025 f64.const -0.10608318448066711 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20203,7 +20203,7 @@ f64.const 0.5617597462207241 f64.const 1.7537559518626311 f64.const -0.39162111282348633 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20217,7 +20217,7 @@ f64.const 0.7741522965913037 f64.const 2.1687528885129246 f64.const -0.2996125817298889 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20231,7 +20231,7 @@ f64.const -0.6787637026394024 f64.const 0.5072437089402843 f64.const 0.47261738777160645 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20273,7 +20273,7 @@ f64.const 1 f64.const 2.718281828459045 f64.const -0.3255307376384735 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20287,7 +20287,7 @@ f64.const -1 f64.const 0.36787944117144233 f64.const 0.22389651834964752 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20344,7 +20344,7 @@ f64.const 1.0397214889526365 f64.const 2.828429155876411 f64.const 0.18803080916404724 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20358,7 +20358,7 @@ f64.const -1.0397214889526365 f64.const 0.35355313670217847 f64.const 0.2527272403240204 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20372,7 +20372,7 @@ f64.const 1.0397210121154785 f64.const 2.8284278071766122 f64.const -0.4184139370918274 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20386,7 +20386,7 @@ f64.const 1.0397214889526367 f64.const 2.8284291558764116 f64.const -0.22618377208709717 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20397,10 +20397,10 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_VALUE + global.get $~lib/builtins/f64.MIN_VALUE f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20411,11 +20411,11 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_VALUE + global.get $~lib/builtins/f64.MIN_VALUE f64.neg f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20427,12 +20427,12 @@ unreachable end i64.const 4649454530587146735 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 9218868437227405098 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const -4631092234375135232 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20444,11 +20444,11 @@ unreachable end i64.const 4649454530587146736 - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const inf f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/OVERFLOW + global.get $std/math/INEXACT + global.get $std/math/OVERFLOW i32.or call $std/math/test_exp i32.eqz @@ -20461,12 +20461,12 @@ unreachable end i64.const -4573606559926636463 - f64.reinterpret/i64 - get_global $~lib/builtins/f64.MIN_VALUE + f64.reinterpret_i64 + global.get $~lib/builtins/f64.MIN_VALUE i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + f64.reinterpret_i64 + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_exp i32.eqz @@ -20479,12 +20479,12 @@ unreachable end i64.const -4573606559926636462 - f64.reinterpret/i64 + f64.reinterpret_i64 f64.const 0 i64.const -4620693217682128896 - f64.reinterpret/i64 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + f64.reinterpret_i64 + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_exp i32.eqz @@ -20497,12 +20497,12 @@ unreachable end i64.const -4573929700241785646 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4503599627370620 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4598386411140284416 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20514,13 +20514,13 @@ unreachable end i64.const -4573929700241785645 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4503599627370108 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4503599627370108 - f64.reinterpret/i64 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + f64.reinterpret_i64 + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_exp i32.eqz @@ -20533,12 +20533,12 @@ unreachable end i64.const 4602685064124656555 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4610109149550689567 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20550,12 +20550,12 @@ unreachable end i64.const 4603836184166978885 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4611122094629841017 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20567,12 +20567,12 @@ unreachable end i64.const 4605718951180848880 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4612385506662149744 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const -4620693217682128896 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20584,12 +20584,12 @@ unreachable end i64.const 4605835761386121865 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4612453422537445296 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20601,12 +20601,12 @@ unreachable end i64.const 4610006203169397430 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4617415291835269761 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20618,12 +20618,12 @@ unreachable end i64.const 4610219797808568955 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4617693563882825047 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20635,12 +20635,12 @@ unreachable end i64.const 4619182163989041060 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4650062712266849886 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20652,12 +20652,12 @@ unreachable end i64.const 4622394943780502425 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4678652243157503230 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20669,12 +20669,12 @@ unreachable end i64.const 4622613550143616215 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4680943662238555301 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20686,12 +20686,12 @@ unreachable end i64.const 4622829325869063755 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4683793372338329074 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20703,12 +20703,12 @@ unreachable end i64.const 4645970351893354075 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 7289148599681560140 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20720,12 +20720,12 @@ unreachable end i64.const 4647695036380671130 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 7926454981994343700 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const -4620693217682128896 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20737,12 +20737,12 @@ unreachable end i64.const -4819432143425896336 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4607182418800017169 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4602678819172646912 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20754,12 +20754,12 @@ unreachable end i64.const -4819256221565452171 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const 4607182418800017163 - f64.reinterpret/i64 + f64.reinterpret_i64 i64.const -4620693217682128896 - f64.reinterpret/i64 - get_global $std/math/INEXACT + f64.reinterpret_i64 + global.get $std/math/INEXACT call $std/math/test_exp i32.eqz if @@ -20773,7 +20773,7 @@ f32.const -8.066848754882812 f32.const 3.1377049162983894e-04 f32.const -0.030193336308002472 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20787,7 +20787,7 @@ f32.const 4.345239639282227 f32.const 77.11051177978516 f32.const -0.2875460684299469 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20801,7 +20801,7 @@ f32.const -8.381433486938477 f32.const 2.2908132814336568e-04 f32.const 0.2237040400505066 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20815,7 +20815,7 @@ f32.const -6.531673431396484 f32.const 1.4565663877874613e-03 f32.const 0.36469703912734985 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20829,7 +20829,7 @@ f32.const 9.267057418823242 f32.const 10583.5634765625 f32.const 0.45962104201316833 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20843,7 +20843,7 @@ f32.const 0.6619858741760254 f32.const 1.93863844871521 f32.const 0.3568260967731476 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20857,7 +20857,7 @@ f32.const -0.40660393238067627 f32.const 0.6659078598022461 f32.const -0.38294991850852966 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20871,7 +20871,7 @@ f32.const 0.5617597699165344 f32.const 1.753756046295166 f32.const 0.44355490803718567 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20885,7 +20885,7 @@ f32.const 0.7741522789001465 f32.const 2.168752908706665 f32.const 0.24562469124794006 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20899,7 +20899,7 @@ f32.const -0.6787636876106262 f32.const 0.5072436928749084 f32.const -0.3974292278289795 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20941,7 +20941,7 @@ f32.const 1 f32.const 2.7182817459106445 f32.const -0.3462330996990204 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -20955,7 +20955,7 @@ f32.const -1 f32.const 0.3678794503211975 f32.const 0.3070148527622223 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -21012,7 +21012,7 @@ f32.const 88.72283172607422 f32.const 340279851902147610656242e15 f32.const -0.09067153930664062 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -21026,8 +21026,8 @@ f32.const 88.72283935546875 f32.const inf f32.const 0 - get_global $std/math/INEXACT - get_global $std/math/OVERFLOW + global.get $std/math/INEXACT + global.get $std/math/OVERFLOW i32.or call $std/math/test_expf i32.eqz @@ -21042,8 +21042,8 @@ f32.const -103.97207641601562 f32.const 1.401298464324817e-45 f32.const 0.49999967217445374 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_expf i32.eqz @@ -21058,8 +21058,8 @@ f32.const -103.97208404541016 f32.const 0 f32.const -0.49999651312828064 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_expf i32.eqz @@ -21074,7 +21074,7 @@ f32.const 0.3465735614299774 f32.const 1.4142135381698608 f32.const 0.13922421634197235 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -21088,7 +21088,7 @@ f32.const 0.3465735912322998 f32.const 1.4142135381698608 f32.const -0.21432916820049286 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -21102,7 +21102,7 @@ f32.const 0.3465736210346222 f32.const 1.4142136573791504 f32.const 0.43211743235588074 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expf i32.eqz if @@ -21116,7 +21116,7 @@ f64.const -8.06684839057968 f64.const -0.9996862293931839 f64.const -0.2760058343410492 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21130,7 +21130,7 @@ f64.const 4.345239849338305 f64.const 76.11053017112141 f64.const -0.02792675793170929 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21144,7 +21144,7 @@ f64.const -8.38143342755525 f64.const -0.9997709186615084 f64.const 0.10052496194839478 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21158,7 +21158,7 @@ f64.const -6.531673581913484 f64.const -0.9985434338739069 f64.const -0.27437829971313477 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21172,7 +21172,7 @@ f64.const 9.267056966972586 f64.const 10582.558245524993 f64.const 0.17696762084960938 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21186,7 +21186,7 @@ f64.const 0.6619858980995045 f64.const 0.9386384525571999 f64.const 0.007150684483349323 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21200,7 +21200,7 @@ f64.const -0.4066039223853553 f64.const -0.3340921107161975 f64.const -0.21216636896133423 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21214,7 +21214,7 @@ f64.const 0.5617597462207241 f64.const 0.7537559518626312 f64.const 0.21675777435302734 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21228,7 +21228,7 @@ f64.const 0.7741522965913037 f64.const 1.1687528885129248 f64.const 0.4007748067378998 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21242,7 +21242,7 @@ f64.const -0.6787637026394024 f64.const -0.4927562910597158 f64.const -0.05476519837975502 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21284,7 +21284,7 @@ f64.const 1 f64.const 1.7182818284590453 f64.const 0.348938524723053 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21298,7 +21298,7 @@ f64.const -1 f64.const -0.6321205588285577 f64.const 0.11194825917482376 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1 i32.eqz if @@ -21355,8 +21355,8 @@ f64.const 2.225073858507201e-308 f64.const 2.225073858507201e-308 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_expm1 i32.eqz @@ -21371,8 +21371,8 @@ f64.const -2.225073858507201e-308 f64.const -2.225073858507201e-308 f64.const 0 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_expm1 i32.eqz @@ -21387,7 +21387,7 @@ f32.const -8.066848754882812 f32.const -0.9996862411499023 f32.const -0.19532723724842072 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21401,7 +21401,7 @@ f32.const 4.345239639282227 f32.const 76.11051177978516 f32.const -0.2875460684299469 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21415,7 +21415,7 @@ f32.const -8.381433486938477 f32.const -0.9997709393501282 f32.const -0.34686920046806335 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21429,7 +21429,7 @@ f32.const -6.531673431396484 f32.const -0.9985434412956238 f32.const -0.1281939446926117 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21443,7 +21443,7 @@ f32.const 9.267057418823242 f32.const 10582.5634765625 f32.const 0.45962104201316833 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21457,7 +21457,7 @@ f32.const 0.6619858741760254 f32.const 0.9386383891105652 f32.const -0.28634780645370483 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21471,7 +21471,7 @@ f32.const -0.40660393238067627 f32.const -0.3340921103954315 f32.const 0.23410017788410187 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21485,7 +21485,7 @@ f32.const 0.5617597699165344 f32.const 0.7537559866905212 f32.const -0.11289017647504807 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21499,7 +21499,7 @@ f32.const 0.7741522789001465 f32.const 1.168752908706665 f32.const 0.4912493824958801 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21513,7 +21513,7 @@ f32.const -0.6787636876106262 f32.const -0.49275627732276917 f32.const 0.20514154434204102 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21555,7 +21555,7 @@ f32.const 1 f32.const 1.718281865119934 f32.const 0.3075338304042816 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21569,7 +21569,7 @@ f32.const -1 f32.const -0.6321205496788025 f32.const 0.15350742638111115 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_expm1f i32.eqz if @@ -21626,7 +21626,7 @@ f64.const -8.06684839057968 f64.const -9 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21640,7 +21640,7 @@ f64.const 4.345239849338305 f64.const 4 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21654,7 +21654,7 @@ f64.const -8.38143342755525 f64.const -9 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21668,7 +21668,7 @@ f64.const -6.531673581913484 f64.const -7 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21682,7 +21682,7 @@ f64.const 9.267056966972586 f64.const 9 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21696,7 +21696,7 @@ f64.const 0.6619858980995045 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21710,7 +21710,7 @@ f64.const -0.4066039223853553 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21724,7 +21724,7 @@ f64.const 0.5617597462207241 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21738,7 +21738,7 @@ f64.const 0.7741522965913037 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21752,7 +21752,7 @@ f64.const -0.6787637026394024 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21866,7 +21866,7 @@ f64.const 0.5 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21880,7 +21880,7 @@ f64.const -0.5 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21894,7 +21894,7 @@ f64.const 1.0000152587890625 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21908,7 +21908,7 @@ f64.const -1.0000152587890625 f64.const -2 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21922,7 +21922,7 @@ f64.const 0.9999923706054688 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21936,7 +21936,7 @@ f64.const -0.9999923706054688 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21950,7 +21950,7 @@ f64.const 7.888609052210118e-31 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21964,7 +21964,7 @@ f64.const -7.888609052210118e-31 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floor i32.eqz if @@ -21978,7 +21978,7 @@ f32.const -8.066848754882812 f32.const -9 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -21992,7 +21992,7 @@ f32.const 4.345239639282227 f32.const 4 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22006,7 +22006,7 @@ f32.const -8.381433486938477 f32.const -9 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22020,7 +22020,7 @@ f32.const -6.531673431396484 f32.const -7 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22034,7 +22034,7 @@ f32.const 9.267057418823242 f32.const 9 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22048,7 +22048,7 @@ f32.const 0.6619858741760254 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22062,7 +22062,7 @@ f32.const -0.40660393238067627 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22076,7 +22076,7 @@ f32.const 0.5617597699165344 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22090,7 +22090,7 @@ f32.const 0.7741522789001465 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22104,7 +22104,7 @@ f32.const -0.6787636876106262 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22218,7 +22218,7 @@ f32.const 0.5 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22232,7 +22232,7 @@ f32.const -0.5 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22246,7 +22246,7 @@ f32.const 1.0000152587890625 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22260,7 +22260,7 @@ f32.const -1.0000152587890625 f32.const -2 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22274,7 +22274,7 @@ f32.const 0.9999923706054688 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22288,7 +22288,7 @@ f32.const -0.9999923706054688 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22302,7 +22302,7 @@ f32.const 7.888609052210118e-31 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22316,7 +22316,7 @@ f32.const -7.888609052210118e-31 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_floorf i32.eqz if @@ -22331,7 +22331,7 @@ f64.const 4.535662560676869 f64.const 9.25452742288464 f64.const -0.31188681721687317 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22346,7 +22346,7 @@ f64.const -8.88799136300345 f64.const 9.893305808328252 f64.const 0.4593673348426819 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22361,7 +22361,7 @@ f64.const -2.763607337379588 f64.const 8.825301797432132 f64.const -0.1701754331588745 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22376,7 +22376,7 @@ f64.const 4.567535276842744 f64.const 7.970265885519092 f64.const -0.3176782727241516 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22391,7 +22391,7 @@ f64.const 4.811392084359796 f64.const 10.441639651824575 f64.const -0.2693633437156677 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22406,7 +22406,7 @@ f64.const 0.6620717923376739 f64.const 6.483936052542593 f64.const 0.35618898272514343 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22421,7 +22421,7 @@ f64.const 0.05215452675006225 f64.const 7.859063309581766 f64.const 0.08044655621051788 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22436,7 +22436,7 @@ f64.const 7.67640268511754 f64.const 7.717156764899584 f64.const 0.05178084969520569 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22451,7 +22451,7 @@ f64.const 2.0119025790324803 f64.const 2.104006123874314 f64.const -0.0918039008975029 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22466,7 +22466,7 @@ f64.const 0.03223983060263804 f64.const 0.5596880129062913 f64.const 0.1383407711982727 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypot i32.eqz if @@ -22770,7 +22770,7 @@ f32.const 4.535662651062012 f32.const 9.254528045654297 f32.const 0.2735958993434906 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22785,7 +22785,7 @@ f32.const -8.887990951538086 f32.const 9.893305778503418 f32.const 0.4530770778656006 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22800,7 +22800,7 @@ f32.const -2.7636072635650635 f32.const 8.825302124023438 f32.const 0.30755728483200073 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22815,7 +22815,7 @@ f32.const 4.567535400390625 f32.const 7.970265865325928 f32.const 0.06785223633050919 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22830,7 +22830,7 @@ f32.const 4.811392307281494 f32.const 10.44163990020752 f32.const -0.26776307821273804 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22845,7 +22845,7 @@ f32.const 0.6620717644691467 f32.const 6.483936309814453 f32.const 0.48381292819976807 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22860,7 +22860,7 @@ f32.const 0.052154526114463806 f32.const 7.859063148498535 f32.const 0.07413065433502197 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22875,7 +22875,7 @@ f32.const 7.676402568817139 f32.const 7.717156887054443 f32.const 0.4940592646598816 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22890,7 +22890,7 @@ f32.const 2.0119025707244873 f32.const 2.104006052017212 f32.const -0.287089467048645 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -22905,7 +22905,7 @@ f32.const 0.03223983198404312 f32.const 0.5596880316734314 f32.const 0.4191940724849701 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_hypotf i32.eqz if @@ -23208,7 +23208,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23222,7 +23222,7 @@ f64.const 4.345239849338305 f64.const 1.4690809584224322 f64.const -0.3412533402442932 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log i32.eqz if @@ -23236,7 +23236,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23250,7 +23250,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23264,7 +23264,7 @@ f64.const 9.267056966972586 f64.const 2.2264658498795615 f64.const 0.3638114035129547 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log i32.eqz if @@ -23278,7 +23278,7 @@ f64.const 0.6619858980995045 f64.const -0.4125110252365137 f64.const -0.29108747839927673 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log i32.eqz if @@ -23292,7 +23292,7 @@ f64.const -0.4066039223853553 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23306,7 +23306,7 @@ f64.const 0.5617597462207241 f64.const -0.5766810183195862 f64.const -0.10983199626207352 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log i32.eqz if @@ -23320,7 +23320,7 @@ f64.const 0.7741522965913037 f64.const -0.2559866591263865 f64.const -0.057990044355392456 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log i32.eqz if @@ -23334,7 +23334,7 @@ f64.const -0.6787637026394024 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23349,7 +23349,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log i32.eqz if @@ -23364,7 +23364,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log i32.eqz if @@ -23378,7 +23378,7 @@ f64.const -7.888609052210118e-31 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23406,7 +23406,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23435,7 +23435,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log i32.eqz if @@ -23464,7 +23464,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_logf i32.eqz if @@ -23479,7 +23479,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_logf i32.eqz if @@ -23493,7 +23493,7 @@ f32.const -7.888609052210118e-31 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_logf i32.eqz if @@ -23521,7 +23521,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_logf i32.eqz if @@ -23550,7 +23550,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_logf i32.eqz if @@ -23579,7 +23579,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_logf i32.eqz if @@ -23594,7 +23594,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_logf i32.eqz if @@ -23608,7 +23608,7 @@ f32.const -7.888609052210118e-31 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_logf i32.eqz if @@ -23636,7 +23636,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_logf i32.eqz if @@ -23665,7 +23665,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_logf i32.eqz if @@ -23693,7 +23693,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23707,7 +23707,7 @@ f64.const 4.345239849338305 f64.const 0.6380137537120029 f64.const -0.2088824063539505 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10 i32.eqz if @@ -23721,7 +23721,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23735,7 +23735,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23749,7 +23749,7 @@ f64.const 9.267056966972586 f64.const 0.9669418327487274 f64.const -0.06120431795716286 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10 i32.eqz if @@ -23763,7 +23763,7 @@ f64.const 0.6619858980995045 f64.const -0.17915126198447093 f64.const 0.39090874791145325 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10 i32.eqz if @@ -23777,7 +23777,7 @@ f64.const -0.4066039223853553 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23791,7 +23791,7 @@ f64.const 0.5617597462207241 f64.const -0.25044938407454437 f64.const -0.3046841621398926 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10 i32.eqz if @@ -23805,7 +23805,7 @@ f64.const 0.7741522965913037 f64.const -0.11117359349943837 f64.const -0.31503361463546753 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10 i32.eqz if @@ -23819,7 +23819,7 @@ f64.const -0.6787637026394024 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23834,7 +23834,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log10 i32.eqz if @@ -23849,7 +23849,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log10 i32.eqz if @@ -23863,7 +23863,7 @@ f64.const -7.888609052210118e-31 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23891,7 +23891,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23920,7 +23920,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10 i32.eqz if @@ -23948,7 +23948,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -23962,7 +23962,7 @@ f32.const 4.345239639282227 f32.const 0.6380137205123901 f32.const -0.20476758480072021 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10f i32.eqz if @@ -23976,7 +23976,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -23990,7 +23990,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -24004,7 +24004,7 @@ f32.const 9.267057418823242 f32.const 0.9669418334960938 f32.const -0.34273025393486023 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10f i32.eqz if @@ -24018,7 +24018,7 @@ f32.const 0.6619858741760254 f32.const -0.1791512817144394 f32.const -0.27078554034233093 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10f i32.eqz if @@ -24032,7 +24032,7 @@ f32.const -0.40660393238067627 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -24046,7 +24046,7 @@ f32.const 0.5617597699165344 f32.const -0.25044935941696167 f32.const 0.2126826047897339 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10f i32.eqz if @@ -24060,7 +24060,7 @@ f32.const 0.7741522789001465 f32.const -0.1111735999584198 f32.const 0.46515095233917236 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log10f i32.eqz if @@ -24074,7 +24074,7 @@ f32.const -0.6787636876106262 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -24089,7 +24089,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log10f i32.eqz if @@ -24104,7 +24104,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log10f i32.eqz if @@ -24118,7 +24118,7 @@ f32.const -7.888609052210118e-31 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -24146,7 +24146,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -24175,7 +24175,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log10f i32.eqz if @@ -24203,7 +24203,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1p i32.eqz if @@ -24217,7 +24217,7 @@ f64.const 4.345239849338305 f64.const 1.6762064170601734 f64.const 0.46188199520111084 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24231,7 +24231,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1p i32.eqz if @@ -24245,7 +24245,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1p i32.eqz if @@ -24259,7 +24259,7 @@ f64.const 9.267056966972586 f64.const 2.3289404168523826 f64.const -0.411114901304245 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24273,7 +24273,7 @@ f64.const 0.6619858980995045 f64.const 0.5080132114992477 f64.const -0.29306045174598694 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24287,7 +24287,7 @@ f64.const -0.4066039223853553 f64.const -0.5218931811663979 f64.const -0.25825726985931396 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24301,7 +24301,7 @@ f64.const 0.5617597462207241 f64.const 0.4458132279488102 f64.const -0.13274887204170227 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24315,7 +24315,7 @@ f64.const 0.7741522965913037 f64.const 0.5733227294648414 f64.const 0.02716583013534546 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24329,7 +24329,7 @@ f64.const -0.6787637026394024 f64.const -1.1355782978128564 f64.const 0.2713092863559723 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24371,7 +24371,7 @@ f64.const -7.888609052210118e-31 f64.const -7.888609052210118e-31 f64.const 1.7763568394002505e-15 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24385,7 +24385,7 @@ f64.const 1 f64.const 0.6931471805599453 f64.const -0.2088811695575714 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1p i32.eqz if @@ -24400,7 +24400,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log1p i32.eqz if @@ -24429,7 +24429,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1p i32.eqz if @@ -24457,7 +24457,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1pf i32.eqz if @@ -24471,7 +24471,7 @@ f32.const 4.345239639282227 f32.const 1.676206350326538 f32.const -0.23014859855175018 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24485,7 +24485,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1pf i32.eqz if @@ -24499,7 +24499,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1pf i32.eqz if @@ -24513,7 +24513,7 @@ f32.const 9.267057418823242 f32.const 2.3289403915405273 f32.const -0.29075589776039124 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24527,7 +24527,7 @@ f32.const 0.6619858741760254 f32.const 0.5080131888389587 f32.const -0.1386766880750656 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24541,7 +24541,7 @@ f32.const -0.40660393238067627 f32.const -0.5218932032585144 f32.const -0.08804433047771454 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24555,7 +24555,7 @@ f32.const 0.5617597699165344 f32.const 0.44581323862075806 f32.const -0.15101368725299835 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24569,7 +24569,7 @@ f32.const 0.7741522789001465 f32.const 0.5733227133750916 f32.const -0.10264533013105392 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24583,7 +24583,7 @@ f32.const -0.6787636876106262 f32.const -1.1355782747268677 f32.const -0.19879481196403503 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24625,7 +24625,7 @@ f32.const -7.888609052210118e-31 f32.const -7.888609052210118e-31 f32.const 3.308722450212111e-24 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24639,7 +24639,7 @@ f32.const 1 f32.const 0.6931471824645996 f32.const 0.031954795122146606 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log1pf i32.eqz if @@ -24654,7 +24654,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log1pf i32.eqz if @@ -24683,7 +24683,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log1pf i32.eqz if @@ -24711,8 +24711,8 @@ f32.const -1.1754942106924411e-38 f32.const -1.1754942106924411e-38 f32.const 4.930380657631324e-32 - get_global $std/math/INEXACT - get_global $std/math/UNDERFLOW + global.get $std/math/INEXACT + global.get $std/math/UNDERFLOW i32.or call $std/math/test_log1pf i32.eqz @@ -24727,7 +24727,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24741,7 +24741,7 @@ f64.const 4.345239849338305 f64.const 2.1194358133804485 f64.const -0.10164877772331238 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2 i32.eqz if @@ -24755,7 +24755,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24769,7 +24769,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24783,7 +24783,7 @@ f64.const 9.267056966972586 f64.const 3.2121112403298744 f64.const -0.15739446878433228 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2 i32.eqz if @@ -24797,7 +24797,7 @@ f64.const 0.6619858980995045 f64.const -0.5951276104207402 f64.const 0.3321485221385956 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2 i32.eqz if @@ -24811,7 +24811,7 @@ f64.const -0.4066039223853553 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24825,7 +24825,7 @@ f64.const 0.5617597462207241 f64.const -0.8319748453044644 f64.const 0.057555437088012695 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2 i32.eqz if @@ -24839,7 +24839,7 @@ f64.const 0.7741522965913037 f64.const -0.36931068365537134 f64.const -0.19838279485702515 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2 i32.eqz if @@ -24853,7 +24853,7 @@ f64.const -0.6787637026394024 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24868,7 +24868,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log2 i32.eqz if @@ -24883,7 +24883,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log2 i32.eqz if @@ -24897,7 +24897,7 @@ f64.const -7.888609052210118e-31 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24925,7 +24925,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24954,7 +24954,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2 i32.eqz if @@ -24982,7 +24982,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -24996,7 +24996,7 @@ f32.const 4.345239639282227 f32.const 2.1194357872009277 f32.const 0.18271538615226746 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2f i32.eqz if @@ -25010,7 +25010,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -25024,7 +25024,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -25038,7 +25038,7 @@ f32.const 9.267057418823242 f32.const 3.212111234664917 f32.const -0.3188050389289856 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2f i32.eqz if @@ -25052,7 +25052,7 @@ f32.const 0.6619858741760254 f32.const -0.5951276421546936 f32.const 0.34231460094451904 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2f i32.eqz if @@ -25066,7 +25066,7 @@ f32.const -0.40660393238067627 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -25080,7 +25080,7 @@ f32.const 0.5617597699165344 f32.const -0.8319748044013977 f32.const -0.33473604917526245 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2f i32.eqz if @@ -25094,7 +25094,7 @@ f32.const 0.7741522789001465 f32.const -0.3693107068538666 f32.const 0.3278401792049408 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_log2f i32.eqz if @@ -25108,7 +25108,7 @@ f32.const -0.6787636876106262 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -25123,7 +25123,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log2f i32.eqz if @@ -25138,7 +25138,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_log2f i32.eqz if @@ -25152,7 +25152,7 @@ f32.const -7.888609052210118e-31 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -25180,7 +25180,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -25209,7 +25209,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_log2f i32.eqz if @@ -29706,7 +29706,7 @@ f64.const 1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -29722,7 +29722,7 @@ f64.const 1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -29902,7 +29902,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -29918,7 +29918,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -29948,7 +29948,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -29963,7 +29963,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30024,7 +30024,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30039,7 +30039,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30100,7 +30100,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30115,7 +30115,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30130,7 +30130,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30146,7 +30146,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30176,7 +30176,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30191,7 +30191,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30207,7 +30207,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30237,7 +30237,7 @@ f64.const 2 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30252,7 +30252,7 @@ f64.const -0.5 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30283,7 +30283,7 @@ f64.const 2 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30299,7 +30299,7 @@ f64.const -0.5 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30405,7 +30405,7 @@ f64.const inf f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30421,7 +30421,7 @@ f64.const inf f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30469,7 +30469,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30486,7 +30486,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_mod i32.eqz if @@ -30861,7 +30861,7 @@ f32.const 1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -30877,7 +30877,7 @@ f32.const 1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31057,7 +31057,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31073,7 +31073,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31103,7 +31103,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31118,7 +31118,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31179,7 +31179,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31194,7 +31194,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31255,7 +31255,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31270,7 +31270,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31285,7 +31285,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31301,7 +31301,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31331,7 +31331,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31346,7 +31346,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31362,7 +31362,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31392,7 +31392,7 @@ f32.const 2 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31407,7 +31407,7 @@ f32.const -0.5 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31438,7 +31438,7 @@ f32.const 2 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31454,7 +31454,7 @@ f32.const -0.5 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31560,7 +31560,7 @@ f32.const inf f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31576,7 +31576,7 @@ f32.const inf f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31624,7 +31624,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31641,7 +31641,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_modf i32.eqz if @@ -31716,7 +31716,7 @@ f64.const 4.535662560676869 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -31731,7 +31731,7 @@ f64.const -8.88799136300345 f64.const 2.1347118825587285e-06 f64.const 0.3250160217285156 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_pow i32.eqz if @@ -31746,7 +31746,7 @@ f64.const -2.763607337379588 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -31761,7 +31761,7 @@ f64.const 4.567535276842744 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -31776,7 +31776,7 @@ f64.const 4.811392084359796 f64.const 44909.29941512966 f64.const -0.26659080386161804 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_pow i32.eqz if @@ -31791,7 +31791,7 @@ f64.const 0.6620717923376739 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -31806,7 +31806,7 @@ f64.const 0.05215452675006225 f64.const 1.1135177413458652 f64.const -0.37168607115745544 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_pow i32.eqz if @@ -31821,7 +31821,7 @@ f64.const 7.67640268511754 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -31836,7 +31836,7 @@ f64.const 2.0119025790324803 f64.const 0.37690773521380183 f64.const 0.32473301887512207 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_pow i32.eqz if @@ -31851,7 +31851,7 @@ f64.const 0.03223983060263804 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -31986,7 +31986,7 @@ f64.const -0.5 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32001,7 +32001,7 @@ f64.const -1 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32016,7 +32016,7 @@ f64.const -2 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32031,7 +32031,7 @@ f64.const -3 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32046,7 +32046,7 @@ f64.const -4 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32197,7 +32197,7 @@ f64.const -0.5 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32213,7 +32213,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32228,7 +32228,7 @@ f64.const -2 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32244,7 +32244,7 @@ f64.const inf f64.neg f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32259,7 +32259,7 @@ f64.const -4 f64.const inf f64.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_pow i32.eqz if @@ -32578,7 +32578,7 @@ f64.const 0.5 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -32699,7 +32699,7 @@ f64.const 0.5 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -32714,7 +32714,7 @@ f64.const 1.5 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_pow i32.eqz if @@ -33271,7 +33271,7 @@ f32.const 4.535662651062012 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -33286,7 +33286,7 @@ f32.const -8.887990951538086 f32.const 2.134714122803416e-06 f32.const 0.1436440795660019 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_powf i32.eqz if @@ -33301,7 +33301,7 @@ f32.const -2.7636072635650635 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -33316,7 +33316,7 @@ f32.const 4.567535400390625 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -33331,7 +33331,7 @@ f32.const 4.811392307281494 f32.const 44909.33203125 f32.const -0.05356409028172493 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_powf i32.eqz if @@ -33346,7 +33346,7 @@ f32.const 0.6620717644691467 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -33361,7 +33361,7 @@ f32.const 0.052154526114463806 f32.const 1.1135177612304688 f32.const 0.19122089445590973 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_powf i32.eqz if @@ -33376,7 +33376,7 @@ f32.const 7.676402568817139 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -33391,7 +33391,7 @@ f32.const 2.0119025707244873 f32.const 0.3769077658653259 f32.const 0.337149053812027 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_powf i32.eqz if @@ -33406,7 +33406,7 @@ f32.const 0.03223983198404312 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -33541,7 +33541,7 @@ f32.const -0.5 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33556,7 +33556,7 @@ f32.const -1 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33571,7 +33571,7 @@ f32.const -2 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33586,7 +33586,7 @@ f32.const -3 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33601,7 +33601,7 @@ f32.const -4 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33752,7 +33752,7 @@ f32.const -0.5 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33768,7 +33768,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33783,7 +33783,7 @@ f32.const -2 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33799,7 +33799,7 @@ f32.const inf f32.neg f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -33814,7 +33814,7 @@ f32.const -4 f32.const inf f32.const 0 - get_global $std/math/DIVBYZERO + global.get $std/math/DIVBYZERO call $std/math/test_powf i32.eqz if @@ -34133,7 +34133,7 @@ f32.const 0.5 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -34254,7 +34254,7 @@ f32.const 0.5 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -34269,7 +34269,7 @@ f32.const 1.5 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_powf i32.eqz if @@ -34823,31 +34823,31 @@ unreachable end call $~lib/bindings/Math/random - i64.reinterpret/f64 + i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom block $break|0 i32.const 0 - set_local $0 + local.set $0 loop $repeat|0 - get_local $0 - f64.convert_s/i32 + local.get $0 + f64.convert_i32_s f64.const 1e6 f64.lt i32.eqz br_if $break|0 block call $~lib/math/NativeMath.random - set_local $1 - get_local $1 + local.set $1 + local.get $1 f64.const 0 f64.ge - tee_local $2 + local.tee $2 if (result i32) - get_local $1 + local.get $1 f64.const 1 f64.lt else - get_local $2 + local.get $2 end i32.eqz if @@ -34859,10 +34859,10 @@ unreachable end end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 unreachable end @@ -34870,34 +34870,34 @@ end block call $~lib/bindings/Math/random - i64.reinterpret/f64 - set_local $3 - get_local $3 + i64.reinterpret_f64 + local.set $3 + local.get $3 call $~lib/math/NativeMath.seedRandom end block $break|1 i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 - f64.convert_s/i32 + local.get $0 + f64.convert_i32_s f64.const 1e6 f64.lt i32.eqz br_if $break|1 block call $~lib/math/NativeMathf.random - set_local $4 - get_local $4 + local.set $4 + local.get $4 f32.const 0 f32.ge - tee_local $2 + local.tee $2 if (result i32) - get_local $4 + local.get $4 f32.const 1 f32.lt else - get_local $2 + local.get $2 end i32.eqz if @@ -34909,10 +34909,10 @@ unreachable end end - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 unreachable end @@ -34921,7 +34921,7 @@ f64.const -8.06684839057968 f64.const -8 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -34935,7 +34935,7 @@ f64.const 4.345239849338305 f64.const 4 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -34949,7 +34949,7 @@ f64.const -8.38143342755525 f64.const -8 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -34963,7 +34963,7 @@ f64.const -6.531673581913484 f64.const -7 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -34977,7 +34977,7 @@ f64.const 9.267056966972586 f64.const 9 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -34991,7 +34991,7 @@ f64.const 0.6619858980995045 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35005,7 +35005,7 @@ f64.const -0.4066039223853553 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35019,7 +35019,7 @@ f64.const 0.5617597462207241 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35033,7 +35033,7 @@ f64.const 0.7741522965913037 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35047,7 +35047,7 @@ f64.const -0.6787637026394024 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35161,7 +35161,7 @@ f64.const 0.5 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35175,7 +35175,7 @@ f64.const -0.5 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35189,7 +35189,7 @@ f64.const 1.5 f64.const 2 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35203,7 +35203,7 @@ f64.const -1.5 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35217,7 +35217,7 @@ f64.const 1.0000152587890625 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35231,7 +35231,7 @@ f64.const -1.0000152587890625 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35245,7 +35245,7 @@ f64.const 0.9999923706054688 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35259,7 +35259,7 @@ f64.const -0.9999923706054688 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35273,7 +35273,7 @@ f64.const 7.888609052210118e-31 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35287,7 +35287,7 @@ f64.const -7.888609052210118e-31 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35301,7 +35301,7 @@ f32.const -8.066848754882812 f32.const -8 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35315,7 +35315,7 @@ f32.const 4.345239639282227 f32.const 4 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35329,7 +35329,7 @@ f32.const -8.381433486938477 f32.const -8 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35343,7 +35343,7 @@ f32.const -6.531673431396484 f32.const -7 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35357,7 +35357,7 @@ f32.const 9.267057418823242 f32.const 9 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35371,7 +35371,7 @@ f32.const 0.6619858741760254 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35385,7 +35385,7 @@ f32.const -0.40660393238067627 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35399,7 +35399,7 @@ f32.const 0.5617597699165344 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35413,7 +35413,7 @@ f32.const 0.7741522789001465 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35427,7 +35427,7 @@ f32.const -0.6787636876106262 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35541,7 +35541,7 @@ f32.const 0.5 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35555,7 +35555,7 @@ f32.const -0.5 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35569,7 +35569,7 @@ f64.const 1.5 f64.const 2 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35583,7 +35583,7 @@ f64.const -1.5 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_round i32.eqz if @@ -35597,7 +35597,7 @@ f32.const 1.0000152587890625 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35611,7 +35611,7 @@ f32.const -1.0000152587890625 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35625,7 +35625,7 @@ f32.const 0.9999923706054688 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35639,7 +35639,7 @@ f32.const -0.9999923706054688 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35653,7 +35653,7 @@ f32.const 7.888609052210118e-31 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35667,7 +35667,7 @@ f32.const -7.888609052210118e-31 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_roundf i32.eqz if @@ -35934,14 +35934,14 @@ end block $~lib/math/NativeMath.signbit|inlined.4 (result i32) f64.const 0 - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -35960,14 +35960,14 @@ end block $~lib/math/NativeMath.signbit|inlined.5 (result i32) f64.const -0 - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -35986,14 +35986,14 @@ end block $~lib/math/NativeMath.signbit|inlined.6 (result i32) f64.const 1 - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -36012,14 +36012,14 @@ end block $~lib/math/NativeMath.signbit|inlined.7 (result i32) f64.const -1 - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -36038,14 +36038,14 @@ end block $~lib/math/NativeMath.signbit|inlined.8 (result i32) f64.const nan:0x8000000000000 - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -36065,14 +36065,14 @@ block $~lib/math/NativeMath.signbit|inlined.9 (result i32) f64.const nan:0x8000000000000 f64.neg - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -36091,14 +36091,14 @@ end block $~lib/math/NativeMath.signbit|inlined.10 (result i32) f64.const inf - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -36118,14 +36118,14 @@ block $~lib/math/NativeMath.signbit|inlined.11 (result i32) f64.const inf f64.neg - set_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $1 + local.get $1 + i64.reinterpret_f64 i64.const 63 i64.shr_u - i32.wrap/i64 - get_local $1 - get_local $1 + i32.wrap_i64 + local.get $1 + local.get $1 f64.eq i32.and end @@ -36144,13 +36144,13 @@ end block $~lib/math/NativeMathf.signbit|inlined.4 (result i32) f32.const 0 - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36169,13 +36169,13 @@ end block $~lib/math/NativeMathf.signbit|inlined.5 (result i32) f32.const -0 - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36194,13 +36194,13 @@ end block $~lib/math/NativeMathf.signbit|inlined.6 (result i32) f32.const 1 - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36219,13 +36219,13 @@ end block $~lib/math/NativeMathf.signbit|inlined.7 (result i32) f32.const -1 - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36244,13 +36244,13 @@ end block $~lib/math/NativeMathf.signbit|inlined.8 (result i32) f32.const nan:0x400000 - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36270,13 +36270,13 @@ block $~lib/math/NativeMathf.signbit|inlined.9 (result i32) f32.const nan:0x400000 f32.neg - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36295,13 +36295,13 @@ end block $~lib/math/NativeMathf.signbit|inlined.10 (result i32) f32.const inf - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36321,13 +36321,13 @@ block $~lib/math/NativeMathf.signbit|inlined.11 (result i32) f32.const inf f32.neg - set_local $4 - get_local $4 - i32.reinterpret/f32 + local.set $4 + local.get $4 + i32.reinterpret_f32 i32.const 31 i32.shr_u - get_local $4 - get_local $4 + local.get $4 + local.get $4 f32.eq i32.and end @@ -36648,7 +36648,7 @@ f64.const 1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -36664,7 +36664,7 @@ f64.const 1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -36844,7 +36844,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -36860,7 +36860,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -36890,7 +36890,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -36905,7 +36905,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -36966,7 +36966,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -36981,7 +36981,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37042,7 +37042,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37057,7 +37057,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37072,7 +37072,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37088,7 +37088,7 @@ f64.const 0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37118,7 +37118,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37133,7 +37133,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37149,7 +37149,7 @@ f64.const -0 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37179,7 +37179,7 @@ f64.const 2 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37194,7 +37194,7 @@ f64.const -0.5 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37225,7 +37225,7 @@ f64.const 2 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37241,7 +37241,7 @@ f64.const -0.5 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37347,7 +37347,7 @@ f64.const inf f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37363,7 +37363,7 @@ f64.const inf f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37411,7 +37411,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37428,7 +37428,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_rem i32.eqz if @@ -37818,7 +37818,7 @@ f32.const 1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -37834,7 +37834,7 @@ f32.const 1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38014,7 +38014,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38030,7 +38030,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38060,7 +38060,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38075,7 +38075,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38136,7 +38136,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38151,7 +38151,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38212,7 +38212,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38227,7 +38227,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38242,7 +38242,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38258,7 +38258,7 @@ f32.const 0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38288,7 +38288,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38303,7 +38303,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38319,7 +38319,7 @@ f32.const -0 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38349,7 +38349,7 @@ f32.const 2 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38364,7 +38364,7 @@ f32.const -0.5 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38395,7 +38395,7 @@ f32.const 2 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38411,7 +38411,7 @@ f32.const -0.5 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38517,7 +38517,7 @@ f32.const inf f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38533,7 +38533,7 @@ f32.const inf f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38581,7 +38581,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38598,7 +38598,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_remf i32.eqz if @@ -38687,7 +38687,7 @@ f64.const -8.06684839057968 f64.const -1593.5206801156262 f64.const -0.2138727605342865 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38701,7 +38701,7 @@ f64.const 4.345239849338305 f64.const 38.54878088685412 f64.const 0.21537430584430695 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38715,7 +38715,7 @@ f64.const -8.38143342755525 f64.const -2182.6307505145546 f64.const 0.16213826835155487 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38729,7 +38729,7 @@ f64.const -6.531673581913484 f64.const -343.2723926847529 f64.const 0.20479513704776764 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38743,7 +38743,7 @@ f64.const 9.267056966972586 f64.const 5291.7790755194055 f64.const -0.48676517605781555 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38757,7 +38757,7 @@ f64.const 0.6619858980995045 f64.const 0.7114062568229157 f64.const -0.4584641456604004 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38771,7 +38771,7 @@ f64.const -0.4066039223853553 f64.const -0.41790065258739445 f64.const 0.37220045924186707 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38785,7 +38785,7 @@ f64.const 0.5617597462207241 f64.const 0.5917755935451237 f64.const 0.46178996562957764 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38799,7 +38799,7 @@ f64.const 0.7741522965913037 f64.const 0.8538292008852542 f64.const -0.07019051909446716 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38813,7 +38813,7 @@ f64.const -0.6787637026394024 f64.const -0.732097615653169 f64.const 0.26858529448509216 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinh i32.eqz if @@ -38899,7 +38899,7 @@ f32.const -8.066848754882812 f32.const -1593.521240234375 f32.const 0.1671663224697113 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -38913,7 +38913,7 @@ f32.const 4.345239639282227 f32.const 38.548770904541016 f32.const -0.49340328574180603 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -38927,7 +38927,7 @@ f32.const -8.381433486938477 f32.const -2182.630859375 f32.const 0.0849970355629921 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -38941,7 +38941,7 @@ f32.const -6.531673431396484 f32.const -343.2723388671875 f32.const 0.0704190656542778 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -38955,7 +38955,7 @@ f32.const 9.267057418823242 f32.const 5291.78125 f32.const -0.44362515211105347 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -38969,7 +38969,7 @@ f32.const 0.6619858741760254 f32.const 0.7114062309265137 f32.const 0.058103885501623154 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -38983,7 +38983,7 @@ f32.const -0.40660393238067627 f32.const -0.4179006516933441 f32.const 0.39349499344825745 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -38997,7 +38997,7 @@ f32.const 0.5617597699165344 f32.const 0.5917755961418152 f32.const -0.4183797240257263 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -39011,7 +39011,7 @@ f32.const 0.7741522789001465 f32.const 0.8538292050361633 f32.const 0.45992106199264526 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -39025,7 +39025,7 @@ f32.const -0.6787636876106262 f32.const -0.7320976257324219 f32.const -0.48159059882164 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sinhf i32.eqz if @@ -39111,7 +39111,7 @@ f64.const -8.06684839057968 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39125,7 +39125,7 @@ f64.const 4.345239849338305 f64.const 2.0845238903256313 f64.const -0.07180261611938477 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39139,7 +39139,7 @@ f64.const -8.38143342755525 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39153,7 +39153,7 @@ f64.const -6.531673581913484 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39167,7 +39167,7 @@ f64.const 9.267056966972586 f64.const 3.0441841217266385 f64.const -0.01546262577176094 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39181,7 +39181,7 @@ f64.const 0.6619858980995045 f64.const 0.8136251582267503 f64.const -0.08618157356977463 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39195,7 +39195,7 @@ f64.const -0.4066039223853553 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39209,7 +39209,7 @@ f64.const 0.5617597462207241 f64.const 0.7495063350104014 f64.const -0.0981396734714508 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39223,7 +39223,7 @@ f64.const 0.7741522965913037 f64.const 0.879859248170583 f64.const -0.37124353647232056 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39237,7 +39237,7 @@ f64.const -0.6787637026394024 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39280,7 +39280,7 @@ f64.neg f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39336,7 +39336,7 @@ f64.const -1 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39364,7 +39364,7 @@ f64.const 1e-323 f64.const 3.1434555694052576e-162 f64.const 0.43537619709968567 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39378,7 +39378,7 @@ f64.const 1.5e-323 f64.const 3.849931087076416e-162 f64.const -0.45194002985954285 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39406,7 +39406,7 @@ f64.const -5e-324 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39420,7 +39420,7 @@ f64.const 0.9999999999999999 f64.const 0.9999999999999999 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39434,7 +39434,7 @@ f64.const 1.9999999999999998 f64.const 1.414213562373095 f64.const -0.21107041835784912 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39448,7 +39448,7 @@ f64.const 1.0000000000000002 f64.const 1 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39462,7 +39462,7 @@ f64.const 2.0000000000000004 f64.const 1.4142135623730951 f64.const -0.27173060178756714 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39476,7 +39476,7 @@ f64.const 1.0000000000000002 f64.const 1 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39490,7 +39490,7 @@ f64.const 0.9999999999999999 f64.const 0.9999999999999999 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39504,7 +39504,7 @@ f64.const -1797693134862315708145274e284 f64.const nan:0x8000000000000 f64.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrt i32.eqz if @@ -39518,7 +39518,7 @@ f64.const 1797693134862315708145274e284 f64.const 1340780792994259561100831e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39532,7 +39532,7 @@ f64.const 179769313486231490980915e285 f64.const 134078079299425926338769e131 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39546,7 +39546,7 @@ f64.const 1797693134862314111473026e284 f64.const 1340780792994258965674548e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39560,7 +39560,7 @@ f64.const 1797693134862313313136902e284 f64.const 1340780792994258667961407e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39574,7 +39574,7 @@ f64.const 1797693134862312514800778e284 f64.const 1340780792994258370248265e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39588,7 +39588,7 @@ f64.const 1797693134862311716464655e284 f64.const 1340780792994258072535124e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39602,7 +39602,7 @@ f64.const 1797693134862310918128531e284 f64.const 1340780792994257774821982e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39616,7 +39616,7 @@ f64.const 1797693134862310119792407e284 f64.const 1340780792994257477108841e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39630,7 +39630,7 @@ f64.const 1797693134862309321456283e284 f64.const 1340780792994257179395699e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39644,7 +39644,7 @@ f64.const 1797693134862308523120159e284 f64.const 1340780792994256881682558e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39658,7 +39658,7 @@ f64.const 1797693134862307724784036e284 f64.const 1340780792994256583969417e130 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39672,7 +39672,7 @@ f64.const 2.225073858507203e-308 f64.const 1.4916681462400417e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39686,7 +39686,7 @@ f64.const 2.225073858507205e-308 f64.const 1.4916681462400423e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39700,7 +39700,7 @@ f64.const 2.225073858507207e-308 f64.const 1.491668146240043e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39714,7 +39714,7 @@ f64.const 2.225073858507209e-308 f64.const 1.4916681462400437e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39728,7 +39728,7 @@ f64.const 2.225073858507211e-308 f64.const 1.4916681462400443e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39742,7 +39742,7 @@ f64.const 2.2250738585072127e-308 f64.const 1.491668146240045e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39756,7 +39756,7 @@ f64.const 2.2250738585072147e-308 f64.const 1.4916681462400457e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39770,7 +39770,7 @@ f64.const 2.2250738585072167e-308 f64.const 1.4916681462400463e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39784,7 +39784,7 @@ f64.const 2.2250738585072187e-308 f64.const 1.491668146240047e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39798,7 +39798,7 @@ f64.const 2.2250738585072207e-308 f64.const 1.4916681462400476e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39812,7 +39812,7 @@ f64.const 2.2250738585072226e-308 f64.const 1.4916681462400483e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39826,7 +39826,7 @@ f64.const 2.2250738585072246e-308 f64.const 1.491668146240049e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39840,7 +39840,7 @@ f64.const 2.2250738585072266e-308 f64.const 1.4916681462400496e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39854,7 +39854,7 @@ f64.const 2.2250738585072286e-308 f64.const 1.4916681462400503e-154 f64.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39868,7 +39868,7 @@ f64.const 92.35130391890645 f64.const 9.609958580499006 f64.const 0.4998137056827545 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39882,7 +39882,7 @@ f64.const 93.3599596388916 f64.const 9.662295774757238 f64.const -0.49979978799819946 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39896,7 +39896,7 @@ f64.const 95.42049628886124 f64.const 9.76834153215689 f64.const -0.49997270107269287 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39910,7 +39910,7 @@ f64.const 95.87916941885449 f64.const 9.791790919890728 f64.const 0.4998766779899597 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39924,7 +39924,7 @@ f64.const 96.84804174884022 f64.const 9.841140266698785 f64.const 0.499801903963089 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39938,7 +39938,7 @@ f64.const 97.43639050883155 f64.const 9.87098731175517 f64.const 0.4997696280479431 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39952,7 +39952,7 @@ f64.const 97.50957979883047 f64.const 9.874693909120955 f64.const 0.49999818205833435 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39966,7 +39966,7 @@ f64.const 97.80496893882612 f64.const 9.88963947466368 f64.const -0.4999580681324005 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39980,7 +39980,7 @@ f64.const 98.2751822888192 f64.const 9.913383997849534 f64.const 0.49979931116104126 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -39994,7 +39994,7 @@ f64.const 99.47293564880155 f64.const 9.973611966023219 f64.const -0.4999540448188782 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40008,7 +40008,7 @@ f64.const 100.57047130878539 f64.const 10.028483001370914 f64.const -0.49996453523635864 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40022,7 +40022,7 @@ f64.const 100.60954608878481 f64.const 10.030431002144665 f64.const 0.49975672364234924 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40036,7 +40036,7 @@ f64.const 100.67909109878379 f64.const 10.033897104255344 f64.const -0.4997771382331848 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40050,7 +40050,7 @@ f64.const 101.12268095877725 f64.const 10.055977374615422 f64.const 0.49988678097724915 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40064,7 +40064,7 @@ f64.const 101.3027691287746 f64.const 10.064927676281366 f64.const 0.4999105632305145 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40078,7 +40078,7 @@ f64.const 2.45932313565507e-307 f64.const 4.9591563149945874e-154 f64.const -0.4998999834060669 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40092,7 +40092,7 @@ f64.const 5.610957305180409e-307 f64.const 7.490632353266584e-154 f64.const -0.4999343752861023 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40106,7 +40106,7 @@ f64.const 5.8073887977408524e-307 f64.const 7.62062254526548e-154 f64.const -0.49989569187164307 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40120,7 +40120,7 @@ f64.const 7.026137080471427e-307 f64.const 8.382205605013174e-154 f64.const 0.49980640411376953 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40134,7 +40134,7 @@ f64.const 8.438697769194972e-307 f64.const 9.186238495268328e-154 f64.const -0.4999065697193146 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40148,7 +40148,7 @@ f64.const 1.1607792515836795e-306 f64.const 1.0773946591586944e-153 f64.const -0.49997684359550476 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40162,7 +40162,7 @@ f64.const 1.2827413827423193e-306 f64.const 1.1325817333606962e-153 f64.const -0.4999513030052185 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40176,7 +40176,7 @@ f64.const 1.7116604596087457e-306 f64.const 1.3083044216117078e-153 f64.const -0.49986395239830017 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40190,7 +40190,7 @@ f64.const 2.038173251686994e-306 f64.const 1.4276460526639628e-153 f64.const 0.4998403787612915 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40204,7 +40204,7 @@ f64.const 2.171572060856931e-306 f64.const 1.4736254818836879e-153 f64.const 0.4999290406703949 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40218,7 +40218,7 @@ f64.const 2.4681399631804094e-306 f64.const 1.5710314965589996e-153 f64.const 0.49989044666290283 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40232,7 +40232,7 @@ f64.const 2.5175533964200588e-306 f64.const 1.5866799918131124e-153 f64.const -0.4997701048851013 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40246,7 +40246,7 @@ f64.const 2.6461505468829625e-306 f64.const 1.6266992797941982e-153 f64.const 0.4998672902584076 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40260,7 +40260,7 @@ f64.const 3.8167076367720413e-306 f64.const 1.9536395872248397e-153 f64.const 0.49983471632003784 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40274,7 +40274,7 @@ f64.const 4.5743220778562766e-306 f64.const 2.1387664851161936e-153 f64.const 0.49985939264297485 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrt i32.eqz if @@ -40288,7 +40288,7 @@ f32.const -8.066848754882812 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40302,7 +40302,7 @@ f32.const 4.345239639282227 f32.const 2.084523916244507 f32.const 0.3200402557849884 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40316,7 +40316,7 @@ f32.const -8.381433486938477 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40330,7 +40330,7 @@ f32.const -6.531673431396484 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40344,7 +40344,7 @@ f32.const 9.267057418823242 f32.const 3.0441842079162598 f32.const 0.05022354796528816 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40358,7 +40358,7 @@ f32.const 0.6619858741760254 f32.const 0.813625156879425 f32.const 0.2240506112575531 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40372,7 +40372,7 @@ f32.const -0.40660393238067627 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40386,7 +40386,7 @@ f32.const 0.5617597699165344 f32.const 0.7495063543319702 f32.const 0.05895441770553589 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40400,7 +40400,7 @@ f32.const 0.7741522789001465 f32.const 0.879859209060669 f32.const -0.4874873757362366 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40414,7 +40414,7 @@ f32.const -0.6787636876106262 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40457,7 +40457,7 @@ f32.neg f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40513,7 +40513,7 @@ f32.const -1 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40555,7 +40555,7 @@ f32.const 4.203895392974451e-45 f32.const 6.483745598763743e-23 f32.const 0.37388554215431213 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40569,7 +40569,7 @@ f32.const 1.401298464324817e-45 f32.const 3.743392066509216e-23 f32.const -0.20303145051002502 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40583,7 +40583,7 @@ f32.const -1.401298464324817e-45 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40597,7 +40597,7 @@ f32.const 3402823466385288598117041e14 f32.const 18446742974197923840 f32.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40611,7 +40611,7 @@ f32.const -3402823466385288598117041e14 f32.const nan:0x400000 f32.const 0 - get_global $std/math/INVALID + global.get $std/math/INVALID call $std/math/test_sqrtf i32.eqz if @@ -40625,7 +40625,7 @@ f32.const 0.9999998807907104 f32.const 0.9999999403953552 f32.const 2.980232594040899e-08 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40639,7 +40639,7 @@ f32.const 0.9999999403953552 f32.const 0.9999999403953552 f32.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40653,7 +40653,7 @@ f32.const 1.999999761581421 f32.const 1.4142134189605713 f32.const -0.4959246516227722 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40667,7 +40667,7 @@ f32.const 1.9999998807907104 f32.const 1.4142135381698608 f32.const 0.15052194893360138 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40681,7 +40681,7 @@ f32.const 1.0000001192092896 f32.const 1 f32.const -0.5 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40695,7 +40695,7 @@ f32.const 1.000000238418579 f32.const 1.0000001192092896 f32.const 5.960463766996327e-08 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40709,7 +40709,7 @@ f32.const 2.000000238418579 f32.const 1.4142136573791504 f32.const 0.08986179530620575 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40723,7 +40723,7 @@ f32.const 2.000000476837158 f32.const 1.41421377658844 f32.const 0.3827550709247589 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_sqrtf i32.eqz if @@ -40737,7 +40737,7 @@ f64.const -8.06684839057968 f64.const -0.999999803096032 f64.const 0.012793331407010555 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40751,7 +40751,7 @@ f64.const 4.345239849338305 f64.const 0.9996636978961307 f64.const 0.1573508232831955 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40765,7 +40765,7 @@ f64.const -8.38143342755525 f64.const -0.9999998950434862 f64.const 0.27985066175460815 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40779,7 +40779,7 @@ f64.const -6.531673581913484 f64.const -0.9999957568392429 f64.const -0.44285574555397034 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40793,7 +40793,7 @@ f64.const 9.267056966972586 f64.const 0.9999999821447234 f64.const 0.4462755024433136 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40807,7 +40807,7 @@ f64.const 0.6619858980995045 f64.const 0.5796835018635275 f64.const 0.4892043173313141 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40821,7 +40821,7 @@ f64.const -0.4066039223853553 f64.const -0.3855853099901652 f64.const 0.35993871092796326 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40835,7 +40835,7 @@ f64.const 0.5617597462207241 f64.const 0.5092819248700439 f64.const -0.39436522126197815 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40849,7 +40849,7 @@ f64.const 0.7741522965913037 f64.const 0.6493374550318555 f64.const -0.4899396002292633 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40863,7 +40863,7 @@ f64.const -0.6787637026394024 f64.const -0.590715084799841 f64.const -0.0145387789234519 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanh i32.eqz if @@ -40948,7 +40948,7 @@ f32.const -8.066848754882812 f32.const -0.9999998211860657 f32.const -0.3034979999065399 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -40962,7 +40962,7 @@ f32.const 4.345239639282227 f32.const 0.9996637105941772 f32.const 0.2154078334569931 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -40976,7 +40976,7 @@ f32.const -8.381433486938477 f32.const -0.9999998807907104 f32.const 0.23912210762500763 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -40990,7 +40990,7 @@ f32.const -6.531673431396484 f32.const -0.999995768070221 f32.const -0.18844597041606903 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -41004,7 +41004,7 @@ f32.const 9.267057418823242 f32.const 1 f32.const 0.1497807800769806 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -41018,7 +41018,7 @@ f32.const 0.6619858741760254 f32.const 0.5796834826469421 f32.const -0.05590476095676422 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -41032,7 +41032,7 @@ f32.const -0.40660393238067627 f32.const -0.38558530807495117 f32.const 0.349787175655365 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -41046,7 +41046,7 @@ f32.const 0.5617597699165344 f32.const 0.5092819333076477 f32.const -0.1528785079717636 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -41060,7 +41060,7 @@ f32.const 0.7741522789001465 f32.const 0.6493374705314636 f32.const 0.4317026138305664 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -41074,7 +41074,7 @@ f32.const -0.6787636876106262 f32.const -0.5907150506973267 f32.const 0.4079873859882355 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_tanhf i32.eqz if @@ -41159,7 +41159,7 @@ f64.const -8.06684839057968 f64.const -8 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41173,7 +41173,7 @@ f64.const 4.345239849338305 f64.const 4 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41187,7 +41187,7 @@ f64.const -8.38143342755525 f64.const -8 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41201,7 +41201,7 @@ f64.const -6.531673581913484 f64.const -6 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41215,7 +41215,7 @@ f64.const 9.267056966972586 f64.const 9 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41229,7 +41229,7 @@ f64.const 0.6619858980995045 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41243,7 +41243,7 @@ f64.const -0.4066039223853553 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41257,7 +41257,7 @@ f64.const 0.5617597462207241 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41271,7 +41271,7 @@ f64.const 0.7741522965913037 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41285,7 +41285,7 @@ f64.const -0.6787637026394024 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41399,7 +41399,7 @@ f64.const 0.5 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41413,7 +41413,7 @@ f64.const -0.5 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41427,7 +41427,7 @@ f64.const 1.0000152587890625 f64.const 1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41441,7 +41441,7 @@ f64.const -1.0000152587890625 f64.const -1 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41455,7 +41455,7 @@ f64.const 0.9999923706054688 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41469,7 +41469,7 @@ f64.const -0.9999923706054688 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41483,7 +41483,7 @@ f64.const 7.888609052210118e-31 f64.const 0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41497,7 +41497,7 @@ f64.const -7.888609052210118e-31 f64.const -0 f64.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_trunc i32.eqz if @@ -41511,7 +41511,7 @@ f32.const -8.066848754882812 f32.const -8 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41525,7 +41525,7 @@ f32.const 4.345239639282227 f32.const 4 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41539,7 +41539,7 @@ f32.const -8.381433486938477 f32.const -8 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41553,7 +41553,7 @@ f32.const -6.531673431396484 f32.const -6 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41567,7 +41567,7 @@ f32.const 9.267057418823242 f32.const 9 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41581,7 +41581,7 @@ f32.const 0.6619858741760254 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41595,7 +41595,7 @@ f32.const -0.40660393238067627 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41609,7 +41609,7 @@ f32.const 0.5617597699165344 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41623,7 +41623,7 @@ f32.const 0.7741522789001465 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41637,7 +41637,7 @@ f32.const -0.6787636876106262 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41751,7 +41751,7 @@ f32.const 0.5 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41765,7 +41765,7 @@ f32.const -0.5 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41779,7 +41779,7 @@ f32.const 1.0000152587890625 f32.const 1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41793,7 +41793,7 @@ f32.const -1.0000152587890625 f32.const -1 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41807,7 +41807,7 @@ f32.const 0.9999923706054688 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41821,7 +41821,7 @@ f32.const -0.9999923706054688 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41835,7 +41835,7 @@ f32.const 7.888609052210118e-31 f32.const 0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -41849,7 +41849,7 @@ f32.const -7.888609052210118e-31 f32.const -0 f32.const 0 - get_global $std/math/INEXACT + global.get $std/math/INEXACT call $std/math/test_truncf i32.eqz if @@ -42014,8 +42014,8 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_VALUE - get_global $~lib/builtins/f64.MAX_VALUE + global.get $~lib/builtins/f64.MAX_VALUE + global.get $~lib/builtins/f64.MAX_VALUE call $~lib/math/NativeMath.imul f64.const 0 f64.eq @@ -42456,9 +42456,9 @@ f32.const nan:0x400000 i32.const 1 call $~lib/math/ipow32f - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.ne end i32.const 0 @@ -42476,9 +42476,9 @@ f32.const nan:0x400000 i32.const -1 call $~lib/math/ipow32f - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.ne end i32.const 0 @@ -42496,9 +42496,9 @@ f32.const nan:0x400000 i32.const 2 call $~lib/math/ipow32f - set_local $4 - get_local $4 - get_local $4 + local.set $4 + local.get $4 + local.get $4 f32.ne end i32.const 0 @@ -42600,7 +42600,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MAX_VALUE + global.get $~lib/builtins/f32.MAX_VALUE i32.const 2 call $~lib/math/ipow32f f32.const inf @@ -42614,7 +42614,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MIN_VALUE + global.get $~lib/builtins/f32.MIN_VALUE i32.const 2 call $~lib/math/ipow32f f32.const 0 @@ -42628,7 +42628,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f32.MAX_VALUE + global.get $~lib/builtins/f32.MAX_VALUE i32.const -1 call $~lib/math/ipow32f f32.const 2.938735877055719e-39 @@ -42825,7 +42825,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_VALUE + global.get $~lib/builtins/f64.MAX_VALUE i32.const 2 call $~lib/math/ipow64f f64.const inf @@ -42839,7 +42839,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MIN_VALUE + global.get $~lib/builtins/f64.MIN_VALUE i32.const 2 call $~lib/math/ipow64f f64.const 0 @@ -42853,7 +42853,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_VALUE + global.get $~lib/builtins/f64.MAX_VALUE i32.const -1 call $~lib/math/ipow64f f64.const 5.562684646268003e-309 diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index 2fd35e88..520d77d3 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -11,7 +11,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) @@ -26,249 +26,249 @@ (local $7 i64) (local $8 i64) (local $9 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $2 + local.get $0 + i64.reinterpret_f64 + local.tee $2 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $4 - get_local $1 - i64.reinterpret/f64 - tee_local $3 + local.set $4 + local.get $1 + i64.reinterpret_f64 + local.tee $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i64.const 63 i64.shr_u - set_local $8 - get_local $3 + local.set $8 + local.get $3 i64.const 1 i64.shl - tee_local $7 + local.tee $7 i64.const 0 i64.eq - tee_local $6 + local.tee $6 i32.eqz if - get_local $4 + local.get $4 i64.const 2047 i64.eq - set_local $6 + local.set $6 end - get_local $6 + local.get $6 i32.eqz if - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne - set_local $6 + local.set $6 end - get_local $6 + local.get $6 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.div return end block $folding-inner0 - get_local $2 + local.get $2 i64.const 1 i64.shl - tee_local $9 - get_local $7 + local.tee $9 + local.get $7 i64.le_u if - get_local $7 - get_local $9 + local.get $7 + local.get $9 i64.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i64.eqz if (result i64) - get_local $2 + local.get $2 i64.const 0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i64.const 12 i64.shl i64.clz i64.sub - tee_local $4 + local.tee $4 i64.sub i64.const 1 i64.add i64.shl else - get_local $2 + local.get $2 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i64.eqz if (result i64) - get_local $3 + local.get $3 i64.const 0 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.const 12 i64.shl i64.clz i64.sub - tee_local $5 + local.tee $5 i64.sub i64.const 1 i64.add i64.shl else - get_local $3 + local.get $3 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $3 + local.set $3 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.gt_s if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if (result i64) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq br_if $folding-inner0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub else - get_local $2 + local.get $2 end i64.const 1 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 1 i64.sub - set_local $4 + local.set $4 br $continue|0 end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq br_if $folding-inner0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i64.const 11 i64.shl i64.clz - tee_local $3 + local.tee $3 i64.shl - set_local $2 - get_local $4 - get_local $3 + local.set $2 + local.get $4 + local.get $3 i64.sub - tee_local $4 + local.tee $4 i64.const 0 i64.gt_s if (result i64) - get_local $2 + local.get $2 i64.const 4503599627370496 i64.sub - get_local $4 + local.get $4 i64.const 52 i64.shl i64.or else - get_local $2 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shr_u end - get_local $8 + local.get $8 i64.const 63 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 return end f64.const 0 - get_local $0 + local.get $0 f64.mul ) (func $std/mod/check (; 3 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne return end - get_local $1 + local.get $1 f64.const 0 f64.eq if f64.const 1 - get_local $1 + local.get $1 f64.div f64.const 1 - get_local $0 + local.get $0 f64.div f64.eq return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.eq ) (func $std/mod/test_fmod (; 4 ;) (type $FFFi) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.mod - get_local $2 + local.get $2 call $std/mod/check - tee_local $3 + local.tee $3 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $std/mod/mod - get_local $2 + local.get $2 call $std/mod/check - set_local $3 + local.set $3 end - get_local $3 + local.get $3 ) (func $~lib/math/NativeMathf.mod (; 5 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) @@ -278,226 +278,226 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 - i32.reinterpret/f32 - tee_local $2 + local.get $0 + i32.reinterpret_f32 + local.tee $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $3 - get_local $1 - i32.reinterpret/f32 - tee_local $4 + local.set $3 + local.get $1 + i32.reinterpret_f32 + local.tee $4 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const -2147483648 i32.and - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 1 i32.shl - tee_local $7 + local.tee $7 i32.eqz - tee_local $5 + local.tee $5 i32.eqz if - get_local $3 + local.get $3 i32.const 255 i32.eq - set_local $5 + local.set $5 end - get_local $5 + local.get $5 i32.eqz if - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne - set_local $5 + local.set $5 end - get_local $5 + local.get $5 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f32.div return end block $folding-inner0 - get_local $2 + local.get $2 i32.const 1 i32.shl - tee_local $5 - get_local $7 + local.tee $5 + local.get $7 i32.le_u if - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 if (result i32) - get_local $2 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $2 + local.get $2 i32.const 1 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - tee_local $3 + local.tee $3 i32.sub i32.shl end - set_local $2 - get_local $6 + local.set $2 + local.get $6 if (result i32) - get_local $4 + local.get $4 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $4 + local.get $4 i32.const 1 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.const 9 i32.shl i32.clz i32.sub - tee_local $6 + local.tee $6 i32.sub i32.shl end - set_local $4 + local.set $4 loop $continue|0 - get_local $3 - get_local $6 + local.get $3 + local.get $6 i32.gt_s if - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.ge_u if (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.eq br_if $folding-inner0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.sub else - get_local $2 + local.get $2 end i32.const 1 i32.shl - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 1 i32.sub - set_local $3 + local.set $3 br $continue|0 end end - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.ge_u if - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.eq br_if $folding-inner0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.sub - set_local $2 + local.set $2 end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.const 8 i32.shl i32.clz - tee_local $5 + local.tee $5 i32.shl - set_local $2 - get_local $3 - get_local $5 + local.set $2 + local.get $3 + local.get $5 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.gt_s if (result i32) - get_local $2 + local.get $2 i32.const 8388608 i32.sub - get_local $3 + local.get $3 i32.const 23 i32.shl i32.or else - get_local $2 + local.get $2 i32.const 1 - get_local $3 + local.get $3 i32.sub i32.shr_u end - get_local $8 + local.get $8 i32.or - f32.reinterpret/i32 + f32.reinterpret_i32 return end f32.const 0 - get_local $0 + local.get $0 f32.mul ) (func $std/mod/check (; 6 ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne return end - get_local $1 + local.get $1 f32.const 0 f32.eq if f32.const 1 - get_local $1 + local.get $1 f32.div f32.const 1 - get_local $0 + local.get $0 f32.div f32.eq return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.eq ) (func $std/mod/test_fmodf (; 7 ;) (type $fffi) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.mod - get_local $2 + local.get $2 call $std/mod/check ) (func $start (; 8 ;) (type $v) diff --git a/tests/compiler/std/mod.untouched.wat b/tests/compiler/std/mod.untouched.wat index 7d5996a6..0786d00d 100644 --- a/tests/compiler/std/mod.untouched.wat +++ b/tests/compiler/std/mod.untouched.wat @@ -13,7 +13,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/mod/js i32 (i32.const 1)) (global $NaN f64 (f64.const nan:0x8000000000000)) @@ -34,305 +34,305 @@ (local $9 f64) (local $10 i64) (local $11 i64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 + 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 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i64.const 63 i64.shr_u - set_local $6 - get_local $3 + local.set $6 + local.get $3 i64.const 1 i64.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i64.const 0 i64.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i64.const 2047 i64.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f64.div return end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i64.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i64.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i64.const 12 i64.shl i64.clz i64.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i64.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.const 12 i64.shl i64.clz i64.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i64.const 0 - get_local $5 + local.get $5 i64.sub i64.const 1 i64.add i64.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 1 i64.const 52 i64.shl i64.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 1 i64.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 11 i64.shl i64.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i64.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 0 i64.gt_s if - get_local $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i64.const 63 i64.shl i64.or - set_local $2 - get_local $2 - f64.reinterpret/i64 + local.set $2 + local.get $2 + f64.reinterpret_i64 ) (func $~lib/builtins/isNaN (; 3 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne ) (func $std/mod/check (; 4 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) - get_local $1 + local.get $1 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 call $~lib/builtins/isNaN return end - get_local $1 + local.get $1 f64.const 0 f64.eq if i32.const 1 - f64.convert_u/i32 - get_local $1 + f64.convert_i32_u + local.get $1 f64.div f64.const 1 - get_local $0 + local.get $0 f64.div f64.eq return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.eq ) (func $std/mod/test_fmod (; 5 ;) (type $FFFi) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMath.mod - get_local $2 + local.get $2 call $std/mod/check - tee_local $3 + local.tee $3 if (result i32) - get_global $std/mod/js + global.get $std/mod/js i32.eqz - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $std/mod/mod - get_local $2 + local.get $2 call $std/mod/check end else - get_local $3 + local.get $3 end ) (func $~lib/math/NativeMathf.mod (; 6 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) @@ -346,285 +346,285 @@ (local $9 f32) (local $10 i32) (local $11 i32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + local.get $0 + i32.reinterpret_f32 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const -2147483648 i32.and - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.const 1 i32.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.const 0 i32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i32.const 255 i32.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f32.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i32.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i32.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i32.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.const 9 i32.shl i32.clz i32.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 0 - get_local $5 + local.get $5 i32.sub i32.const 1 i32.add i32.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.const 23 i32.shl i32.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 8 i32.shl i32.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i32.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 0 i32.gt_s if - get_local $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.or - set_local $2 - get_local $2 - f32.reinterpret/i32 + local.set $2 + local.get $2 + f32.reinterpret_i32 ) (func $~lib/builtins/isNaN (; 7 ;) (type $fi) (param $0 f32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.ne ) (func $std/mod/check (; 8 ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) - get_local $1 + local.get $1 call $~lib/builtins/isNaN if - get_local $0 + local.get $0 call $~lib/builtins/isNaN return end - get_local $1 + local.get $1 f32.const 0 f32.eq if i32.const 1 - f32.convert_u/i32 - get_local $1 + f32.convert_i32_u + local.get $1 f32.div f32.const 1 - get_local $0 + local.get $0 f32.div f32.eq return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.eq ) (func $std/mod/test_fmodf (; 9 ;) (type $fffi) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/math/NativeMathf.mod - get_local $2 + local.get $2 call $std/mod/check ) (func $start (; 10 ;) (type $v) diff --git a/tests/compiler/std/new.optimized.wat b/tests/compiler/std/new.optimized.wat index b10a54cc..d0272311 100644 --- a/tests/compiler/std/new.optimized.wat +++ b/tests/compiler/std/new.optimized.wat @@ -3,7 +3,7 @@ (type $v (func)) (type $FUNCSIG$i (func (result i32))) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -15,17 +15,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -34,16 +34,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -51,16 +51,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -69,38 +69,38 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $std/new/AClass#constructor (; 1 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 1 i32.store - get_local $0 + local.get $0 f32.const 2 f32.store offset=4 i32.const 0 - get_local $0 + local.get $0 i32.load i32.const 1 i32.add i32.store - get_local $0 + local.get $0 f32.const 3 f32.store offset=4 - get_local $0 + local.get $0 ) (func $start (; 2 ;) (type $v) i32.const 8 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset call $std/new/AClass#constructor - set_global $std/new/aClass + global.set $std/new/aClass ) (func $null (; 3 ;) (type $v) nop diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 4f9a49ea..bd92f831 100644 --- a/tests/compiler/std/new.untouched.wat +++ b/tests/compiler/std/new.untouched.wat @@ -3,7 +3,7 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -23,41 +23,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -67,22 +67,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -91,57 +91,57 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $std/new/AClass#constructor (; 2 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) - get_local $0 + local.get $0 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 1 i32.store - get_local $0 + local.get $0 f32.const 2 f32.store offset=4 - get_local $0 + local.get $0 end i32.load i32.const 1 i32.add i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.store offset=4 - get_local $0 + local.get $0 ) (func $start (; 3 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 f32.const 3 call $std/new/AClass#constructor - set_global $std/new/aClass + global.set $std/new/aClass ) (func $null (; 4 ;) (type $v) ) diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index e1522a87..d4d94964 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -9,7 +9,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -86,17 +86,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -105,16 +105,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -122,16 +122,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -140,97 +140,97 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $std/operator-overloading/Tester#constructor (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) i32.const 8 call $~lib/allocator/arena/__memory_allocate - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.store - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.store offset=4 - get_local $2 + local.get $2 ) (func $~lib/math/NativeMath.scalbn (; 3 ;) (type $FiF) (param $0 f64) (param $1 i32) (result f64) - get_local $1 + local.get $1 i32.const 1023 i32.gt_s if (result f64) - get_local $0 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1023 i32.sub - tee_local $1 + local.tee $1 i32.const 1023 i32.gt_s if (result f64) - get_local $1 + local.get $1 i32.const 1023 i32.sub - tee_local $1 + local.tee $1 i32.const 1023 - get_local $1 + local.get $1 i32.const 1023 i32.lt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 8988465674311579538646525e283 f64.mul else - get_local $0 + local.get $0 end else - get_local $1 + local.get $1 i32.const -1022 i32.lt_s if (result f64) - get_local $0 + local.get $0 f64.const 2.004168360008973e-292 f64.mul - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 969 i32.add - tee_local $1 + local.tee $1 i32.const -1022 i32.lt_s if (result f64) - get_local $1 + local.get $1 i32.const 969 i32.add - tee_local $1 + local.tee $1 i32.const -1022 - get_local $1 + local.get $1 i32.const -1022 i32.gt_s select - set_local $1 - get_local $0 + local.set $1 + local.get $0 f64.const 2.004168360008973e-292 f64.mul else - get_local $0 + local.get $0 end else - get_local $0 + local.get $0 end end - get_local $1 - i64.extend_s/i32 + local.get $1 + i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl - f64.reinterpret/i64 + f64.reinterpret_i64 f64.mul ) (func $~lib/math/NativeMath.pow (; 4 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -254,171 +254,171 @@ (local $19 f64) (local $20 i32) (local $21 i32) - get_local $0 - i64.reinterpret/f64 - tee_local $17 + local.get $0 + i64.reinterpret_f64 + local.tee $17 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $18 - get_local $17 - i32.wrap/i64 - set_local $20 - get_local $18 + i32.wrap_i64 + local.set $18 + local.get $17 + i32.wrap_i64 + local.set $20 + local.get $18 i32.const 2147483647 i32.and - set_local $5 - get_local $1 - i64.reinterpret/f64 - tee_local $17 + local.set $5 + local.get $1 + i64.reinterpret_f64 + local.tee $17 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $13 + i32.wrap_i64 + local.tee $13 i32.const 2147483647 i32.and - set_local $11 - get_local $11 - get_local $17 - i32.wrap/i64 - tee_local $21 + local.set $11 + local.get $11 + local.get $17 + i32.wrap_i64 + local.tee $21 i32.or i32.eqz if f64.const 1 return end - get_local $5 + local.get $5 i32.const 2146435072 i32.gt_s - tee_local $4 + local.tee $4 i32.eqz if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq - tee_local $4 + local.tee $4 if - get_local $20 + local.get $20 i32.const 0 i32.ne - set_local $4 + local.set $4 end end - get_local $4 + local.get $4 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.gt_s - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.eq - tee_local $4 + local.tee $4 if - get_local $21 + local.get $21 i32.const 0 i32.ne - set_local $4 + local.set $4 end end - get_local $4 + local.get $4 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end - get_local $18 + local.get $18 i32.const 0 i32.lt_s if - get_local $11 + local.get $11 i32.const 1128267776 i32.ge_s if (result i32) i32.const 2 else - get_local $11 + local.get $11 i32.const 1072693248 i32.ge_s if (result i32) - get_local $21 - get_local $11 - get_local $11 + local.get $21 + local.get $11 + local.get $11 i32.const 20 i32.shr_s i32.const 1023 i32.sub - tee_local $12 + local.tee $12 i32.const 20 i32.gt_s - tee_local $4 + local.tee $4 select - tee_local $7 + local.tee $7 i32.const 52 i32.const 20 - get_local $4 + local.get $4 select - get_local $12 + local.get $12 i32.sub - tee_local $9 + local.tee $9 i32.shr_s - set_local $4 + local.set $4 i32.const 2 - get_local $4 + local.get $4 i32.const 1 i32.and i32.sub i32.const 0 - get_local $4 - get_local $9 + local.get $4 + local.get $9 i32.shl - get_local $7 + local.get $7 i32.eq select else i32.const 0 end end - set_local $15 + local.set $15 end - get_local $21 + local.get $21 i32.eqz if - get_local $11 + local.get $11 i32.const 2146435072 i32.eq if - get_local $5 + local.get $5 i32.const 1072693248 i32.sub - get_local $20 + local.get $20 i32.or if - get_local $5 + local.get $5 i32.const 1072693248 i32.ge_s if - get_local $13 + local.get $13 i32.const 0 i32.lt_s if f64.const 0 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 return else f64.const 0 - get_local $1 + local.get $1 f64.neg - get_local $13 + local.get $13 i32.const 0 i32.ge_s select @@ -431,184 +431,184 @@ end unreachable end - get_local $11 + local.get $11 i32.const 1072693248 i32.eq if - get_local $13 + local.get $13 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 return end f64.const 1 - get_local $0 + local.get $0 f64.div return end - get_local $13 + local.get $13 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul return end - get_local $13 + local.get $13 i32.const 1071644672 i32.eq if - get_local $18 + local.get $18 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f64.sqrt return end end end - get_local $0 + local.get $0 f64.abs - set_local $2 - get_local $20 + local.set $2 + local.get $20 i32.eqz if - get_local $5 + local.get $5 i32.eqz - tee_local $4 + local.tee $4 i32.eqz if - get_local $5 + local.get $5 i32.const 2146435072 i32.eq - set_local $4 + local.set $4 end - get_local $4 + local.get $4 i32.eqz if - get_local $5 + local.get $5 i32.const 1072693248 i32.eq - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if f64.const 1 - get_local $2 + local.get $2 f64.div - get_local $2 - get_local $13 + local.get $2 + local.get $13 i32.const 0 i32.lt_s select - set_local $2 - get_local $18 + local.set $2 + local.get $18 i32.const 0 i32.lt_s if (result f64) - get_local $5 + local.get $5 i32.const 1072693248 i32.sub - get_local $15 + local.get $15 i32.or if (result f64) - get_local $2 + local.get $2 f64.neg - get_local $2 - get_local $15 + local.get $2 + local.get $15 i32.const 1 i32.eq select else - get_local $2 - get_local $2 + local.get $2 + local.get $2 f64.sub - tee_local $14 - get_local $14 + local.tee $14 + local.get $14 f64.div end else - get_local $2 + local.get $2 end return end end f64.const 1 - set_local $10 - get_local $18 + local.set $10 + local.get $18 i32.const 0 i32.lt_s if - get_local $15 + local.get $15 i32.eqz if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub - tee_local $14 - get_local $14 + local.tee $14 + local.get $14 f64.div return end f64.const -1 f64.const 1 - get_local $15 + local.get $15 i32.const 1 i32.eq select - set_local $10 + local.set $10 end - get_local $11 + local.get $11 i32.const 1105199104 i32.gt_s if (result f64) - get_local $11 + local.get $11 i32.const 1139802112 i32.gt_s if - get_local $5 + local.get $5 i32.const 1072693247 i32.le_s if f64.const inf f64.const 0 - get_local $13 + local.get $13 i32.const 0 i32.lt_s select return end - get_local $5 + local.get $5 i32.const 1072693248 i32.ge_s if f64.const inf f64.const 0 - get_local $13 + local.get $13 i32.const 0 i32.gt_s select return end end - get_local $5 + local.get $5 i32.const 1072693247 i32.lt_s if - get_local $13 + local.get $13 i32.const 0 i32.lt_s if (result f64) - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -616,21 +616,21 @@ end return end - get_local $5 + local.get $5 i32.const 1072693248 i32.gt_s if - get_local $13 + local.get $13 i32.const 0 i32.gt_s if (result f64) - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -638,168 +638,168 @@ end return end - get_local $2 + local.get $2 f64.const 1 f64.sub - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul f64.const 0.5 - get_local $3 + local.get $3 f64.const 0.3333333333333333 - get_local $3 + local.get $3 f64.const 0.25 f64.mul f64.sub f64.mul f64.sub f64.mul - set_local $0 + local.set $0 f64.const 1.4426950216293335 - get_local $3 + local.get $3 f64.mul - tee_local $16 - get_local $3 + local.tee $16 + local.get $3 f64.const 1.9259629911266175e-08 f64.mul - get_local $0 + local.get $0 f64.const 1.4426950408889634 f64.mul f64.sub - tee_local $6 + local.tee $6 f64.add - set_local $8 - get_local $6 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $6 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 - get_local $16 + f64.reinterpret_i64 + local.tee $8 + local.get $16 f64.sub f64.sub else i32.const 0 - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 1048576 i32.lt_s if (result i32) - get_local $2 + local.get $2 f64.const 9007199254740992 f64.mul - tee_local $2 - i64.reinterpret/f64 + local.tee $2 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 + i32.wrap_i64 + local.set $5 i32.const -53 else i32.const 0 end - get_local $5 + local.get $5 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 1048575 i32.and - tee_local $9 + local.tee $9 i32.const 1072693248 i32.or - set_local $5 - get_local $9 + local.set $5 + local.get $9 i32.const 235662 i32.le_s if (result i32) i32.const 0 else - get_local $9 + local.get $9 i32.const 767610 i32.lt_s if (result i32) i32.const 1 else - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const -1048576 i32.add - set_local $5 + local.set $5 i32.const 0 end end - set_local $12 - get_local $2 - i64.reinterpret/f64 + local.set $12 + local.get $2 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $5 - i64.extend_s/i32 + local.get $5 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - tee_local $2 + f64.reinterpret_i64 + local.tee $2 f64.const 1.5 f64.const 1 - get_local $12 + local.get $12 select - tee_local $0 + local.tee $0 f64.sub - tee_local $16 + local.tee $16 f64.const 1 - get_local $2 - get_local $0 + local.get $2 + local.get $0 f64.add f64.div - tee_local $6 + local.tee $6 f64.mul - set_local $14 - get_local $2 - get_local $5 + local.set $14 + local.get $2 + local.get $5 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - get_local $12 + local.get $12 i32.const 18 i32.shl i32.add - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - tee_local $8 - get_local $0 + f64.reinterpret_i64 + local.tee $8 + local.get $0 f64.sub f64.sub - set_local $2 - get_local $14 - get_local $14 + local.set $2 + local.get $14 + local.get $14 f64.mul - tee_local $3 - get_local $3 + local.tee $3 + local.get $3 f64.mul f64.const 0.5999999999999946 - get_local $3 + local.get $3 f64.const 0.4285714285785502 - get_local $3 + local.get $3 f64.const 0.33333332981837743 - get_local $3 + local.get $3 f64.const 0.272728123808534 - get_local $3 + local.get $3 f64.const 0.23066074577556175 - get_local $3 + local.get $3 f64.const 0.20697501780033842 f64.mul f64.add @@ -812,300 +812,300 @@ f64.mul f64.add f64.mul - set_local $19 - get_local $6 - get_local $16 - get_local $14 - i64.reinterpret/f64 + local.set $19 + local.get $6 + local.get $16 + local.get $14 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $6 - get_local $8 + f64.reinterpret_i64 + local.tee $6 + local.get $8 f64.mul f64.sub - get_local $6 - get_local $2 + local.get $6 + local.get $2 f64.mul f64.sub f64.mul - set_local $0 + local.set $0 f64.const 3 - get_local $6 - get_local $6 + local.get $6 + local.get $6 f64.mul - tee_local $3 + local.tee $3 f64.add - get_local $19 - get_local $0 - get_local $6 - get_local $14 + local.get $19 + local.get $0 + local.get $6 + local.get $14 f64.add f64.mul f64.add - tee_local $19 + local.tee $19 f64.add - set_local $8 - get_local $19 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $19 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 + f64.reinterpret_i64 + local.tee $8 f64.const 3 f64.sub - get_local $3 + local.get $3 f64.sub f64.sub - set_local $2 - get_local $6 - get_local $8 + local.set $2 + local.get $6 + local.get $8 f64.mul - tee_local $16 - get_local $0 - get_local $8 + local.tee $16 + local.get $0 + local.get $8 f64.mul - get_local $2 - get_local $14 + local.get $2 + local.get $14 f64.mul f64.add - tee_local $6 + local.tee $6 f64.add - set_local $0 - get_local $6 - get_local $0 - i64.reinterpret/f64 + local.set $0 + local.get $6 + local.get $0 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $0 - get_local $16 + f64.reinterpret_i64 + local.tee $0 + local.get $16 f64.sub f64.sub - set_local $6 + local.set $6 f64.const 0.9617967009544373 - get_local $0 + local.get $0 f64.mul - tee_local $19 + local.tee $19 f64.const -7.028461650952758e-09 - get_local $0 + local.get $0 f64.mul - get_local $6 + local.get $6 f64.const 0.9617966939259756 f64.mul f64.add f64.const 1.350039202129749e-08 f64.const 0 - get_local $12 + local.get $12 select f64.add - tee_local $2 + local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - get_local $12 + local.get $12 select - tee_local $0 + local.tee $0 f64.add - get_local $7 - f64.convert_s/i32 - tee_local $3 + local.get $7 + f64.convert_i32_s + local.tee $3 f64.add - set_local $8 - get_local $2 - get_local $8 - i64.reinterpret/f64 + local.set $8 + local.get $2 + local.get $8 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $8 - get_local $3 + f64.reinterpret_i64 + local.tee $8 + local.get $3 f64.sub - get_local $0 + local.get $0 f64.sub - get_local $19 + local.get $19 f64.sub f64.sub end - set_local $2 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.set $2 + local.get $1 + local.get $1 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $0 + f64.reinterpret_i64 + local.tee $0 f64.sub - get_local $8 + local.get $8 f64.mul - get_local $1 - get_local $2 + local.get $1 + local.get $2 f64.mul f64.add - tee_local $6 - get_local $0 - get_local $8 + local.tee $6 + local.get $0 + local.get $8 f64.mul - tee_local $0 + local.tee $0 f64.add - tee_local $2 - i64.reinterpret/f64 - tee_local $17 - i32.wrap/i64 - set_local $4 + local.tee $2 + i64.reinterpret_f64 + local.tee $17 + i32.wrap_i64 + local.set $4 block $folding-inner1 block $folding-inner0 - get_local $17 + local.get $17 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $9 + i32.wrap_i64 + local.tee $9 i32.const 1083179008 i32.ge_s if - get_local $9 + local.get $9 i32.const 1083179008 i32.sub - get_local $4 + local.get $4 i32.or br_if $folding-inner0 - get_local $6 + local.get $6 f64.const 8.008566259537294e-17 f64.add - get_local $2 - get_local $0 + local.get $2 + local.get $0 f64.sub f64.gt br_if $folding-inner0 else - get_local $9 + local.get $9 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_s if - get_local $9 + local.get $9 i32.const -1064252416 i32.sub - get_local $4 + local.get $4 i32.or br_if $folding-inner1 - get_local $6 - get_local $2 - get_local $0 + local.get $6 + local.get $2 + local.get $0 f64.sub f64.le br_if $folding-inner1 end end - get_local $9 + local.get $9 i32.const 2147483647 i32.and - tee_local $4 + local.tee $4 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $12 + local.set $12 i32.const 0 - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.const 1071644672 i32.gt_s if i32.const 1048576 - get_local $12 + local.get $12 i32.const 1 i32.add i32.shr_s - get_local $9 + local.get $9 i32.add - tee_local $7 + local.tee $7 i32.const 2147483647 i32.and i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $12 + local.set $12 i32.const 1048575 - get_local $12 + local.get $12 i32.shr_s i32.const -1 i32.xor - get_local $7 + local.get $7 i32.and - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $3 - get_local $7 + f64.reinterpret_i64 + local.set $3 + local.get $7 i32.const 1048575 i32.and i32.const 1048576 i32.or i32.const 20 - get_local $12 + local.get $12 i32.sub i32.shr_s - set_local $7 + local.set $7 i32.const 0 - get_local $7 + local.get $7 i32.sub - get_local $7 - get_local $9 + local.get $7 + local.get $9 i32.const 0 i32.lt_s select - set_local $7 - get_local $0 - get_local $3 + local.set $7 + local.get $0 + local.get $3 f64.sub - set_local $0 + local.set $0 end - get_local $6 - get_local $0 + local.get $6 + local.get $0 f64.add - i64.reinterpret/f64 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - tee_local $3 + f64.reinterpret_i64 + local.tee $3 f64.const 0.6931471824645996 f64.mul - tee_local $16 - get_local $6 - get_local $3 - get_local $0 + local.tee $16 + local.get $6 + local.get $3 + local.get $0 f64.sub f64.sub f64.const 0.6931471805599453 f64.mul - get_local $3 + local.get $3 f64.const -1.904654299957768e-09 f64.mul f64.add - tee_local $6 + local.tee $6 f64.add - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 f64.mul - set_local $3 - get_local $10 + local.set $3 + local.get $10 f64.const 1 - get_local $2 - get_local $2 - get_local $3 + local.get $2 + local.get $2 + local.get $3 f64.const 0.16666666666666602 - get_local $3 + local.get $3 f64.const -2.7777777777015593e-03 - get_local $3 + local.get $3 f64.const 6.613756321437934e-05 - get_local $3 + local.get $3 f64.const -1.6533902205465252e-06 - get_local $3 + local.get $3 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -1117,89 +1117,89 @@ f64.add f64.mul f64.sub - tee_local $8 + local.tee $8 f64.mul - get_local $8 + local.get $8 f64.const 2 f64.sub f64.div - get_local $6 - get_local $2 - get_local $16 + local.get $6 + local.get $2 + local.get $16 f64.sub f64.sub - tee_local $0 - get_local $2 - get_local $0 + local.tee $0 + local.get $2 + local.get $0 f64.mul f64.add f64.sub - get_local $2 + local.get $2 f64.sub f64.sub - tee_local $2 - i64.reinterpret/f64 + local.tee $2 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - get_local $7 + i32.wrap_i64 + local.get $7 i32.const 20 i32.shl i32.add - tee_local $9 + local.tee $9 i32.const 20 i32.shr_s i32.const 0 i32.le_s if (result f64) - get_local $2 - get_local $7 + local.get $2 + local.get $7 call $~lib/math/NativeMath.scalbn else - get_local $2 - i64.reinterpret/f64 + local.get $2 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $9 - i64.extend_s/i32 + local.get $9 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 end f64.mul return end - get_local $10 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - get_local $10 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul ) (func $std/operator-overloading/Tester.pow (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.load - f64.convert_s/i32 - get_local $1 + f64.convert_i32_s + local.get $1 i32.load - f64.convert_s/i32 + f64.convert_i32_s call $~lib/math/NativeMath.pow - i32.trunc_s/f64 - get_local $0 + i32.trunc_f64_s + local.get $0 i32.load offset=4 - f64.convert_s/i32 - get_local $1 + f64.convert_i32_s + local.get $1 i32.load offset=4 - f64.convert_s/i32 + f64.convert_i32_s call $~lib/math/NativeMath.pow - i32.trunc_s/f64 + i32.trunc_f64_s call $std/operator-overloading/Tester#constructor ) (func $start (; 6 ;) (type $v) @@ -1207,43 +1207,43 @@ (local $1 i32) (local $2 i32) i32.const 72 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 1 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/a1 + global.set $std/operator-overloading/a1 i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/a2 - get_global $std/operator-overloading/a1 - tee_local $0 + global.set $std/operator-overloading/a2 + global.get $std/operator-overloading/a1 + local.tee $0 i32.load - get_global $std/operator-overloading/a2 - tee_local $1 + global.get $std/operator-overloading/a2 + local.tee $1 i32.load i32.add - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.add call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/a - get_global $std/operator-overloading/a + global.set $std/operator-overloading/a + global.get $std/operator-overloading/a i32.load i32.const 3 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/a + global.get $std/operator-overloading/a i32.load offset=4 i32.const 5 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1257,36 +1257,36 @@ i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/s1 + global.set $std/operator-overloading/s1 i32.const 2 i32.const -3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/s2 - get_global $std/operator-overloading/s1 - tee_local $0 + global.set $std/operator-overloading/s2 + global.get $std/operator-overloading/s1 + local.tee $0 i32.load - get_global $std/operator-overloading/s2 - tee_local $1 + global.get $std/operator-overloading/s2 + local.tee $1 i32.load i32.sub - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.sub call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/s - get_global $std/operator-overloading/s + global.set $std/operator-overloading/s + global.get $std/operator-overloading/s i32.load i32.eqz - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/s + global.get $std/operator-overloading/s i32.load offset=4 i32.const 6 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1300,37 +1300,37 @@ i32.const 2 i32.const 5 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/m1 + global.set $std/operator-overloading/m1 i32.const 3 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/m2 - get_global $std/operator-overloading/m1 - tee_local $0 + global.set $std/operator-overloading/m2 + global.get $std/operator-overloading/m1 + local.tee $0 i32.load - get_global $std/operator-overloading/m2 - tee_local $1 + global.get $std/operator-overloading/m2 + local.tee $1 i32.load i32.mul - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.mul call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/m - get_global $std/operator-overloading/m + global.set $std/operator-overloading/m + global.get $std/operator-overloading/m i32.load i32.const 6 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/m + global.get $std/operator-overloading/m i32.load offset=4 i32.const 10 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1344,37 +1344,37 @@ i32.const 6 i32.const 50 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/d1 + global.set $std/operator-overloading/d1 i32.const 3 i32.const 10 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/d2 - get_global $std/operator-overloading/d1 - tee_local $0 + global.set $std/operator-overloading/d2 + global.get $std/operator-overloading/d1 + local.tee $0 i32.load - get_global $std/operator-overloading/d2 - tee_local $1 + global.get $std/operator-overloading/d2 + local.tee $1 i32.load i32.div_s - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.div_s call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/d - get_global $std/operator-overloading/d + global.set $std/operator-overloading/d + global.get $std/operator-overloading/d i32.load i32.const 2 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/d + global.get $std/operator-overloading/d i32.load offset=4 i32.const 5 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1388,36 +1388,36 @@ i32.const 10 i32.const 10 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/f1 + global.set $std/operator-overloading/f1 i32.const 6 i32.const 10 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/f2 - get_global $std/operator-overloading/f1 - tee_local $0 + global.set $std/operator-overloading/f2 + global.get $std/operator-overloading/f1 + local.tee $0 i32.load - get_global $std/operator-overloading/f2 - tee_local $1 + global.get $std/operator-overloading/f2 + local.tee $1 i32.load i32.rem_s - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.rem_s call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/f - get_global $std/operator-overloading/f + global.set $std/operator-overloading/f + global.get $std/operator-overloading/f i32.load i32.const 4 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/f + global.get $std/operator-overloading/f i32.load offset=4 i32.eqz else - get_local $0 + local.get $0 end i32.eqz if @@ -1431,27 +1431,27 @@ i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/p1 + global.set $std/operator-overloading/p1 i32.const 4 i32.const 5 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/p2 - get_global $std/operator-overloading/p1 - get_global $std/operator-overloading/p2 + global.set $std/operator-overloading/p2 + global.get $std/operator-overloading/p1 + global.get $std/operator-overloading/p2 call $std/operator-overloading/Tester.pow - set_global $std/operator-overloading/p - get_global $std/operator-overloading/p + global.set $std/operator-overloading/p + global.get $std/operator-overloading/p i32.load i32.const 16 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/p + global.get $std/operator-overloading/p i32.load offset=4 i32.const 243 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1465,37 +1465,37 @@ i32.const 255 i32.const 15 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/n1 + global.set $std/operator-overloading/n1 i32.const 15 i32.const 255 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/n2 - get_global $std/operator-overloading/n1 - tee_local $0 + global.set $std/operator-overloading/n2 + global.get $std/operator-overloading/n1 + local.tee $0 i32.load - get_global $std/operator-overloading/n2 - tee_local $1 + global.get $std/operator-overloading/n2 + local.tee $1 i32.load i32.and - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.and call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/n - get_global $std/operator-overloading/n + global.set $std/operator-overloading/n + global.get $std/operator-overloading/n i32.load i32.const 15 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/n + global.get $std/operator-overloading/n i32.load offset=4 i32.const 15 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1509,37 +1509,37 @@ i32.const 3855 i32.const 255 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/o1 + global.set $std/operator-overloading/o1 i32.const 61680 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/o2 - get_global $std/operator-overloading/o1 - tee_local $0 + global.set $std/operator-overloading/o2 + global.get $std/operator-overloading/o1 + local.tee $0 i32.load - get_global $std/operator-overloading/o2 - tee_local $1 + global.get $std/operator-overloading/o2 + local.tee $1 i32.load i32.or - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.or call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/o - get_global $std/operator-overloading/o + global.set $std/operator-overloading/o + global.get $std/operator-overloading/o i32.load i32.const 65535 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/o + global.get $std/operator-overloading/o i32.load offset=4 i32.const 255 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1553,37 +1553,37 @@ i32.const 255 i32.const 255 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/x1 + global.set $std/operator-overloading/x1 i32.const 65280 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/x2 - get_global $std/operator-overloading/x1 - tee_local $0 + global.set $std/operator-overloading/x2 + global.get $std/operator-overloading/x1 + local.tee $0 i32.load - get_global $std/operator-overloading/x2 - tee_local $1 + global.get $std/operator-overloading/x2 + local.tee $1 i32.load i32.xor - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.xor call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/x - get_global $std/operator-overloading/x + global.set $std/operator-overloading/x + global.get $std/operator-overloading/x i32.load i32.const 65535 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/x + global.get $std/operator-overloading/x i32.load offset=4 i32.const 255 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1597,30 +1597,30 @@ i32.const 1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq1 + global.set $std/operator-overloading/eq1 i32.const 1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq2 - get_global $std/operator-overloading/eq1 - tee_local $1 + global.set $std/operator-overloading/eq2 + global.get $std/operator-overloading/eq1 + local.tee $1 i32.load - get_global $std/operator-overloading/eq2 - tee_local $2 + global.get $std/operator-overloading/eq2 + local.tee $2 i32.load i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.eq else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/eq - get_global $std/operator-overloading/eq + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq i32.const 1 i32.ne if @@ -1634,30 +1634,30 @@ i32.const 1 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq3 + global.set $std/operator-overloading/eq3 i32.const 0 i32.const 1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq4 - get_global $std/operator-overloading/eq3 - tee_local $1 + global.set $std/operator-overloading/eq4 + global.get $std/operator-overloading/eq3 + local.tee $1 i32.load - get_global $std/operator-overloading/eq4 - tee_local $2 + global.get $std/operator-overloading/eq4 + local.tee $2 i32.load i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.eq else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/eqf - get_global $std/operator-overloading/eqf + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf if i32.const 0 i32.const 8 @@ -1666,25 +1666,25 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/eq1 - tee_local $1 + global.get $std/operator-overloading/eq1 + local.tee $1 i32.load - get_global $std/operator-overloading/eq2 - tee_local $2 + global.get $std/operator-overloading/eq2 + local.tee $2 i32.load i32.ne - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.ne else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/eq - get_global $std/operator-overloading/eq + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq if i32.const 0 i32.const 8 @@ -1693,25 +1693,25 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/eq3 - tee_local $1 + global.get $std/operator-overloading/eq3 + local.tee $1 i32.load - get_global $std/operator-overloading/eq4 - tee_local $2 + global.get $std/operator-overloading/eq4 + local.tee $2 i32.load i32.ne - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.ne else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/eqf - get_global $std/operator-overloading/eqf + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf i32.const 1 i32.ne if @@ -1725,30 +1725,30 @@ i32.const 2 i32.const 2147483647 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gt1 + global.set $std/operator-overloading/gt1 i32.const 1 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gt2 - get_global $std/operator-overloading/gt1 - tee_local $1 + global.set $std/operator-overloading/gt2 + global.get $std/operator-overloading/gt1 + local.tee $1 i32.load - get_global $std/operator-overloading/gt2 - tee_local $2 + global.get $std/operator-overloading/gt2 + local.tee $2 i32.load i32.gt_s - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.gt_s else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/gt - get_global $std/operator-overloading/gt + global.set $std/operator-overloading/gt + global.get $std/operator-overloading/gt i32.const 1 i32.ne if @@ -1762,30 +1762,30 @@ i32.const 2 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gte1 + global.set $std/operator-overloading/gte1 i32.const 2 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gte2 - get_global $std/operator-overloading/gte1 - tee_local $1 + global.set $std/operator-overloading/gte2 + global.get $std/operator-overloading/gte1 + local.tee $1 i32.load - get_global $std/operator-overloading/gte2 - tee_local $2 + global.get $std/operator-overloading/gte2 + local.tee $2 i32.load i32.ge_s - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.ge_s else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/gte - get_global $std/operator-overloading/gte + global.set $std/operator-overloading/gte + global.get $std/operator-overloading/gte i32.const 1 i32.ne if @@ -1799,30 +1799,30 @@ i32.const 5 i32.const -1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/le1 + global.set $std/operator-overloading/le1 i32.const 6 i32.const 6 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/le2 - get_global $std/operator-overloading/le1 - tee_local $1 + global.set $std/operator-overloading/le2 + global.get $std/operator-overloading/le1 + local.tee $1 i32.load - get_global $std/operator-overloading/le2 - tee_local $2 + global.get $std/operator-overloading/le2 + local.tee $2 i32.load i32.lt_s - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.lt_s else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/le - get_global $std/operator-overloading/le + global.set $std/operator-overloading/le + global.get $std/operator-overloading/le i32.const 1 i32.ne if @@ -1836,30 +1836,30 @@ i32.const 4 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/leq1 + global.set $std/operator-overloading/leq1 i32.const 4 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/leq2 - get_global $std/operator-overloading/leq1 - tee_local $1 + global.set $std/operator-overloading/leq2 + global.get $std/operator-overloading/leq1 + local.tee $1 i32.load - get_global $std/operator-overloading/leq2 - tee_local $2 + global.get $std/operator-overloading/leq2 + local.tee $2 i32.load i32.le_s - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $2 + local.get $2 i32.load offset=4 i32.le_s else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/leq - get_global $std/operator-overloading/leq + global.set $std/operator-overloading/leq + global.get $std/operator-overloading/leq i32.const 1 i32.ne if @@ -1873,30 +1873,30 @@ i32.const 8 i32.const 16 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/shr - get_global $std/operator-overloading/shr - tee_local $0 + global.set $std/operator-overloading/shr + global.get $std/operator-overloading/shr + local.tee $0 i32.load i32.const 3 i32.shr_s - get_local $0 + local.get $0 i32.load offset=4 i32.const 3 i32.shr_s call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/sres - get_global $std/operator-overloading/sres + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1910,30 +1910,30 @@ i32.const -8 i32.const -16 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/shu - get_global $std/operator-overloading/shu - tee_local $0 + global.set $std/operator-overloading/shu + global.get $std/operator-overloading/shu + local.tee $0 i32.load i32.const 3 i32.shr_u - get_local $0 + local.get $0 i32.load offset=4 i32.const 3 i32.shr_u call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/ures - get_global $std/operator-overloading/ures + global.set $std/operator-overloading/ures + global.get $std/operator-overloading/ures i32.load i32.const 536870911 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/ures + global.get $std/operator-overloading/ures i32.load offset=4 i32.const 536870910 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1947,30 +1947,30 @@ i32.const 1 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/shl - get_global $std/operator-overloading/shl - tee_local $0 + global.set $std/operator-overloading/shl + global.get $std/operator-overloading/shl + local.tee $0 i32.load i32.const 3 i32.shl - get_local $0 + local.get $0 i32.load offset=4 i32.const 3 i32.shl call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/sres - get_global $std/operator-overloading/sres + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load i32.const 8 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load offset=4 i32.const 16 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1984,28 +1984,28 @@ i32.const 1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/pos - get_global $std/operator-overloading/pos - tee_local $0 + global.set $std/operator-overloading/pos + global.get $std/operator-overloading/pos + local.tee $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/pres - get_global $std/operator-overloading/pres + global.set $std/operator-overloading/pres + global.get $std/operator-overloading/pres i32.load - get_global $std/operator-overloading/pos + global.get $std/operator-overloading/pos i32.load i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/pres + global.get $std/operator-overloading/pres i32.load offset=4 - get_global $std/operator-overloading/pos + global.get $std/operator-overloading/pos i32.load offset=4 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2019,36 +2019,36 @@ i32.const -1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/neg + global.set $std/operator-overloading/neg i32.const 0 - get_global $std/operator-overloading/neg - tee_local $0 + global.get $std/operator-overloading/neg + local.tee $0 i32.load i32.sub i32.const 0 - get_local $0 + local.get $0 i32.load offset=4 i32.sub call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/nres - get_global $std/operator-overloading/nres + global.set $std/operator-overloading/nres + global.get $std/operator-overloading/nres i32.load i32.const 0 - get_global $std/operator-overloading/neg + global.get $std/operator-overloading/neg i32.load i32.sub i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/nres + global.get $std/operator-overloading/nres i32.load offset=4 i32.const 0 - get_global $std/operator-overloading/neg + global.get $std/operator-overloading/neg i32.load offset=4 i32.sub i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2062,36 +2062,36 @@ i32.const 255 i32.const 16 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/not - get_global $std/operator-overloading/not - tee_local $0 + global.set $std/operator-overloading/not + global.get $std/operator-overloading/not + local.tee $0 i32.load i32.const -1 i32.xor - get_local $0 + local.get $0 i32.load offset=4 i32.const -1 i32.xor call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/res - get_global $std/operator-overloading/res + global.set $std/operator-overloading/res + global.get $std/operator-overloading/res i32.load - get_global $std/operator-overloading/not + global.get $std/operator-overloading/not i32.load i32.const -1 i32.xor i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/res + global.get $std/operator-overloading/res i32.load offset=4 - get_global $std/operator-overloading/not + global.get $std/operator-overloading/not i32.load offset=4 i32.const -1 i32.xor i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2105,34 +2105,34 @@ i32.const 0 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/excl - get_global $std/operator-overloading/excl - tee_local $1 + global.set $std/operator-overloading/excl + global.get $std/operator-overloading/excl + local.tee $1 i32.load i32.eqz - tee_local $0 + local.tee $0 if (result i32) - get_local $1 + local.get $1 i32.load offset=4 i32.eqz else - get_local $0 + local.get $0 end - set_global $std/operator-overloading/bres - get_global $std/operator-overloading/bres - set_local $1 - get_global $std/operator-overloading/excl + 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 - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/excl + global.get $std/operator-overloading/excl i32.load offset=4 i32.eqz else - get_local $0 + local.get $0 end - get_local $1 + local.get $1 i32.ne if i32.const 0 @@ -2142,7 +2142,7 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/bres + global.get $std/operator-overloading/bres i32.const 1 i32.ne if @@ -2156,34 +2156,34 @@ i32.const 0 i32.const 1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/incdec - get_global $std/operator-overloading/incdec - tee_local $0 - get_local $0 + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec + local.tee $0 + local.get $0 i32.load i32.const 1 i32.add i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=4 i32.const 1 i32.add i32.store offset=4 - get_local $0 - set_global $std/operator-overloading/incdec - get_global $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2194,32 +2194,32 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/incdec - tee_local $0 - get_local $0 + global.get $std/operator-overloading/incdec + local.tee $0 + local.get $0 i32.load i32.const 1 i32.sub i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub i32.store offset=4 - get_local $0 - set_global $std/operator-overloading/incdec - get_global $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.eqz - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2233,31 +2233,31 @@ i32.const 0 i32.const 1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/incdec - get_global $std/operator-overloading/incdec - tee_local $0 + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec + local.tee $0 i32.load i32.const 1 i32.add - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.add call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/incdec - get_local $0 - set_global $std/operator-overloading/tmp - get_global $std/operator-overloading/tmp + global.set $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load i32.eqz - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 1 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2268,18 +2268,18 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2290,31 +2290,31 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/incdec - tee_local $0 + global.get $std/operator-overloading/incdec + local.tee $0 i32.load i32.const 1 i32.sub - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/incdec - get_local $0 - set_global $std/operator-overloading/tmp - get_global $std/operator-overloading/tmp + global.set $std/operator-overloading/incdec + local.get $0 + global.set $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2325,17 +2325,17 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.eqz - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2349,48 +2349,48 @@ i32.const 1 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/ais1 - get_global $std/operator-overloading/ais1 - tee_local $0 + global.set $std/operator-overloading/ais1 + global.get $std/operator-overloading/ais1 + local.tee $0 i32.load i32.const 1 i32.add - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.add call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/ais1 + global.set $std/operator-overloading/ais1 i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/ais2 - get_global $std/operator-overloading/ais1 - tee_local $0 + global.set $std/operator-overloading/ais2 + global.get $std/operator-overloading/ais1 + local.tee $0 i32.load - get_global $std/operator-overloading/ais2 - tee_local $1 + global.get $std/operator-overloading/ais2 + local.tee $1 i32.load i32.add - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.add call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/ais - get_global $std/operator-overloading/ais + global.set $std/operator-overloading/ais + global.get $std/operator-overloading/ais i32.load i32.const 4 i32.eq - tee_local $1 + local.tee $1 if (result i32) - get_global $std/operator-overloading/ais + global.get $std/operator-overloading/ais i32.load offset=4 i32.const 6 i32.eq else - get_local $1 + local.get $1 end i32.eqz if @@ -2404,48 +2404,48 @@ i32.const 1 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/aii1 - get_global $std/operator-overloading/aii1 - tee_local $1 + global.set $std/operator-overloading/aii1 + global.get $std/operator-overloading/aii1 + local.tee $1 i32.load i32.const 1 i32.add - get_local $1 + local.get $1 i32.load offset=4 i32.const 1 i32.add call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/aii1 + global.set $std/operator-overloading/aii1 i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/aii2 - get_global $std/operator-overloading/aii1 - tee_local $1 + global.set $std/operator-overloading/aii2 + global.get $std/operator-overloading/aii1 + local.tee $1 i32.load - get_global $std/operator-overloading/aii2 - tee_local $0 + global.get $std/operator-overloading/aii2 + local.tee $0 i32.load i32.add - get_local $1 + local.get $1 i32.load offset=4 - get_local $0 + local.get $0 i32.load offset=4 i32.add call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/aii - get_global $std/operator-overloading/aii + global.set $std/operator-overloading/aii + global.get $std/operator-overloading/aii i32.load i32.const 4 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/aii + global.get $std/operator-overloading/aii i32.load offset=4 i32.const 6 i32.eq else - get_local $0 + local.get $0 end i32.eqz if diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 278388cc..324f3fd9 100644 --- a/tests/compiler/std/operator-overloading.untouched.wat +++ b/tests/compiler/std/operator-overloading.untouched.wat @@ -9,7 +9,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -96,41 +96,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -140,22 +140,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -164,97 +164,97 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $std/operator-overloading/Tester#constructor (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=4 - get_local $0 + local.get $0 ) (func $std/operator-overloading/Tester.add (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.add - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.add call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.sub (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.sub - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.sub call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.mul (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.mul - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.mul call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.div (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.div_s - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.div_s call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.mod (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.rem_s - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.rem_s call $std/operator-overloading/Tester#constructor @@ -263,91 +263,91 @@ (local $2 f64) (local $3 i32) (local $4 i32) - get_local $0 - set_local $2 - get_local $1 + local.get $0 + local.set $2 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1023 i32.gt_s if - get_local $2 + local.get $2 f64.const 8988465674311579538646525e283 f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1023 i32.sub - tee_local $3 + local.tee $3 i32.const 1023 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - set_local $1 + local.set $1 end else - get_local $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.const 53 i32.sub i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const -1022 i32.lt_s if - get_local $2 + local.get $2 f64.const 2.2250738585072014e-308 f64.const 9007199254740992 f64.mul f64.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1022 i32.add i32.const 53 i32.sub - tee_local $3 + local.tee $3 i32.const -1022 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - set_local $1 + local.set $1 end end end - get_local $2 + local.get $2 i64.const 1023 - get_local $1 - i64.extend_s/i32 + local.get $1 + i64.extend_i32_s i64.add i64.const 52 i64.shl - f64.reinterpret/i64 + f64.reinterpret_i64 f64.mul ) (func $~lib/math/NativeMath.pow (; 10 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) @@ -391,38 +391,38 @@ (local $39 f64) (local $40 f64) (local $41 i32) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $3 - get_local $2 - i32.wrap/i64 - set_local $4 - get_local $1 - i64.reinterpret/f64 - set_local $2 - get_local $2 + i32.wrap_i64 + local.set $3 + local.get $2 + i32.wrap_i64 + local.set $4 + local.get $1 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $5 - get_local $2 - i32.wrap/i64 - set_local $6 - get_local $3 + i32.wrap_i64 + local.set $5 + local.get $2 + i32.wrap_i64 + local.set $6 + local.get $3 i32.const 2147483647 i32.and - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 2147483647 i32.and - set_local $8 - get_local $8 - get_local $6 + local.set $8 + local.get $8 + local.get $6 i32.or i32.const 0 i32.eq @@ -430,126 +430,126 @@ f64.const 1 return end - get_local $7 + local.get $7 i32.const 2146435072 i32.gt_s - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $4 + local.get $4 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.gt_s end - tee_local $9 + local.tee $9 if (result i32) - get_local $9 + local.get $9 else - get_local $8 + local.get $8 i32.const 2146435072 i32.eq - tee_local $9 + local.tee $9 if (result i32) - get_local $6 + local.get $6 i32.const 0 i32.ne else - get_local $9 + local.get $9 end end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add return end i32.const 0 - set_local $10 - get_local $3 + local.set $10 + local.get $3 i32.const 0 i32.lt_s if - get_local $8 + local.get $8 i32.const 1128267776 i32.ge_s if i32.const 2 - set_local $10 + local.set $10 else - get_local $8 + local.get $8 i32.const 1072693248 i32.ge_s if - get_local $8 + local.get $8 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 - get_local $11 + local.set $11 + local.get $11 i32.const 20 i32.gt_s - set_local $9 + local.set $9 i32.const 52 i32.const 20 - get_local $9 + local.get $9 select - get_local $11 + local.get $11 i32.sub - set_local $12 - get_local $6 - get_local $8 - get_local $9 + local.set $12 + local.get $6 + local.get $8 + local.get $9 select - set_local $13 - get_local $13 - get_local $12 + local.set $13 + local.get $13 + local.get $12 i32.shr_s - set_local $14 - get_local $14 - get_local $12 + local.set $14 + local.get $14 + local.get $12 i32.shl - get_local $13 + local.get $13 i32.eq if i32.const 2 - get_local $14 + local.get $14 i32.const 1 i32.and i32.sub - set_local $10 + local.set $10 end end end end - get_local $6 + local.get $6 i32.const 0 i32.eq if - get_local $8 + local.get $8 i32.const 2146435072 i32.eq if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $4 + local.get $4 i32.or i32.const 0 i32.eq @@ -557,27 +557,27 @@ f64.const nan:0x8000000000000 return else - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) - get_local $1 + local.get $1 else f64.const 0 end return else - get_local $5 + local.get $5 i32.const 0 i32.ge_s if (result f64) f64.const 0 else - get_local $1 + local.get $1 f64.neg end return @@ -587,158 +587,158 @@ unreachable unreachable end - get_local $8 + local.get $8 i32.const 1072693248 i32.eq if - get_local $5 + local.get $5 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 return end f64.const 1 - get_local $0 + local.get $0 f64.div return end - get_local $5 + local.get $5 i32.const 1073741824 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul return end - get_local $5 + local.get $5 i32.const 1071644672 i32.eq if - get_local $3 + local.get $3 i32.const 0 i32.ge_s if - get_local $0 + local.get $0 f64.sqrt return end end end - get_local $0 + local.get $0 f64.abs - set_local $15 - get_local $4 + local.set $15 + local.get $4 i32.const 0 i32.eq if - get_local $7 + local.get $7 i32.const 0 i32.eq - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 2146435072 i32.eq end - tee_local $14 + local.tee $14 if (result i32) - get_local $14 + local.get $14 else - get_local $7 + local.get $7 i32.const 1072693248 i32.eq end if - get_local $15 - set_local $16 - get_local $5 + local.get $15 + local.set $16 + local.get $5 i32.const 0 i32.lt_s if f64.const 1 - get_local $16 + local.get $16 f64.div - set_local $16 + local.set $16 end - get_local $3 + local.get $3 i32.const 0 i32.lt_s if - get_local $7 + local.get $7 i32.const 1072693248 i32.sub - get_local $10 + local.get $10 i32.or i32.const 0 i32.eq if - get_local $16 - get_local $16 + local.get $16 + local.get $16 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div - set_local $16 + local.set $16 else - get_local $10 + local.get $10 i32.const 1 i32.eq if - get_local $16 + local.get $16 f64.neg - set_local $16 + local.set $16 end end end - get_local $16 + local.get $16 return end end f64.const 1 - set_local $18 - get_local $3 + local.set $18 + local.get $3 i32.const 0 i32.lt_s if - get_local $10 + local.get $10 i32.const 0 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub - set_local $17 - get_local $17 - get_local $17 + local.set $17 + local.get $17 + local.get $17 f64.div return end - get_local $10 + local.get $10 i32.const 1 i32.eq if f64.const -1 - set_local $18 + local.set $18 end end - get_local $8 + local.get $8 i32.const 1105199104 i32.gt_s if - get_local $8 + local.get $8 i32.const 1139802112 i32.gt_s if - get_local $7 + local.get $7 i32.const 1072693247 i32.le_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) @@ -752,11 +752,11 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.ge_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) @@ -771,21 +771,21 @@ return end end - get_local $7 + local.get $7 i32.const 1072693247 i32.lt_s if - get_local $5 + local.get $5 i32.const 0 i32.lt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -793,21 +793,21 @@ end return end - get_local $7 + local.get $7 i32.const 1072693248 i32.gt_s if - get_local $5 + local.get $5 i32.const 0 i32.gt_s if (result f64) - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul else - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -815,205 +815,205 @@ end return end - get_local $15 + local.get $15 f64.const 1 f64.sub - set_local $24 - get_local $24 - get_local $24 + local.set $24 + local.get $24 + local.get $24 f64.mul f64.const 0.5 - get_local $24 + local.get $24 f64.const 0.3333333333333333 - get_local $24 + local.get $24 f64.const 0.25 f64.mul f64.sub f64.mul f64.sub f64.mul - set_local $27 + local.set $27 f64.const 1.4426950216293335 - get_local $24 + local.get $24 f64.mul - set_local $25 - get_local $24 + local.set $25 + local.get $24 f64.const 1.9259629911266175e-08 f64.mul - get_local $27 + local.get $27 f64.const 1.4426950408889634 f64.mul f64.sub - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $26 - get_local $19 - get_local $25 + f64.reinterpret_i64 + local.set $19 + local.get $26 + local.get $19 + local.get $25 f64.sub f64.sub - set_local $20 + local.set $20 else i32.const 0 - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.lt_s if - get_local $15 + local.get $15 f64.const 9007199254740992 f64.mul - set_local $15 - get_local $29 + local.set $15 + local.get $29 i32.const 53 i32.sub - set_local $29 - get_local $15 - i64.reinterpret/f64 + local.set $29 + local.get $15 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $7 + i32.wrap_i64 + local.set $7 end - get_local $29 - get_local $7 + local.get $29 + local.get $7 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048575 i32.and - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 1072693248 i32.or - set_local $7 - get_local $28 + local.set $7 + local.get $28 i32.const 235662 i32.le_s if i32.const 0 - set_local $11 + local.set $11 else - get_local $28 + local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - set_local $11 + local.set $11 else i32.const 0 - set_local $11 - get_local $29 + local.set $11 + local.get $29 i32.const 1 i32.add - set_local $29 - get_local $7 + local.set $29 + local.get $7 i32.const 1048576 i32.sub - set_local $7 + local.set $7 end end - get_local $15 - i64.reinterpret/f64 + local.get $15 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $15 + f64.reinterpret_i64 + local.set $15 f64.const 1.5 f64.const 1 - get_local $11 + local.get $11 select - set_local $35 - get_local $15 - get_local $35 + local.set $35 + local.get $15 + local.get $35 f64.sub - set_local $25 + local.set $25 f64.const 1 - get_local $15 - get_local $35 + local.get $15 + local.get $35 f64.add f64.div - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.mul - set_local $17 - get_local $17 - set_local $31 - get_local $31 - i64.reinterpret/f64 + local.set $17 + local.get $17 + local.set $31 + local.get $31 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $31 - get_local $7 + f64.reinterpret_i64 + local.set $31 + local.get $7 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - get_local $11 + local.get $11 i32.const 18 i32.shl i32.add - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $33 - get_local $15 - get_local $33 - get_local $35 + f64.reinterpret_i64 + local.set $33 + local.get $15 + local.get $33 + local.get $35 f64.sub f64.sub - set_local $34 - get_local $26 - get_local $25 - get_local $31 - get_local $33 + local.set $34 + local.get $26 + local.get $25 + local.get $31 + local.get $33 f64.mul f64.sub - get_local $31 - get_local $34 + local.get $31 + local.get $34 f64.mul f64.sub f64.mul - set_local $32 - get_local $17 - get_local $17 + local.set $32 + local.get $17 + local.get $17 f64.mul - set_local $30 - get_local $30 - get_local $30 + local.set $30 + local.get $30 + local.get $30 f64.mul f64.const 0.5999999999999946 - get_local $30 + local.get $30 f64.const 0.4285714285785502 - get_local $30 + local.get $30 f64.const 0.33333332981837743 - get_local $30 + local.get $30 f64.const 0.272728123808534 - get_local $30 + local.get $30 f64.const 0.23066074577556175 - get_local $30 + local.get $30 f64.const 0.20697501780033842 f64.mul f64.add @@ -1026,184 +1026,184 @@ f64.mul f64.add f64.mul - set_local $23 - get_local $23 - get_local $32 - get_local $31 - get_local $17 + local.set $23 + local.get $23 + local.get $32 + local.get $31 + local.get $17 f64.add f64.mul f64.add - set_local $23 - get_local $31 - get_local $31 + local.set $23 + local.get $31 + local.get $31 f64.mul - set_local $30 + local.set $30 f64.const 3 - get_local $30 + local.get $30 f64.add - get_local $23 + local.get $23 f64.add - set_local $33 - get_local $33 - i64.reinterpret/f64 + local.set $33 + local.get $33 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $33 - get_local $23 - get_local $33 + f64.reinterpret_i64 + local.set $33 + local.get $23 + local.get $33 f64.const 3 f64.sub - get_local $30 + local.get $30 f64.sub f64.sub - set_local $34 - get_local $31 - get_local $33 + local.set $34 + local.get $31 + local.get $33 f64.mul - set_local $25 - get_local $32 - get_local $33 + local.set $25 + local.get $32 + local.get $33 f64.mul - get_local $34 - get_local $17 + local.get $34 + local.get $17 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $21 - get_local $21 - i64.reinterpret/f64 + local.set $21 + local.get $21 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $21 - get_local $26 - get_local $21 - get_local $25 + f64.reinterpret_i64 + local.set $21 + local.get $26 + local.get $21 + local.get $25 f64.sub f64.sub - set_local $22 + local.set $22 f64.const 0.9617967009544373 - get_local $21 + local.get $21 f64.mul - set_local $36 + local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - get_local $11 + local.get $11 select - set_local $37 + local.set $37 f64.const -7.028461650952758e-09 - get_local $21 + local.get $21 f64.mul - get_local $22 + local.get $22 f64.const 0.9617966939259756 f64.mul f64.add - get_local $37 + local.get $37 f64.add - set_local $38 - get_local $29 - f64.convert_s/i32 - set_local $24 + local.set $38 + local.get $29 + f64.convert_i32_s + local.set $24 f64.const 0.5849624872207642 f64.const 0 - get_local $11 + local.get $11 select - set_local $39 - get_local $36 - get_local $38 + local.set $39 + local.get $36 + local.get $38 f64.add - get_local $39 + local.get $39 f64.add - get_local $24 + local.get $24 f64.add - set_local $19 - get_local $19 - i64.reinterpret/f64 + local.set $19 + local.get $19 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $19 - get_local $38 - get_local $19 - get_local $24 + f64.reinterpret_i64 + local.set $19 + local.get $38 + local.get $19 + local.get $24 f64.sub - get_local $39 + local.get $39 f64.sub - get_local $36 + local.get $36 f64.sub f64.sub - set_local $20 + local.set $20 end - get_local $1 - set_local $40 - get_local $40 - i64.reinterpret/f64 + local.get $1 + local.set $40 + local.get $40 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $40 - get_local $1 - get_local $40 + f64.reinterpret_i64 + local.set $40 + local.get $1 + local.get $40 f64.sub - get_local $19 + local.get $19 f64.mul - get_local $1 - get_local $20 + local.get $1 + local.get $20 f64.mul f64.add - set_local $22 - get_local $40 - get_local $19 + local.set $22 + local.get $40 + local.get $19 f64.mul - set_local $21 - get_local $22 - get_local $21 + local.set $21 + local.get $22 + local.get $21 f64.add - set_local $16 - get_local $16 - i64.reinterpret/f64 - set_local $2 - get_local $2 + local.set $16 + local.get $16 + i64.reinterpret_f64 + local.set $2 + local.get $2 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $2 - i32.wrap/i64 - set_local $41 - get_local $28 + i32.wrap_i64 + local.set $28 + local.get $2 + i32.wrap_i64 + local.set $41 + local.get $28 i32.const 1083179008 i32.ge_s if - get_local $28 + local.get $28 i32.const 1083179008 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - get_local $22 + local.get $22 f64.const 8.008566259537294e-17 f64.add - get_local $16 - get_local $21 + local.get $16 + local.get $21 f64.sub f64.gt if - get_local $18 + local.get $18 f64.const 1.e+300 f64.mul f64.const 1.e+300 @@ -1211,34 +1211,34 @@ return end else - get_local $28 + local.get $28 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_s if - get_local $28 + local.get $28 i32.const -1064252416 i32.sub - get_local $41 + local.get $41 i32.or i32.const 0 i32.ne if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul return end - get_local $22 - get_local $16 - get_local $21 + local.get $22 + local.get $16 + local.get $21 f64.sub f64.le if - get_local $18 + local.get $18 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -1247,126 +1247,126 @@ end end end - get_local $28 + local.get $28 i32.const 2147483647 i32.and - set_local $41 - get_local $41 + local.set $41 + local.get $41 i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 i32.const 0 - set_local $29 - get_local $41 + local.set $29 + local.get $41 i32.const 1071644672 i32.gt_s if - get_local $28 + local.get $28 i32.const 1048576 - get_local $11 + local.get $11 i32.const 1 i32.add i32.shr_s i32.add - set_local $29 - get_local $29 + local.set $29 + local.get $29 i32.const 2147483647 i32.and i32.const 20 i32.shr_s i32.const 1023 i32.sub - set_local $11 + local.set $11 f64.const 0 - set_local $24 - get_local $29 + local.set $24 + local.get $29 i32.const 1048575 - get_local $11 + local.get $11 i32.shr_s i32.const -1 i32.xor i32.and - i64.extend_s/i32 + i64.extend_i32_s i64.const 32 i64.shl - f64.reinterpret/i64 - set_local $24 - get_local $29 + f64.reinterpret_i64 + local.set $24 + local.get $29 i32.const 1048575 i32.and i32.const 1048576 i32.or i32.const 20 - get_local $11 + local.get $11 i32.sub i32.shr_s - set_local $29 - get_local $28 + local.set $29 + local.get $28 i32.const 0 i32.lt_s if i32.const 0 - get_local $29 + local.get $29 i32.sub - set_local $29 + local.set $29 end - get_local $21 - get_local $24 + local.get $21 + local.get $24 f64.sub - set_local $21 + local.set $21 end - get_local $22 - get_local $21 + local.get $22 + local.get $21 f64.add - set_local $24 - get_local $24 - i64.reinterpret/f64 + local.set $24 + local.get $24 + i64.reinterpret_f64 i64.const -4294967296 i64.and - f64.reinterpret/i64 - set_local $24 - get_local $24 + f64.reinterpret_i64 + local.set $24 + local.get $24 f64.const 0.6931471824645996 f64.mul - set_local $25 - get_local $22 - get_local $24 - get_local $21 + local.set $25 + local.get $22 + local.get $24 + local.get $21 f64.sub f64.sub f64.const 0.6931471805599453 f64.mul - get_local $24 + local.get $24 f64.const -1.904654299957768e-09 f64.mul f64.add - set_local $26 - get_local $25 - get_local $26 + local.set $26 + local.get $25 + local.get $26 f64.add - set_local $16 - get_local $26 - get_local $16 - get_local $25 + local.set $16 + local.get $26 + local.get $16 + local.get $25 f64.sub f64.sub - set_local $27 - get_local $16 - get_local $16 + local.set $27 + local.get $16 + local.get $16 f64.mul - set_local $24 - get_local $16 - get_local $24 + local.set $24 + local.get $16 + local.get $24 f64.const 0.16666666666666602 - get_local $24 + local.get $24 f64.const -2.7777777777015593e-03 - get_local $24 + local.get $24 f64.const 6.613756321437934e-05 - get_local $24 + local.get $24 f64.const -1.6533902205465252e-06 - get_local $24 + local.get $24 f64.const 4.1381367970572385e-08 f64.mul f64.add @@ -1378,299 +1378,299 @@ f64.add f64.mul f64.sub - set_local $19 - get_local $16 - get_local $19 + local.set $19 + local.get $16 + local.get $19 f64.mul - get_local $19 + local.get $19 f64.const 2 f64.sub f64.div - get_local $27 - get_local $16 - get_local $27 + local.get $27 + local.get $16 + local.get $27 f64.mul f64.add f64.sub - set_local $23 + local.set $23 f64.const 1 - get_local $23 - get_local $16 + local.get $23 + local.get $16 f64.sub f64.sub - set_local $16 - get_local $16 - i64.reinterpret/f64 + local.set $16 + local.get $16 + i64.reinterpret_f64 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $28 - get_local $28 - get_local $29 + i32.wrap_i64 + local.set $28 + local.get $28 + local.get $29 i32.const 20 i32.shl i32.add - set_local $28 - get_local $28 + local.set $28 + local.get $28 i32.const 20 i32.shr_s i32.const 0 i32.le_s if - get_local $16 - get_local $29 + local.get $16 + local.get $29 call $~lib/math/NativeMath.scalbn - set_local $16 + local.set $16 else - get_local $16 - i64.reinterpret/f64 + local.get $16 + i64.reinterpret_f64 i64.const 4294967295 i64.and - get_local $28 - i64.extend_s/i32 + local.get $28 + i64.extend_i32_s i64.const 32 i64.shl i64.or - f64.reinterpret/i64 - set_local $16 + f64.reinterpret_i64 + local.set $16 end - get_local $18 - get_local $16 + local.get $18 + local.get $16 f64.mul ) (func $std/operator-overloading/Tester.pow (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - f64.convert_s/i32 - get_local $1 + f64.convert_i32_s + local.get $1 i32.load - f64.convert_s/i32 + f64.convert_i32_s call $~lib/math/NativeMath.pow - i32.trunc_s/f64 - get_local $0 + i32.trunc_f64_s + local.get $0 i32.load offset=4 - f64.convert_s/i32 - get_local $1 + f64.convert_i32_s + local.get $1 i32.load offset=4 - f64.convert_s/i32 + f64.convert_i32_s call $~lib/math/NativeMath.pow - i32.trunc_s/f64 + i32.trunc_f64_s call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.and (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.and - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.and call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.or (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.or - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.or call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.xor (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.xor - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.xor call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.equals (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.eq else - get_local $2 + local.get $2 end ) (func $std/operator-overloading/Tester.notEquals (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.ne - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.ne else - get_local $2 + local.get $2 end ) (func $std/operator-overloading/Tester.greater (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.gt_s - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.gt_s else - get_local $2 + local.get $2 end ) (func $std/operator-overloading/Tester.greaterEquals (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.ge_s - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.ge_s else - get_local $2 + local.get $2 end ) (func $std/operator-overloading/Tester.less (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.lt_s - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.lt_s else - get_local $2 + local.get $2 end ) (func $std/operator-overloading/Tester.lessEquals (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.le_s - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.le_s else - get_local $2 + local.get $2 end ) (func $std/operator-overloading/Tester.shr (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.shr_s - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.shr_s call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.shu (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.shr_u - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.shr_u call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.shl (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.shl - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.shl call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.pos (; 24 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.neg (; 25 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 i32.const 0 - get_local $0 + local.get $0 i32.load i32.sub i32.const 0 - get_local $0 + local.get $0 i32.load offset=4 i32.sub call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/Tester.not (; 26 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load i32.const -1 i32.xor - get_local $0 + local.get $0 i32.load offset=4 i32.const -1 i32.xor @@ -1678,55 +1678,55 @@ ) (func $std/operator-overloading/Tester.excl (; 27 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.load i32.eqz - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 i32.eqz else - get_local $1 + local.get $1 end ) (func $std/operator-overloading/Tester#inc (; 28 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 1 i32.add i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=4 i32.const 1 i32.add i32.store offset=4 - get_local $0 + local.get $0 ) (func $std/operator-overloading/Tester#dec (; 29 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load i32.const 1 i32.sub i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 ) (func $std/operator-overloading/Tester#postInc (; 30 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load i32.const 1 i32.add - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.add @@ -1734,87 +1734,87 @@ ) (func $std/operator-overloading/Tester#postDec (; 31 ;) (type $ii) (param $0 i32) (result i32) i32.const 0 - get_local $0 + local.get $0 i32.load i32.const 1 i32.sub - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.sub call $std/operator-overloading/Tester#constructor ) (func $std/operator-overloading/TesterInlineStatic#constructor (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=4 - get_local $0 + local.get $0 ) (func $std/operator-overloading/TesterInlineInstance#constructor (; 33 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=4 - get_local $0 + local.get $0 ) (func $start (; 34 ;) (type $v) (local $0 i32) (local $1 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 i32.const 1 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/a1 + global.set $std/operator-overloading/a1 i32.const 0 i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/a2 - get_global $std/operator-overloading/a1 - get_global $std/operator-overloading/a2 + global.set $std/operator-overloading/a2 + global.get $std/operator-overloading/a1 + global.get $std/operator-overloading/a2 call $std/operator-overloading/Tester.add - set_global $std/operator-overloading/a - get_global $std/operator-overloading/a + global.set $std/operator-overloading/a + global.get $std/operator-overloading/a i32.load i32.const 3 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/a + global.get $std/operator-overloading/a i32.load offset=4 i32.const 5 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1829,28 +1829,28 @@ i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/s1 + global.set $std/operator-overloading/s1 i32.const 0 i32.const 2 i32.const -3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/s2 - get_global $std/operator-overloading/s1 - get_global $std/operator-overloading/s2 + global.set $std/operator-overloading/s2 + global.get $std/operator-overloading/s1 + global.get $std/operator-overloading/s2 call $std/operator-overloading/Tester.sub - set_global $std/operator-overloading/s - get_global $std/operator-overloading/s + global.set $std/operator-overloading/s + global.get $std/operator-overloading/s i32.load i32.const 0 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/s + global.get $std/operator-overloading/s i32.load offset=4 i32.const 6 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1865,28 +1865,28 @@ i32.const 2 i32.const 5 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/m1 + global.set $std/operator-overloading/m1 i32.const 0 i32.const 3 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/m2 - get_global $std/operator-overloading/m1 - get_global $std/operator-overloading/m2 + global.set $std/operator-overloading/m2 + global.get $std/operator-overloading/m1 + global.get $std/operator-overloading/m2 call $std/operator-overloading/Tester.mul - set_global $std/operator-overloading/m - get_global $std/operator-overloading/m + global.set $std/operator-overloading/m + global.get $std/operator-overloading/m i32.load i32.const 6 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/m + global.get $std/operator-overloading/m i32.load offset=4 i32.const 10 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1901,28 +1901,28 @@ i32.const 6 i32.const 50 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/d1 + global.set $std/operator-overloading/d1 i32.const 0 i32.const 3 i32.const 10 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/d2 - get_global $std/operator-overloading/d1 - get_global $std/operator-overloading/d2 + global.set $std/operator-overloading/d2 + global.get $std/operator-overloading/d1 + global.get $std/operator-overloading/d2 call $std/operator-overloading/Tester.div - set_global $std/operator-overloading/d - get_global $std/operator-overloading/d + global.set $std/operator-overloading/d + global.get $std/operator-overloading/d i32.load i32.const 2 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/d + global.get $std/operator-overloading/d i32.load offset=4 i32.const 5 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1937,28 +1937,28 @@ i32.const 10 i32.const 10 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/f1 + global.set $std/operator-overloading/f1 i32.const 0 i32.const 6 i32.const 10 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/f2 - get_global $std/operator-overloading/f1 - get_global $std/operator-overloading/f2 + global.set $std/operator-overloading/f2 + global.get $std/operator-overloading/f1 + global.get $std/operator-overloading/f2 call $std/operator-overloading/Tester.mod - set_global $std/operator-overloading/f - get_global $std/operator-overloading/f + global.set $std/operator-overloading/f + global.get $std/operator-overloading/f i32.load i32.const 4 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/f + global.get $std/operator-overloading/f i32.load offset=4 i32.const 0 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -1973,28 +1973,28 @@ i32.const 2 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/p1 + global.set $std/operator-overloading/p1 i32.const 0 i32.const 4 i32.const 5 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/p2 - get_global $std/operator-overloading/p1 - get_global $std/operator-overloading/p2 + global.set $std/operator-overloading/p2 + global.get $std/operator-overloading/p1 + global.get $std/operator-overloading/p2 call $std/operator-overloading/Tester.pow - set_global $std/operator-overloading/p - get_global $std/operator-overloading/p + global.set $std/operator-overloading/p + global.get $std/operator-overloading/p i32.load i32.const 16 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/p + global.get $std/operator-overloading/p i32.load offset=4 i32.const 243 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2009,28 +2009,28 @@ i32.const 255 i32.const 15 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/n1 + global.set $std/operator-overloading/n1 i32.const 0 i32.const 15 i32.const 255 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/n2 - get_global $std/operator-overloading/n1 - get_global $std/operator-overloading/n2 + global.set $std/operator-overloading/n2 + global.get $std/operator-overloading/n1 + global.get $std/operator-overloading/n2 call $std/operator-overloading/Tester.and - set_global $std/operator-overloading/n - get_global $std/operator-overloading/n + global.set $std/operator-overloading/n + global.get $std/operator-overloading/n i32.load i32.const 15 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/n + global.get $std/operator-overloading/n i32.load offset=4 i32.const 15 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2045,28 +2045,28 @@ i32.const 3855 i32.const 255 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/o1 + global.set $std/operator-overloading/o1 i32.const 0 i32.const 61680 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/o2 - get_global $std/operator-overloading/o1 - get_global $std/operator-overloading/o2 + global.set $std/operator-overloading/o2 + global.get $std/operator-overloading/o1 + global.get $std/operator-overloading/o2 call $std/operator-overloading/Tester.or - set_global $std/operator-overloading/o - get_global $std/operator-overloading/o + global.set $std/operator-overloading/o + global.get $std/operator-overloading/o i32.load i32.const 65535 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/o + global.get $std/operator-overloading/o i32.load offset=4 i32.const 255 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2081,28 +2081,28 @@ i32.const 255 i32.const 255 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/x1 + global.set $std/operator-overloading/x1 i32.const 0 i32.const 65280 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/x2 - get_global $std/operator-overloading/x1 - get_global $std/operator-overloading/x2 + global.set $std/operator-overloading/x2 + global.get $std/operator-overloading/x1 + global.get $std/operator-overloading/x2 call $std/operator-overloading/Tester.xor - set_global $std/operator-overloading/x - get_global $std/operator-overloading/x + global.set $std/operator-overloading/x + global.get $std/operator-overloading/x i32.load i32.const 65535 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/x + global.get $std/operator-overloading/x i32.load offset=4 i32.const 255 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2117,17 +2117,17 @@ i32.const 1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq1 + global.set $std/operator-overloading/eq1 i32.const 0 i32.const 1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq2 - get_global $std/operator-overloading/eq1 - get_global $std/operator-overloading/eq2 + global.set $std/operator-overloading/eq2 + global.get $std/operator-overloading/eq1 + global.get $std/operator-overloading/eq2 call $std/operator-overloading/Tester.equals - set_global $std/operator-overloading/eq - get_global $std/operator-overloading/eq + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq i32.const 1 i32.eq i32.eqz @@ -2143,17 +2143,17 @@ i32.const 1 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq3 + global.set $std/operator-overloading/eq3 i32.const 0 i32.const 0 i32.const 1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/eq4 - get_global $std/operator-overloading/eq3 - get_global $std/operator-overloading/eq4 + global.set $std/operator-overloading/eq4 + global.get $std/operator-overloading/eq3 + global.get $std/operator-overloading/eq4 call $std/operator-overloading/Tester.equals - set_global $std/operator-overloading/eqf - get_global $std/operator-overloading/eqf + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf i32.const 0 i32.eq i32.eqz @@ -2165,11 +2165,11 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/eq1 - get_global $std/operator-overloading/eq2 + global.get $std/operator-overloading/eq1 + global.get $std/operator-overloading/eq2 call $std/operator-overloading/Tester.notEquals - set_global $std/operator-overloading/eq - get_global $std/operator-overloading/eq + global.set $std/operator-overloading/eq + global.get $std/operator-overloading/eq i32.const 0 i32.eq i32.eqz @@ -2181,11 +2181,11 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/eq3 - get_global $std/operator-overloading/eq4 + global.get $std/operator-overloading/eq3 + global.get $std/operator-overloading/eq4 call $std/operator-overloading/Tester.notEquals - set_global $std/operator-overloading/eqf - get_global $std/operator-overloading/eqf + global.set $std/operator-overloading/eqf + global.get $std/operator-overloading/eqf i32.const 1 i32.eq i32.eqz @@ -2199,19 +2199,19 @@ end i32.const 0 i32.const 2 - get_global $~lib/builtins/i32.MAX_VALUE + global.get $~lib/builtins/i32.MAX_VALUE call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gt1 + global.set $std/operator-overloading/gt1 i32.const 0 i32.const 1 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gt2 - get_global $std/operator-overloading/gt1 - get_global $std/operator-overloading/gt2 + global.set $std/operator-overloading/gt2 + global.get $std/operator-overloading/gt1 + global.get $std/operator-overloading/gt2 call $std/operator-overloading/Tester.greater - set_global $std/operator-overloading/gt - get_global $std/operator-overloading/gt + global.set $std/operator-overloading/gt + global.get $std/operator-overloading/gt i32.const 1 i32.eq i32.eqz @@ -2227,17 +2227,17 @@ i32.const 2 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gte1 + global.set $std/operator-overloading/gte1 i32.const 0 i32.const 2 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/gte2 - get_global $std/operator-overloading/gte1 - get_global $std/operator-overloading/gte2 + global.set $std/operator-overloading/gte2 + global.get $std/operator-overloading/gte1 + global.get $std/operator-overloading/gte2 call $std/operator-overloading/Tester.greaterEquals - set_global $std/operator-overloading/gte - get_global $std/operator-overloading/gte + global.set $std/operator-overloading/gte + global.get $std/operator-overloading/gte i32.const 1 i32.eq i32.eqz @@ -2253,17 +2253,17 @@ i32.const 5 i32.const -1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/le1 + global.set $std/operator-overloading/le1 i32.const 0 i32.const 6 i32.const 6 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/le2 - get_global $std/operator-overloading/le1 - get_global $std/operator-overloading/le2 + global.set $std/operator-overloading/le2 + global.get $std/operator-overloading/le1 + global.get $std/operator-overloading/le2 call $std/operator-overloading/Tester.less - set_global $std/operator-overloading/le - get_global $std/operator-overloading/le + global.set $std/operator-overloading/le + global.get $std/operator-overloading/le i32.const 1 i32.eq i32.eqz @@ -2279,17 +2279,17 @@ i32.const 4 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/leq1 + global.set $std/operator-overloading/leq1 i32.const 0 i32.const 4 i32.const 3 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/leq2 - get_global $std/operator-overloading/leq1 - get_global $std/operator-overloading/leq2 + global.set $std/operator-overloading/leq2 + global.get $std/operator-overloading/leq1 + global.get $std/operator-overloading/leq2 call $std/operator-overloading/Tester.lessEquals - set_global $std/operator-overloading/leq - get_global $std/operator-overloading/leq + global.set $std/operator-overloading/leq + global.get $std/operator-overloading/leq i32.const 1 i32.eq i32.eqz @@ -2305,23 +2305,23 @@ i32.const 8 i32.const 16 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/shr - get_global $std/operator-overloading/shr + global.set $std/operator-overloading/shr + global.get $std/operator-overloading/shr i32.const 3 call $std/operator-overloading/Tester.shr - set_global $std/operator-overloading/sres - get_global $std/operator-overloading/sres + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2336,23 +2336,23 @@ i32.const -8 i32.const -16 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/shu - get_global $std/operator-overloading/shu + global.set $std/operator-overloading/shu + global.get $std/operator-overloading/shu i32.const 3 call $std/operator-overloading/Tester.shu - set_global $std/operator-overloading/ures - get_global $std/operator-overloading/ures + global.set $std/operator-overloading/ures + global.get $std/operator-overloading/ures i32.load i32.const 536870911 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/ures + global.get $std/operator-overloading/ures i32.load offset=4 i32.const 536870910 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2367,23 +2367,23 @@ i32.const 1 i32.const 2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/shl - get_global $std/operator-overloading/shl + global.set $std/operator-overloading/shl + global.get $std/operator-overloading/shl i32.const 3 call $std/operator-overloading/Tester.shl - set_global $std/operator-overloading/sres - get_global $std/operator-overloading/sres + global.set $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load i32.const 8 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/sres + global.get $std/operator-overloading/sres i32.load offset=4 i32.const 16 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2398,24 +2398,24 @@ i32.const 1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/pos - get_global $std/operator-overloading/pos + global.set $std/operator-overloading/pos + global.get $std/operator-overloading/pos call $std/operator-overloading/Tester.pos - set_global $std/operator-overloading/pres - get_global $std/operator-overloading/pres + global.set $std/operator-overloading/pres + global.get $std/operator-overloading/pres i32.load - get_global $std/operator-overloading/pos + global.get $std/operator-overloading/pos i32.load i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/pres + global.get $std/operator-overloading/pres i32.load offset=4 - get_global $std/operator-overloading/pos + global.get $std/operator-overloading/pos i32.load offset=4 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2430,28 +2430,28 @@ i32.const -1 i32.const -2 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/neg - get_global $std/operator-overloading/neg + global.set $std/operator-overloading/neg + global.get $std/operator-overloading/neg call $std/operator-overloading/Tester.neg - set_global $std/operator-overloading/nres - get_global $std/operator-overloading/nres + global.set $std/operator-overloading/nres + global.get $std/operator-overloading/nres i32.load i32.const 0 - get_global $std/operator-overloading/neg + global.get $std/operator-overloading/neg i32.load i32.sub i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/nres + global.get $std/operator-overloading/nres i32.load offset=4 i32.const 0 - get_global $std/operator-overloading/neg + global.get $std/operator-overloading/neg i32.load offset=4 i32.sub i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2466,28 +2466,28 @@ i32.const 255 i32.const 16 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/not - get_global $std/operator-overloading/not + global.set $std/operator-overloading/not + global.get $std/operator-overloading/not call $std/operator-overloading/Tester.not - set_global $std/operator-overloading/res - get_global $std/operator-overloading/res + global.set $std/operator-overloading/res + global.get $std/operator-overloading/res i32.load - get_global $std/operator-overloading/not + global.get $std/operator-overloading/not i32.load i32.const -1 i32.xor i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/res + global.get $std/operator-overloading/res i32.load offset=4 - get_global $std/operator-overloading/not + global.get $std/operator-overloading/not i32.load offset=4 i32.const -1 i32.xor i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2502,21 +2502,21 @@ i32.const 0 i32.const 0 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/excl - get_global $std/operator-overloading/excl + global.set $std/operator-overloading/excl + global.get $std/operator-overloading/excl call $std/operator-overloading/Tester.excl - set_global $std/operator-overloading/bres - get_global $std/operator-overloading/bres - get_global $std/operator-overloading/excl + global.set $std/operator-overloading/bres + global.get $std/operator-overloading/bres + global.get $std/operator-overloading/excl i32.load i32.eqz - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/excl + global.get $std/operator-overloading/excl i32.load offset=4 i32.eqz else - get_local $0 + local.get $0 end i32.eq i32.eqz @@ -2528,7 +2528,7 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/bres + global.get $std/operator-overloading/bres i32.const 1 i32.eq i32.eqz @@ -2544,22 +2544,22 @@ i32.const 0 i32.const 1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/incdec - get_global $std/operator-overloading/incdec + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec call $std/operator-overloading/Tester#inc - set_global $std/operator-overloading/incdec - get_global $std/operator-overloading/incdec + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2570,21 +2570,21 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec call $std/operator-overloading/Tester#dec - set_global $std/operator-overloading/incdec - get_global $std/operator-overloading/incdec + global.set $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.const 0 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2599,27 +2599,27 @@ i32.const 0 i32.const 1 call $std/operator-overloading/Tester#constructor - set_global $std/operator-overloading/incdec + global.set $std/operator-overloading/incdec block (result i32) - get_global $std/operator-overloading/incdec - tee_local $0 + global.get $std/operator-overloading/incdec + local.tee $0 call $std/operator-overloading/Tester#postInc - set_global $std/operator-overloading/incdec - get_local $0 + global.set $std/operator-overloading/incdec + local.get $0 end - set_global $std/operator-overloading/tmp - get_global $std/operator-overloading/tmp + global.set $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load i32.const 0 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 1 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2630,18 +2630,18 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2653,25 +2653,25 @@ unreachable end block (result i32) - get_global $std/operator-overloading/incdec - tee_local $0 + global.get $std/operator-overloading/incdec + local.tee $0 call $std/operator-overloading/Tester#postDec - set_global $std/operator-overloading/incdec - get_local $0 + global.set $std/operator-overloading/incdec + local.get $0 end - set_global $std/operator-overloading/tmp - get_global $std/operator-overloading/tmp + global.set $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/tmp + global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 2 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2682,18 +2682,18 @@ call $~lib/env/abort unreachable end - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load i32.const 0 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/incdec + global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -2708,58 +2708,58 @@ i32.const 1 i32.const 2 call $std/operator-overloading/TesterInlineStatic#constructor - set_global $std/operator-overloading/ais1 + global.set $std/operator-overloading/ais1 block $std/operator-overloading/TesterInlineStatic.postInc|inlined.0 (result i32) - get_global $std/operator-overloading/ais1 - set_local $0 + global.get $std/operator-overloading/ais1 + local.set $0 i32.const 0 - get_local $0 + local.get $0 i32.load i32.const 1 i32.add - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.add call $std/operator-overloading/TesterInlineStatic#constructor end - set_global $std/operator-overloading/ais1 + global.set $std/operator-overloading/ais1 i32.const 0 i32.const 2 i32.const 3 call $std/operator-overloading/TesterInlineStatic#constructor - set_global $std/operator-overloading/ais2 + global.set $std/operator-overloading/ais2 block $std/operator-overloading/TesterInlineStatic.add|inlined.0 (result i32) - get_global $std/operator-overloading/ais1 - set_local $0 - get_global $std/operator-overloading/ais2 - set_local $1 + global.get $std/operator-overloading/ais1 + local.set $0 + global.get $std/operator-overloading/ais2 + local.set $1 i32.const 0 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.load i32.add - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.load offset=4 i32.add call $std/operator-overloading/TesterInlineStatic#constructor end - set_global $std/operator-overloading/ais - get_global $std/operator-overloading/ais + global.set $std/operator-overloading/ais + global.get $std/operator-overloading/ais i32.load i32.const 4 i32.eq - tee_local $1 + local.tee $1 if (result i32) - get_global $std/operator-overloading/ais + global.get $std/operator-overloading/ais i32.load offset=4 i32.const 6 i32.eq else - get_local $1 + local.get $1 end i32.eqz if @@ -2774,58 +2774,58 @@ i32.const 1 i32.const 2 call $std/operator-overloading/TesterInlineInstance#constructor - set_global $std/operator-overloading/aii1 + global.set $std/operator-overloading/aii1 block $std/operator-overloading/TesterInlineInstance#postInc|inlined.0 (result i32) - get_global $std/operator-overloading/aii1 - set_local $1 + global.get $std/operator-overloading/aii1 + local.set $1 i32.const 0 - get_local $1 + local.get $1 i32.load i32.const 1 i32.add - get_local $1 + local.get $1 i32.load offset=4 i32.const 1 i32.add call $std/operator-overloading/TesterInlineInstance#constructor end - set_global $std/operator-overloading/aii1 + global.set $std/operator-overloading/aii1 i32.const 0 i32.const 2 i32.const 3 call $std/operator-overloading/TesterInlineInstance#constructor - set_global $std/operator-overloading/aii2 + global.set $std/operator-overloading/aii2 block $std/operator-overloading/TesterInlineInstance#add|inlined.0 (result i32) - get_global $std/operator-overloading/aii1 - set_local $1 - get_global $std/operator-overloading/aii2 - set_local $0 + global.get $std/operator-overloading/aii1 + local.set $1 + global.get $std/operator-overloading/aii2 + local.set $0 i32.const 0 - get_local $1 + local.get $1 i32.load - get_local $0 + local.get $0 i32.load i32.add - get_local $1 + local.get $1 i32.load offset=4 - get_local $0 + local.get $0 i32.load offset=4 i32.add call $std/operator-overloading/TesterInlineInstance#constructor end - set_global $std/operator-overloading/aii - get_global $std/operator-overloading/aii + global.set $std/operator-overloading/aii + global.get $std/operator-overloading/aii i32.load i32.const 4 i32.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/operator-overloading/aii + global.get $std/operator-overloading/aii i32.load offset=4 i32.const 6 i32.eq else - get_local $0 + local.get $0 end i32.eqz if diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index 66aca7b2..88f99829 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -7,7 +7,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/pointer/one (mut i32) (i32.const 0)) (global $std/pointer/two (mut i32) (i32.const 0)) @@ -20,43 +20,43 @@ (start $start) (func $~lib/internal/memory/memset (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 8 i32.add - tee_local $1 + local.tee $1 i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 4 i32.sub i32.const 0 @@ -67,894 +67,894 @@ (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -964,156 +964,156 @@ (local $3 i32) (local $4 i32) i32.const 8 - set_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 + local.get $1 i32.const 8 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 8 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1121,18 +1121,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1141,16 +1141,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1163,10 +1163,10 @@ (local $0 i32) (local $1 i32) i32.const 8 - set_global $std/pointer/one + global.set $std/pointer/one i32.const 24 - set_global $std/pointer/two - get_global $std/pointer/one + global.set $std/pointer/two + global.get $std/pointer/one i32.const 8 i32.ne if @@ -1177,7 +1177,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/two + global.get $std/pointer/two i32.const 24 i32.ne if @@ -1188,14 +1188,14 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one - tee_local $0 + global.get $std/pointer/one + local.tee $0 i32.const 1 i32.store - get_local $0 + local.get $0 i32.const 2 i32.store offset=4 - get_local $0 + local.get $0 i32.load i32.const 1 i32.ne @@ -1207,7 +1207,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one + global.get $std/pointer/one i32.load offset=4 i32.const 2 i32.ne @@ -1219,11 +1219,11 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one - get_global $std/pointer/two + global.get $std/pointer/one + global.get $std/pointer/two i32.add - set_global $std/pointer/add - get_global $std/pointer/add + global.set $std/pointer/add + global.get $std/pointer/add i32.const 32 i32.ne if @@ -1234,11 +1234,11 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/two - get_global $std/pointer/one + global.get $std/pointer/two + global.get $std/pointer/one i32.sub - set_global $std/pointer/sub - get_global $std/pointer/sub + global.set $std/pointer/sub + global.get $std/pointer/sub i32.const 16 i32.ne if @@ -1249,7 +1249,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one + global.get $std/pointer/one i32.const 8 i32.ne if @@ -1260,15 +1260,15 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one + global.get $std/pointer/one i32.const 8 i32.add - set_global $std/pointer/one - get_global $std/pointer/one - tee_local $0 - set_global $std/pointer/nextOne - get_global $std/pointer/nextOne - get_local $0 + 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 i32.ne if i32.const 0 @@ -1278,7 +1278,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one + global.get $std/pointer/one i32.const 16 i32.ne if @@ -1289,7 +1289,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/two + global.get $std/pointer/two i32.const 24 i32.ne if @@ -1300,15 +1300,15 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/two + global.get $std/pointer/two i32.const 8 i32.sub - set_global $std/pointer/two - get_global $std/pointer/two + global.set $std/pointer/two + global.get $std/pointer/two i32.const 8 i32.sub - set_global $std/pointer/two - get_global $std/pointer/two + global.set $std/pointer/two + global.get $std/pointer/two i32.const 8 i32.ne if @@ -1319,7 +1319,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/two + global.get $std/pointer/two i32.load i32.const 1 i32.ne @@ -1331,7 +1331,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/two + global.get $std/pointer/two i32.load offset=4 i32.const 2 i32.ne @@ -1343,20 +1343,20 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one - set_local $0 - get_global $std/pointer/two - tee_local $1 + global.get $std/pointer/one + local.set $0 + global.get $std/pointer/two + local.tee $1 if - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/memory/memmove else - get_local $0 + local.get $0 call $~lib/internal/memory/memset end - get_global $std/pointer/one - get_global $std/pointer/two + global.get $std/pointer/one + global.get $std/pointer/two i32.eq if i32.const 0 @@ -1366,7 +1366,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one + global.get $std/pointer/one i32.load i32.const 1 i32.ne @@ -1378,7 +1378,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one + global.get $std/pointer/one i32.load offset=4 i32.const 2 i32.ne @@ -1391,16 +1391,16 @@ unreachable end i32.const 0 - set_global $std/pointer/buf - get_global $std/pointer/buf + global.set $std/pointer/buf + global.get $std/pointer/buf f32.const 1.100000023841858 f32.store - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 4 i32.add f32.const 1.2000000476837158 f32.store - get_global $std/pointer/buf + global.get $std/pointer/buf f32.load f32.const 1.100000023841858 f32.ne @@ -1412,7 +1412,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 4 i32.add f32.load @@ -1426,7 +1426,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf + global.get $std/pointer/buf f32.load f32.const 1.100000023841858 f32.ne @@ -1438,7 +1438,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 4 i32.add f32.load @@ -1476,13 +1476,13 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf - tee_local $0 + global.get $std/pointer/buf + local.tee $0 i32.const 8 i32.add f32.const 1.2999999523162842 f32.store - get_local $0 + local.get $0 i32.const 8 i32.add f32.load @@ -1496,7 +1496,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 8 i32.add f32.load @@ -1522,10 +1522,10 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf + global.get $std/pointer/buf f32.const 1.399999976158142 f32.store - get_global $std/pointer/buf + global.get $std/pointer/buf f32.load f32.const 1.399999976158142 f32.ne diff --git a/tests/compiler/std/pointer.untouched.wat b/tests/compiler/std/pointer.untouched.wat index ca8a55a8..8709c112 100644 --- a/tests/compiler/std/pointer.untouched.wat +++ b/tests/compiler/std/pointer.untouched.wat @@ -10,7 +10,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/pointer/one (mut i32) (i32.const 0)) (global $std/pointer/two (mut i32) (i32.const 0)) @@ -23,256 +23,256 @@ (export "table" (table $0)) (start $start) (func $std/pointer/Pointer#constructor (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -285,44 +285,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -330,141 +330,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -472,167 +472,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -644,130 +644,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -779,112 +779,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -896,585 +896,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -1482,77 +1482,77 @@ ) (func $~lib/internal/memory/memmove (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -1563,27 +1563,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -1592,67 +1592,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1663,20 +1663,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1688,16 +1688,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1710,50 +1710,50 @@ (func $std/pointer/Pointer#set:value (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 0 - set_local $2 + local.set $2 i32.const 8 - set_local $3 - get_local $0 - get_local $2 - get_local $3 + local.set $3 + local.get $0 + local.get $2 + local.get $3 call $~lib/internal/memory/memset else i32.const 8 - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/internal/memory/memmove end ) (func $std/pointer/Pointer#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 + local.get $1 ) (func $std/pointer/Pointer#set (; 7 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 4 i32.mul i32.add - get_local $2 + local.get $2 f32.store ) (func $std/pointer/Pointer#get (; 8 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 4 i32.mul i32.add f32.load ) (func $std/pointer/Pointer#set:value (; 9 ;) (type $ifv) (param $0 i32) (param $1 f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.store ) (func $start (; 10 ;) (type $v) @@ -1762,24 +1762,24 @@ (local $2 f32) block $std/pointer/Pointer#constructor|inlined.0 (result i32) i32.const 0 - set_local $0 + local.set $0 i32.const 8 - set_local $1 - get_local $1 + local.set $1 + local.get $1 end - set_global $std/pointer/one + global.set $std/pointer/one block $std/pointer/Pointer#constructor|inlined.1 (result i32) i32.const 0 - set_local $1 + local.set $1 i32.const 24 - set_local $0 - get_local $0 + local.set $0 + local.get $0 end - set_global $std/pointer/two + global.set $std/pointer/two block $std/pointer/Pointer#get:offset|inlined.0 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 end i32.const 8 i32.eq @@ -1793,9 +1793,9 @@ unreachable end block $std/pointer/Pointer#get:offset|inlined.1 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 end i32.const 24 i32.eq @@ -1809,25 +1809,25 @@ unreachable end block $std/pointer/Pointer#get:value|inlined.0 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.0 end i32.const 1 i32.store block $std/pointer/Pointer#get:value|inlined.1 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.1 end i32.const 2 i32.store offset=4 block $std/pointer/Pointer#get:value|inlined.2 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.2 end i32.load @@ -1843,9 +1843,9 @@ unreachable end block $std/pointer/Pointer#get:value|inlined.3 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.3 end i32.load offset=4 @@ -1861,19 +1861,19 @@ unreachable end block $std/pointer/Pointer#add|inlined.0 (result i32) - get_global $std/pointer/one - set_local $0 - get_global $std/pointer/two - set_local $1 - get_local $0 - get_local $1 + 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 - set_global $std/pointer/add + global.set $std/pointer/add block $std/pointer/Pointer#get:offset|inlined.2 (result i32) - get_global $std/pointer/add - set_local $1 - get_local $1 + global.get $std/pointer/add + local.set $1 + local.get $1 end i32.const 32 i32.eq @@ -1887,19 +1887,19 @@ unreachable end block $std/pointer/Pointer#sub|inlined.0 (result i32) - get_global $std/pointer/two - set_local $1 - get_global $std/pointer/one - set_local $0 - get_local $1 - get_local $0 + 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 - set_global $std/pointer/sub + global.set $std/pointer/sub block $std/pointer/Pointer#get:offset|inlined.3 (result i32) - get_global $std/pointer/sub - set_local $0 - get_local $0 + global.get $std/pointer/sub + local.set $0 + local.get $0 end i32.const 16 i32.eq @@ -1913,9 +1913,9 @@ unreachable end block $std/pointer/Pointer#get:offset|inlined.4 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 end i32.const 8 i32.eq @@ -1930,18 +1930,18 @@ end block (result i32) block $std/pointer/Pointer#inc|inlined.0 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 i32.const 8 i32.add end - set_global $std/pointer/one - get_global $std/pointer/one + global.set $std/pointer/one + global.get $std/pointer/one end - set_global $std/pointer/nextOne - get_global $std/pointer/nextOne - get_global $std/pointer/one + global.set $std/pointer/nextOne + global.get $std/pointer/nextOne + global.get $std/pointer/one i32.eq i32.eqz if @@ -1953,9 +1953,9 @@ unreachable end block $std/pointer/Pointer#get:offset|inlined.5 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 end i32.const 16 i32.eq @@ -1969,9 +1969,9 @@ unreachable end block $std/pointer/Pointer#get:offset|inlined.6 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 end i32.const 24 i32.eq @@ -1985,25 +1985,25 @@ unreachable end block $std/pointer/Pointer#dec|inlined.0 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 i32.const 8 i32.sub end - set_global $std/pointer/two + global.set $std/pointer/two block $std/pointer/Pointer#dec|inlined.1 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 i32.const 8 i32.sub end - set_global $std/pointer/two + global.set $std/pointer/two block $std/pointer/Pointer#get:offset|inlined.7 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 end i32.const 8 i32.eq @@ -2017,9 +2017,9 @@ unreachable end block $std/pointer/Pointer#get:value|inlined.4 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.4 end i32.load @@ -2035,9 +2035,9 @@ unreachable end block $std/pointer/Pointer#get:value|inlined.5 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.5 end i32.load offset=4 @@ -2052,23 +2052,23 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/one + global.get $std/pointer/one block $std/pointer/Pointer#get:value|inlined.6 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 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) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 end block $std/pointer/Pointer#get:offset|inlined.9 (result i32) - get_global $std/pointer/two - set_local $0 - get_local $0 + global.get $std/pointer/two + local.set $0 + local.get $0 end i32.ne i32.eqz @@ -2081,9 +2081,9 @@ unreachable end block $std/pointer/Pointer#get:value|inlined.7 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.7 end i32.load @@ -2099,9 +2099,9 @@ unreachable end block $std/pointer/Pointer#get:value|inlined.8 (result i32) - get_global $std/pointer/one - set_local $0 - get_local $0 + global.get $std/pointer/one + local.set $0 + local.get $0 br $std/pointer/Pointer#get:value|inlined.8 end i32.load offset=4 @@ -2118,21 +2118,21 @@ end block $std/pointer/Pointer#constructor|inlined.0 (result i32) i32.const 0 - set_local $0 + local.set $0 i32.const 0 - set_local $1 - get_local $1 + local.set $1 + local.get $1 end - set_global $std/pointer/buf - get_global $std/pointer/buf + global.set $std/pointer/buf + global.get $std/pointer/buf i32.const 0 f32.const 1.100000023841858 call $std/pointer/Pointer#set - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 1 f32.const 1.2000000476837158 call $std/pointer/Pointer#set - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 0 call $std/pointer/Pointer#get f32.const 1.100000023841858 @@ -2146,7 +2146,7 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 1 call $std/pointer/Pointer#get f32.const 1.2000000476837158 @@ -2161,12 +2161,12 @@ unreachable end block $std/pointer/Pointer#get|inlined.0 (result f32) - get_global $std/pointer/buf - set_local $1 + global.get $std/pointer/buf + local.set $1 i32.const 0 - set_local $0 - get_local $1 - get_local $0 + local.set $0 + local.get $1 + local.get $0 i32.const 4 i32.mul i32.add @@ -2184,12 +2184,12 @@ unreachable end block $std/pointer/Pointer#get|inlined.1 (result f32) - get_global $std/pointer/buf - set_local $0 + global.get $std/pointer/buf + local.set $0 i32.const 1 - set_local $1 - get_local $0 - get_local $1 + local.set $1 + local.get $0 + local.get $1 i32.const 4 i32.mul i32.add @@ -2233,21 +2233,21 @@ unreachable end block - get_global $std/pointer/buf - set_local $1 + global.get $std/pointer/buf + local.set $1 i32.const 2 - set_local $0 + local.set $0 f32.const 1.2999999523162842 - set_local $2 - get_local $1 - get_local $0 + local.set $2 + local.get $1 + local.get $0 i32.const 4 i32.mul i32.add - get_local $2 + local.get $2 f32.store end - get_global $std/pointer/buf + global.get $std/pointer/buf i32.const 2 call $std/pointer/Pointer#get f32.const 1.2999999523162842 @@ -2262,12 +2262,12 @@ unreachable end block $std/pointer/Pointer#get|inlined.2 (result f32) - get_global $std/pointer/buf - set_local $0 + global.get $std/pointer/buf + local.set $0 i32.const 2 - set_local $1 - get_local $0 - get_local $1 + local.set $1 + local.get $0 + local.get $1 i32.const 4 i32.mul i32.add @@ -2297,13 +2297,13 @@ call $~lib/env/abort unreachable end - get_global $std/pointer/buf + global.get $std/pointer/buf f32.const 1.399999976158142 call $std/pointer/Pointer#set:value block $std/pointer/Pointer#get:value|inlined.0 (result f32) - get_global $std/pointer/buf - set_local $1 - get_local $1 + global.get $std/pointer/buf + local.set $1 + local.get $1 f32.load br $std/pointer/Pointer#get:value|inlined.0 end diff --git a/tests/compiler/std/polyfills.optimized.wat b/tests/compiler/std/polyfills.optimized.wat index e21dfcae..aed9b48e 100644 --- a/tests/compiler/std/polyfills.optimized.wat +++ b/tests/compiler/std/polyfills.optimized.wat @@ -2,7 +2,7 @@ (type $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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/std/polyfills.untouched.wat b/tests/compiler/std/polyfills.untouched.wat index 9c4fa2ac..2355a176 100644 --- a/tests/compiler/std/polyfills.untouched.wat +++ b/tests/compiler/std/polyfills.untouched.wat @@ -6,25 +6,25 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 44)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) (func $~lib/polyfills/bswap (; 1 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 return ) (func $~lib/polyfills/bswap (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 return ) (func $~lib/polyfills/bswap (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 8 i32.shl - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 8 @@ -35,10 +35,10 @@ return ) (func $~lib/polyfills/bswap (; 4 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 8 i32.shl - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -51,12 +51,12 @@ return ) (func $~lib/polyfills/bswap (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 @@ -65,12 +65,12 @@ return ) (func $~lib/polyfills/bswap (; 6 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 @@ -82,36 +82,36 @@ (local $1 i64) (local $2 i64) (local $3 i64) - get_local $0 + local.get $0 i64.const 8 i64.shr_u i64.const 71777214294589695 i64.and - set_local $1 - get_local $0 + local.set $1 + local.get $0 i64.const 71777214294589695 i64.and i64.const 8 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 16 i64.shr_u i64.const 281470681808895 i64.and - set_local $1 - get_local $3 + local.set $1 + local.get $3 i64.const 281470681808895 i64.and i64.const 16 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or i64.const 32 i64.rotr @@ -121,48 +121,48 @@ (local $1 i64) (local $2 i64) (local $3 i64) - get_local $0 + local.get $0 i64.const 8 i64.shr_u i64.const 71777214294589695 i64.and - set_local $1 - get_local $0 + local.set $1 + local.get $0 i64.const 71777214294589695 i64.and i64.const 8 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 16 i64.shr_u i64.const 281470681808895 i64.and - set_local $1 - get_local $3 + local.set $1 + local.get $3 i64.const 281470681808895 i64.and i64.const 16 i64.shl - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i64.or i64.const 32 i64.rotr return ) (func $~lib/polyfills/bswap (; 9 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 @@ -171,12 +171,12 @@ return ) (func $~lib/polyfills/bswap (; 10 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const -16711936 i32.and i32.const 8 i32.rotl - get_local $0 + local.get $0 i32.const 16711935 i32.and i32.const 8 @@ -338,8 +338,8 @@ end block $~lib/polyfills/bswap16|inlined.0 (result i32) i32.const 170 - set_local $0 - get_local $0 + local.set $0 + local.get $0 br $~lib/polyfills/bswap16|inlined.0 end i32.const 255 @@ -357,8 +357,8 @@ end block $~lib/polyfills/bswap16|inlined.0 (result i32) i32.const 170 - set_local $0 - get_local $0 + local.set $0 + local.get $0 br $~lib/polyfills/bswap16|inlined.0 end i32.const 24 @@ -382,11 +382,11 @@ end block $~lib/polyfills/bswap16|inlined.0 (result i32) i32.const 43707 - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 8 i32.shl - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.const 255 @@ -409,11 +409,11 @@ end block $~lib/polyfills/bswap16|inlined.0 (result i32) i32.const 43707 - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 8 i32.shl - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -446,19 +446,19 @@ end block $~lib/polyfills/bswap16|inlined.0 (result i32) i32.const -7820613 - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 8 i32.shl i32.const 65280 i32.and - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.const 255 i32.and i32.or - get_local $0 + local.get $0 i32.const -65536 i32.and i32.or @@ -477,19 +477,19 @@ end block $~lib/polyfills/bswap16|inlined.0 (result i32) i32.const -7820613 - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 8 i32.shl i32.const 65280 i32.and - get_local $0 + local.get $0 i32.const 8 i32.shr_s i32.const 255 i32.and i32.or - get_local $0 + local.get $0 i32.const -65536 i32.and i32.or diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 730cf1ce..a76808e3 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -26,7 +26,7 @@ (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 anyfunc) + (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)) @@ -37,17 +37,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -56,16 +56,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -73,16 +73,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -91,13 +91,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -110,240 +110,240 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + 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) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -354,41 +354,41 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.eqz if - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $0 + local.get $0 call $~lib/internal/memory/memset end - get_local $2 + local.get $2 ) (func $~lib/set/Set#clear (; 5 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 + local.get $0 i32.const 3 i32.store offset=4 - get_local $0 + local.get $0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 + local.get $0 i32.const 4 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) @@ -396,77 +396,77 @@ (local $0 i32) i32.const 24 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/set/Set#find (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load8_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=4 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/set/Set#has (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -487,101 +487,101 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 3 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_s i32.store8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_s i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=4 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 8 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 8 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -589,7 +589,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -598,35 +598,35 @@ i32.xor i32.const 16777619 i32.mul - tee_local $2 - set_local $4 - get_local $0 - get_local $1 - get_local $2 + local.tee $2 + local.set $4 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -635,55 +635,55 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 3 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.store8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -693,57 +693,57 @@ i32.const 16777619 i32.mul call $~lib/set/Set#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=4 i32.const 1 i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/set/Set#rehash end i32.const 1 @@ -752,14 +752,14 @@ (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -769,17 +769,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -792,7 +792,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -805,14 +805,14 @@ unreachable end i32.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -823,17 +823,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -846,7 +846,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -859,14 +859,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -877,12 +877,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -892,16 +892,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -914,14 +914,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -931,11 +931,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -946,12 +946,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -961,16 +961,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -982,9 +982,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -996,9 +996,9 @@ end ) (func $~lib/set/Set#has (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 255 i32.and i32.const -2128831035 @@ -1017,101 +1017,101 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 3 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_u i32.store8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load8_u i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=4 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 8 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 8 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -1119,42 +1119,42 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - tee_local $2 - set_local $4 - get_local $0 - get_local $1 - get_local $2 + local.tee $2 + local.set $4 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1163,55 +1163,55 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 3 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.store8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 255 i32.and i32.const -2128831035 @@ -1219,57 +1219,57 @@ i32.const 16777619 i32.mul call $~lib/set/Set#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=4 i32.const 1 i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/set/Set#rehash end i32.const 1 @@ -1278,14 +1278,14 @@ (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -1295,17 +1295,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -1318,7 +1318,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -1331,14 +1331,14 @@ unreachable end i32.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -1349,17 +1349,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -1372,7 +1372,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -1385,14 +1385,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -1403,12 +1403,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -1418,16 +1418,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -1440,14 +1440,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -1457,11 +1457,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -1472,12 +1472,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -1487,16 +1487,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -1508,9 +1508,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -1522,45 +1522,45 @@ end ) (func $~lib/set/Set#find (; 18 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load16_u - get_local $1 + local.get $1 i32.const 65535 i32.and i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=4 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end @@ -1568,21 +1568,21 @@ ) (func $~lib/set/Set#has (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - tee_local $2 + local.tee $2 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $2 + local.get $2 i32.const 8 i32.shr_u i32.xor @@ -1600,110 +1600,110 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $2 - f64.convert_s/i32 + local.set $5 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $7 + i32.trunc_f64_s + local.tee $7 i32.const 3 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $8 + local.get $2 + local.get $8 i32.ne if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_s i32.store16 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_s - tee_local $4 + local.tee $4 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $4 + local.get $4 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=4 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 8 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 8 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=8 - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -1711,53 +1711,53 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - tee_local $2 + local.tee $2 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $2 + local.get $2 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - tee_local $2 - set_local $4 - get_local $0 - get_local $1 - get_local $2 + local.tee $2 + local.set $4 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1766,124 +1766,124 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 3 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.store16 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - tee_local $1 + local.tee $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul call $~lib/set/Set#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=4 i32.const 1 i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/set/Set#rehash end i32.const 1 @@ -1892,14 +1892,14 @@ (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -1909,17 +1909,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -1932,7 +1932,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -1945,14 +1945,14 @@ unreachable end i32.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -1963,17 +1963,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -1986,7 +1986,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -1999,14 +1999,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -2017,12 +2017,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -2032,16 +2032,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -2054,14 +2054,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -2071,11 +2071,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -2086,12 +2086,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -2101,16 +2101,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -2122,9 +2122,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -2137,19 +2137,19 @@ ) (func $~lib/set/Set#has (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 65535 i32.and - tee_local $2 + local.tee $2 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $2 + local.get $2 i32.const 8 i32.shr_u i32.xor @@ -2167,110 +2167,110 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $2 - f64.convert_s/i32 + local.set $5 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $7 + i32.trunc_f64_s + local.tee $7 i32.const 3 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $8 + local.get $2 + local.get $8 i32.ne if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_u i32.store16 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load16_u - tee_local $4 + local.tee $4 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $4 + local.get $4 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=4 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 8 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 8 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=8 - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -2278,51 +2278,51 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.const 65535 i32.and - tee_local $2 + local.tee $2 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $2 + local.get $2 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul - tee_local $2 - set_local $4 - get_local $0 - get_local $1 - get_local $2 + local.tee $2 + local.set $4 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -2331,122 +2331,122 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 3 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.store16 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 i32.const 65535 i32.and - tee_local $1 + local.tee $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.xor i32.const 16777619 i32.mul call $~lib/set/Set#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=4 i32.const 1 i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $1 + local.get $1 end if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/set/Set#rehash end i32.const 1 @@ -2455,14 +2455,14 @@ (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -2472,17 +2472,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -2495,7 +2495,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -2508,14 +2508,14 @@ unreachable end i32.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -2526,17 +2526,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -2549,7 +2549,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -2562,14 +2562,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -2580,12 +2580,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -2595,16 +2595,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -2617,14 +2617,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -2634,11 +2634,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -2649,12 +2649,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -2664,16 +2664,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -2685,9 +2685,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -2699,14 +2699,14 @@ end ) (func $~lib/internal/hash/hash32 (; 29 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.const 255 @@ -2714,7 +2714,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 16 i32.shr_u i32.const 255 @@ -2722,7 +2722,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 24 i32.shr_u i32.xor @@ -2730,52 +2730,52 @@ i32.mul ) (func $~lib/set/Set#find (; 30 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load - get_local $1 + local.get $1 i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=4 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/set/Set#has (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 call $~lib/set/Set#find i32.const 0 @@ -2789,98 +2789,98 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 3 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load i32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load call $~lib/internal/hash/hash32 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=4 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 8 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 8 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -2888,37 +2888,37 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 - tee_local $2 - set_local $4 - get_local $0 - get_local $1 - get_local $2 + local.tee $2 + local.set $4 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -2927,108 +2927,108 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 3 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 34 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 call $~lib/set/Set#find - tee_local $1 + local.tee $1 i32.eqz if i32.const 0 return end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.load offset=4 i32.const 1 i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $1 + local.tee $1 i32.const 4 - get_local $1 + local.get $1 i32.gt_u select i32.ge_u - tee_local $1 + local.tee $1 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $1 + local.set $1 end - get_local $1 + local.get $1 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/set/Set#rehash end i32.const 1 @@ -3037,14 +3037,14 @@ (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3054,17 +3054,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -3077,7 +3077,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3090,14 +3090,14 @@ unreachable end i32.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -3108,17 +3108,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -3131,7 +3131,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3144,14 +3144,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -3162,12 +3162,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3177,16 +3177,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3199,14 +3199,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3216,11 +3216,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -3231,12 +3231,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3246,16 +3246,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3267,9 +3267,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -3284,14 +3284,14 @@ (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3301,17 +3301,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -3324,7 +3324,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3337,14 +3337,14 @@ unreachable end i32.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i32.const 100 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -3355,17 +3355,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -3378,7 +3378,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3391,14 +3391,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -3409,12 +3409,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3424,16 +3424,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3446,14 +3446,14 @@ unreachable end i32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i32.const 50 i32.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3463,11 +3463,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -3478,12 +3478,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3493,16 +3493,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -3514,9 +3514,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -3528,26 +3528,26 @@ end ) (func $~lib/set/Set#clear (; 37 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 + local.get $0 i32.const 3 i32.store offset=4 - get_local $0 + local.get $0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 + local.get $0 i32.const 4 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) @@ -3555,40 +3555,40 @@ (local $0 i32) i32.const 24 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash64 (; 39 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) - get_local $0 - i32.wrap/i64 - tee_local $1 + local.get $0 + i32.wrap_i64 + local.tee $1 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.const 255 @@ -3596,7 +3596,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 16 i32.shr_u i32.const 255 @@ -3604,23 +3604,23 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 24 i32.shr_u i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i64.const 32 i64.shr_u - i32.wrap/i64 - tee_local $1 + i32.wrap_i64 + local.tee $1 i32.const 255 i32.and i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 8 i32.shr_u i32.const 255 @@ -3628,7 +3628,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 16 i32.shr_u i32.const 255 @@ -3636,7 +3636,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $1 + local.get $1 i32.const 24 i32.shr_u i32.xor @@ -3644,52 +3644,52 @@ i32.mul ) (func $~lib/set/Set#find (; 40 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i64.load - get_local $1 + local.get $1 i64.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/set/Set#has (; 41 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash64 call $~lib/set/Set#find i32.const 0 @@ -3703,98 +3703,98 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 4 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i64.load i64.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i64.load call $~lib/internal/hash/hash64 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 16 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 16 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -3802,37 +3802,37 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 - tee_local $2 - set_local $4 - get_local $0 - get_local $1 - get_local $2 + local.tee $2 + local.set $4 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -3841,109 +3841,109 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 4 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i64.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 44 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash64 call $~lib/set/Set#find - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $2 + local.tee $2 i32.const 4 - get_local $2 + local.get $2 i32.gt_u select i32.ge_u - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -3952,14 +3952,14 @@ (local $0 i64) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i64.const 100 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -3969,17 +3969,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -3992,7 +3992,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4005,14 +4005,14 @@ unreachable end i64.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i64.const 100 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4023,17 +4023,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -4046,7 +4046,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4059,14 +4059,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i64.const 50 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4077,12 +4077,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4092,16 +4092,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4114,14 +4114,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i64.const 50 i64.lt_s if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4131,11 +4131,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4146,12 +4146,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4161,16 +4161,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4182,9 +4182,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -4199,14 +4199,14 @@ (local $0 i64) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 i64.const 100 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4216,17 +4216,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -4239,7 +4239,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4252,14 +4252,14 @@ unreachable end i64.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 i64.const 100 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4270,17 +4270,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -4293,7 +4293,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4306,14 +4306,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 i64.const 50 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4324,12 +4324,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4339,16 +4339,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4361,14 +4361,14 @@ unreachable end i64.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 i64.const 50 i64.lt_u if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4378,11 +4378,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4393,12 +4393,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4408,16 +4408,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 i64.const 1 i64.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4429,9 +4429,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -4443,57 +4443,57 @@ end ) (func $~lib/internal/hash/HASH (; 47 ;) (type $fi) (param $0 f32) (result i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 ) (func $~lib/set/Set#find (; 48 ;) (type $ifii) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 f32.load - get_local $1 + local.get $1 f32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=4 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/set/Set#has (; 49 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -4507,99 +4507,99 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 3 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 f32.load f32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 f32.load - i32.reinterpret/f32 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=4 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 8 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 8 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -4607,35 +4607,35 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH - tee_local $4 + local.tee $4 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -4644,110 +4644,110 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 3 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 f32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 52 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 - get_local $1 - i32.reinterpret/f32 + local.get $0 + local.get $1 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 call $~lib/set/Set#find - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $2 + local.tee $2 i32.const 4 - get_local $2 + local.get $2 i32.gt_u select i32.ge_u - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -4756,14 +4756,14 @@ (local $0 f32) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 f32.const 100 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4773,17 +4773,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -4796,7 +4796,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4809,14 +4809,14 @@ unreachable end f32.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 f32.const 100 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4827,17 +4827,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -4850,7 +4850,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4863,14 +4863,14 @@ unreachable end f32.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 f32.const 50 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4881,12 +4881,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4896,16 +4896,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4918,14 +4918,14 @@ unreachable end f32.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 f32.const 50 f32.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4935,11 +4935,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -4950,12 +4950,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -4965,16 +4965,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f32.const 1 f32.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -4986,9 +4986,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -5000,57 +5000,57 @@ end ) (func $~lib/internal/hash/HASH (; 54 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 ) (func $~lib/set/Set#find (; 55 ;) (type $iFii) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 f64.load - get_local $1 + local.get $1 f64.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end i32.const 0 ) (func $~lib/set/Set#has (; 56 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -5064,99 +5064,99 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 4 i32.shl i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 f64.load f64.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 f64.load - i64.reinterpret/f64 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 16 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 16 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -5164,35 +5164,35 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH - tee_local $4 + local.tee $4 call $~lib/set/Set#find i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -5201,110 +5201,110 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $2 - get_local $0 - get_local $0 + local.set $2 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.store offset=16 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 4 i32.shl i32.add - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 f64.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $4 + local.get $4 i32.and i32.const 2 i32.shl i32.add - tee_local $3 + local.tee $3 i32.load offset=8 i32.store offset=8 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=8 end ) (func $~lib/set/Set#delete (; 59 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 - get_local $1 - i64.reinterpret/f64 + local.get $0 + local.get $1 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 call $~lib/set/Set#find - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - tee_local $3 + local.tee $3 i32.const 1 i32.add i32.const 4 - get_local $0 + local.get $0 i32.load offset=20 - tee_local $2 + local.tee $2 i32.const 4 - get_local $2 + local.get $2 i32.gt_u select i32.ge_u - tee_local $2 + local.tee $2 if - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -5313,14 +5313,14 @@ (local $0 f64) (local $1 i32) call $~lib/set/Set#constructor - set_local $1 + local.set $1 loop $repeat|0 - get_local $0 + local.get $0 f64.const 100 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -5330,17 +5330,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|0 else i32.const 0 @@ -5353,7 +5353,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -5366,14 +5366,14 @@ unreachable end f64.const 50 - set_local $0 + local.set $0 loop $repeat|1 - get_local $0 + local.get $0 f64.const 100 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -5384,17 +5384,17 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|1 else i32.const 0 @@ -5407,7 +5407,7 @@ unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -5420,14 +5420,14 @@ unreachable end f64.const 0 - set_local $0 + local.set $0 loop $repeat|2 - get_local $0 + local.get $0 f64.const 50 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -5438,12 +5438,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -5453,16 +5453,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|2 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -5475,14 +5475,14 @@ unreachable end f64.const 0 - set_local $0 + local.set $0 loop $repeat|3 - get_local $0 + local.get $0 f64.const 50 f64.lt if - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -5492,11 +5492,11 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#add - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has i32.eqz if @@ -5507,12 +5507,12 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#delete drop - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/set/Set#has if i32.const 0 @@ -5522,16 +5522,16 @@ call $~lib/env/abort unreachable else - get_local $0 + local.get $0 f64.const 1 f64.add - set_local $0 + local.set $0 br $repeat|3 end unreachable end end - get_local $1 + local.get $1 i32.load offset=20 i32.const 50 i32.ne @@ -5543,9 +5543,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/set/Set#clear - get_local $1 + local.get $1 i32.load offset=20 if i32.const 0 @@ -5558,9 +5558,9 @@ ) (func $start (; 61 ;) (type $v) i32.const 144 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 75504d3f..5569f7e4 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -24,7 +24,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -52,41 +52,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -96,22 +96,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -120,20 +120,20 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -144,8 +144,8 @@ (func $~lib/internal/arraybuffer/allocateUnsafe (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -157,267 +157,267 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -428,8 +428,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -439,96 +439,96 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 0 i32.ne i32.eqz if - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $1 + local.set $5 + local.get $4 + local.get $5 + local.get $1 call $~lib/internal/memory/memset end - get_local $3 + local.get $3 ) (func $~lib/set/Set#clear (; 7 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash8 (; 9 ;) (type $ii) (param $0 i32) (result i32) - get_global $~lib/internal/hash/FNV_OFFSET - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.get $0 i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul ) (func $~lib/internal/hash/HASH (; 10 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -539,51 +539,51 @@ (func $~lib/set/Set#find (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load8_s - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -592,9 +592,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -612,127 +612,127 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 8 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 8 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load8_s i32.store8 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i32.load8_s - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/set/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=4 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 8 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -741,38 +741,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -781,58 +781,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=4 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 15 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -840,10 +840,10 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -852,60 +852,60 @@ br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -915,19 +915,19 @@ (local $1 i32) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -939,11 +939,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -955,16 +955,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -979,16 +979,16 @@ end block $break|1 i32.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -999,11 +999,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1015,16 +1015,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -1039,16 +1039,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1059,12 +1059,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -1077,16 +1077,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -1101,16 +1101,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -1122,11 +1122,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1137,12 +1137,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -1155,16 +1155,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -1177,9 +1177,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -1194,67 +1194,67 @@ end ) (func $~lib/set/Set#clear (; 18 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 19 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/HASH (; 20 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and call $~lib/internal/hash/hash8 @@ -1263,49 +1263,49 @@ (func $~lib/set/Set#find (; 21 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load8_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -1314,9 +1314,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -1334,127 +1334,127 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 8 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 8 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load8_u i32.store8 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i32.load8_u - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/set/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=4 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 8 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -1463,38 +1463,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1503,58 +1503,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=4 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 25 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -1562,70 +1562,70 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 255 i32.and call $~lib/internal/hash/hash8 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -1635,19 +1635,19 @@ (local $1 i32) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -1659,11 +1659,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1675,16 +1675,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -1699,16 +1699,16 @@ end block $break|1 i32.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1719,11 +1719,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1735,16 +1735,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -1759,16 +1759,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1779,12 +1779,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -1797,16 +1797,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -1821,16 +1821,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -1842,11 +1842,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -1857,12 +1857,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -1875,16 +1875,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -1897,9 +1897,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -1914,89 +1914,89 @@ end ) (func $~lib/set/Set#clear (; 28 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 29 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash16 (; 30 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 - get_local $1 - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 + local.get $1 + local.get $0 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 8 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 + local.set $1 + local.get $1 ) (func $~lib/internal/hash/HASH (; 31 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -2007,51 +2007,51 @@ (func $~lib/set/Set#find (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load16_s - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -2060,9 +2060,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 33 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -2080,127 +2080,127 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 8 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 8 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load16_s i32.store16 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i32.load16_s - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/set/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=4 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 8 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -2209,38 +2209,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -2249,58 +2249,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store16 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=4 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 36 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 37 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -2308,10 +2308,10 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -2320,60 +2320,60 @@ br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -2383,19 +2383,19 @@ (local $1 i32) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -2407,11 +2407,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -2423,16 +2423,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -2447,16 +2447,16 @@ end block $break|1 i32.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -2467,11 +2467,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -2483,16 +2483,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -2507,16 +2507,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -2527,12 +2527,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -2545,16 +2545,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -2569,16 +2569,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -2590,11 +2590,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -2605,12 +2605,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -2623,16 +2623,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -2645,9 +2645,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -2662,67 +2662,67 @@ end ) (func $~lib/set/Set#clear (; 39 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 40 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/HASH (; 41 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and call $~lib/internal/hash/hash16 @@ -2731,49 +2731,49 @@ (func $~lib/set/Set#find (; 42 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load16_u - get_local $1 + local.get $1 i32.const 65535 i32.and i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -2782,9 +2782,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 43 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -2802,127 +2802,127 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 8 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 8 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load16_u i32.store16 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i32.load16_u - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/set/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=4 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 8 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -2931,38 +2931,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -2971,58 +2971,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store16 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=4 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 46 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 47 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -3030,70 +3030,70 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 65535 i32.and call $~lib/internal/hash/hash16 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -3103,19 +3103,19 @@ (local $1 i32) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -3127,11 +3127,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3143,16 +3143,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -3167,16 +3167,16 @@ end block $break|1 i32.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3187,11 +3187,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3203,16 +3203,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -3227,16 +3227,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3247,12 +3247,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -3265,16 +3265,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -3289,16 +3289,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -3310,11 +3310,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3325,12 +3325,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -3343,16 +3343,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -3365,9 +3365,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -3382,156 +3382,156 @@ end ) (func $~lib/set/Set#clear (; 49 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 50 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash32 (; 51 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 - get_local $1 - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 + local.get $1 + local.get $0 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 + local.set $1 + local.get $1 ) (func $~lib/internal/hash/HASH (; 52 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/internal/hash/hash32 return ) (func $~lib/set/Set#find (; 53 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load - get_local $1 + local.get $1 i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -3540,9 +3540,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 54 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -3560,127 +3560,127 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 8 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 8 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load i32.store block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i32.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/set/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=4 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 8 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -3689,38 +3689,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -3729,58 +3729,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=4 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 57 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 58 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -3788,68 +3788,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -3859,19 +3859,19 @@ (local $1 i32) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -3883,11 +3883,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3899,16 +3899,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -3923,16 +3923,16 @@ end block $break|1 i32.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3943,11 +3943,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -3959,16 +3959,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -3983,16 +3983,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -4003,12 +4003,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -4021,16 +4021,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -4045,16 +4045,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -4066,11 +4066,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -4081,12 +4081,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -4099,16 +4099,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -4121,9 +4121,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -4138,114 +4138,114 @@ end ) (func $~lib/set/Set#clear (; 60 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 61 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/HASH (; 62 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/internal/hash/hash32 return ) (func $~lib/set/Set#find (; 63 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load - get_local $1 + local.get $1 i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -4254,9 +4254,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 64 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -4274,127 +4274,127 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 8 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 8 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load i32.store block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i32.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/set/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=4 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 8 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -4403,38 +4403,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -4443,58 +4443,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=4 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 67 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 68 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -4502,68 +4502,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -4573,19 +4573,19 @@ (local $1 i32) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -4597,11 +4597,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -4613,16 +4613,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -4637,16 +4637,16 @@ end block $break|1 i32.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i32.const 100 i32.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -4657,11 +4657,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -4673,16 +4673,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -4697,16 +4697,16 @@ end block $break|2 i32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -4717,12 +4717,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -4735,16 +4735,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -4759,16 +4759,16 @@ end block $break|3 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i32.const 50 i32.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -4780,11 +4780,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -4795,12 +4795,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -4813,16 +4813,16 @@ unreachable end end - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -4835,9 +4835,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -4852,202 +4852,202 @@ end ) (func $~lib/set/Set#clear (; 70 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 71 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hash64 (; 72 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 - i32.wrap/i64 - set_local $1 - get_local $0 + local.get $0 + i32.wrap_i64 + local.set $1 + local.get $0 i64.const 32 i64.shr_u - i32.wrap/i64 - set_local $2 - get_global $~lib/internal/hash/FNV_OFFSET - set_local $3 - get_local $3 - get_local $1 + i32.wrap_i64 + local.set $2 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $3 + local.get $3 + local.get $1 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 - get_local $2 + local.set $3 + local.get $3 + local.get $2 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $3 - get_local $3 + local.set $3 + local.get $3 ) (func $~lib/internal/hash/HASH (; 73 ;) (type $Ii) (param $0 i64) (result i32) - get_local $0 + local.get $0 call $~lib/internal/hash/hash64 return ) (func $~lib/set/Set#find (; 74 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i64.load - get_local $1 + local.get $1 i64.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -5056,9 +5056,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 75 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -5077,127 +5077,127 @@ (local $11 i64) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 16 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 16 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i64.load i64.store block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i64.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/set/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=8 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 16 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -5206,38 +5206,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -5246,58 +5246,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i64.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=8 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 78 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 79 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) @@ -5305,68 +5305,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -5376,19 +5376,19 @@ (local $1 i64) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i64.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i64.const 100 i64.lt_s i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -5400,11 +5400,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -5416,16 +5416,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -5440,16 +5440,16 @@ end block $break|1 i64.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i64.const 100 i64.lt_s i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -5460,11 +5460,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -5476,16 +5476,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -5500,16 +5500,16 @@ end block $break|2 i64.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i64.const 50 i64.lt_s i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -5520,12 +5520,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -5538,16 +5538,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -5562,16 +5562,16 @@ end block $break|3 i64.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i64.const 50 i64.lt_s i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -5583,11 +5583,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -5598,12 +5598,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -5616,16 +5616,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -5638,9 +5638,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -5655,114 +5655,114 @@ end ) (func $~lib/set/Set#clear (; 81 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 82 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/HASH (; 83 ;) (type $Ii) (param $0 i64) (result i32) - get_local $0 + local.get $0 call $~lib/internal/hash/hash64 return ) (func $~lib/set/Set#find (; 84 ;) (type $iIii) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i64.load - get_local $1 + local.get $1 i64.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -5771,9 +5771,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 85 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -5792,127 +5792,127 @@ (local $11 i64) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 16 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 16 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i64.load i64.store block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 i64.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/set/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=8 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 16 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -5921,38 +5921,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -5961,58 +5961,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i64.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=8 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 88 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 89 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32) @@ -6020,68 +6020,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -6091,19 +6091,19 @@ (local $1 i64) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 i64.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i64.const 100 i64.lt_u i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -6115,11 +6115,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6131,16 +6131,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -6155,16 +6155,16 @@ end block $break|1 i64.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 i64.const 100 i64.lt_u i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6175,11 +6175,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6191,16 +6191,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -6215,16 +6215,16 @@ end block $break|2 i64.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 i64.const 50 i64.lt_u i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6235,12 +6235,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -6253,16 +6253,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -6277,16 +6277,16 @@ end block $break|3 i64.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 i64.const 50 i64.lt_u i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -6298,11 +6298,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6313,12 +6313,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -6331,16 +6331,16 @@ unreachable end end - get_local $1 + local.get $1 i64.const 1 i64.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -6353,9 +6353,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -6370,115 +6370,115 @@ end ) (func $~lib/set/Set#clear (; 91 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 32 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 92 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/HASH (; 93 ;) (type $fi) (param $0 f32) (result i32) - get_local $0 - i32.reinterpret/f32 + local.get $0 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 return ) (func $~lib/set/Set#find (; 94 ;) (type $ifii) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 f32.load - get_local $1 + local.get $1 f32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -6487,9 +6487,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 95 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -6508,128 +6508,128 @@ (local $11 f32) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 8 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 8 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 f32.load f32.store block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 f32.load - set_local $11 - get_local $11 - i32.reinterpret/f32 + local.set $11 + local.get $11 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/set/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=4 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 8 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -6638,38 +6638,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -6678,58 +6678,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 f32.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=4 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 98 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 99 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32) @@ -6737,69 +6737,69 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 - i32.reinterpret/f32 + local.get $1 + i32.reinterpret_f32 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=4 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -6809,19 +6809,19 @@ (local $1 f32) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 f32.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 f32.const 100 f32.lt i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -6833,11 +6833,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6849,16 +6849,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -6873,16 +6873,16 @@ end block $break|1 f32.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 f32.const 100 f32.lt i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6893,11 +6893,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6909,16 +6909,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -6933,16 +6933,16 @@ end block $break|2 f32.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 f32.const 50 f32.lt i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -6953,12 +6953,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -6971,16 +6971,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -6995,16 +6995,16 @@ end block $break|3 f32.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 f32.const 50 f32.lt i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -7016,11 +7016,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -7031,12 +7031,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -7049,16 +7049,16 @@ unreachable end end - get_local $1 + local.get $1 f32.const 1 f32.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -7071,9 +7071,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -7088,115 +7088,115 @@ end ) (func $~lib/set/Set#clear (; 101 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 64 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/set/INITIAL_CAPACITY + local.get $0 + global.get $~lib/set/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/set/Set#constructor (; 102 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/set/Set#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/HASH (; 103 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - i64.reinterpret/f64 + local.get $0 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 return ) (func $~lib/set/Set#find (; 104 ;) (type $iFii) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 f64.load - get_local $1 + local.get $1 f64.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -7205,9 +7205,9 @@ i32.const 0 ) (func $~lib/set/Set#has (; 105 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/HASH call $~lib/set/Set#find i32.const 0 @@ -7226,128 +7226,128 @@ (local $11 f64) (local $12 i32) (local $13 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/set/BUCKET_SIZE + local.get $2 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/set/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/set/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/set/ENTRY_SIZE|inlined.1 (result i32) i32.const 16 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/set/ENTRY_SIZE|inlined.2 (result i32) i32.const 16 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 f64.load f64.store block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $9 + local.get $9 f64.load - set_local $11 - get_local $11 - i64.reinterpret/f64 + local.set $11 + local.get $11 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.0 end - get_local $1 + local.get $1 i32.and - set_local $12 - get_local $3 - get_local $12 - get_global $~lib/set/BUCKET_SIZE + local.set $12 + local.get $3 + local.get $12 + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $13 - get_local $10 - get_local $13 + local.set $13 + local.get $10 + local.get $13 i32.load offset=8 i32.store offset=8 - get_local $13 - get_local $8 + local.get $13 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) i32.const 16 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -7356,38 +7356,38 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 call $~lib/internal/hash/HASH - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/set/Set#find - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -7396,58 +7396,58 @@ end call $~lib/set/Set#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $4 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $5 + local.tee $5 i32.const 1 i32.add i32.store offset=16 - get_local $5 + local.get $5 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 16 end i32.mul i32.add - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 f64.store - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/set/BUCKET_SIZE + global.get $~lib/set/BUCKET_SIZE i32.mul i32.add - set_local $5 - get_local $3 - get_local $5 + local.set $5 + local.get $3 + local.get $5 i32.load offset=8 i32.store offset=8 - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.store offset=8 end ) (func $~lib/set/Set#get:size (; 108 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.load offset=20 ) (func $~lib/set/Set#delete (; 109 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32) @@ -7455,69 +7455,69 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 - i64.reinterpret/f64 + local.get $1 + i64.reinterpret_f64 call $~lib/internal/hash/hash64 br $~lib/internal/hash/HASH|inlined.1 end call $~lib/set/Set#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if i32.const 0 return end - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.load offset=8 - get_global $~lib/set/EMPTY + global.get $~lib/set/EMPTY i32.or i32.store offset=8 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.sub i32.store offset=20 - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shr_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.add - get_global $~lib/set/INITIAL_CAPACITY - tee_local $4 - get_local $0 + global.get $~lib/set/INITIAL_CAPACITY + local.tee $4 + local.get $0 i32.load offset=20 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_u select i32.ge_u - tee_local $4 + local.tee $4 if (result i32) - get_local $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/set/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/set/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -7527,19 +7527,19 @@ (local $1 f64) i32.const 0 call $~lib/set/Set#constructor - set_local $0 + local.set $0 block $break|0 f64.const 0 - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 f64.const 100 f64.lt i32.eqz br_if $break|0 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -7551,11 +7551,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -7567,16 +7567,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -7591,16 +7591,16 @@ end block $break|1 f64.const 50 - set_local $1 + local.set $1 loop $repeat|1 - get_local $1 + local.get $1 f64.const 100 f64.lt i32.eqz br_if $break|1 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -7611,11 +7611,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -7627,16 +7627,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|1 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 100 i32.eq @@ -7651,16 +7651,16 @@ end block $break|2 f64.const 0 - set_local $1 + local.set $1 loop $repeat|2 - get_local $1 + local.get $1 f64.const 50 f64.lt i32.eqz br_if $break|2 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -7671,12 +7671,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -7689,16 +7689,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|2 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -7713,16 +7713,16 @@ end block $break|3 f64.const 0 - set_local $1 + local.set $1 loop $repeat|3 - get_local $1 + local.get $1 f64.const 50 f64.lt i32.eqz br_if $break|3 block - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -7734,11 +7734,11 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#add - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz if @@ -7749,12 +7749,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#delete drop - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/set/Set#has i32.eqz i32.eqz @@ -7767,16 +7767,16 @@ unreachable end end - get_local $1 + local.get $1 f64.const 1 f64.add - set_local $1 + local.set $1 br $repeat|3 unreachable end unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 50 i32.eq @@ -7789,9 +7789,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/set/Set#clear - get_local $0 + local.get $0 call $~lib/set/Set#get:size i32.const 0 i32.eq @@ -7806,16 +7806,16 @@ end ) (func $start (; 111 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + 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 diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 86ef7c64..178505fd 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -21,7 +21,7 @@ (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 anyfunc) + (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)) @@ -32,17 +32,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -51,16 +51,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -68,16 +68,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -86,13 +86,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -105,911 +105,911 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memcpy (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -1017,156 +1017,156 @@ (func $~lib/internal/memory/memmove (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1174,18 +1174,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1194,16 +1194,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1214,219 +1214,219 @@ ) (func $~lib/internal/memory/memset (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end @@ -1434,13 +1434,13 @@ (func $~lib/internal/arraybuffer/reallocateUnsafe (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.gt_s if - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_s if @@ -1451,10 +1451,10 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.const 32 - get_local $2 + local.get $2 i32.const 7 i32.add i32.clz @@ -1464,38 +1464,38 @@ i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $3 + local.tee $3 i32.const 8 i32.add - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 call $~lib/internal/memory/memmove - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.lt_s if @@ -1506,35 +1506,35 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/array/Array#__set (; 7 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 0 i32.const 24 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.ge_u if i32.const 24 - get_local $0 + local.get $0 i32.const 4 call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $0 + local.tee $0 i32.store i32.const 28 i32.const 1 i32.store end - get_local $0 + local.get $0 i32.const 2 i32.store offset=8 ) @@ -1543,23 +1543,23 @@ i32.const 0 i32.const 64 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.ge_u if i32.const 64 - get_local $0 + local.get $0 i32.const 8 call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $0 + local.tee $0 i32.store i32.const 68 i32.const 1 i32.store end - get_local $0 + local.get $0 i64.const 4 i64.store offset=8 ) @@ -1568,23 +1568,23 @@ i32.const 0 i32.const 88 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.ge_u if i32.const 88 - get_local $0 + local.get $0 i32.const 4 call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $0 + local.tee $0 i32.store i32.const 92 i32.const 1 i32.store end - get_local $0 + local.get $0 f32.const 2.5 f32.store offset=8 ) @@ -1593,32 +1593,32 @@ i32.const 0 i32.const 128 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.ge_u if i32.const 128 - get_local $0 + local.get $0 i32.const 8 call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $0 + local.tee $0 i32.store i32.const 132 i32.const 1 i32.store end - get_local $0 + local.get $0 f64.const 2.25 f64.store offset=8 ) (func $start (; 11 ;) (type $v) (local $0 i32) i32.const 280 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 28 i32.load i32.const 2 @@ -1634,13 +1634,13 @@ i32.const 0 i32.const 24 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -1658,13 +1658,13 @@ i32.const 1 i32.const 24 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -1685,13 +1685,13 @@ i32.const 0 i32.const 24 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -1721,13 +1721,13 @@ i32.const 0 i32.const 64 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.lt_u if (result i64) - get_local $0 + local.get $0 i64.load offset=8 else unreachable @@ -1745,13 +1745,13 @@ i32.const 1 i32.const 64 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.lt_u if (result i64) - get_local $0 + local.get $0 i32.const 8 i32.add i64.load offset=8 @@ -1772,13 +1772,13 @@ i32.const 0 i32.const 64 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.lt_u if (result i64) - get_local $0 + local.get $0 i64.load offset=8 else unreachable @@ -1808,13 +1808,13 @@ i32.const 0 i32.const 88 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $0 + local.get $0 f32.load offset=8 else unreachable @@ -1832,13 +1832,13 @@ i32.const 1 i32.const 88 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $0 + local.get $0 i32.const 4 i32.add f32.load offset=8 @@ -1859,13 +1859,13 @@ i32.const 0 i32.const 88 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) - get_local $0 + local.get $0 f32.load offset=8 else unreachable @@ -1895,13 +1895,13 @@ i32.const 0 i32.const 128 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) - get_local $0 + local.get $0 f64.load offset=8 else unreachable @@ -1919,13 +1919,13 @@ i32.const 1 i32.const 128 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) - get_local $0 + local.get $0 i32.const 8 i32.add f64.load offset=8 @@ -1946,13 +1946,13 @@ i32.const 0 i32.const 128 i32.load - tee_local $0 + local.tee $0 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) - get_local $0 + local.get $0 f64.load offset=8 else unreachable diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index fbbfddd8..4045a188 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -24,7 +24,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -45,24 +45,24 @@ (func $~lib/array/Array#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -72,8 +72,8 @@ (func $~lib/internal/arraybuffer/computeSize (; 2 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -88,41 +88,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -132,22 +132,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -156,15 +156,15 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -176,18 +176,18 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memcpy (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -195,44 +195,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -240,141 +240,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -382,167 +382,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -554,130 +554,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -689,112 +689,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -806,585 +806,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -1392,77 +1392,77 @@ ) (func $~lib/internal/memory/memmove (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -1473,27 +1473,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -1502,67 +1502,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1573,20 +1573,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1598,16 +1598,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1624,250 +1624,250 @@ (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -1879,15 +1879,15 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.gt_s if - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_s i32.eqz if @@ -1898,66 +1898,66 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/internal/arraybuffer/computeSize - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memmove block $~lib/memory/memory.free|inlined.0 block - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable end unreachable end - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $2 + local.get $2 i32.add - set_local $3 + local.set $3 i32.const 0 - set_local $5 - get_local $1 - get_local $2 + local.set $5 + local.get $1 + local.get $2 i32.sub - set_local $4 - get_local $3 - get_local $5 - get_local $4 + local.set $4 + local.get $3 + local.get $5 + local.get $4 call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.ge_s i32.eqz @@ -1969,30 +1969,30 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/array/Array#__set (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -2003,56 +2003,56 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $~lib/array/Array#__get (; 11 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 3 i32.shr_u i32.lt_u if (result i64) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 3 i32.shl i32.add - get_local $3 + local.get $3 i32.add i64.load offset=8 else @@ -2063,19 +2063,19 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 3 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 134217727 i32.ge_u if @@ -2086,56 +2086,56 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 3 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 3 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 i64.store offset=8 ) (func $~lib/array/Array#__get (; 13 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result f32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add f32.load offset=8 else @@ -2146,19 +2146,19 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 268435454 i32.ge_u if @@ -2169,56 +2169,56 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 f32.store offset=8 ) (func $~lib/array/Array#__get (; 15 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 3 i32.shr_u i32.lt_u if (result f64) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 3 i32.shl i32.add - get_local $3 + local.get $3 i32.add f64.load offset=8 else @@ -2229,19 +2229,19 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 3 i32.shr_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i32.ge_u if - get_local $1 + local.get $1 i32.const 134217727 i32.ge_u if @@ -2252,51 +2252,51 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 1 i32.add i32.const 3 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.store offset=4 end i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 3 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $2 + local.get $2 f64.store offset=8 ) (func $start (; 17 ;) (type $v) (local $0 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/static-array/i - set_local $0 - get_local $0 + global.get $std/static-array/i + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -2310,7 +2310,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/i + global.get $std/static-array/i i32.const 0 call $~lib/array/Array#__get i32.const 1 @@ -2324,7 +2324,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/i + global.get $std/static-array/i i32.const 1 call $~lib/array/Array#__get i32.const 2 @@ -2338,11 +2338,11 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/i + global.get $std/static-array/i i32.const 0 i32.const 2 call $~lib/array/Array#__set - get_global $std/static-array/i + global.get $std/static-array/i i32.const 0 call $~lib/array/Array#__get i32.const 2 @@ -2357,9 +2357,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/static-array/I - set_local $0 - get_local $0 + global.get $std/static-array/I + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -2373,7 +2373,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/I + global.get $std/static-array/I i32.const 0 call $~lib/array/Array#__get i64.const 3 @@ -2387,7 +2387,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/I + global.get $std/static-array/I i32.const 1 call $~lib/array/Array#__get i64.const 4 @@ -2401,11 +2401,11 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/I + global.get $std/static-array/I i32.const 0 i64.const 4 call $~lib/array/Array#__set - get_global $std/static-array/I + global.get $std/static-array/I i32.const 0 call $~lib/array/Array#__get i64.const 4 @@ -2420,9 +2420,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/static-array/f - set_local $0 - get_local $0 + global.get $std/static-array/f + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -2436,7 +2436,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/f + global.get $std/static-array/f i32.const 0 call $~lib/array/Array#__get f32.const 1.5 @@ -2450,7 +2450,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/f + global.get $std/static-array/f i32.const 1 call $~lib/array/Array#__get f32.const 2.5 @@ -2464,11 +2464,11 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/f + global.get $std/static-array/f i32.const 0 f32.const 2.5 call $~lib/array/Array#__set - get_global $std/static-array/f + global.get $std/static-array/f i32.const 0 call $~lib/array/Array#__get f32.const 2.5 @@ -2483,9 +2483,9 @@ unreachable end block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/static-array/F - set_local $0 - get_local $0 + global.get $std/static-array/F + local.set $0 + local.get $0 i32.load offset=4 end i32.const 2 @@ -2499,7 +2499,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/F + global.get $std/static-array/F i32.const 0 call $~lib/array/Array#__get f64.const 1.25 @@ -2513,7 +2513,7 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/F + global.get $std/static-array/F i32.const 1 call $~lib/array/Array#__get f64.const 2.25 @@ -2527,11 +2527,11 @@ call $~lib/env/abort unreachable end - get_global $std/static-array/F + global.get $std/static-array/F i32.const 0 f64.const 2.25 call $~lib/array/Array#__set - get_global $std/static-array/F + global.get $std/static-array/F i32.const 0 call $~lib/array/Array#__get f64.const 2.25 diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index ea8186a9..26bf0239 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -15,7 +15,7 @@ (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 anyfunc) + (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)) @@ -31,116 +31,116 @@ (local $3 i32) (local $4 i32) i32.const 1 - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load - set_local $4 + local.set $4 loop $continue|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_u if - get_local $2 + local.get $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.load16_u offset=4 - tee_local $3 + local.tee $3 i32.const 128 i32.lt_u if (result i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add else - get_local $3 + local.get $3 i32.const 2048 i32.lt_u if (result i32) - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add else - get_local $3 + local.get $3 i32.const 64512 i32.and i32.const 55296 i32.eq - tee_local $3 + local.tee $3 if - get_local $2 + local.get $2 i32.const 1 i32.add - get_local $4 + local.get $4 i32.lt_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $2 + local.get $2 i32.const 1 i32.add i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.load16_u offset=4 i32.const 64512 i32.and i32.const 56320 i32.eq - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 2 i32.add else - get_local $1 + local.get $1 i32.const 3 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add end end end - set_local $2 + local.set $2 br $continue|0 end end - get_local $1 + local.get $1 ) (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -149,16 +149,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -166,16 +166,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -184,9 +184,9 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/string/String#toUTF8 (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -196,118 +196,118 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 call $~lib/string/String#get:lengthUTF8 call $~lib/allocator/arena/__memory_allocate - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load - set_local $7 + local.set $7 loop $continue|0 - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.lt_u if - get_local $3 + local.get $3 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.load16_u offset=4 - tee_local $1 + local.tee $1 i32.const 128 i32.lt_u if - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 else - get_local $1 + local.get $1 i32.const 2048 i32.lt_u if - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add - tee_local $4 - get_local $1 + local.tee $4 + local.get $1 i32.const 6 i32.shr_u i32.const 192 i32.or i32.store8 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=1 - get_local $2 + local.get $2 i32.const 2 i32.add - set_local $2 + local.set $2 else - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 64512 i32.and i32.const 55296 i32.eq - tee_local $6 + local.tee $6 if - get_local $3 + local.get $3 i32.const 1 i32.add - get_local $7 + local.get $7 i32.lt_u - set_local $6 + local.set $6 end - get_local $6 + local.get $6 if - get_local $3 + local.get $3 i32.const 1 i32.add i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.load16_u offset=4 - tee_local $6 + local.tee $6 i32.const 64512 i32.and i32.const 56320 i32.eq if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 1023 i32.and i32.const 10 i32.shl i32.const 65536 i32.add - get_local $6 + local.get $6 i32.const 1023 i32.and i32.add - tee_local $1 + local.tee $1 i32.const 18 i32.shr_u i32.const 240 i32.or i32.store8 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 12 i32.shr_u i32.const 63 @@ -315,8 +315,8 @@ i32.const 128 i32.or i32.store8 offset=1 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -324,33 +324,33 @@ i32.const 128 i32.or i32.store8 offset=2 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=3 - get_local $2 + local.get $2 i32.const 4 i32.add - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 2 i32.add - set_local $3 + local.set $3 br $continue|0 end end - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 12 i32.shr_u i32.const 224 i32.or i32.store8 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -358,46 +358,46 @@ i32.const 128 i32.or i32.store8 offset=1 - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=2 - get_local $2 + local.get $2 i32.const 3 i32.add - set_local $2 + local.set $2 end end - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $continue|0 end end - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add i32.const 0 i32.store8 - get_local $5 + local.get $5 ) (func $~lib/internal/string/allocateUnsafe (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if - get_local $0 + local.get $0 i32.const 536870910 i32.le_s - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -407,910 +407,910 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.shl i32.const 4 i32.add call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memcpy (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -1318,156 +1318,156 @@ (func $~lib/internal/memory/memmove (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1475,18 +1475,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1495,16 +1495,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1519,58 +1519,58 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $1 + local.get $1 i32.const 1 i32.lt_u if i32.const 64 return end - get_local $1 + local.get $1 i32.const 1 i32.shl call $~lib/allocator/arena/__memory_allocate - set_local $5 + local.set $5 loop $continue|0 - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.lt_u if - get_local $2 - tee_local $3 + local.get $2 + local.tee $3 i32.const 1 i32.add - set_local $2 - get_local $0 - get_local $3 + local.set $2 + local.get $0 + local.get $3 i32.add i32.load8_u - tee_local $3 + local.tee $3 i32.const 128 i32.lt_u if - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.add - get_local $3 + local.get $3 i32.store16 else - get_local $3 + local.get $3 i32.const 191 i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $3 + local.get $3 i32.const 224 i32.lt_u else - get_local $6 + local.get $6 end if - get_local $2 + local.get $2 i32.const 1 i32.add - get_local $1 + local.get $1 i32.gt_u if i32.const 0 @@ -1580,21 +1580,21 @@ call $~lib/env/abort unreachable end - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.add - set_local $2 - get_local $4 - get_local $5 + local.set $2 + local.get $4 + local.get $5 i32.add - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.add i32.load8_u i32.const 63 i32.and - get_local $3 + local.get $3 i32.const 31 i32.and i32.const 6 @@ -1602,22 +1602,22 @@ i32.or i32.store16 else - get_local $3 + local.get $3 i32.const 239 i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $3 + local.get $3 i32.const 365 i32.lt_u else - get_local $6 + local.get $6 end if - get_local $2 + local.get $2 i32.const 3 i32.add - get_local $1 + local.get $1 i32.gt_u if i32.const 0 @@ -1627,16 +1627,16 @@ call $~lib/env/abort unreachable end - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.add - get_local $3 + local.get $3 i32.const 7 i32.and i32.const 18 i32.shl - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.load8_u i32.const 63 @@ -1644,11 +1644,11 @@ i32.const 12 i32.shl i32.or - get_local $2 + local.get $2 i32.const 1 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add i32.load8_u i32.const 63 @@ -1656,11 +1656,11 @@ i32.const 6 i32.shl i32.or - get_local $2 + local.get $2 i32.const 1 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add i32.load8_u i32.const 63 @@ -1668,29 +1668,29 @@ i32.or i32.const 65536 i32.sub - tee_local $3 + local.tee $3 i32.const 10 i32.shr_u i32.const 55296 i32.add i32.store16 - get_local $5 - get_local $4 + local.get $5 + local.get $4 i32.const 2 i32.add - tee_local $4 + local.tee $4 i32.add - get_local $3 + local.get $3 i32.const 1023 i32.and i32.const 56320 i32.add i32.store16 else - get_local $2 + local.get $2 i32.const 2 i32.add - get_local $1 + local.get $1 i32.gt_u if i32.const 0 @@ -1700,16 +1700,16 @@ call $~lib/env/abort unreachable end - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.add - get_local $3 + local.get $3 i32.const 15 i32.and i32.const 12 i32.shl - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.load8_u i32.const 63 @@ -1717,11 +1717,11 @@ i32.const 6 i32.shl i32.or - get_local $2 + local.get $2 i32.const 1 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add i32.load8_u i32.const 63 @@ -1729,21 +1729,21 @@ i32.or i32.store16 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 end end - get_local $4 + local.get $4 i32.const 2 i32.add - set_local $4 + local.set $4 br $continue|0 end end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.ne if i32.const 0 @@ -1753,99 +1753,99 @@ call $~lib/env/abort unreachable end - get_local $4 + local.get $4 i32.const 1 i32.shr_u call $~lib/internal/string/allocateUnsafe - tee_local $0 + local.tee $0 i32.const 4 i32.add - get_local $5 - get_local $4 + local.get $5 + local.get $4 call $~lib/internal/memory/memmove - get_local $0 + local.get $0 ) (func $~lib/internal/string/compareUnsafe (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $0 + local.get $0 i32.load16_u offset=4 - get_local $1 + local.get $1 i32.load16_u offset=4 i32.sub - tee_local $3 + local.tee $3 i32.eqz else - get_local $2 + local.get $2 end if - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 br $continue|0 end end - get_local $3 + local.get $3 ) (func $~lib/string/String.__eq (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $0 + local.get $0 i32.load - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $start (; 10 ;) (type $v) i32.const 192 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $std/string-utf8/str + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $std/string-utf8/str call $~lib/string/String#get:lengthUTF8 - set_global $std/string-utf8/len - get_global $std/string-utf8/len + global.set $std/string-utf8/len + global.get $std/string-utf8/len i32.const 11 i32.ne if @@ -1856,10 +1856,10 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/str + global.get $std/string-utf8/str call $~lib/string/String#toUTF8 - set_global $std/string-utf8/ptr - get_global $std/string-utf8/ptr + global.set $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u i32.const 240 i32.ne @@ -1871,7 +1871,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=1 i32.const 144 i32.ne @@ -1883,7 +1883,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=2 i32.const 144 i32.ne @@ -1895,7 +1895,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=3 i32.const 183 i32.ne @@ -1907,7 +1907,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=4 i32.const 104 i32.ne @@ -1919,7 +1919,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=5 i32.const 105 i32.ne @@ -1931,7 +1931,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=6 i32.const 240 i32.ne @@ -1943,7 +1943,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=7 i32.const 164 i32.ne @@ -1955,7 +1955,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=8 i32.const 173 i32.ne @@ -1967,7 +1967,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=9 i32.const 162 i32.ne @@ -1979,7 +1979,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=10 if i32.const 0 @@ -1989,7 +1989,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 0 call $~lib/string/String.fromUTF8 i32.const 64 @@ -2003,12 +2003,12 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr - get_global $std/string-utf8/len + global.get $std/string-utf8/ptr + global.get $std/string-utf8/len i32.const 1 i32.sub call $~lib/string/String.fromUTF8 - get_global $std/string-utf8/str + global.get $std/string-utf8/str call $~lib/string/String.__eq i32.eqz if @@ -2019,7 +2019,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 4 call $~lib/string/String.fromUTF8 i32.const 160 @@ -2033,7 +2033,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 4 i32.add i32.const 2 @@ -2049,7 +2049,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 6 i32.add i32.const 4 @@ -2065,7 +2065,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 10 i32.add i32.const 1 diff --git a/tests/compiler/std/string-utf8.untouched.wat b/tests/compiler/std/string-utf8.untouched.wat index 090e88d2..58ed9645 100644 --- a/tests/compiler/std/string-utf8.untouched.wat +++ b/tests/compiler/std/string-utf8.untouched.wat @@ -17,7 +17,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -41,71 +41,71 @@ (local $4 i32) (local $5 i32) i32.const 1 - set_local $1 + local.set $1 i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_u if block - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add i32.load16_u offset=4 - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 128 i32.lt_u if - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 else - get_local $4 + local.get $4 i32.const 2048 i32.lt_u if - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 else - get_local $4 + local.get $4 i32.const 64512 i32.and i32.const 55296 i32.eq - tee_local $5 + local.tee $5 if (result i32) - get_local $2 + local.get $2 i32.const 1 i32.add - get_local $3 + local.get $3 i32.lt_u else - get_local $5 + local.get $5 end - tee_local $5 + local.tee $5 if (result i32) - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.add i32.const 1 @@ -117,26 +117,26 @@ i32.const 56320 i32.eq else - get_local $5 + local.get $5 end if - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 2 i32.add - set_local $2 + local.set $2 else - get_local $1 + local.get $1 i32.const 3 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 end end end @@ -145,7 +145,7 @@ end end end - get_local $1 + local.get $1 ) (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -154,41 +154,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -198,22 +198,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -222,9 +222,9 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/string/String#toUTF8 (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -235,140 +235,140 @@ (local $6 i32) (local $7 i32) block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/string/String#get:lengthUTF8 - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $2 + local.set $2 i32.const 0 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 + local.set $4 i32.const 0 - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.lt_u if block - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add i32.load16_u offset=4 - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 128 i32.lt_u if - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 else - get_local $1 + local.get $1 i32.const 2048 i32.lt_u if - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add - set_local $6 - get_local $6 - get_local $1 + local.set $6 + local.get $6 + local.get $1 i32.const 6 i32.shr_u i32.const 192 i32.or i32.store8 - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=1 - get_local $5 + local.get $5 i32.const 2 i32.add - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 else - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add - set_local $6 - get_local $1 + local.set $6 + local.get $1 i32.const 64512 i32.and i32.const 55296 i32.eq - tee_local $7 + local.tee $7 if (result i32) - get_local $3 + local.get $3 i32.const 1 i32.add - get_local $4 + local.get $4 i32.lt_u else - get_local $7 + local.get $7 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.add i32.const 1 i32.shl i32.add i32.load16_u offset=4 - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.const 64512 i32.and i32.const 56320 i32.eq if i32.const 65536 - get_local $1 + local.get $1 i32.const 1023 i32.and i32.const 10 i32.shl i32.add - get_local $7 + local.get $7 i32.const 1023 i32.and i32.add - set_local $1 - get_local $6 - get_local $1 + local.set $1 + local.get $6 + local.get $1 i32.const 18 i32.shr_u i32.const 240 i32.or i32.store8 - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 12 i32.shr_u i32.const 63 @@ -376,8 +376,8 @@ i32.const 128 i32.or i32.store8 offset=1 - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -385,33 +385,33 @@ i32.const 128 i32.or i32.store8 offset=2 - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=3 - get_local $5 + local.get $5 i32.const 4 i32.add - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 2 i32.add - set_local $3 + local.set $3 br $continue|0 end end - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 12 i32.shr_u i32.const 224 i32.or i32.store8 - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -419,21 +419,21 @@ i32.const 128 i32.or i32.store8 offset=1 - get_local $6 - get_local $1 + local.get $6 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=2 - get_local $5 + local.get $5 i32.const 3 i32.add - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 end end end @@ -441,26 +441,26 @@ end end end - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.add i32.const 0 i32.store8 - get_local $2 + local.get $2 ) (func $~lib/internal/string/allocateUnsafe (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if (result i32) - get_local $0 - get_global $~lib/internal/string/MAX_LENGTH + local.get $0 + global.get $~lib/internal/string/MAX_LENGTH i32.le_s else - get_local $1 + local.get $1 end i32.eqz if @@ -472,21 +472,21 @@ unreachable end block $~lib/memory/memory.allocate|inlined.2 (result i32) - get_global $~lib/internal/string/HEADER_SIZE - get_local $0 + global.get $~lib/internal/string/HEADER_SIZE + local.get $0 i32.const 1 i32.shl i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.2 end - set_local $2 - get_local $2 - get_local $0 + local.set $2 + local.get $2 + local.get $0 i32.store - get_local $2 + local.get $2 ) (func $~lib/internal/memory/memcpy (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -494,44 +494,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -539,141 +539,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -681,167 +681,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -853,130 +853,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -988,112 +988,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -1105,585 +1105,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -1691,77 +1691,77 @@ ) (func $~lib/internal/memory/memmove (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -1772,27 +1772,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -1801,67 +1801,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1872,20 +1872,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1897,16 +1897,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1926,7 +1926,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $1 + local.get $1 i32.const 1 i32.lt_u if @@ -1934,68 +1934,68 @@ return end i32.const 0 - set_local $2 + local.set $2 block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $3 - get_local $3 + local.set $3 + local.get $3 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_local $4 + local.set $4 i32.const 0 - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.lt_u if block - get_local $0 + local.get $0 block (result i32) - get_local $2 - tee_local $3 + local.get $2 + local.tee $3 i32.const 1 i32.add - set_local $2 - get_local $3 + local.set $2 + local.get $3 end i32.add i32.load8_u - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 128 i32.lt_u if - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.add - get_local $3 + local.get $3 i32.store16 - get_local $5 + local.get $5 i32.const 2 i32.add - set_local $5 + local.set $5 else - get_local $3 + local.get $3 i32.const 191 i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $3 + local.get $3 i32.const 224 i32.lt_u else - get_local $6 + local.get $6 end if - get_local $2 + local.get $2 i32.const 1 i32.add - get_local $1 + local.get $1 i32.le_u i32.eqz if @@ -2006,22 +2006,22 @@ call $~lib/env/abort unreachable end - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.add - get_local $3 + local.get $3 i32.const 31 i32.and i32.const 6 i32.shl - get_local $0 + local.get $0 block (result i32) - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.add - set_local $2 - get_local $6 + local.set $2 + local.get $6 end i32.add i32.load8_u @@ -2029,27 +2029,27 @@ i32.and i32.or i32.store16 - get_local $5 + local.get $5 i32.const 2 i32.add - set_local $5 + local.set $5 else - get_local $3 + local.get $3 i32.const 239 i32.gt_u - tee_local $6 + local.tee $6 if (result i32) - get_local $3 + local.get $3 i32.const 365 i32.lt_u else - get_local $6 + local.get $6 end if - get_local $2 + local.get $2 i32.const 3 i32.add - get_local $1 + local.get $1 i32.le_u i32.eqz if @@ -2060,19 +2060,19 @@ call $~lib/env/abort unreachable end - get_local $3 + local.get $3 i32.const 7 i32.and i32.const 18 i32.shl - get_local $0 + local.get $0 block (result i32) - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.add - set_local $2 - get_local $6 + local.set $2 + local.get $6 end i32.add i32.load8_u @@ -2081,14 +2081,14 @@ i32.const 12 i32.shl i32.or - get_local $0 + local.get $0 block (result i32) - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.add - set_local $2 - get_local $6 + local.set $2 + local.get $6 end i32.add i32.load8_u @@ -2097,14 +2097,14 @@ i32.const 6 i32.shl i32.or - get_local $0 + local.get $0 block (result i32) - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.add - set_local $2 - get_local $6 + local.set $2 + local.get $6 end i32.add i32.load8_u @@ -2113,38 +2113,38 @@ i32.or i32.const 65536 i32.sub - set_local $3 - get_local $4 - get_local $5 + local.set $3 + local.get $4 + local.get $5 i32.add i32.const 55296 - get_local $3 + local.get $3 i32.const 10 i32.shr_u i32.add i32.store16 - get_local $5 + local.get $5 i32.const 2 i32.add - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.add i32.const 56320 - get_local $3 + local.get $3 i32.const 1023 i32.and i32.add i32.store16 - get_local $5 + local.get $5 i32.const 2 i32.add - set_local $5 + local.set $5 else - get_local $2 + local.get $2 i32.const 2 i32.add - get_local $1 + local.get $1 i32.le_u i32.eqz if @@ -2155,22 +2155,22 @@ call $~lib/env/abort unreachable end - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.add - get_local $3 + local.get $3 i32.const 15 i32.and i32.const 12 i32.shl - get_local $0 + local.get $0 block (result i32) - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.add - set_local $2 - get_local $6 + local.set $2 + local.get $6 end i32.add i32.load8_u @@ -2179,14 +2179,14 @@ i32.const 6 i32.shl i32.or - get_local $0 + local.get $0 block (result i32) - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.add - set_local $2 - get_local $6 + local.set $2 + local.get $6 end i32.add i32.load8_u @@ -2194,10 +2194,10 @@ i32.and i32.or i32.store16 - get_local $5 + local.get $5 i32.const 2 i32.add - set_local $5 + local.set $5 end end end @@ -2206,8 +2206,8 @@ end end end - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.eq i32.eqz if @@ -2218,101 +2218,101 @@ call $~lib/env/abort unreachable end - get_local $5 + local.get $5 i32.const 1 i32.shr_u call $~lib/internal/string/allocateUnsafe - set_local $7 - get_local $7 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $7 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $3 - get_local $3 - get_local $4 - get_local $5 + local.set $3 + local.get $3 + local.get $4 + local.get $5 call $~lib/internal/memory/memmove block $~lib/memory/memory.free|inlined.0 block - get_local $4 + local.get $4 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable end unreachable end - get_local $7 + local.get $7 ) (func $~lib/internal/string/compareUnsafe (; 9 ;) (type $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 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_local $3 + local.set $6 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|0 loop $continue|0 - get_local $4 + local.get $4 if (result i32) - get_local $6 + local.get $6 i32.load16_u offset=4 - get_local $7 + local.get $7 i32.load16_u offset=4 i32.sub - tee_local $5 + local.tee $5 i32.eqz else - get_local $4 + local.get $4 end if block - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2 i32.add - set_local $6 - get_local $7 + local.set $6 + local.get $7 i32.const 2 i32.add - set_local $7 + local.set $7 end br $continue|0 end end end - get_local $5 + local.get $5 ) (func $~lib/string/String.__eq (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -2320,41 +2320,41 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $start (; 11 ;) (type $v) (local $0 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $std/string-utf8/str + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $std/string-utf8/str call $~lib/string/String#get:lengthUTF8 - set_global $std/string-utf8/len - get_global $std/string-utf8/len + global.set $std/string-utf8/len + global.get $std/string-utf8/len i32.const 11 i32.eq i32.eqz @@ -2366,10 +2366,10 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/str + global.get $std/string-utf8/str call $~lib/string/String#toUTF8 - set_global $std/string-utf8/ptr - get_global $std/string-utf8/ptr + global.set $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u i32.const 240 i32.eq @@ -2382,7 +2382,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=1 i32.const 144 i32.eq @@ -2395,7 +2395,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=2 i32.const 144 i32.eq @@ -2408,7 +2408,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=3 i32.const 183 i32.eq @@ -2421,7 +2421,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=4 i32.const 104 i32.eq @@ -2434,7 +2434,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=5 i32.const 105 i32.eq @@ -2447,7 +2447,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=6 i32.const 240 i32.eq @@ -2460,7 +2460,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=7 i32.const 164 i32.eq @@ -2473,7 +2473,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=8 i32.const 173 i32.eq @@ -2486,7 +2486,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=9 i32.const 162 i32.eq @@ -2499,7 +2499,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.load8_u offset=10 i32.const 0 i32.eq @@ -2512,7 +2512,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 0 call $~lib/string/String.fromUTF8 i32.const 64 @@ -2526,12 +2526,12 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr - get_global $std/string-utf8/len + global.get $std/string-utf8/ptr + global.get $std/string-utf8/len i32.const 1 i32.sub call $~lib/string/String.fromUTF8 - get_global $std/string-utf8/str + global.get $std/string-utf8/str call $~lib/string/String.__eq i32.eqz if @@ -2542,7 +2542,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 4 call $~lib/string/String.fromUTF8 i32.const 160 @@ -2556,7 +2556,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 4 i32.add i32.const 2 @@ -2572,7 +2572,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 6 i32.add i32.const 4 @@ -2588,7 +2588,7 @@ call $~lib/env/abort unreachable end - get_global $std/string-utf8/ptr + global.get $std/string-utf8/ptr i32.const 10 i32.add i32.const 1 @@ -2605,10 +2605,10 @@ unreachable end block $~lib/memory/memory.free|inlined.1 - get_global $std/string-utf8/ptr - set_local $0 + global.get $std/string-utf8/ptr + local.set $0 block - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.1 unreachable diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 2df4bae0..5c597806 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -178,7 +178,7 @@ (data (i32.const 5800) "\08\00\00\001\00.\001\00e\00+\001\002\008") (data (i32.const 5824) "\07\00\00\001\00.\001\00e\00-\006\004") (data (i32.const 5848) "\0b\00\00\000\00.\000\000\000\000\003\005\006\008\009") - (table $0 1 anyfunc) + (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)) @@ -200,7 +200,7 @@ (export "getString" (func $std/string/getString)) (start $start) (func $~lib/string/String#charCodeAt (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -211,31 +211,31 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 i32.load i32.ge_u if i32.const -1 return end - get_local $0 + local.get $0 i32.load16_u offset=4 ) (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -244,16 +244,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -261,16 +261,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -279,23 +279,23 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/string/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if - get_local $0 + local.get $0 i32.const 536870910 i32.le_s - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -305,109 +305,109 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.shl i32.const 4 i32.add call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/string/String.fromCharCode (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 call $~lib/internal/string/allocateUnsafe - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store16 offset=4 - get_local $1 + local.get $1 ) (func $~lib/internal/string/compareUnsafe (; 5 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $1 + local.set $1 loop $continue|0 - get_local $3 + local.get $3 if (result i32) - get_local $1 + local.get $1 i32.load16_u offset=4 - get_local $2 + local.get $2 i32.load16_u offset=4 i32.sub - tee_local $4 + local.tee $4 i32.eqz else - get_local $3 + local.get $3 end if - get_local $3 + local.get $3 i32.const 1 i32.sub - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 2 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $4 + local.get $4 ) (func $~lib/string/String.__eq (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $0 + local.get $0 i32.load - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $~lib/string/String.fromCodePoint (; 7 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 1114111 i32.gt_u if @@ -418,48 +418,48 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 65535 i32.gt_s - tee_local $1 + local.tee $1 i32.const 1 i32.add call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $1 + local.set $2 + local.get $1 if - get_local $0 + local.get $0 i32.const 65536 i32.sub - tee_local $0 + local.tee $0 i32.const 10 i32.shr_u i32.const 55296 i32.add - set_local $1 - get_local $2 - get_local $0 + local.set $1 + local.get $2 + local.get $0 i32.const 1023 i32.and i32.const 56320 i32.add - get_local $1 + local.get $1 i32.const 16 i32.shl i32.or i32.store offset=4 else - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.store16 offset=4 end - get_local $2 + local.get $2 ) (func $~lib/string/String#startsWith (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -470,34 +470,34 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 i32.load - tee_local $1 + local.tee $1 i32.const 0 - get_local $1 + local.get $1 i32.lt_s select - tee_local $2 + local.tee $2 i32.const 192 i32.load - tee_local $3 + local.tee $3 i32.add - get_local $1 + local.get $1 i32.gt_s if i32.const 0 return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 192 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $~lib/string/String#endsWith (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -507,48 +507,48 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.eqz if i32.const 0 return end - get_local $2 + local.get $2 i32.const 0 - get_local $2 + local.get $2 i32.const 0 i32.gt_s select - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.lt_s select - get_local $1 + local.get $1 i32.load - tee_local $2 + local.tee $2 i32.sub - tee_local $3 + local.tee $3 i32.const 0 i32.lt_s if i32.const 0 return end - get_local $0 - get_local $3 - get_local $1 - get_local $2 + local.get $0 + local.get $3 + local.get $1 + local.get $2 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $~lib/string/String#indexOf (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -558,62 +558,62 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 200 - get_local $1 + local.get $1 select - tee_local $1 + local.tee $1 i32.load - tee_local $4 + local.tee $4 i32.eqz if i32.const 0 return end - get_local $0 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.eqz if i32.const -1 return end - get_local $2 + local.get $2 i32.const 0 - get_local $2 + local.get $2 i32.const 0 i32.gt_s select - tee_local $2 - get_local $3 - get_local $2 - get_local $3 + local.tee $2 + local.get $3 + local.get $2 + local.get $3 i32.lt_s select - set_local $2 - get_local $3 - get_local $4 + local.set $2 + local.get $3 + local.get $4 i32.sub - set_local $3 + local.set $3 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.gt_s br_if $break|0 - get_local $0 - get_local $2 - get_local $1 - get_local $4 + local.get $0 + local.get $2 + local.get $1 + local.get $4 call $~lib/internal/string/compareUnsafe if - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 else - get_local $2 + local.get $2 return end unreachable @@ -626,894 +626,894 @@ (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -1521,156 +1521,156 @@ (func $~lib/internal/memory/memmove (; 12 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1678,18 +1678,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -1698,16 +1698,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -1722,11 +1722,11 @@ (local $6 i32) (local $7 i64) block $break|0 - get_local $2 + local.get $2 i32.load - tee_local $6 - set_local $5 - get_local $6 + local.tee $6 + local.set $5 + local.get $6 i32.eqz br_if $break|0 block $case5|0 @@ -1734,209 +1734,209 @@ block $case3|0 block $case2|0 block $case1|0 - get_local $5 + local.get $5 i32.const 1 i32.sub br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 end - get_local $2 + local.get $2 i32.load16_u offset=4 - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $0 + local.set $0 loop $repeat|1 block $break|1 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.ge_s br_if $break|1 - get_local $0 + local.get $0 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.store16 offset=4 - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|1 end end br $break|0 end - get_local $2 + local.get $2 i32.load offset=4 - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $5 + local.set $5 i32.const 0 - set_local $0 + local.set $0 loop $repeat|2 block $break|2 - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.ge_s br_if $break|2 - get_local $0 + local.get $0 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add - get_local $4 + local.get $4 i32.store offset=4 - get_local $0 + local.get $0 i32.const 1 i32.add - set_local $0 + local.set $0 br $repeat|2 end end br $break|0 end - get_local $2 + local.get $2 i32.load offset=4 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.load16_u offset=8 - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 + local.set $0 i32.const 0 - set_local $1 + local.set $1 loop $repeat|3 block $break|3 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.ge_s br_if $break|3 - get_local $1 + local.get $1 i32.const 2 i32.shl - get_local $0 + local.get $0 i32.add - get_local $5 + local.get $5 i32.store offset=4 - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $4 + local.get $4 i32.store16 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|3 end end br $break|0 end - get_local $2 + local.get $2 i64.load offset=4 - set_local $7 - get_local $1 + local.set $7 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - set_local $0 + local.set $0 loop $repeat|4 block $break|4 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.ge_s br_if $break|4 - get_local $4 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $7 + local.get $7 i64.store offset=4 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|4 end end br $break|0 end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 1 i32.shl i32.add - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 4 i32.add - set_local $5 + local.set $5 i32.const 0 - set_local $1 - get_local $6 + local.set $1 + local.get $6 i32.const 1 i32.shl - tee_local $0 - get_local $3 + local.tee $0 + local.get $3 i32.mul - set_local $2 + local.set $2 loop $repeat|5 block $break|5 - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.ge_s br_if $break|5 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add - get_local $5 - get_local $0 + local.get $5 + local.get $0 call $~lib/internal/memory/memmove - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - set_local $1 + local.set $1 br $repeat|5 end end end ) (func $~lib/internal/string/copyUnsafe (; 14 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 4 i32.add - get_local $3 + local.get $3 i32.const 1 i32.shl - get_local $2 + local.get $2 i32.add i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 1 i32.shl call $~lib/internal/memory/memmove @@ -1946,7 +1946,7 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -1956,87 +1956,87 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.load - set_local $3 - get_local $1 - get_local $0 + local.set $3 + local.get $1 + local.get $0 i32.load - tee_local $6 + local.tee $6 i32.lt_s - tee_local $4 + local.tee $4 i32.eqz if - get_local $3 + local.get $3 i32.eqz - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $0 + local.get $0 return end - get_local $1 + local.get $1 call $~lib/internal/string/allocateUnsafe - set_local $5 - get_local $1 - get_local $6 + local.set $5 + local.get $1 + local.get $6 i32.sub - tee_local $1 - get_local $3 + local.tee $1 + local.get $3 i32.gt_s if - get_local $1 + local.get $1 i32.const 1 i32.sub - get_local $3 + local.get $3 i32.div_s - tee_local $4 - get_local $3 + local.tee $4 + local.get $3 i32.mul - set_local $3 - get_local $5 + local.set $3 + local.get $5 i32.const 0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 call $~lib/internal/string/repeatUnsafe - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.sub - tee_local $4 + local.tee $4 if - get_local $5 - get_local $3 - get_local $2 + local.get $5 + local.get $3 + local.get $2 i32.const 0 - get_local $4 + local.get $4 call $~lib/internal/string/copyUnsafe end else - get_local $5 + local.get $5 i32.const 0 - get_local $2 + local.get $2 i32.const 0 - get_local $1 + local.get $1 call $~lib/internal/string/copyUnsafe end - get_local $6 + local.get $6 if - get_local $5 - get_local $1 - get_local $0 + local.get $5 + local.get $1 + local.get $0 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe end - get_local $5 + local.get $5 ) (func $~lib/string/String#padStart|trampoline (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -2044,11 +2044,11 @@ unreachable end i32.const 248 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#padStart ) (func $~lib/string/String#padEnd (; 17 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -2056,7 +2056,7 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -2066,90 +2066,90 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.load - set_local $5 - get_local $1 - get_local $0 + local.set $5 + local.get $1 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.lt_s - tee_local $4 + local.tee $4 i32.eqz if - get_local $5 + local.get $5 i32.eqz - set_local $4 + local.set $4 end - get_local $4 + local.get $4 if - get_local $0 + local.get $0 return end - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.sub - set_local $6 - get_local $1 + local.set $6 + local.get $1 call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $3 + local.set $1 + local.get $3 if - get_local $1 + local.get $1 i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe end - get_local $6 - get_local $5 + local.get $6 + local.get $5 i32.gt_s if - get_local $6 + local.get $6 i32.const 1 i32.sub - get_local $5 + local.get $5 i32.div_s - tee_local $4 - get_local $5 + local.tee $4 + local.get $5 i32.mul - set_local $0 - get_local $1 - get_local $3 - get_local $2 - get_local $4 + local.set $0 + local.get $1 + local.get $3 + local.get $2 + local.get $4 call $~lib/internal/string/repeatUnsafe - get_local $6 - get_local $0 + local.get $6 + local.get $0 i32.sub - tee_local $4 + local.tee $4 if - get_local $1 - get_local $0 - get_local $3 + local.get $1 + local.get $0 + local.get $3 i32.add - get_local $2 + local.get $2 i32.const 0 - get_local $4 + local.get $4 call $~lib/internal/string/copyUnsafe end else - get_local $1 - get_local $3 - get_local $2 + local.get $1 + local.get $3 + local.get $2 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe end - get_local $1 + local.get $1 ) (func $~lib/string/String#padEnd|trampoline (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -2157,17 +2157,17 @@ unreachable end i32.const 248 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#padEnd ) (func $~lib/string/String#lastIndexOf (; 19 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -2177,62 +2177,62 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 200 - get_local $1 + local.get $1 select - tee_local $1 + local.tee $1 i32.load - tee_local $4 + local.tee $4 i32.eqz if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.eqz if i32.const -1 return end - get_local $2 + local.get $2 i32.const 0 - get_local $2 + local.get $2 i32.const 0 i32.gt_s select - tee_local $2 - get_local $3 - get_local $4 + local.tee $2 + local.get $3 + local.get $4 i32.sub - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.lt_s select - set_local $2 + local.set $2 loop $repeat|0 block $break|0 - get_local $2 + local.get $2 i32.const 0 i32.lt_s br_if $break|0 - get_local $0 - get_local $2 - get_local $1 - get_local $4 + local.get $0 + local.get $2 + local.get $1 + local.get $4 call $~lib/internal/string/compareUnsafe if - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $repeat|0 else - get_local $2 + local.get $2 return end unreachable @@ -2245,7 +2245,7 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -2253,15 +2253,15 @@ unreachable end i32.const 2147483647 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#lastIndexOf ) (func $std/string/getString (; 21 ;) (type $i) (result i32) - get_global $std/string/str + global.get $std/string/str ) (func $~lib/internal/string/parse (; 22 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) @@ -2269,157 +2269,157 @@ (local $4 i32) (local $5 f64) (local $6 f64) - get_local $0 + local.get $0 i32.load - tee_local $4 + local.tee $4 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.load16_u offset=4 - tee_local $2 + local.tee $2 i32.const 45 i32.eq if (result f64) - get_local $4 + local.get $4 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $3 + local.get $3 i32.const 2 i32.add - tee_local $3 + local.tee $3 i32.load16_u offset=4 - set_local $2 + local.set $2 f64.const -1 else - get_local $2 + local.get $2 i32.const 43 i32.eq if - get_local $4 + local.get $4 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $3 + local.get $3 i32.const 2 i32.add - tee_local $3 + local.tee $3 i32.load16_u offset=4 - set_local $2 + local.set $2 end f64.const 1 end - set_local $6 - get_local $1 + local.set $6 + local.get $1 if - get_local $1 + local.get $1 i32.const 2 i32.lt_s - tee_local $0 + local.tee $0 i32.eqz if - get_local $1 + local.get $1 i32.const 36 i32.gt_s - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if f64.const nan:0x8000000000000 return end else - get_local $2 + local.get $2 i32.const 48 i32.eq - tee_local $0 + local.tee $0 if - get_local $4 + local.get $4 i32.const 2 i32.gt_s - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if (result i32) block $break|0 (result i32) block $case6|0 block $case5|0 block $case3|0 block $case1|0 - get_local $3 + local.get $3 i32.const 2 i32.add i32.load16_u offset=4 - tee_local $0 + local.tee $0 i32.const 66 i32.eq br_if $case1|0 - get_local $0 + local.get $0 i32.const 98 i32.eq br_if $case1|0 - get_local $0 + local.get $0 i32.const 79 i32.eq br_if $case3|0 - get_local $0 + local.get $0 i32.const 111 i32.eq br_if $case3|0 - get_local $0 + local.get $0 i32.const 88 i32.eq br_if $case5|0 - get_local $0 + local.get $0 i32.const 120 i32.eq br_if $case5|0 br $case6|0 end - get_local $3 + local.get $3 i32.const 4 i32.add - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 2 i32.sub - set_local $4 + local.set $4 i32.const 2 br $break|0 end - get_local $3 + local.get $3 i32.const 4 i32.add - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 2 i32.sub - set_local $4 + local.set $4 i32.const 8 br $break|0 end - get_local $3 + local.get $3 i32.const 4 i32.add - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 2 i32.sub - set_local $4 + local.set $4 i32.const 16 br $break|0 end @@ -2428,95 +2428,95 @@ else i32.const 10 end - set_local $1 + local.set $1 end loop $continue|1 block $break|1 - get_local $4 - tee_local $0 + local.get $4 + local.tee $0 i32.const 1 i32.sub - set_local $4 - get_local $0 + local.set $4 + local.get $0 if - get_local $3 + local.get $3 i32.load16_u offset=4 - tee_local $2 + local.tee $2 i32.const 48 i32.ge_s - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.const 57 i32.le_s - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if (result i32) - get_local $2 + local.get $2 i32.const 48 i32.sub else - get_local $2 + local.get $2 i32.const 65 i32.ge_s - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.const 90 i32.le_s - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if (result i32) - get_local $2 + local.get $2 i32.const 55 i32.sub else - get_local $2 + local.get $2 i32.const 97 i32.ge_s - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.const 122 i32.le_s - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.eqz br_if $break|1 - get_local $2 + local.get $2 i32.const 87 i32.sub end end - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.ge_s br_if $break|1 - get_local $5 - get_local $1 - f64.convert_s/i32 + local.get $5 + local.get $1 + f64.convert_i32_s f64.mul - get_local $2 - f64.convert_s/i32 + local.get $2 + f64.convert_i32_s f64.add - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 2 i32.add - set_local $3 + local.set $3 br $continue|1 end end end - get_local $6 - get_local $5 + local.get $6 + local.get $5 f64.mul ) (func $~lib/string/parseInt (; 23 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) - get_local $0 + local.get $0 i32.const 0 call $~lib/internal/string/parse ) @@ -2527,105 +2527,105 @@ (local $4 f64) (local $5 f64) (local $6 f64) - get_local $0 + local.get $0 i32.load - tee_local $3 + local.tee $3 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $0 - tee_local $1 + local.get $0 + local.tee $1 i32.load16_u offset=4 - tee_local $2 + local.tee $2 i32.const 45 i32.eq if (result f64) - get_local $3 + local.get $3 i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $1 + local.get $1 i32.const 2 i32.add - tee_local $1 + local.tee $1 i32.load16_u offset=4 drop f64.const -1 else - get_local $2 + local.get $2 i32.const 43 i32.eq if - get_local $3 + local.get $3 i32.const 1 i32.sub - tee_local $3 + local.tee $3 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $1 + local.get $1 i32.const 2 i32.add - tee_local $1 + local.tee $1 i32.load16_u offset=4 drop end f64.const 1 end - set_local $6 + local.set $6 loop $continue|0 block $break|0 - get_local $3 - tee_local $0 + local.get $3 + local.tee $0 i32.const 1 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 if - get_local $1 + local.get $1 i32.load16_u offset=4 - tee_local $2 + local.tee $2 i32.const 46 i32.eq if - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 f64.const 0.1 - set_local $5 + local.set $5 loop $continue|1 block $break|1 - get_local $3 - tee_local $0 + local.get $3 + local.tee $0 i32.const 1 i32.sub - set_local $3 - get_local $0 + local.set $3 + local.get $0 if - get_local $1 + local.get $1 i32.load16_u offset=4 - tee_local $2 + local.tee $2 i32.const 69 i32.eq - tee_local $0 + local.tee $0 i32.eqz if - get_local $2 + local.get $2 i32.const 101 i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if i32.const 0 i32.const 80 @@ -2634,65 +2634,65 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.const 48 i32.sub - tee_local $2 + local.tee $2 i32.const 9 i32.gt_u br_if $break|1 - get_local $4 - get_local $2 - f64.convert_s/i32 - get_local $5 + local.get $4 + local.get $2 + f64.convert_i32_s + local.get $5 f64.mul f64.add - set_local $4 - get_local $5 + local.set $4 + local.get $5 f64.const 0.1 f64.mul - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 br $continue|1 end end end br $break|0 end - get_local $2 + local.get $2 i32.const 48 i32.sub - tee_local $2 + local.tee $2 i32.const 10 i32.ge_u br_if $break|0 - get_local $4 + local.get $4 f64.const 10 f64.mul - get_local $2 - f64.convert_s/i32 + local.get $2 + f64.convert_i32_s f64.add - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 br $continue|0 end end end - get_local $6 - get_local $4 + local.get $6 + local.get $4 f64.mul ) (func $~lib/string/String#concat (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -2702,102 +2702,102 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.const 200 - get_local $1 + local.get $1 select - tee_local $1 + local.tee $1 i32.load - tee_local $4 + local.tee $4 i32.add - tee_local $2 + local.tee $2 i32.eqz if i32.const 256 return end - get_local $2 + local.get $2 call $~lib/internal/string/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $3 - get_local $1 + local.get $2 + local.get $3 + local.get $1 i32.const 0 - get_local $4 + local.get $4 call $~lib/internal/string/copyUnsafe - get_local $2 + local.get $2 ) (func $~lib/string/String.__concat (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.const 200 - get_local $0 + local.get $0 select - get_local $1 + local.get $1 call $~lib/string/String#concat ) (func $~lib/string/String.__ne (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__eq i32.eqz ) (func $~lib/string/String.__gt (; 28 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 i32.eqz if - get_local $0 + local.get $0 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $1 + local.get $1 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.eqz if i32.const 0 return end - get_local $3 + local.get $3 i32.eqz if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 - get_local $2 - get_local $3 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 i32.lt_s select call $~lib/internal/string/compareUnsafe @@ -2807,52 +2807,52 @@ (func $~lib/string/String.__gte (; 29 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $1 + local.get $1 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.eqz if - get_local $3 + local.get $3 i32.eqz return end - get_local $3 + local.get $3 i32.eqz if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 - get_local $2 - get_local $3 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 i32.lt_s select call $~lib/internal/string/compareUnsafe @@ -2862,52 +2862,52 @@ (func $~lib/string/String.__lt (; 30 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 i32.eqz if - get_local $0 + local.get $0 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.load - tee_local $3 + local.tee $3 i32.eqz if i32.const 0 return end - get_local $2 + local.get $2 i32.eqz if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 - get_local $2 - get_local $3 - get_local $2 - get_local $3 + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 i32.lt_s select call $~lib/internal/string/compareUnsafe @@ -2917,14 +2917,14 @@ (func $~lib/string/String.__lte (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 256 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -2932,17 +2932,17 @@ end i32.const 256 i32.load - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz return end - get_local $1 + local.get $1 i32.eqz if i32.const 1 @@ -2950,11 +2950,11 @@ end i32.const 256 i32.const 0 - get_local $0 - get_local $1 - get_local $2 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 + local.get $1 + local.get $2 i32.lt_s select call $~lib/internal/string/compareUnsafe @@ -2964,7 +2964,7 @@ (func $~lib/string/String#repeat (; 32 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -2974,23 +2974,23 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.mul i32.const 268435456 i32.gt_s - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 i32.const 80 @@ -2999,113 +2999,113 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.eqz - tee_local $2 + local.tee $2 i32.eqz if - get_local $3 + local.get $3 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 256 return end - get_local $1 + local.get $1 i32.const 1 i32.eq if - get_local $0 + local.get $0 return end - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.mul call $~lib/internal/string/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/string/repeatUnsafe - get_local $2 + local.get $2 ) (func $~lib/string/String#slice (; 33 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - tee_local $1 + local.tee $1 i32.const 0 - get_local $1 + local.get $1 i32.const 0 i32.gt_s select else - get_local $1 - get_local $3 - get_local $1 - get_local $3 + local.get $1 + local.get $3 + local.get $1 + local.get $3 i32.lt_s select end - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - tee_local $1 + local.tee $1 i32.const 0 - get_local $1 + local.get $1 i32.const 0 i32.gt_s select else - get_local $2 - tee_local $1 - get_local $3 - get_local $1 - get_local $3 + local.get $2 + local.tee $1 + local.get $3 + local.get $1 + local.get $3 i32.lt_s select end - get_local $4 + local.get $4 i32.sub - tee_local $2 + local.tee $2 i32.const 0 i32.le_s if i32.const 256 return end - get_local $2 + local.get $2 call $~lib/internal/string/allocateUnsafe - tee_local $1 + local.tee $1 i32.const 0 - get_local $0 - get_local $4 - get_local $2 + local.get $0 + local.get $4 + local.get $2 call $~lib/internal/string/copyUnsafe - get_local $1 + local.get $1 ) (func $~lib/string/String#slice|trampoline (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -3113,16 +3113,16 @@ unreachable end i32.const 2147483647 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#slice ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 35 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -3135,233 +3135,233 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end @@ -3370,7 +3370,7 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 268435454 i32.gt_u if @@ -3381,43 +3381,43 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 i32.shl - tee_local $3 + local.tee $3 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $2 + local.set $2 i32.const 8 call $~lib/allocator/arena/__memory_allocate - tee_local $1 + local.tee $1 i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 0 i32.store offset=4 - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.store - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.store offset=4 - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $3 + local.get $3 call $~lib/internal/memory/memset - get_local $1 + local.get $1 ) (func $~lib/internal/arraybuffer/reallocateUnsafe (; 38 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load - tee_local $2 + local.tee $2 i32.gt_s if - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_s if @@ -3428,10 +3428,10 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.const 32 - get_local $2 + local.get $2 i32.const 7 i32.add i32.clz @@ -3441,38 +3441,38 @@ i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $3 + local.tee $3 i32.const 8 i32.add - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 call $~lib/internal/memory/memmove - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $2 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.lt_s if @@ -3483,33 +3483,33 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/array/Array#push (; 39 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=4 - tee_local $2 + local.tee $2 i32.const 1 i32.add - set_local $3 - get_local $2 - get_local $0 + local.set $3 + local.get $2 + local.get $0 i32.load - tee_local $4 + local.tee $4 i32.load i32.const 2 i32.shr_u i32.ge_u if - get_local $2 + local.get $2 i32.const 268435454 i32.ge_u if @@ -3520,26 +3520,26 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $4 - get_local $3 + local.get $0 + local.get $4 + local.get $3 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - tee_local $4 + local.tee $4 i32.store end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store offset=4 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.const 2 i32.shl i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $3 + local.get $3 ) (func $~lib/string/String#split (; 40 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -3550,7 +3550,7 @@ (local $8 i32) (local $9 i32) (local $10 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -3560,203 +3560,203 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.eqz if i32.const 0 call $~lib/array/Array#constructor return end - get_local $1 + local.get $1 i32.eqz if i32.const 1 call $~lib/array/Array#constructor - tee_local $3 + local.tee $3 i32.load - get_local $0 + local.get $0 i32.store offset=8 - get_local $3 + local.get $3 return end - get_local $0 + local.get $0 i32.load - set_local $4 + local.set $4 i32.const 2147483647 - get_local $2 - get_local $2 + local.get $2 + local.get $2 i32.const 0 i32.lt_s select - set_local $2 + local.set $2 block $folding-inner0 - get_local $1 + local.get $1 i32.load - tee_local $9 + local.tee $9 if - get_local $4 + local.get $4 i32.eqz if i32.const 1 call $~lib/array/Array#constructor - tee_local $3 + local.tee $3 i32.load i32.const 256 i32.store offset=8 br $folding-inner0 end else - get_local $4 + local.get $4 i32.eqz if i32.const 0 call $~lib/array/Array#constructor return end - get_local $4 - tee_local $3 - get_local $2 - get_local $3 - get_local $2 + local.get $4 + local.tee $3 + local.get $2 + local.get $3 + local.get $2 i32.lt_s select - tee_local $4 + local.tee $4 call $~lib/array/Array#constructor - tee_local $3 + local.tee $3 i32.load - set_local $5 + local.set $5 i32.const 0 - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if i32.const 1 call $~lib/internal/string/allocateUnsafe - tee_local $1 - get_local $2 + local.tee $1 + local.get $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.load16_u offset=4 i32.store16 offset=4 - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $3 + local.get $3 return end i32.const 0 call $~lib/array/Array#constructor - set_local $6 + local.set $6 loop $continue|1 - get_local $0 - get_local $1 - get_local $7 + local.get $0 + local.get $1 + local.get $7 call $~lib/string/String#indexOf - tee_local $8 + local.tee $8 i32.const -1 i32.ne if - get_local $8 - get_local $7 + local.get $8 + local.get $7 i32.sub - tee_local $5 + local.tee $5 i32.const 0 i32.gt_s if - get_local $5 + local.get $5 call $~lib/internal/string/allocateUnsafe - tee_local $3 + local.tee $3 i32.const 0 - get_local $0 - get_local $7 - get_local $5 + local.get $0 + local.get $7 + local.get $5 call $~lib/internal/string/copyUnsafe - get_local $6 - get_local $3 + local.get $6 + local.get $3 call $~lib/array/Array#push drop else - get_local $6 + local.get $6 i32.const 256 call $~lib/array/Array#push drop end - get_local $10 + local.get $10 i32.const 1 i32.add - tee_local $10 - get_local $2 + local.tee $10 + local.get $2 i32.eq if - get_local $6 + local.get $6 return end - get_local $8 - get_local $9 + local.get $8 + local.get $9 i32.add - set_local $7 + local.set $7 br $continue|1 end end - get_local $7 + local.get $7 i32.eqz if i32.const 1 call $~lib/array/Array#constructor - tee_local $3 + local.tee $3 i32.load - get_local $0 + local.get $0 i32.store offset=8 br $folding-inner0 end - get_local $4 - get_local $7 + local.get $4 + local.get $7 i32.sub - tee_local $1 + local.tee $1 i32.const 0 i32.gt_s if - get_local $1 + local.get $1 call $~lib/internal/string/allocateUnsafe - tee_local $5 + local.tee $5 i32.const 0 - get_local $0 - get_local $7 - get_local $1 + local.get $0 + local.get $7 + local.get $1 call $~lib/internal/string/copyUnsafe - get_local $6 - get_local $5 + local.get $6 + local.get $5 call $~lib/array/Array#push drop else - get_local $6 + local.get $6 i32.const 256 call $~lib/array/Array#push drop end - get_local $6 + local.get $6 return end - get_local $3 + local.get $3 i32.load i32.load offset=8 drop - get_local $3 + local.get $3 ) (func $~lib/string/String#split|trampoline (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3764,34 +3764,34 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of2 $1of2 $2of2 $outOfRange end unreachable end i32.const 0 - set_local $1 + local.set $1 end i32.const 2147483647 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#split ) (func $~lib/internal/number/decimalCount32 (; 42 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 100000 i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 100 i32.lt_u if (result i32) i32.const 1 i32.const 2 - get_local $0 + local.get $0 i32.const 10 i32.lt_u select @@ -3799,23 +3799,23 @@ i32.const 3 i32.const 4 i32.const 5 - get_local $0 + local.get $0 i32.const 10000 i32.lt_u select - get_local $0 + local.get $0 i32.const 1000 i32.lt_u select end else - get_local $0 + local.get $0 i32.const 10000000 i32.lt_u if (result i32) i32.const 6 i32.const 7 - get_local $0 + local.get $0 i32.const 1000000 i32.lt_u select @@ -3823,11 +3823,11 @@ i32.const 8 i32.const 9 i32.const 10 - get_local $0 + local.get $0 i32.const 1000000000 i32.lt_u select - get_local $0 + local.get $0 i32.const 100000000 i32.lt_u select @@ -3839,38 +3839,38 @@ (local $4 i32) i32.const 1816 i32.load - set_local $3 + local.set $3 loop $continue|0 - get_local $1 + local.get $1 i32.const 10000 i32.ge_u if - get_local $1 + local.get $1 i32.const 10000 i32.rem_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 10000 i32.div_u - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 4 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.div_u i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.rem_u i32.const 2 @@ -3884,61 +3884,61 @@ br $continue|0 end end - get_local $1 + local.get $1 i32.const 100 i32.ge_u if - get_local $1 + local.get $1 i32.const 100 i32.rem_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 100 i32.div_u - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 2 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=4 end - get_local $1 + local.get $1 i32.const 10 i32.ge_u if - get_local $2 + local.get $2 i32.const 2 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add i32.load offset=8 i32.store offset=4 else - get_local $2 + local.get $2 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.const 48 i32.add i32.store16 offset=4 @@ -3948,71 +3948,71 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 480 return end - get_local $0 + local.get $0 i32.const 0 i32.lt_s - tee_local $1 + local.tee $1 if i32.const 0 - get_local $0 + local.get $0 i32.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - tee_local $3 + local.tee $3 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 - get_local $3 + local.tee $2 + local.get $0 + local.get $3 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 if - get_local $2 + local.get $2 i32.const 45 i32.store16 offset=4 end - get_local $2 + local.get $2 ) (func $~lib/internal/number/utoa32 (; 45 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 480 return end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - tee_local $1 + local.tee $1 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 - get_local $1 + local.tee $2 + local.get $0 + local.get $1 call $~lib/internal/number/utoa32_lut - get_local $2 + local.get $2 ) (func $~lib/internal/number/decimalCount64 (; 46 ;) (type $Ii) (param $0 i64) (result i32) - get_local $0 + local.get $0 i64.const 1000000000000000 i64.lt_u if (result i32) - get_local $0 + local.get $0 i64.const 1000000000000 i64.lt_u if (result i32) i32.const 11 i32.const 12 - get_local $0 + local.get $0 i64.const 100000000000 i64.lt_u select @@ -4020,23 +4020,23 @@ i32.const 13 i32.const 14 i32.const 15 - get_local $0 + local.get $0 i64.const 100000000000000 i64.lt_u select - get_local $0 + local.get $0 i64.const 10000000000000 i64.lt_u select end else - get_local $0 + local.get $0 i64.const 100000000000000000 i64.lt_u if (result i32) i32.const 16 i32.const 17 - get_local $0 + local.get $0 i64.const 10000000000000000 i64.lt_u select @@ -4044,11 +4044,11 @@ i32.const 18 i32.const 19 i32.const 20 - get_local $0 + local.get $0 i64.const -8446744073709551616 i64.lt_u select - get_local $0 + local.get $0 i64.const 1000000000000000000 i64.lt_u select @@ -4062,53 +4062,53 @@ (local $6 i32) i32.const 2608 i32.load - set_local $3 + local.set $3 loop $continue|0 - get_local $1 + local.get $1 i64.const 100000000 i64.ge_u if - get_local $1 - get_local $1 + local.get $1 + local.get $1 i64.const 100000000 i64.div_u - tee_local $1 + local.tee $1 i64.const 100000000 i64.mul i64.sub - i32.wrap/i64 - tee_local $4 + i32.wrap_i64 + local.tee $4 i32.const 10000 i32.div_u - tee_local $5 + local.tee $5 i32.const 100 i32.div_u - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 100 i32.rem_u - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 4 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 10000 i32.rem_u - tee_local $4 + local.tee $4 i32.const 100 i32.div_u i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.const 100 i32.rem_u i32.const 2 @@ -4119,22 +4119,22 @@ i64.shl i64.or i64.store offset=4 - get_local $2 + local.get $2 i32.const 4 i32.sub - tee_local $2 + local.tee $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - get_local $6 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add @@ -4146,106 +4146,106 @@ br $continue|0 end end - get_local $0 - get_local $1 - i32.wrap/i64 - get_local $2 + local.get $0 + local.get $1 + i32.wrap_i64 + local.get $2 call $~lib/internal/number/utoa32_lut ) (func $~lib/internal/number/utoa64 (; 48 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 480 return end - get_local $0 + local.get $0 i64.const 4294967295 i64.le_u if - get_local $0 - i32.wrap/i64 - tee_local $3 + local.get $0 + i32.wrap_i64 + local.tee $3 call $~lib/internal/number/decimalCount32 - tee_local $1 + local.tee $1 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $3 - get_local $1 + local.tee $2 + local.get $3 + local.get $1 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - tee_local $1 + local.tee $1 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 - get_local $1 + local.tee $2 + local.get $0 + local.get $1 call $~lib/internal/number/utoa64_lut end - get_local $2 + local.get $2 ) (func $~lib/internal/number/itoa64 (; 49 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 480 return end block (result i32) - get_local $0 + local.get $0 i64.const 0 i64.lt_s - tee_local $1 + local.tee $1 if i64.const 0 - get_local $0 + local.get $0 i64.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i64.const 4294967295 i64.le_u end if - get_local $0 - i32.wrap/i64 - tee_local $4 + local.get $0 + i32.wrap_i64 + local.tee $4 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - tee_local $2 + local.tee $2 call $~lib/internal/string/allocateUnsafe - tee_local $3 - get_local $4 - get_local $2 + local.tee $3 + local.get $4 + local.get $2 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - get_local $1 + local.get $1 i32.add - tee_local $2 + local.tee $2 call $~lib/internal/string/allocateUnsafe - tee_local $3 - get_local $0 - get_local $2 + local.tee $3 + local.get $0 + local.get $2 call $~lib/internal/number/utoa64_lut end - get_local $1 + local.get $1 if - get_local $3 + local.get $3 i32.const 45 i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/internal/number/genDigits (; 50 ;) (type $iIiIiIii) (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) @@ -4256,37 +4256,37 @@ (local $12 i32) (local $13 i64) (local $14 i64) - get_local $3 - get_local $1 + local.get $3 + local.get $1 i64.sub - set_local $8 + local.set $8 i64.const 1 i32.const 0 - get_local $4 + local.get $4 i32.sub - tee_local $11 - i64.extend_s/i32 - tee_local $13 + local.tee $11 + i64.extend_i32_s + local.tee $13 i64.shl - tee_local $10 + local.tee $10 i64.const 1 i64.sub - tee_local $14 - get_local $3 + local.tee $14 + local.get $3 i64.and - set_local $1 - get_local $3 - get_local $13 + local.set $1 + local.get $3 + local.get $13 i64.shr_u - i32.wrap/i64 - tee_local $7 + i32.wrap_i64 + local.tee $7 call $~lib/internal/number/decimalCount32 - set_local $9 + local.set $9 i32.const 4624 i32.load - set_local $12 + local.set $12 loop $continue|0 - get_local $9 + local.get $9 i32.const 0 i32.gt_s if @@ -4301,622 +4301,622 @@ block $case3|1 block $case2|1 block $case1|1 - get_local $9 - tee_local $2 + local.get $9 + local.tee $2 i32.const 10 i32.ne if - get_local $2 + local.get $2 i32.const 1 i32.sub br_table $case9|1 $case8|1 $case7|1 $case6|1 $case5|1 $case4|1 $case3|1 $case2|1 $case1|1 $case10|1 end - get_local $7 + local.get $7 i32.const 1000000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 1000000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 1000 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 1000 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 100 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 100 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 + local.get $7 i32.const 10 i32.div_u - set_local $4 - get_local $7 + local.set $4 + local.get $7 i32.const 10 i32.rem_u - set_local $7 + local.set $7 br $break|1 end - get_local $7 - set_local $4 + local.get $7 + local.set $4 i32.const 0 - set_local $7 + local.set $7 br $break|1 end i32.const 0 - set_local $4 + local.set $4 end - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.or if - get_local $6 - tee_local $2 + local.get $6 + local.tee $2 i32.const 1 i32.add - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $4 + local.get $4 i32.const 65535 i32.and i32.const 48 i32.add i32.store16 offset=4 end - get_local $9 + local.get $9 i32.const 1 i32.sub - set_local $9 - get_local $7 - i64.extend_u/i32 - get_local $11 - i64.extend_s/i32 + local.set $9 + local.get $7 + i64.extend_i32_u + local.get $11 + i64.extend_i32_s i64.shl - get_local $1 + local.get $1 i64.add - tee_local $3 - get_local $5 + local.tee $3 + local.get $5 i64.le_u if - get_global $~lib/internal/number/_K - get_local $9 + global.get $~lib/internal/number/_K + local.get $9 i32.add - set_global $~lib/internal/number/_K - get_local $12 - get_local $9 + global.set $~lib/internal/number/_K + local.get $12 + local.get $9 i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $11 - i64.extend_s/i32 + local.get $11 + i64.extend_i32_s i64.shl - set_local $1 - get_local $6 + local.set $1 + local.get $6 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $2 + local.tee $2 i32.load16_u offset=4 - set_local $7 + local.set $7 loop $continue|2 - get_local $3 - get_local $8 + local.get $3 + local.get $8 i64.lt_u - tee_local $0 + local.tee $0 if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.sub - get_local $1 + local.get $1 i64.ge_u - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $1 - get_local $3 + local.get $1 + local.get $3 i64.add - get_local $8 + local.get $8 i64.lt_u - tee_local $0 + local.tee $0 i32.eqz if - get_local $8 - get_local $3 + local.get $8 + local.get $3 i64.sub - get_local $1 - get_local $3 + local.get $1 + local.get $3 i64.add - get_local $8 + local.get $8 i64.sub i64.gt_u - set_local $0 + local.set $0 end end - get_local $0 + local.get $0 if - get_local $7 + local.get $7 i32.const 1 i32.sub - set_local $7 - get_local $1 - get_local $3 + local.set $7 + local.get $1 + local.get $3 i64.add - set_local $3 + local.set $3 br $continue|2 end end - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.store16 offset=4 - get_local $6 + local.get $6 return end br $continue|0 end end loop $continue|3 (result i32) - get_local $5 + local.get $5 i64.const 10 i64.mul - set_local $5 - get_local $1 + local.set $5 + local.get $1 i64.const 10 i64.mul - tee_local $1 - get_local $11 - i64.extend_s/i32 + local.tee $1 + local.get $11 + i64.extend_i32_s i64.shr_u - tee_local $3 - get_local $6 - i64.extend_s/i32 + local.tee $3 + local.get $6 + i64.extend_i32_s i64.or i64.const 0 i64.ne if - get_local $6 - tee_local $4 + local.get $6 + local.tee $4 i32.const 1 i32.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $3 - i32.wrap/i64 + local.get $3 + i32.wrap_i64 i32.const 65535 i32.and i32.const 48 i32.add i32.store16 offset=4 end - get_local $9 + local.get $9 i32.const 1 i32.sub - set_local $9 - get_local $1 - get_local $14 + local.set $9 + local.get $1 + local.get $14 i64.and - tee_local $1 - get_local $5 + local.tee $1 + local.get $5 i64.ge_u br_if $continue|3 - get_global $~lib/internal/number/_K - get_local $9 + global.get $~lib/internal/number/_K + local.get $9 i32.add - set_global $~lib/internal/number/_K - get_local $12 + global.set $~lib/internal/number/_K + local.get $12 i32.const 0 - get_local $9 + local.get $9 i32.sub i32.const 2 i32.shl i32.add i64.load32_u offset=8 - get_local $8 + local.get $8 i64.mul - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 1 i32.sub i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $7 + local.tee $7 i32.load16_u offset=4 - set_local $4 + local.set $4 loop $continue|4 - get_local $1 - get_local $8 + local.get $1 + local.get $8 i64.lt_u - tee_local $2 + local.tee $2 if - get_local $5 - get_local $1 + local.get $5 + local.get $1 i64.sub - get_local $10 + local.get $10 i64.ge_u - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if - get_local $1 - get_local $10 + local.get $1 + local.get $10 i64.add - get_local $8 + local.get $8 i64.lt_u - tee_local $2 + local.tee $2 i32.eqz if - get_local $8 - get_local $1 + local.get $8 + local.get $1 i64.sub - get_local $1 - get_local $10 + local.get $1 + local.get $10 i64.add - get_local $8 + local.get $8 i64.sub i64.gt_u - set_local $2 + local.set $2 end end - get_local $2 + local.get $2 if - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $1 - get_local $10 + local.set $4 + local.get $1 + local.get $10 i64.add - set_local $1 + local.set $1 br $continue|4 end end - get_local $7 - get_local $4 + local.get $7 + local.get $4 i32.store16 offset=4 - get_local $6 + local.get $6 end ) (func $~lib/internal/number/prettify (; 51 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $2 + local.get $2 i32.eqz if - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 3145774 i32.store offset=4 - get_local $1 + local.get $1 i32.const 2 i32.add return end - get_local $1 - get_local $1 - get_local $2 + local.get $1 + local.get $1 + local.get $2 i32.add - tee_local $5 + local.tee $5 i32.le_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 21 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $1 - set_local $3 + local.get $1 + local.set $3 loop $repeat|0 block $break|0 - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.ge_s br_if $break|0 - get_local $3 + local.get $3 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 48 i32.store16 offset=4 - get_local $3 + local.get $3 i32.const 1 i32.add - set_local $3 + local.set $3 br $repeat|0 end end - get_local $5 + local.get $5 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 3145774 i32.store offset=4 - get_local $5 + local.get $5 i32.const 2 i32.add else - get_local $5 + local.get $5 i32.const 0 i32.gt_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 21 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $5 + local.get $5 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - tee_local $3 + local.tee $3 i32.const 4 i32.add - tee_local $0 + local.tee $0 i32.const 2 i32.add - get_local $0 + local.get $0 i32.const 0 - get_local $2 + local.get $2 i32.sub i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $3 + local.get $3 i32.const 46 i32.store16 offset=4 - get_local $1 + local.get $1 i32.const 1 i32.add else i32.const -6 - get_local $5 + local.get $5 i32.lt_s - tee_local $3 + local.tee $3 if - get_local $5 + local.get $5 i32.const 0 i32.le_s - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $2 + local.tee $2 i32.const 2 - get_local $5 + local.get $5 i32.sub - tee_local $3 + local.tee $3 i32.const 1 i32.shl i32.add - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 1 i32.shl call $~lib/internal/memory/memmove - get_local $0 + local.get $0 i32.const 3014704 i32.store offset=4 i32.const 2 - set_local $4 + local.set $4 loop $repeat|1 block $break|1 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.ge_s br_if $break|1 - get_local $4 + local.get $4 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 48 i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|1 end end - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add else - get_local $1 + local.get $1 i32.const 1 i32.eq if (result i32) - get_local $0 + local.get $0 i32.const 101 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 block (result i32) - get_local $5 + local.get $5 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s - tee_local $2 + local.tee $2 if i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $4 + local.set $4 end - get_local $4 + local.get $4 end - get_local $4 + local.get $4 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - tee_local $4 + local.tee $4 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 i32.const 45 i32.const 43 - get_local $2 + local.get $2 select i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 2 i32.add else - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 i32.const 4 i32.add - get_local $3 + local.get $3 i32.const 2 i32.add - get_local $1 + local.get $1 i32.const 1 i32.shl - tee_local $4 + local.tee $4 i32.const 2 i32.sub call $~lib/internal/memory/memmove - get_local $0 + local.get $0 i32.const 46 i32.store16 offset=6 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.add - tee_local $0 + local.tee $0 i32.const 101 i32.store16 offset=6 - get_local $0 + local.get $0 i32.const 4 i32.add - tee_local $3 + local.tee $3 block (result i32) - get_local $5 + local.get $5 i32.const 1 i32.sub - tee_local $4 + local.tee $4 i32.const 0 i32.lt_s - tee_local $2 + local.tee $2 if i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $4 + local.set $4 end - get_local $4 + local.get $4 end - get_local $4 + local.get $4 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - tee_local $0 + local.tee $0 call $~lib/internal/number/utoa32_lut - get_local $3 + local.get $3 i32.const 45 i32.const 43 - get_local $2 + local.get $2 select i32.store16 offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 2 i32.add @@ -4940,166 +4940,166 @@ (local $13 i32) (local $14 i32) (local $15 i64) - get_local $1 + local.get $1 f64.const 0 f64.lt - tee_local $13 + local.tee $13 if (result f64) - get_local $0 + local.get $0 i32.const 45 i32.store16 offset=4 - get_local $1 + local.get $1 f64.neg else - get_local $1 + local.get $1 end - i64.reinterpret/f64 - tee_local $2 + i64.reinterpret_f64 + local.tee $2 i64.const 9218868437227405312 i64.and i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $8 - get_local $2 + i32.wrap_i64 + local.set $8 + local.get $2 i64.const 4503599627370495 i64.and - get_local $8 + local.get $8 i32.const 0 i32.ne - tee_local $6 - i64.extend_u/i32 + local.tee $6 + i64.extend_i32_u i64.const 52 i64.shl i64.add - set_local $2 - get_local $8 + local.set $2 + local.get $8 i32.const 1 - get_local $6 + local.get $6 select i32.const 1075 i32.sub - tee_local $8 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $2 + local.set $6 + local.get $2 i64.const 1 i64.shl i64.const 1 i64.add - tee_local $5 + local.tee $5 i64.clz - i32.wrap/i64 - set_local $4 - get_local $5 - get_local $4 - i64.extend_s/i32 + i32.wrap_i64 + local.set $4 + local.get $5 + local.get $4 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_plus - get_local $2 - get_local $2 + global.set $~lib/internal/number/_frc_plus + local.get $2 + local.get $2 i64.const 4503599627370496 i64.eq i32.const 1 i32.add - tee_local $14 - i64.extend_s/i32 + local.tee $14 + i64.extend_i32_s i64.shl i64.const 1 i64.sub - get_local $8 - get_local $14 + local.get $8 + local.get $14 i32.sub - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.sub - tee_local $6 + local.tee $6 i32.sub - i64.extend_s/i32 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_minus - get_local $6 - set_global $~lib/internal/number/_exp + global.set $~lib/internal/number/_frc_minus + local.get $6 + global.set $~lib/internal/number/_exp i32.const 348 i32.const -61 - get_global $~lib/internal/number/_exp + global.get $~lib/internal/number/_exp i32.sub - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.30102999566398114 f64.mul f64.const 347 f64.add - tee_local $1 - i32.trunc_s/f64 - tee_local $4 - get_local $4 - f64.convert_s/i32 - get_local $1 + local.tee $1 + i32.trunc_f64_s + local.tee $4 + local.get $4 + f64.convert_i32_s + local.get $1 f64.ne i32.add i32.const 3 i32.shr_s i32.const 1 i32.add - tee_local $6 + local.tee $6 i32.const 3 i32.shl i32.sub - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K i32.const 4552 i32.load - set_local $4 + local.set $4 i32.const 4288 i32.load - get_local $6 + local.get $6 i32.const 3 i32.shl i32.add i64.load offset=8 - set_global $~lib/internal/number/_frc_pow - get_local $4 - get_local $6 + global.set $~lib/internal/number/_frc_pow + local.get $4 + local.get $6 i32.const 1 i32.shl i32.add i32.load16_s offset=8 - set_global $~lib/internal/number/_exp_pow - get_local $2 - get_local $2 + global.set $~lib/internal/number/_exp_pow + local.get $2 + local.get $2 i64.clz - i32.wrap/i64 - tee_local $4 - i64.extend_s/i32 + i32.wrap_i64 + local.tee $4 + i64.extend_i32_s i64.shl - tee_local $2 + local.tee $2 i64.const 4294967295 i64.and - tee_local $7 - get_global $~lib/internal/number/_frc_pow - tee_local $5 + local.tee $7 + global.get $~lib/internal/number/_frc_pow + local.tee $5 i64.const 4294967295 i64.and - tee_local $9 + local.tee $9 i64.mul - set_local $10 - get_local $5 + local.set $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $11 - get_local $7 + local.tee $11 + local.get $7 i64.mul - get_local $2 + local.get $2 i64.const 32 i64.shr_u - tee_local $12 - get_local $9 + local.tee $12 + local.get $9 i64.mul - get_local $10 + local.get $10 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add @@ -5107,43 +5107,43 @@ i64.add i64.const 32 i64.shr_u - get_local $11 - get_local $12 + local.get $11 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add i64.add - set_local $2 - get_local $5 + local.set $2 + local.get $5 i64.const 4294967295 i64.and - tee_local $11 - get_global $~lib/internal/number/_frc_plus - tee_local $3 + local.tee $11 + global.get $~lib/internal/number/_frc_plus + local.tee $3 i64.const 4294967295 i64.and - tee_local $10 + local.tee $10 i64.mul - set_local $7 - get_local $10 - get_local $5 + local.set $7 + local.get $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $9 + local.tee $9 i64.mul - get_local $11 - get_local $3 + local.get $11 + local.get $3 i64.const 32 i64.shr_u - tee_local $12 + local.tee $12 i64.mul - get_local $7 + local.get $7 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add @@ -5151,59 +5151,59 @@ i64.add i64.const 32 i64.shr_u - get_local $9 - get_local $12 + local.get $9 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add i64.add - set_local $15 - get_global $~lib/internal/number/_frc_minus - tee_local $3 + local.set $15 + global.get $~lib/internal/number/_frc_minus + local.tee $3 i64.const 4294967295 i64.and - tee_local $7 - get_local $5 + local.tee $7 + local.get $5 i64.const 4294967295 i64.and - tee_local $9 + local.tee $9 i64.mul - set_local $10 - get_local $5 + local.set $10 + local.get $5 i64.const 32 i64.shr_u - tee_local $11 - get_local $7 + local.tee $11 + local.get $7 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u - tee_local $12 - get_local $9 + local.tee $12 + local.get $9 i64.mul - get_local $10 + local.get $10 i64.const 32 i64.shr_u i64.add - tee_local $3 + local.tee $3 i64.const 4294967295 i64.and i64.add - set_local $5 - get_local $15 + local.set $5 + local.get $15 i64.const 1 i64.sub - tee_local $7 - get_local $11 - get_local $12 + local.tee $7 + local.get $11 + local.get $12 i64.mul - get_local $3 + local.get $3 i64.const 32 i64.shr_u i64.add - get_local $5 + local.get $5 i64.const 2147483647 i64.add i64.const 32 @@ -5212,43 +5212,43 @@ i64.const 1 i64.add i64.sub - set_local $3 - get_local $13 + local.set $3 + local.get $13 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add - get_local $0 - get_local $2 - get_local $8 - get_local $4 + local.get $0 + local.get $2 + local.get $8 + local.get $4 i32.sub - get_global $~lib/internal/number/_exp_pow - tee_local $4 + global.get $~lib/internal/number/_exp_pow + local.tee $4 i32.add i32.const -64 i32.sub - get_local $7 - get_local $4 - get_global $~lib/internal/number/_exp + local.get $7 + local.get $4 + global.get $~lib/internal/number/_exp i32.add i32.const -64 i32.sub - get_local $3 - get_local $13 + local.get $3 + local.get $13 call $~lib/internal/number/genDigits - get_local $13 + local.get $13 i32.sub - get_global $~lib/internal/number/_K + global.get $~lib/internal/number/_K call $~lib/internal/number/prettify - get_local $13 + local.get $13 i32.add ) (func $~lib/string/String#substring (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -5258,92 +5258,92 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 - get_local $1 + local.get $1 i32.const 0 i32.gt_s select - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.lt_s select - set_local $1 + local.set $1 i32.const 0 - get_local $3 + local.get $3 i32.const 0 - get_local $3 + local.get $3 i32.lt_s select - tee_local $2 - get_local $1 - get_local $2 - get_local $1 + local.tee $2 + local.get $1 + local.get $2 + local.get $1 i32.lt_s select - set_local $4 - get_local $2 - get_local $1 - get_local $2 - get_local $1 + local.set $4 + local.get $2 + local.get $1 + local.get $2 + local.get $1 i32.gt_s select - tee_local $1 - get_local $4 + local.tee $1 + local.get $4 i32.sub - tee_local $3 + local.tee $3 i32.eqz if i32.const 256 return end - get_local $4 + local.get $4 i32.eqz - tee_local $2 + local.tee $2 if (result i32) - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.eq else - get_local $2 + local.get $2 end if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 0 - get_local $0 - get_local $4 - get_local $3 + local.get $0 + local.get $4 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $2 + local.get $2 ) (func $~lib/internal/number/dtoa (; 54 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 f64.const 0 f64.eq if i32.const 3184 return end - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.ne if - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne if i32.const 3200 @@ -5351,7 +5351,7 @@ end i32.const 3216 i32.const 3240 - get_local $0 + local.get $0 f64.const 0 f64.lt select @@ -5359,15 +5359,15 @@ end i32.const 28 call $~lib/internal/string/allocateUnsafe - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 call $~lib/internal/number/dtoa_core - set_local $1 - get_local $2 - get_local $1 + local.set $1 + local.get $2 + local.get $1 call $~lib/string/String#substring - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.eqz if i32.const 0 @@ -5377,16 +5377,16 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 ) (func $start (; 55 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 5880 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $std/string/str + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $std/string/str i32.const 8 i32.ne if @@ -5397,7 +5397,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.load i32.const 16 i32.ne @@ -5409,7 +5409,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str call $~lib/string/String#charCodeAt i32.const 104 i32.ne @@ -5497,7 +5497,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str call $~lib/string/String#startsWith i32.eqz if @@ -5509,13 +5509,13 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str - set_local $1 + global.set $~argc + global.get $std/string/str + local.set $1 block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -5523,11 +5523,11 @@ unreachable end i32.const 536870910 - set_local $0 + local.set $0 end - get_local $1 + local.get $1 i32.const 216 - get_local $0 + local.get $0 call $~lib/string/String#endsWith i32.eqz if @@ -5538,7 +5538,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 232 i32.const 0 call $~lib/string/String#indexOf @@ -5553,11 +5553,11 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 0 call $~lib/string/String#padStart|trampoline - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -5569,11 +5569,11 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 15 call $~lib/string/String#padStart|trampoline - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -5585,7 +5585,7 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 3 call $~lib/string/String#padStart|trampoline @@ -5631,7 +5631,7 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 288 i32.const 5 call $~lib/string/String#padStart|trampoline @@ -5677,11 +5677,11 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 0 call $~lib/string/String#padEnd|trampoline - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -5693,11 +5693,11 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 15 call $~lib/string/String#padEnd|trampoline - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -5709,7 +5709,7 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 3 call $~lib/string/String#padEnd|trampoline @@ -5755,7 +5755,7 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 288 i32.const 5 call $~lib/string/String#padEnd|trampoline @@ -5838,9 +5838,9 @@ call $~lib/env/abort unreachable end - get_global $std/string/str - tee_local $0 - get_local $0 + global.get $std/string/str + local.tee $0 + local.get $0 i32.const 0 call $~lib/string/String#indexOf if @@ -5851,7 +5851,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 256 i32.const 0 call $~lib/string/String#indexOf @@ -5863,7 +5863,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 0 call $~lib/string/String#indexOf @@ -5877,7 +5877,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 440 i32.const 0 call $~lib/string/String#indexOf @@ -5891,7 +5891,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 2 call $~lib/string/String#indexOf @@ -5905,7 +5905,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 3 call $~lib/string/String#indexOf @@ -5919,7 +5919,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 448 i32.const -1 call $~lib/string/String#indexOf @@ -5934,7 +5934,7 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 256 call $~lib/string/String#lastIndexOf|trampoline @@ -5947,7 +5947,7 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 192 call $~lib/string/String#lastIndexOf|trampoline @@ -5962,11 +5962,11 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 256 call $~lib/string/String#lastIndexOf|trampoline - get_global $std/string/str + global.get $std/string/str i32.load i32.ne if @@ -5978,8 +5978,8 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 432 call $~lib/string/String#lastIndexOf|trampoline i32.const 2 @@ -5993,8 +5993,8 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 440 call $~lib/string/String#lastIndexOf|trampoline i32.const -1 @@ -6008,8 +6008,8 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 464 call $~lib/string/String#lastIndexOf|trampoline i32.const 15 @@ -6022,7 +6022,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 2 call $~lib/string/String#lastIndexOf @@ -6036,7 +6036,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 3 call $~lib/string/String#lastIndexOf @@ -6050,7 +6050,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 448 i32.const -1 call $~lib/string/String#lastIndexOf @@ -6064,7 +6064,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 472 i32.const 0 call $~lib/string/String#lastIndexOf @@ -6078,7 +6078,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 192 i32.const 0 call $~lib/string/String#lastIndexOf @@ -6249,8 +6249,8 @@ i32.const 280 i32.const 648 call $~lib/string/String.__concat - set_global $std/string/c - get_global $std/string/c + global.set $std/string/c + global.get $std/string/c i32.const 656 call $~lib/string/String.__eq i32.eqz @@ -6262,7 +6262,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/c + global.get $std/string/c i32.const 280 call $~lib/string/String.__ne i32.eqz @@ -6287,7 +6287,7 @@ unreachable end i32.const 256 - get_global $std/string/nullStr + global.get $std/string/nullStr call $~lib/string/String.__ne i32.eqz if @@ -6298,7 +6298,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/nullStr + global.get $std/string/nullStr i32.const 256 call $~lib/string/String.__ne i32.eqz @@ -6478,7 +6478,7 @@ unreachable end i32.const 648 - get_global $std/string/nullStr + global.get $std/string/nullStr call $~lib/string/String.__lt if i32.const 0 @@ -6488,7 +6488,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/nullStr + global.get $std/string/nullStr i32.const 648 call $~lib/string/String.__lt if @@ -6615,15 +6615,15 @@ end i32.const 65377 call $~lib/string/String.fromCodePoint - set_global $std/string/a + 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 - set_global $std/string/b - get_global $std/string/a - get_global $std/string/b + global.set $std/string/b + global.get $std/string/a + global.get $std/string/b call $~lib/string/String.__gt i32.eqz if @@ -6773,10 +6773,10 @@ unreachable end i32.const 976 - set_global $std/string/str + global.set $std/string/str i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 0 call $~lib/string/String#slice|trampoline i32.const 976 @@ -6791,8 +6791,8 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const -1 call $~lib/string/String#slice|trampoline i32.const 1008 @@ -6807,8 +6807,8 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const -5 call $~lib/string/String#slice|trampoline i32.const 1016 @@ -6822,7 +6822,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 2 i32.const 7 call $~lib/string/String#slice @@ -6837,7 +6837,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const -11 i32.const -6 call $~lib/string/String#slice @@ -6852,7 +6852,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 4 i32.const 3 call $~lib/string/String#slice @@ -6867,7 +6867,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 0 i32.const -1 call $~lib/string/String#slice @@ -6883,27 +6883,27 @@ unreachable end i32.const 0 - set_global $~argc + global.set $~argc i32.const 256 i32.const 0 call $~lib/string/String#split|trampoline - set_global $std/string/sa - get_global $std/string/sa + global.set $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -6911,7 +6911,7 @@ i32.const 256 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -6923,12 +6923,12 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 256 call $~lib/string/String#split|trampoline - set_global $std/string/sa - get_global $std/string/sa + global.set $std/string/sa + global.get $std/string/sa i32.load offset=4 if i32.const 0 @@ -6939,27 +6939,27 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 432 call $~lib/string/String#split|trampoline - set_global $std/string/sa - get_global $std/string/sa + global.set $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -6967,7 +6967,7 @@ i32.const 256 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -6979,27 +6979,27 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 1192 i32.const 1208 call $~lib/string/String#split|trampoline - set_global $std/string/sa - get_global $std/string/sa + global.set $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -7007,7 +7007,7 @@ i32.const 1192 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7019,50 +7019,50 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 1192 i32.const 432 call $~lib/string/String#split|trampoline - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 3 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7071,21 +7071,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7095,7 +7095,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7107,50 +7107,50 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 1224 i32.const 1248 call $~lib/string/String#split|trampoline - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 3 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7159,21 +7159,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7183,7 +7183,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7195,51 +7195,51 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 1256 i32.const 432 call $~lib/string/String#split|trampoline - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 4 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7248,21 +7248,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7271,21 +7271,21 @@ end i32.const 256 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 3 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 12 i32.add i32.load offset=8 @@ -7295,7 +7295,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7307,51 +7307,51 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 1272 i32.const 432 call $~lib/string/String#split|trampoline - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 4 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 256 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7360,21 +7360,21 @@ end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7383,21 +7383,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 3 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 12 i32.add i32.load offset=8 @@ -7407,7 +7407,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7419,51 +7419,51 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 1288 i32.const 432 call $~lib/string/String#split|trampoline - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 4 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7472,21 +7472,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7495,21 +7495,21 @@ end i32.const 1216 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 3 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 12 i32.add i32.load offset=8 @@ -7519,7 +7519,7 @@ i32.const 256 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7531,50 +7531,50 @@ unreachable end i32.const 1 - set_global $~argc + global.set $~argc i32.const 288 i32.const 256 call $~lib/string/String#split|trampoline - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 3 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7583,21 +7583,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7607,7 +7607,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7622,8 +7622,8 @@ i32.const 256 i32.const 0 call $~lib/string/String#split - set_global $std/string/sa - get_global $std/string/sa + global.set $std/string/sa + global.get $std/string/sa i32.load offset=4 if i32.const 0 @@ -7637,23 +7637,23 @@ i32.const 256 i32.const 1 call $~lib/string/String#split - set_global $std/string/sa - get_global $std/string/sa + global.set $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -7661,7 +7661,7 @@ i32.const 280 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7676,23 +7676,23 @@ i32.const 432 i32.const 1 call $~lib/string/String#split - set_global $std/string/sa - get_global $std/string/sa + global.set $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 1 i32.eq - tee_local $0 + local.tee $0 if (result i32) i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable @@ -7700,7 +7700,7 @@ i32.const 280 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7715,46 +7715,46 @@ i32.const 256 i32.const 4 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 3 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7763,21 +7763,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7787,7 +7787,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7802,46 +7802,46 @@ i32.const 256 i32.const -1 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 3 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7850,21 +7850,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7874,7 +7874,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if @@ -7889,46 +7889,46 @@ i32.const 432 i32.const -1 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block (result i32) block (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.load offset=4 i32.const 3 i32.eq - tee_local $0 + local.tee $0 if i32.const 0 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.load offset=8 else unreachable end i32.const 280 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if i32.const 1 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add i32.load offset=8 @@ -7937,21 +7937,21 @@ end i32.const 648 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) i32.const 2 - get_global $std/string/sa + global.get $std/string/sa i32.load - tee_local $0 + local.tee $0 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $0 + local.get $0 i32.const 8 i32.add i32.load offset=8 @@ -7961,7 +7961,7 @@ i32.const 1216 call $~lib/string/String.__eq else - get_local $0 + local.get $0 end i32.eqz if diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 36a22c86..452a7da7 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -176,7 +176,7 @@ (data (i32.const 5800) "\08\00\00\001\00.\001\00e\00+\001\002\008\00") (data (i32.const 5824) "\07\00\00\001\00.\001\00e\00-\006\004\00") (data (i32.const 5848) "\0b\00\00\000\00.\000\000\000\000\003\005\006\008\009\00") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -246,7 +246,7 @@ (export "getString" (func $std/string/getString)) (start $start) (func $~lib/string/String#charCodeAt (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -258,16 +258,16 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load i32.ge_u if i32.const -1 return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add @@ -280,41 +280,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -324,22 +324,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -348,23 +348,23 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/string/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if (result i32) - get_local $0 - get_global $~lib/internal/string/MAX_LENGTH + local.get $0 + global.get $~lib/internal/string/MAX_LENGTH i32.le_s else - get_local $1 + local.get $1 end i32.eqz if @@ -376,103 +376,103 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_global $~lib/internal/string/HEADER_SIZE - get_local $0 + global.get $~lib/internal/string/HEADER_SIZE + local.get $0 i32.const 1 i32.shl i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $2 - get_local $2 - get_local $0 + local.set $2 + local.get $2 + local.get $0 i32.store - get_local $2 + local.get $2 ) (func $~lib/string/String.fromCharCode (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store16 offset=4 - get_local $1 + local.get $1 ) (func $~lib/internal/string/compareUnsafe (; 5 ;) (type $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 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_local $3 + local.set $6 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|0 loop $continue|0 - get_local $4 + local.get $4 if (result i32) - get_local $6 + local.get $6 i32.load16_u offset=4 - get_local $7 + local.get $7 i32.load16_u offset=4 i32.sub - tee_local $5 + local.tee $5 i32.eqz else - get_local $4 + local.get $4 end if block - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2 i32.add - set_local $6 - get_local $7 + local.set $6 + local.get $7 i32.const 2 i32.add - set_local $7 + local.set $7 end br $continue|0 end end end - get_local $5 + local.get $5 ) (func $~lib/string/String.__eq (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -480,22 +480,22 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) @@ -504,7 +504,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.const 1114111 i32.le_u i32.eqz @@ -516,47 +516,47 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 65535 i32.gt_s - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.add call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.eqz if - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.store16 offset=4 else - get_local $0 + local.get $0 i32.const 65536 i32.sub - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 10 i32.shr_u i32.const 55296 i32.add - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 1023 i32.and i32.const 56320 i32.add - set_local $4 - get_local $2 - get_local $3 + local.set $4 + local.get $2 + local.get $3 i32.const 16 i32.shl - get_local $4 + local.get $4 i32.or i32.store offset=4 end - get_local $2 + local.get $2 ) (func $~lib/string/String#startsWith (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -565,7 +565,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -577,51 +577,51 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 200 - set_local $1 + local.set $1 end - get_local $2 - set_local $3 - get_local $0 + local.get $2 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $3 - tee_local $5 + local.set $4 + local.get $3 + local.tee $5 i32.const 0 - tee_local $6 - get_local $5 - get_local $6 + local.tee $6 + local.get $5 + local.get $6 i32.gt_s select - tee_local $5 - get_local $4 - tee_local $6 - get_local $5 - get_local $6 + local.tee $5 + local.get $4 + local.tee $6 + local.get $5 + local.get $6 i32.lt_s select - set_local $7 - get_local $1 + local.set $7 + local.get $1 i32.load - set_local $8 - get_local $8 - get_local $7 + local.set $8 + local.get $8 + local.get $7 i32.add - get_local $4 + local.get $4 i32.gt_s if i32.const 0 return end - get_local $0 - get_local $7 - get_local $1 + local.get $0 + local.get $7 + local.get $1 i32.const 0 - get_local $8 + local.get $8 call $~lib/internal/string/compareUnsafe i32.eqz ) @@ -631,7 +631,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -643,49 +643,49 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 0 return end - get_local $2 - tee_local $3 + local.get $2 + local.tee $3 i32.const 0 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - tee_local $3 - get_local $0 + local.tee $3 + local.get $0 i32.load - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - set_local $5 - get_local $1 + local.set $5 + local.get $1 i32.load - set_local $6 - get_local $5 - get_local $6 + local.set $6 + local.get $5 + local.get $6 i32.sub - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.const 0 i32.lt_s if i32.const 0 return end - get_local $0 - get_local $7 - get_local $1 + local.get $0 + local.get $7 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/compareUnsafe i32.eqz ) @@ -693,19 +693,19 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange end unreachable end - get_global $~lib/internal/string/MAX_LENGTH - set_local $2 + global.get $~lib/internal/string/MAX_LENGTH + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#endsWith ) (func $~lib/string/String#indexOf (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -714,7 +714,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -726,75 +726,75 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 200 - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.eqz if i32.const -1 return end - get_local $2 - tee_local $5 + local.get $2 + local.tee $5 i32.const 0 - tee_local $6 - get_local $5 - get_local $6 + local.tee $6 + local.get $5 + local.get $6 i32.gt_s select - tee_local $5 - get_local $4 - tee_local $6 - get_local $5 - get_local $6 + local.tee $5 + local.get $4 + local.tee $6 + local.get $5 + local.get $6 i32.lt_s select - set_local $7 - get_local $4 - get_local $3 + local.set $7 + local.get $4 + local.get $3 i32.sub - set_local $4 + local.set $4 block $break|0 - get_local $7 - set_local $5 + local.get $7 + local.set $5 loop $repeat|0 - get_local $5 - get_local $4 + local.get $5 + local.get $4 i32.le_s i32.eqz br_if $break|0 - get_local $0 - get_local $5 - get_local $1 + local.get $0 + local.get $5 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz if - get_local $5 + local.get $5 return end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -808,44 +808,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -853,141 +853,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -995,167 +995,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -1167,130 +1167,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -1302,112 +1302,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -1419,585 +1419,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -2005,77 +2005,77 @@ ) (func $~lib/internal/memory/memmove (; 13 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -2086,27 +2086,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -2115,67 +2115,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2186,20 +2186,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -2211,16 +2211,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2239,9 +2239,9 @@ (local $9 i64) (local $10 i32) (local $11 i32) - get_local $2 + local.get $2 i32.load - set_local $4 + local.set $4 block $break|0 block $case5|0 block $case4|0 @@ -2249,25 +2249,25 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $4 - set_local $5 - get_local $5 + local.get $4 + local.set $5 + local.get $5 i32.const 0 i32.eq br_if $case0|0 - get_local $5 + local.get $5 i32.const 1 i32.eq br_if $case1|0 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case2|0 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case3|0 - get_local $5 + local.get $5 i32.const 4 i32.eq br_if $case4|0 @@ -2276,35 +2276,35 @@ br $break|0 end block - get_local $2 + local.get $2 i32.load16_u offset=4 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 + local.set $6 block $break|1 i32.const 0 - set_local $7 + local.set $7 loop $repeat|1 - get_local $7 - get_local $3 + local.get $7 + local.get $3 i32.lt_s i32.eqz br_if $break|1 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store16 offset=4 - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|1 unreachable end @@ -2316,35 +2316,35 @@ unreachable end block - get_local $2 + local.get $2 i32.load offset=4 - set_local $6 - get_local $0 - get_local $1 + local.set $6 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $5 + local.set $5 block $break|2 i32.const 0 - set_local $7 + local.set $7 loop $repeat|2 - get_local $7 - get_local $3 + local.get $7 + local.get $3 i32.lt_s i32.eqz br_if $break|2 - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.store offset=4 - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|2 unreachable end @@ -2356,47 +2356,47 @@ unreachable end block - get_local $2 + local.get $2 i32.load offset=4 - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.load16_u offset=8 - set_local $6 - get_local $0 - get_local $1 + local.set $6 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|3 i32.const 0 - set_local $8 + local.set $8 loop $repeat|3 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.lt_s i32.eqz br_if $break|3 block - get_local $7 - get_local $8 + local.get $7 + local.get $8 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.store offset=4 - get_local $7 - get_local $8 + local.get $7 + local.get $8 i32.const 1 i32.shl i32.add - get_local $6 + local.get $6 i32.store16 offset=8 end - get_local $8 + local.get $8 i32.const 1 i32.add - set_local $8 + local.set $8 br $repeat|3 unreachable end @@ -2408,35 +2408,35 @@ unreachable end block - get_local $2 + local.get $2 i64.load offset=4 - set_local $9 - get_local $0 - get_local $1 + local.set $9 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|4 i32.const 0 - set_local $6 + local.set $6 loop $repeat|4 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|4 - get_local $7 - get_local $6 + local.get $7 + local.get $6 i32.const 3 i32.shl i32.add - get_local $9 + local.get $9 i64.store offset=4 - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|4 unreachable end @@ -2448,51 +2448,51 @@ unreachable end block - get_local $4 + local.get $4 i32.const 1 i32.shl - set_local $7 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - get_local $1 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_global $~lib/internal/string/HEADER_SIZE + local.set $6 + local.get $2 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $5 + local.set $5 block $break|5 block i32.const 0 - set_local $8 - get_local $7 - get_local $3 + local.set $8 + local.get $7 + local.get $3 i32.mul - set_local $10 + local.set $10 end loop $repeat|5 - get_local $8 - get_local $10 + local.get $8 + local.get $10 i32.lt_s i32.eqz br_if $break|5 block - get_local $6 - get_local $8 + local.get $6 + local.get $8 i32.add - set_local $11 - get_local $11 - get_local $5 - get_local $7 + local.set $11 + local.get $11 + local.get $5 + local.get $7 call $~lib/internal/memory/memmove end - get_local $8 - get_local $7 + local.get $8 + local.get $7 i32.add - set_local $8 + local.set $8 br $repeat|5 unreachable end @@ -2508,29 +2508,29 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $5 - get_local $2 - get_local $3 + local.set $5 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.shl - set_local $7 - get_local $5 - get_local $6 - get_local $7 + local.set $7 + local.get $5 + local.get $6 + local.get $7 call $~lib/internal/memory/memmove ) (func $~lib/string/String#padStart (; 16 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -2541,7 +2541,7 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -2553,89 +2553,89 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.load - set_local $4 - get_local $1 - get_local $3 + local.set $4 + local.get $1 + local.get $3 i32.lt_s - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $4 + local.get $4 i32.eqz end if - get_local $0 + local.get $0 return end - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.sub - set_local $6 - get_local $1 + local.set $6 + local.get $1 call $~lib/internal/string/allocateUnsafe - set_local $7 - get_local $6 - get_local $4 + local.set $7 + local.get $6 + local.get $4 i32.gt_s if - get_local $6 + local.get $6 i32.const 1 i32.sub - get_local $4 + local.get $4 i32.div_s - set_local $5 - get_local $5 - get_local $4 + local.set $5 + local.get $5 + local.get $4 i32.mul - set_local $8 - get_local $6 - get_local $8 + local.set $8 + local.get $6 + local.get $8 i32.sub - set_local $9 - get_local $7 + local.set $9 + local.get $7 i32.const 0 - get_local $2 - get_local $5 + local.get $2 + local.get $5 call $~lib/internal/string/repeatUnsafe - get_local $9 + local.get $9 if - get_local $7 - get_local $8 - get_local $2 + local.get $7 + local.get $8 + local.get $2 i32.const 0 - get_local $9 + local.get $9 call $~lib/internal/string/copyUnsafe end else - get_local $7 + local.get $7 i32.const 0 - get_local $2 + local.get $2 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe end - get_local $3 + local.get $3 if - get_local $7 - get_local $6 - get_local $0 + local.get $7 + local.get $6 + local.get $0 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe end - get_local $7 + local.get $7 ) (func $~lib/string/String#padStart|trampoline (; 17 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -2643,11 +2643,11 @@ unreachable end i32.const 248 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#padStart ) (func $~lib/string/String#padEnd (; 18 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -2658,7 +2658,7 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -2670,91 +2670,91 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.load - set_local $4 - get_local $1 - get_local $3 + local.set $4 + local.get $1 + local.get $3 i32.lt_s - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else - get_local $4 + local.get $4 i32.eqz end if - get_local $0 + local.get $0 return end - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.sub - set_local $6 - get_local $1 + local.set $6 + local.get $1 call $~lib/internal/string/allocateUnsafe - set_local $7 - get_local $3 + local.set $7 + local.get $3 if - get_local $7 + local.get $7 i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe end - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.gt_s if - get_local $6 + local.get $6 i32.const 1 i32.sub - get_local $4 + local.get $4 i32.div_s - set_local $5 - get_local $5 - get_local $4 + local.set $5 + local.get $5 + local.get $4 i32.mul - set_local $8 - get_local $6 - get_local $8 + local.set $8 + local.get $6 + local.get $8 i32.sub - set_local $9 - get_local $7 - get_local $3 - get_local $2 - get_local $5 + local.set $9 + local.get $7 + local.get $3 + local.get $2 + local.get $5 call $~lib/internal/string/repeatUnsafe - get_local $9 + local.get $9 if - get_local $7 - get_local $8 - get_local $3 + local.get $7 + local.get $8 + local.get $3 i32.add - get_local $2 + local.get $2 i32.const 0 - get_local $9 + local.get $9 call $~lib/internal/string/copyUnsafe end else - get_local $7 - get_local $3 - get_local $2 + local.get $7 + local.get $3 + local.get $2 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/copyUnsafe end - get_local $7 + local.get $7 ) (func $~lib/string/String#padEnd|trampoline (; 19 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange @@ -2762,11 +2762,11 @@ unreachable end i32.const 248 - set_local $2 + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#padEnd ) (func $~lib/string/String#lastIndexOf (; 20 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -2775,7 +2775,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -2787,73 +2787,73 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 200 - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.load - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.eqz if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.eqz if i32.const -1 return end - get_local $2 - tee_local $5 + local.get $2 + local.tee $5 i32.const 0 - tee_local $6 - get_local $5 - get_local $6 + local.tee $6 + local.get $5 + local.get $6 i32.gt_s select - tee_local $5 - get_local $3 - get_local $4 + local.tee $5 + local.get $3 + local.get $4 i32.sub - tee_local $6 - get_local $5 - get_local $6 + local.tee $6 + local.get $5 + local.get $6 i32.lt_s select - set_local $7 + local.set $7 block $break|0 - get_local $7 - set_local $5 + local.get $7 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 - get_local $0 - get_local $5 - get_local $1 + local.get $0 + local.get $5 + local.get $1 i32.const 0 - get_local $4 + local.get $4 call $~lib/internal/string/compareUnsafe i32.eqz if - get_local $5 + local.get $5 return end - get_local $5 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -2865,23 +2865,23 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange end unreachable end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $2 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#lastIndexOf ) (func $std/string/getString (; 22 ;) (type $i) (result i32) - get_global $std/string/str + global.get $std/string/str ) (func $~lib/internal/string/parse (; 23 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) @@ -2890,81 +2890,81 @@ (local $5 f64) (local $6 i32) (local $7 f64) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $0 - set_local $3 - get_local $3 + local.get $0 + local.set $3 + local.get $3 i32.load16_u offset=4 - set_local $4 - get_local $4 - get_global $~lib/internal/string/CharCode.MINUS + local.set $4 + local.get $4 + global.get $~lib/internal/string/CharCode.MINUS i32.eq if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $3 + local.get $3 i32.const 2 i32.add - tee_local $3 + local.tee $3 i32.load16_u offset=4 - set_local $4 + local.set $4 f64.const -1 - set_local $5 + local.set $5 else - get_local $4 - get_global $~lib/internal/string/CharCode.PLUS + local.get $4 + global.get $~lib/internal/string/CharCode.PLUS i32.eq if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $3 + local.get $3 i32.const 2 i32.add - tee_local $3 + local.tee $3 i32.load16_u offset=4 - set_local $4 + local.set $4 f64.const 1 - set_local $5 + local.set $5 else f64.const 1 - set_local $5 + local.set $5 end end - get_local $1 + local.get $1 i32.eqz if - get_local $4 - get_global $~lib/internal/string/CharCode._0 + local.get $4 + global.get $~lib/internal/string/CharCode._0 i32.eq - tee_local $6 + local.tee $6 if (result i32) - get_local $2 + local.get $2 i32.const 2 i32.gt_s else - get_local $6 + local.get $6 end if block $break|0 @@ -2975,49 +2975,49 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $3 + local.get $3 i32.const 2 i32.add i32.load16_u offset=4 - set_local $6 - get_local $6 - get_global $~lib/internal/string/CharCode.B + local.set $6 + local.get $6 + global.get $~lib/internal/string/CharCode.B i32.eq br_if $case0|0 - get_local $6 - get_global $~lib/internal/string/CharCode.b + local.get $6 + global.get $~lib/internal/string/CharCode.b i32.eq br_if $case1|0 - get_local $6 - get_global $~lib/internal/string/CharCode.O + local.get $6 + global.get $~lib/internal/string/CharCode.O i32.eq br_if $case2|0 - get_local $6 - get_global $~lib/internal/string/CharCode.o + local.get $6 + global.get $~lib/internal/string/CharCode.o i32.eq br_if $case3|0 - get_local $6 - get_global $~lib/internal/string/CharCode.X + local.get $6 + global.get $~lib/internal/string/CharCode.X i32.eq br_if $case4|0 - get_local $6 - get_global $~lib/internal/string/CharCode.x + local.get $6 + global.get $~lib/internal/string/CharCode.x i32.eq br_if $case5|0 br $case6|0 end end block - get_local $3 + local.get $3 i32.const 4 i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 i32.const 2 - set_local $1 + local.set $1 br $break|0 unreachable end @@ -3025,16 +3025,16 @@ end end block - get_local $3 + local.get $3 i32.const 4 i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 i32.const 8 - set_local $1 + local.set $1 br $break|0 unreachable end @@ -3042,37 +3042,37 @@ end end block - get_local $3 + local.get $3 i32.const 4 i32.add - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 i32.const 16 - set_local $1 + local.set $1 br $break|0 unreachable end unreachable end i32.const 10 - set_local $1 + local.set $1 end else i32.const 10 - set_local $1 + local.set $1 end else - get_local $1 + local.get $1 i32.const 2 i32.lt_s - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $1 + local.get $1 i32.const 36 i32.gt_s end @@ -3082,111 +3082,111 @@ end end f64.const 0 - set_local $7 + local.set $7 block $break|1 loop $continue|1 block (result i32) - get_local $2 - tee_local $6 + local.get $2 + local.tee $6 i32.const 1 i32.sub - set_local $2 - get_local $6 + local.set $2 + local.get $6 end if block - get_local $3 + local.get $3 i32.load16_u offset=4 - set_local $4 - get_local $4 - get_global $~lib/internal/string/CharCode._0 + local.set $4 + local.get $4 + global.get $~lib/internal/string/CharCode._0 i32.ge_s - tee_local $6 + local.tee $6 if (result i32) - get_local $4 - get_global $~lib/internal/string/CharCode._9 + local.get $4 + global.get $~lib/internal/string/CharCode._9 i32.le_s else - get_local $6 + local.get $6 end if - get_local $4 - get_global $~lib/internal/string/CharCode._0 + local.get $4 + global.get $~lib/internal/string/CharCode._0 i32.sub - set_local $4 + local.set $4 else - get_local $4 - get_global $~lib/internal/string/CharCode.A + local.get $4 + global.get $~lib/internal/string/CharCode.A i32.ge_s - tee_local $6 + local.tee $6 if (result i32) - get_local $4 - get_global $~lib/internal/string/CharCode.Z + local.get $4 + global.get $~lib/internal/string/CharCode.Z i32.le_s else - get_local $6 + local.get $6 end if - get_local $4 - get_global $~lib/internal/string/CharCode.A + local.get $4 + global.get $~lib/internal/string/CharCode.A i32.const 10 i32.sub i32.sub - set_local $4 + local.set $4 else - get_local $4 - get_global $~lib/internal/string/CharCode.a + local.get $4 + global.get $~lib/internal/string/CharCode.a i32.ge_s - tee_local $6 + local.tee $6 if (result i32) - get_local $4 - get_global $~lib/internal/string/CharCode.z + local.get $4 + global.get $~lib/internal/string/CharCode.z i32.le_s else - get_local $6 + local.get $6 end if - get_local $4 - get_global $~lib/internal/string/CharCode.a + local.get $4 + global.get $~lib/internal/string/CharCode.a i32.const 10 i32.sub i32.sub - set_local $4 + local.set $4 else br $break|1 end end end - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.ge_s if br $break|1 end - get_local $7 - get_local $1 - f64.convert_s/i32 + local.get $7 + local.get $1 + f64.convert_i32_s f64.mul - get_local $4 - f64.convert_s/i32 + local.get $4 + f64.convert_i32_s f64.add - set_local $7 - get_local $3 + local.set $7 + local.get $3 i32.const 2 i32.add - set_local $3 + local.set $3 end br $continue|1 end end end - get_local $5 - get_local $7 + local.get $5 + local.get $7 f64.mul ) (func $~lib/string/parseInt (; 24 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/string/parse ) (func $~lib/string/parseFloat (; 25 ;) (type $iF) (param $0 i32) (result f64) @@ -3197,119 +3197,119 @@ (local $5 f64) (local $6 i32) (local $7 f64) - get_local $0 + local.get $0 i32.load - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $0 - set_local $2 - get_local $2 + local.get $0 + local.set $2 + local.get $2 i32.load16_u offset=4 - set_local $3 - get_local $3 - get_global $~lib/internal/string/CharCode.MINUS + local.set $3 + local.get $3 + global.get $~lib/internal/string/CharCode.MINUS i32.eq if - get_local $1 + local.get $1 i32.const 1 i32.sub - tee_local $1 + local.tee $1 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $2 + local.get $2 i32.const 2 i32.add - tee_local $2 + local.tee $2 i32.load16_u offset=4 - set_local $3 + local.set $3 f64.const -1 - set_local $4 + local.set $4 else - get_local $3 - get_global $~lib/internal/string/CharCode.PLUS + local.get $3 + global.get $~lib/internal/string/CharCode.PLUS i32.eq if - get_local $1 + local.get $1 i32.const 1 i32.sub - tee_local $1 + local.tee $1 i32.eqz if f64.const nan:0x8000000000000 return end - get_local $2 + local.get $2 i32.const 2 i32.add - tee_local $2 + local.tee $2 i32.load16_u offset=4 - set_local $3 + local.set $3 f64.const 1 - set_local $4 + local.set $4 else f64.const 1 - set_local $4 + local.set $4 end end f64.const 0 - set_local $5 + local.set $5 block $break|0 loop $continue|0 block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.sub - set_local $1 - get_local $6 + local.set $1 + local.get $6 end if block - get_local $2 + local.get $2 i32.load16_u offset=4 - set_local $3 - get_local $3 - get_global $~lib/internal/string/CharCode.DOT + local.set $3 + local.get $3 + global.get $~lib/internal/string/CharCode.DOT i32.eq if - get_local $2 + local.get $2 i32.const 2 i32.add - set_local $2 + local.set $2 f64.const 0.1 - set_local $7 + local.set $7 block $break|1 loop $continue|1 block (result i32) - get_local $1 - tee_local $6 + local.get $1 + local.tee $6 i32.const 1 i32.sub - set_local $1 - get_local $6 + local.set $1 + local.get $6 end if block - get_local $2 + local.get $2 i32.load16_u offset=4 - set_local $3 - get_local $3 - get_global $~lib/internal/string/CharCode.E + local.set $3 + local.get $3 + global.get $~lib/internal/string/CharCode.E i32.eq - tee_local $6 + local.tee $6 if (result i32) - get_local $6 + local.get $6 else - get_local $3 - get_global $~lib/internal/string/CharCode.e + local.get $3 + global.get $~lib/internal/string/CharCode.e i32.eq end if @@ -3324,31 +3324,31 @@ unreachable end end - get_local $3 - get_global $~lib/internal/string/CharCode._0 + local.get $3 + global.get $~lib/internal/string/CharCode._0 i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 9 i32.gt_u if br $break|1 end - get_local $5 - get_local $3 - f64.convert_s/i32 - get_local $7 + local.get $5 + local.get $3 + f64.convert_i32_s + local.get $7 f64.mul f64.add - set_local $5 - get_local $7 + local.set $5 + local.get $7 f64.const 0.1 f64.mul - set_local $7 - get_local $2 + local.set $7 + local.get $2 i32.const 2 i32.add - set_local $2 + local.set $2 end br $continue|1 end @@ -3356,34 +3356,34 @@ end br $break|0 end - get_local $3 - get_global $~lib/internal/string/CharCode._0 + local.get $3 + global.get $~lib/internal/string/CharCode._0 i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 10 i32.ge_u if br $break|0 end - get_local $5 + local.get $5 f64.const 10 f64.mul - get_local $3 - f64.convert_s/i32 + local.get $3 + f64.convert_i32_s f64.add - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 2 i32.add - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $4 - get_local $5 + local.get $4 + local.get $5 f64.mul ) (func $~lib/string/String#concat (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -3391,7 +3391,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -3403,61 +3403,61 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 200 - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.load - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.add - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 0 i32.eq if i32.const 256 return end - get_local $4 + local.get $4 call $~lib/internal/string/allocateUnsafe - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $2 + local.get $2 call $~lib/internal/string/copyUnsafe - get_local $5 - get_local $2 - get_local $1 + local.get $5 + local.get $2 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $5 + local.get $5 ) (func $~lib/string/String.__concat (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 200 - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String#concat ) (func $~lib/string/String.__ne (; 28 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String.__eq i32.eqz ) @@ -3467,22 +3467,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 + local.get $0 i32.const 0 i32.eq end - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -3490,38 +3490,38 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.load - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.eqz if i32.const 0 return end - get_local $4 + local.get $4 i32.eqz if i32.const 1 return end - get_local $3 - tee_local $2 - get_local $4 - tee_local $5 - get_local $2 - get_local $5 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 i32.lt_s select - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/compareUnsafe i32.const 0 i32.gt_s @@ -3532,21 +3532,21 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -3554,39 +3554,39 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.load - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.eqz if - get_local $4 + local.get $4 i32.eqz return end - get_local $4 + local.get $4 i32.eqz if i32.const 1 return end - get_local $3 - tee_local $2 - get_local $4 - tee_local $5 - get_local $2 - get_local $5 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 i32.lt_s select - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/compareUnsafe i32.const 0 i32.ge_s @@ -3597,22 +3597,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $0 + local.get $0 i32.const 0 i32.eq end - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -3620,38 +3620,38 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.load - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.eqz if i32.const 0 return end - get_local $3 + local.get $3 i32.eqz if i32.const 1 return end - get_local $3 - tee_local $2 - get_local $4 - tee_local $5 - get_local $2 - get_local $5 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 i32.lt_s select - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/compareUnsafe i32.const 0 i32.lt_s @@ -3662,21 +3662,21 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -3684,39 +3684,39 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.load - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.eqz if - get_local $3 + local.get $3 i32.eqz return end - get_local $3 + local.get $3 i32.eqz if i32.const 1 return end - get_local $3 - tee_local $2 - get_local $4 - tee_local $5 - get_local $2 - get_local $5 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 i32.lt_s select - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/string/compareUnsafe i32.const 0 i32.le_s @@ -3725,7 +3725,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -3737,18 +3737,18 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 i32.lt_s - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.mul i32.const 1 i32.const 28 @@ -3763,38 +3763,38 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $2 + local.get $2 i32.eqz end if i32.const 256 return end - get_local $1 + local.get $1 i32.const 1 i32.eq if - get_local $0 + local.get $0 return end - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.mul call $~lib/internal/string/allocateUnsafe - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/string/repeatUnsafe - get_local $4 + local.get $4 ) (func $~lib/string/String#slice (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -3804,105 +3804,105 @@ (local $7 i32) (local $8 i32) (local $9 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select else - get_local $1 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select end - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select else - get_local $2 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select end - set_local $7 - get_local $7 - get_local $6 + local.set $7 + local.get $7 + local.get $6 i32.sub - set_local $8 - get_local $8 + local.set $8 + local.get $8 i32.const 0 i32.le_s if i32.const 256 return end - get_local $8 + local.get $8 call $~lib/internal/string/allocateUnsafe - set_local $9 - get_local $9 + local.set $9 + local.get $9 i32.const 0 - get_local $0 - get_local $6 - get_local $8 + local.get $0 + local.get $6 + local.get $8 call $~lib/internal/string/copyUnsafe - get_local $9 + local.get $9 ) (func $~lib/string/String#slice|trampoline (; 35 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of1 $1of1 $outOfRange end unreachable end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $2 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#slice ) (func $~lib/internal/arraybuffer/computeSize (; 36 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -3913,8 +3913,8 @@ (func $~lib/internal/arraybuffer/allocateUnsafe (; 37 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -3926,21 +3926,21 @@ unreachable end block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/memory/memory.allocate (; 38 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) @@ -3948,250 +3948,250 @@ (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -4203,7 +4203,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -4214,78 +4214,78 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 + local.set $3 block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 8 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset - get_local $0 + local.get $0 ) (func $~lib/array/Array#__unchecked_set (; 41 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 + local.set $3 i32.const 0 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $~lib/array/Array#__unchecked_get (; 42 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 + local.set $2 i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 ) @@ -4297,15 +4297,15 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.gt_s if - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_s i32.eqz if @@ -4316,66 +4316,66 @@ call $~lib/env/abort unreachable end - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/internal/arraybuffer/computeSize - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.sub i32.le_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store else - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memmove block $~lib/memory/memory.free|inlined.0 block - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable end unreachable end - get_local $3 - set_local $0 + local.get $3 + local.set $0 end - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - get_local $2 + local.get $2 i32.add - set_local $3 + local.set $3 i32.const 0 - set_local $5 - get_local $1 - get_local $2 + local.set $5 + local.get $1 + local.get $2 i32.sub - set_local $4 - get_local $3 - get_local $5 - get_local $4 + local.set $4 + local.get $3 + local.get $5 + local.get $4 call $~lib/internal/memory/memset else - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.lt_s if - get_local $1 + local.get $1 i32.const 0 i32.ge_s i32.eqz @@ -4387,12 +4387,12 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store end end - get_local $0 + local.get $0 ) (func $~lib/array/Array#push (; 45 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -4400,26 +4400,26 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load i32.const 2 i32.shr_u - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 1 i32.add - set_local $5 - get_local $2 - get_local $4 + local.set $5 + local.get $2 + local.get $4 i32.ge_u if - get_local $2 + local.get $2 i32.const 268435454 i32.ge_u if @@ -4430,31 +4430,31 @@ call $~lib/env/abort unreachable end - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl call $~lib/internal/arraybuffer/reallocateUnsafe - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.store end - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=4 i32.const 0 - set_local $6 - get_local $3 - get_local $2 + local.set $6 + local.get $3 + local.get $2 i32.const 2 i32.shl i32.add - get_local $6 + local.get $6 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $5 + local.get $5 ) (func $~lib/string/String#split (; 46 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -4469,7 +4469,7 @@ (local $12 i32) (local $13 i32) (local $14 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -4481,7 +4481,7 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.eqz if i32.const 0 @@ -4489,7 +4489,7 @@ call $~lib/array/Array#constructor return end - get_local $1 + local.get $1 i32.const 0 i32.eq if @@ -4497,32 +4497,32 @@ i32.const 0 i32.const 1 call $~lib/array/Array#constructor - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 0 - get_local $0 + local.get $0 call $~lib/array/Array#__unchecked_set - get_local $3 + local.get $3 end return end - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.load - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const 0 i32.lt_s if - get_global $~lib/builtins/i32.MAX_VALUE - set_local $2 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 end - get_local $5 + local.get $5 i32.eqz if - get_local $4 + local.get $4 i32.eqz if i32.const 0 @@ -4530,250 +4530,250 @@ call $~lib/array/Array#constructor return end - get_local $4 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + local.get $4 + local.tee $3 + local.get $2 + local.tee $6 + local.get $3 + local.get $6 i32.lt_s select - set_local $4 + local.set $4 i32.const 0 - get_local $4 + local.get $4 call $~lib/array/Array#constructor - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $4 + local.get $7 + local.get $4 i32.lt_s i32.eqz br_if $break|0 block i32.const 1 call $~lib/internal/string/allocateUnsafe - set_local $8 - get_local $8 - get_local $0 - get_local $7 + 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 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $3 + local.get $3 return else - get_local $4 + local.get $4 i32.eqz if i32.const 0 i32.const 1 call $~lib/array/Array#constructor - set_local $6 + local.set $6 block (result i32) - get_local $6 - tee_local $3 + local.get $6 + local.tee $3 i32.const 0 - tee_local $7 + local.tee $7 i32.const 256 call $~lib/array/Array#__unchecked_set - get_local $3 - get_local $7 + local.get $3 + local.get $7 call $~lib/array/Array#__unchecked_get end drop - get_local $6 + local.get $6 return end end i32.const 0 i32.const 0 call $~lib/array/Array#constructor - set_local $10 + local.set $10 i32.const 0 - set_local $11 + local.set $11 i32.const 0 - set_local $12 + local.set $12 i32.const 0 - set_local $13 + local.set $13 block $break|1 loop $continue|1 - get_local $0 - get_local $1 - get_local $12 + local.get $0 + local.get $1 + local.get $12 call $~lib/string/String#indexOf - tee_local $11 + local.tee $11 i32.const -1 i32.ne if block - get_local $11 - get_local $12 + local.get $11 + local.get $12 i32.sub - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 i32.gt_s if - get_local $6 + local.get $6 call $~lib/internal/string/allocateUnsafe - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 0 - get_local $0 - get_local $12 - get_local $6 + local.get $0 + local.get $12 + local.get $6 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $3 + local.get $10 + local.get $3 call $~lib/array/Array#push drop else - get_local $10 + local.get $10 i32.const 256 call $~lib/array/Array#push drop end - get_local $13 + local.get $13 i32.const 1 i32.add - tee_local $13 - get_local $2 + local.tee $13 + local.get $2 i32.eq if - get_local $10 + local.get $10 return end - get_local $11 - get_local $5 + local.get $11 + local.get $5 i32.add - set_local $12 + local.set $12 end br $continue|1 end end end - get_local $12 + local.get $12 i32.eqz if i32.const 0 i32.const 1 call $~lib/array/Array#constructor - set_local $6 + local.set $6 block (result i32) - get_local $6 - tee_local $3 + local.get $6 + local.tee $3 i32.const 0 - tee_local $7 - get_local $0 + local.tee $7 + local.get $0 call $~lib/array/Array#__unchecked_set - get_local $3 - get_local $7 + local.get $3 + local.get $7 call $~lib/array/Array#__unchecked_get end drop - get_local $6 + local.get $6 return end - get_local $4 - get_local $12 + local.get $4 + local.get $12 i32.sub - set_local $14 - get_local $14 + local.set $14 + local.get $14 i32.const 0 i32.gt_s if - get_local $14 + local.get $14 call $~lib/internal/string/allocateUnsafe - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.const 0 - get_local $0 - get_local $12 - get_local $14 + local.get $0 + local.get $12 + local.get $14 call $~lib/internal/string/copyUnsafe - get_local $10 - get_local $6 + local.get $10 + local.get $6 call $~lib/array/Array#push drop else - get_local $10 + local.get $10 i32.const 256 call $~lib/array/Array#push drop end - get_local $10 + local.get $10 ) (func $~lib/string/String#split|trampoline (; 47 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $2of2 block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of2 $1of2 $2of2 $outOfRange end unreachable end i32.const 0 - set_local $1 + local.set $1 end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $2 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#split ) (func $~lib/array/Array#__get (; 48 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -4782,17 +4782,17 @@ ) (func $~lib/internal/number/decimalCount32 (; 49 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 100000 i32.lt_u if - get_local $0 + local.get $0 i32.const 100 i32.lt_u if i32.const 1 i32.const 2 - get_local $0 + local.get $0 i32.const 10 i32.lt_u select @@ -4800,14 +4800,14 @@ else i32.const 4 i32.const 5 - get_local $0 + local.get $0 i32.const 10000 i32.lt_u select - set_local $1 + local.set $1 i32.const 3 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 1000 i32.lt_u select @@ -4816,13 +4816,13 @@ unreachable unreachable else - get_local $0 + local.get $0 i32.const 10000000 i32.lt_u if i32.const 6 i32.const 7 - get_local $0 + local.get $0 i32.const 1000000 i32.lt_u select @@ -4830,14 +4830,14 @@ else i32.const 9 i32.const 10 - get_local $0 + local.get $0 i32.const 1000000000 i32.lt_u select - set_local $1 + local.set $1 i32.const 8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 100000000 i32.lt_u select @@ -4862,69 +4862,69 @@ i32.const 1816 end i32.load - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $1 + local.get $1 i32.const 10000 i32.ge_u if block - get_local $1 + local.get $1 i32.const 10000 i32.div_u - set_local $4 - get_local $1 + local.set $4 + local.get $1 i32.const 10000 i32.rem_u - set_local $5 - get_local $4 - set_local $1 - get_local $5 + local.set $5 + local.get $4 + local.set $1 + local.get $5 i32.const 100 i32.div_u - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 100 i32.rem_u - set_local $7 + local.set $7 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 - set_local $8 - get_local $3 - get_local $6 + local.set $8 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i64.load32_u offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) i32.const 0 - set_local $8 - get_local $3 - get_local $7 + local.set $8 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $8 + local.get $8 i32.add i64.load32_u offset=8 end - set_local $10 - get_local $2 + local.set $10 + local.get $2 i32.const 4 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $9 - get_local $10 + local.get $9 + local.get $10 i64.const 32 i64.shl i64.or @@ -4934,88 +4934,88 @@ end end end - get_local $1 + local.get $1 i32.const 100 i32.ge_u if - get_local $1 + local.get $1 i32.const 100 i32.div_u - set_local $7 - get_local $1 + local.set $7 + local.get $1 i32.const 100 i32.rem_u - set_local $6 - get_local $7 - set_local $1 - get_local $2 + local.set $6 + local.get $7 + local.set $1 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $5 - get_local $3 - get_local $6 + local.set $5 + local.get $3 + local.get $6 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store offset=4 end - get_local $1 + local.get $1 i32.const 10 i32.ge_u if - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 0 - set_local $5 - get_local $3 - get_local $1 + local.set $5 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store offset=4 else - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_global $~lib/internal/string/CharCode._0 - get_local $1 + local.set $2 + global.get $~lib/internal/string/CharCode._0 + local.get $1 i32.add - set_local $5 - get_local $0 - get_local $2 + local.set $5 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.store16 offset=4 end ) @@ -5023,77 +5023,77 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 480 return end - get_local $0 + local.get $0 i32.const 0 i32.lt_s - set_local $1 - get_local $1 + local.set $1 + local.get $1 if i32.const 0 - get_local $0 + local.get $0 i32.sub - set_local $0 + local.set $0 end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/string/allocateUnsafe - set_local $3 - get_local $3 - get_local $0 - get_local $2 + local.set $3 + local.get $3 + local.get $0 + local.get $2 call $~lib/internal/number/utoa32_lut - get_local $1 + local.get $1 if - get_local $3 - get_global $~lib/internal/string/CharCode.MINUS + local.get $3 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $3 + local.get $3 ) (func $~lib/internal/number/utoa32 (; 52 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 480 return end - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount32 - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $2 - get_local $0 - get_local $1 + local.set $2 + local.get $2 + local.get $0 + local.get $1 call $~lib/internal/number/utoa32_lut - get_local $2 + local.get $2 ) (func $~lib/internal/number/decimalCount64 (; 53 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) - get_local $0 + local.get $0 i64.const 1000000000000000 i64.lt_u if - get_local $0 + local.get $0 i64.const 1000000000000 i64.lt_u if i32.const 11 i32.const 12 - get_local $0 + local.get $0 i64.const 100000000000 i64.lt_u select @@ -5101,14 +5101,14 @@ else i32.const 14 i32.const 15 - get_local $0 + local.get $0 i64.const 100000000000000 i64.lt_u select - set_local $1 + local.set $1 i32.const 13 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i64.const 10000000000000 i64.lt_u select @@ -5117,13 +5117,13 @@ unreachable unreachable else - get_local $0 + local.get $0 i64.const 100000000000000000 i64.lt_u if i32.const 16 i32.const 17 - get_local $0 + local.get $0 i64.const 10000000000000000 i64.lt_u select @@ -5131,14 +5131,14 @@ else i32.const 19 i32.const 20 - get_local $0 + local.get $0 i64.const -8446744073709551616 i64.lt_u select - set_local $1 + local.set $1 i32.const 18 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i64.const 1000000000000000000 i64.lt_u select @@ -5167,129 +5167,129 @@ i32.const 2608 end i32.load - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $1 + local.get $1 i64.const 100000000 i64.ge_u if block - get_local $1 + local.get $1 i64.const 100000000 i64.div_u - set_local $4 - get_local $1 - get_local $4 + local.set $4 + local.get $1 + local.get $4 i64.const 100000000 i64.mul i64.sub - i32.wrap/i64 - set_local $5 - get_local $4 - set_local $1 - get_local $5 + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 i32.const 10000 i32.div_u - set_local $6 - get_local $5 + local.set $6 + local.get $5 i32.const 10000 i32.rem_u - set_local $7 - get_local $6 + local.set $7 + local.get $6 i32.const 100 i32.div_u - set_local $8 - get_local $6 + local.set $8 + local.get $6 i32.const 100 i32.rem_u - set_local $9 - get_local $7 + local.set $9 + local.get $7 i32.const 100 i32.div_u - set_local $10 - get_local $7 + local.set $10 + local.get $7 i32.const 100 i32.rem_u - set_local $11 + local.set $11 block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $10 + local.set $12 + local.get $3 + local.get $10 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $13 + local.set $13 block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $11 + local.set $12 + local.get $3 + local.get $11 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $14 - get_local $2 + local.set $14 + local.get $2 i32.const 4 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $13 - get_local $14 + local.get $13 + local.get $14 i64.const 32 i64.shl i64.or i64.store offset=4 block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $8 + local.set $12 + local.get $3 + local.get $8 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $13 + local.set $13 block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) i32.const 0 - set_local $12 - get_local $3 - get_local $9 + local.set $12 + local.get $3 + local.get $9 i32.const 2 i32.shl i32.add - get_local $12 + local.get $12 i32.add i64.load32_u offset=8 end - set_local $14 - get_local $2 + local.set $14 + local.get $2 i32.const 4 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $13 - get_local $14 + local.get $13 + local.get $14 i64.const 32 i64.shl i64.or @@ -5299,128 +5299,128 @@ end end end - get_local $0 - get_local $1 - i32.wrap/i64 - get_local $2 + local.get $0 + local.get $1 + i32.wrap_i64 + local.get $2 call $~lib/internal/number/utoa32_lut ) (func $~lib/internal/number/utoa64 (; 55 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 480 return end - get_local $0 - get_global $~lib/builtins/u32.MAX_VALUE - i64.extend_u/i32 + local.get $0 + global.get $~lib/builtins/u32.MAX_VALUE + i64.extend_i32_u i64.le_u if - get_local $0 - i32.wrap/i64 - set_local $2 - get_local $2 + local.get $0 + i32.wrap_i64 + local.set $2 + local.get $2 call $~lib/internal/number/decimalCount32 - set_local $3 - get_local $3 + local.set $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $2 - get_local $3 + local.set $1 + local.get $1 + local.get $2 + local.get $3 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - set_local $3 - get_local $3 + local.set $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $0 - get_local $3 + local.set $1 + local.get $1 + local.get $0 + local.get $3 call $~lib/internal/number/utoa64_lut end - get_local $1 + local.get $1 ) (func $~lib/internal/number/itoa64 (; 56 ;) (type $Ii) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i64.eqz if i32.const 480 return end - get_local $0 + local.get $0 i64.const 0 i64.lt_s - set_local $1 - get_local $1 + local.set $1 + local.get $1 if i64.const 0 - get_local $0 + local.get $0 i64.sub - set_local $0 + local.set $0 end - get_local $0 - get_global $~lib/builtins/u32.MAX_VALUE - i64.extend_u/i32 + local.get $0 + global.get $~lib/builtins/u32.MAX_VALUE + i64.extend_i32_u i64.le_u if - get_local $0 - i32.wrap/i64 - set_local $3 - get_local $3 + local.get $0 + i32.wrap_i64 + local.set $3 + local.get $3 call $~lib/internal/number/decimalCount32 - get_local $1 + local.get $1 i32.add - set_local $4 - get_local $4 + local.set $4 + local.get $4 call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $2 - get_local $3 - get_local $4 + local.set $2 + local.get $2 + local.get $3 + local.get $4 call $~lib/internal/number/utoa32_lut else - get_local $0 + local.get $0 call $~lib/internal/number/decimalCount64 - get_local $1 + local.get $1 i32.add - set_local $4 - get_local $4 + local.set $4 + local.get $4 call $~lib/internal/string/allocateUnsafe - set_local $2 - get_local $2 - get_local $0 - get_local $4 + local.set $2 + local.get $2 + local.get $0 + local.get $4 call $~lib/internal/number/utoa64_lut end - get_local $1 + local.get $1 if - get_local $2 - get_global $~lib/internal/string/CharCode.MINUS + local.get $2 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end - get_local $2 + local.get $2 ) (func $~lib/builtins/isFinite (; 57 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.sub f64.const 0 f64.eq ) (func $~lib/builtins/isNaN (; 58 ;) (type $Fi) (param $0 f64) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.ne ) (func $~lib/internal/number/genDigits (; 59 ;) (type $iIiIiIii) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) @@ -5441,47 +5441,47 @@ (local $21 i32) (local $22 i32) i32.const 0 - get_local $4 + local.get $4 i32.sub - set_local $7 + local.set $7 i64.const 1 - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.shl - set_local $8 - get_local $8 + local.set $8 + local.get $8 i64.const 1 i64.sub - set_local $9 - get_local $3 - get_local $1 + local.set $9 + local.get $3 + local.get $1 i64.sub - set_local $10 - get_local $4 - set_local $11 - get_local $3 - get_local $7 - i64.extend_s/i32 + 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 - set_local $12 - get_local $3 - get_local $9 + i32.wrap_i64 + local.set $12 + local.get $3 + local.get $9 i64.and - set_local $13 - get_local $12 + local.set $13 + local.get $12 call $~lib/internal/number/decimalCount32 - set_local $14 - get_local $6 - set_local $15 + local.set $14 + local.get $6 + local.set $15 block $~lib/internal/number/POWERS10|inlined.0 (result i32) i32.const 4624 end i32.load - set_local $16 + local.set $16 block $break|0 loop $continue|0 - get_local $14 + local.get $14 i32.const 0 i32.gt_s if @@ -5498,181 +5498,181 @@ block $case2|1 block $case1|1 block $case0|1 - get_local $14 - set_local $18 - get_local $18 + local.get $14 + local.set $18 + local.get $18 i32.const 10 i32.eq br_if $case0|1 - get_local $18 + local.get $18 i32.const 9 i32.eq br_if $case1|1 - get_local $18 + local.get $18 i32.const 8 i32.eq br_if $case2|1 - get_local $18 + local.get $18 i32.const 7 i32.eq br_if $case3|1 - get_local $18 + local.get $18 i32.const 6 i32.eq br_if $case4|1 - get_local $18 + local.get $18 i32.const 5 i32.eq br_if $case5|1 - get_local $18 + local.get $18 i32.const 4 i32.eq br_if $case6|1 - get_local $18 + local.get $18 i32.const 3 i32.eq br_if $case7|1 - get_local $18 + local.get $18 i32.const 2 i32.eq br_if $case8|1 - get_local $18 + local.get $18 i32.const 1 i32.eq br_if $case9|1 br $case10|1 end block - get_local $12 + local.get $12 i32.const 1000000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 1000000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 1000 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 1000 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 100 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 100 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 + local.get $12 i32.const 10 i32.div_u - set_local $17 - get_local $12 + local.set $17 + local.get $12 i32.const 10 i32.rem_u - set_local $12 + local.set $12 br $break|1 unreachable end unreachable end block - get_local $12 - set_local $17 + local.get $12 + local.set $17 i32.const 0 - set_local $12 + local.set $12 br $break|1 unreachable end @@ -5680,140 +5680,140 @@ end block i32.const 0 - set_local $17 + local.set $17 br $break|1 unreachable end unreachable end - get_local $17 - get_local $15 + local.get $17 + local.get $15 i32.or if - get_local $0 + local.get $0 block (result i32) - get_local $15 - tee_local $18 + local.get $15 + local.tee $18 i32.const 1 i32.add - set_local $15 - get_local $18 + local.set $15 + local.get $18 end i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 - get_local $17 + global.get $~lib/internal/string/CharCode._0 + local.get $17 i32.const 65535 i32.and i32.add i32.store16 offset=4 end - get_local $14 + local.get $14 i32.const 1 i32.sub - set_local $14 - get_local $12 - i64.extend_u/i32 - get_local $7 - i64.extend_s/i32 + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s i64.shl - get_local $13 + local.get $13 i64.add - set_local $19 - get_local $19 - get_local $5 + local.set $19 + local.get $19 + local.get $5 i64.le_u if - get_global $~lib/internal/number/_K - get_local $14 + global.get $~lib/internal/number/_K + local.get $14 i32.add - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i64) i32.const 0 - set_local $18 - get_local $16 - get_local $14 + local.set $18 + local.get $16 + local.get $14 i32.const 2 i32.shl i32.add - get_local $18 + local.get $18 i32.add i64.load32_u offset=8 end - get_local $7 - i64.extend_s/i32 + local.get $7 + i64.extend_i32_s i64.shl - set_local $20 - get_local $0 - get_local $15 + local.set $20 + local.get $0 + local.get $15 i32.const 1 i32.sub i32.const 1 i32.shl i32.add - set_local $18 - get_local $18 + local.set $18 + local.get $18 i32.load16_u offset=4 - set_local $21 + local.set $21 block $break|2 loop $continue|2 - get_local $19 - get_local $10 + local.get $19 + local.get $10 i64.lt_u - tee_local $22 + local.tee $22 if (result i32) - get_local $5 - get_local $19 + local.get $5 + local.get $19 i64.sub - get_local $20 + local.get $20 i64.ge_u else - get_local $22 + local.get $22 end - tee_local $22 + local.tee $22 if (result i32) - get_local $19 - get_local $20 + local.get $19 + local.get $20 i64.add - get_local $10 + local.get $10 i64.lt_u - tee_local $22 + local.tee $22 if (result i32) - get_local $22 + local.get $22 else - get_local $10 - get_local $19 + local.get $10 + local.get $19 i64.sub - get_local $19 - get_local $20 + local.get $19 + local.get $20 i64.add - get_local $10 + local.get $10 i64.sub i64.gt_u end else - get_local $22 + local.get $22 end if block - get_local $21 + local.get $21 i32.const 1 i32.sub - set_local $21 - get_local $19 - get_local $20 + local.set $21 + local.get $19 + local.get $20 i64.add - set_local $19 + local.set $19 end br $continue|2 end end end - get_local $18 - get_local $21 + local.get $18 + local.get $21 i32.store16 offset=4 - get_local $15 + local.get $15 return end end @@ -5826,150 +5826,150 @@ i32.const 1 if block - get_local $13 + local.get $13 i64.const 10 i64.mul - set_local $13 - get_local $5 + local.set $13 + local.get $5 i64.const 10 i64.mul - set_local $5 - get_local $13 - get_local $7 - i64.extend_s/i32 + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s i64.shr_u - set_local $19 - get_local $19 - get_local $15 - i64.extend_s/i32 + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s i64.or i64.const 0 i64.ne if - get_local $0 + local.get $0 block (result i32) - get_local $15 - tee_local $17 + local.get $15 + local.tee $17 i32.const 1 i32.add - set_local $15 - get_local $17 + local.set $15 + local.get $17 end i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 - get_local $19 - i32.wrap/i64 + global.get $~lib/internal/string/CharCode._0 + local.get $19 + i32.wrap_i64 i32.const 65535 i32.and i32.add i32.store16 offset=4 end - get_local $13 - get_local $9 + local.get $13 + local.get $9 i64.and - set_local $13 - get_local $14 + local.set $13 + local.get $14 i32.const 1 i32.sub - set_local $14 - get_local $13 - get_local $5 + local.set $14 + local.get $13 + local.get $5 i64.lt_u if - get_global $~lib/internal/number/_K - get_local $14 + global.get $~lib/internal/number/_K + local.get $14 i32.add - set_global $~lib/internal/number/_K - get_local $10 + global.set $~lib/internal/number/_K + local.get $10 block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) i32.const 0 - get_local $14 + local.get $14 i32.sub - set_local $17 + local.set $17 i32.const 0 - set_local $21 - get_local $16 - get_local $17 + local.set $21 + local.get $16 + local.get $17 i32.const 2 i32.shl i32.add - get_local $21 + local.get $21 i32.add i64.load32_u offset=8 end i64.mul - set_local $10 - get_local $0 - get_local $15 + local.set $10 + local.get $0 + local.get $15 i32.const 1 i32.sub i32.const 1 i32.shl i32.add - set_local $21 - get_local $21 + local.set $21 + local.get $21 i32.load16_u offset=4 - set_local $17 + local.set $17 block $break|4 loop $continue|4 - get_local $13 - get_local $10 + local.get $13 + local.get $10 i64.lt_u - tee_local $18 + local.tee $18 if (result i32) - get_local $5 - get_local $13 + local.get $5 + local.get $13 i64.sub - get_local $8 + local.get $8 i64.ge_u else - get_local $18 + local.get $18 end - tee_local $18 + local.tee $18 if (result i32) - get_local $13 - get_local $8 + local.get $13 + local.get $8 i64.add - get_local $10 + local.get $10 i64.lt_u - tee_local $18 + local.tee $18 if (result i32) - get_local $18 + local.get $18 else - get_local $10 - get_local $13 + local.get $10 + local.get $13 i64.sub - get_local $13 - get_local $8 + local.get $13 + local.get $8 i64.add - get_local $10 + local.get $10 i64.sub i64.gt_u end else - get_local $18 + local.get $18 end if block - get_local $17 + local.get $17 i32.const 1 i32.sub - set_local $17 - get_local $13 - get_local $8 + local.set $17 + local.get $13 + local.get $8 i64.add - set_local $13 + local.set $13 end br $continue|4 end end end - get_local $21 - get_local $17 + local.get $21 + local.get $17 i32.store16 offset=4 - get_local $15 + local.get $15 return end end @@ -5977,7 +5977,7 @@ end end end - get_local $15 + local.get $15 ) (func $~lib/internal/number/prettify (; 60 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -5986,330 +5986,330 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $2 + local.get $2 i32.eqz if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode._0 i32.const 16 i32.shl i32.or i32.store offset=4 - get_local $1 + local.get $1 i32.const 2 i32.add return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - set_local $3 - get_local $1 - get_local $3 + local.set $3 + local.get $1 + local.get $3 i32.le_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 21 i32.le_s else - get_local $4 + local.get $4 end if block $break|0 - get_local $1 - set_local $4 + local.get $1 + local.set $4 loop $repeat|0 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end unreachable end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode._0 i32.const 16 i32.shl i32.or i32.store offset=4 - get_local $3 + local.get $3 i32.const 2 i32.add return else - get_local $3 + local.get $3 i32.const 0 i32.gt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 21 i32.le_s else - get_local $4 + local.get $4 end if - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - set_local $4 - get_local $4 - get_global $~lib/internal/string/HEADER_SIZE + local.set $4 + local.get $4 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 2 i32.add - set_local $5 - get_local $4 - get_global $~lib/internal/string/HEADER_SIZE + local.set $5 + local.get $4 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 + local.set $6 i32.const 0 - get_local $2 + local.get $2 i32.sub i32.const 1 i32.shl - set_local $7 - get_local $5 - get_local $6 - get_local $7 + local.set $7 + local.get $5 + local.get $6 + local.get $7 call $~lib/internal/memory/memmove - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode.DOT + global.get $~lib/internal/string/CharCode.DOT i32.store16 offset=4 - get_local $1 + local.get $1 i32.const 1 i32.add return else i32.const -6 - get_local $3 + local.get $3 i32.lt_s - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.const 0 i32.le_s else - get_local $4 + local.get $4 end if i32.const 2 - get_local $3 + local.get $3 i32.sub - set_local $4 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $4 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - get_local $4 + local.get $4 i32.const 1 i32.shl i32.add - set_local $7 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $1 + local.set $6 + local.get $1 i32.const 1 i32.shl - set_local $5 - get_local $7 - get_local $6 - get_local $5 + local.set $5 + local.get $7 + local.get $6 + local.get $5 call $~lib/internal/memory/memmove - get_local $0 - get_global $~lib/internal/string/CharCode._0 - get_global $~lib/internal/string/CharCode.DOT + local.get $0 + global.get $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode.DOT i32.const 16 i32.shl i32.or i32.store offset=4 block $break|1 i32.const 2 - set_local $5 + local.set $5 loop $repeat|1 - get_local $5 - get_local $4 + local.get $5 + local.get $4 i32.lt_s i32.eqz br_if $break|1 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/CharCode._0 + global.get $~lib/internal/string/CharCode._0 i32.store16 offset=4 - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|1 unreachable end unreachable end - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.add return else - get_local $1 + local.get $1 i32.const 1 i32.eq if - get_local $0 - get_global $~lib/internal/string/CharCode.e + local.get $0 + global.get $~lib/internal/string/CharCode.e i32.store16 offset=6 block $~lib/internal/number/genExponent|inlined.0 (result i32) - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1 i32.sub - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.lt_s - set_local $6 - get_local $6 + local.set $6 + local.get $6 if i32.const 0 - get_local $5 + local.get $5 i32.sub - set_local $5 + local.set $5 end - get_local $5 + local.get $5 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - set_local $7 - get_local $4 - get_local $5 - get_local $7 + local.set $7 + local.get $4 + local.get $5 + local.get $7 call $~lib/internal/number/utoa32_lut - get_local $4 - get_global $~lib/internal/string/CharCode.MINUS - get_global $~lib/internal/string/CharCode.PLUS - get_local $6 + local.get $4 + global.get $~lib/internal/string/CharCode.MINUS + global.get $~lib/internal/string/CharCode.PLUS + local.get $6 select i32.store16 offset=4 - get_local $7 + local.get $7 end - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 2 i32.add return else - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $7 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $7 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 4 i32.add - set_local $6 - get_local $0 - get_global $~lib/internal/string/HEADER_SIZE + local.set $6 + local.get $0 + global.get $~lib/internal/string/HEADER_SIZE i32.add i32.const 2 i32.add - set_local $5 - get_local $7 + local.set $5 + local.get $7 i32.const 2 i32.sub - set_local $4 - get_local $6 - get_local $5 - get_local $4 + local.set $4 + local.get $6 + local.get $5 + local.get $4 call $~lib/internal/memory/memmove - get_local $0 - get_global $~lib/internal/string/CharCode.DOT + local.get $0 + global.get $~lib/internal/string/CharCode.DOT i32.store16 offset=6 - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.add - get_global $~lib/internal/string/CharCode.e + global.get $~lib/internal/string/CharCode.e i32.store16 offset=6 - get_local $1 + local.get $1 block $~lib/internal/number/genExponent|inlined.1 (result i32) - get_local $0 - get_local $7 + local.get $0 + local.get $7 i32.add i32.const 4 i32.add - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 1 i32.sub - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 i32.lt_s - set_local $6 - get_local $6 + local.set $6 + local.get $6 if i32.const 0 - get_local $5 + local.get $5 i32.sub - set_local $5 + local.set $5 end - get_local $5 + local.get $5 call $~lib/internal/number/decimalCount32 i32.const 1 i32.add - set_local $8 - get_local $4 - get_local $5 - get_local $8 + local.set $8 + local.get $4 + local.get $5 + local.get $8 call $~lib/internal/number/utoa32_lut - get_local $4 - get_global $~lib/internal/string/CharCode.MINUS - get_global $~lib/internal/string/CharCode.PLUS - get_local $6 + local.get $4 + global.get $~lib/internal/string/CharCode.MINUS + global.get $~lib/internal/string/CharCode.PLUS + local.get $6 select i32.store16 offset=4 - get_local $8 + local.get $8 end i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 2 i32.add return @@ -6348,46 +6348,46 @@ (local $23 i64) (local $24 i64) (local $25 i32) - get_local $1 + local.get $1 f64.const 0 f64.lt - set_local $2 - get_local $2 + local.set $2 + local.get $2 if - get_local $1 + local.get $1 f64.neg - set_local $1 - get_local $0 - get_global $~lib/internal/string/CharCode.MINUS + local.set $1 + local.get $0 + global.get $~lib/internal/string/CharCode.MINUS i32.store16 offset=4 end block $~lib/internal/number/grisu2|inlined.0 (result i32) - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $3 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $3 i64.const 9218868437227405312 i64.and i64.const 52 i64.shr_u - i32.wrap/i64 - set_local $4 - get_local $3 + i32.wrap_i64 + local.set $4 + local.get $3 i64.const 4503599627370495 i64.and - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 0 i32.ne - i64.extend_u/i32 + i64.extend_i32_u i64.const 52 i64.shl - get_local $5 + local.get $5 i64.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 - get_local $4 + local.get $4 i32.const 0 i32.ne select @@ -6395,371 +6395,371 @@ i32.const 52 i32.add i32.sub - set_local $4 + local.set $4 block - get_local $6 + local.get $6 i64.const 1 i64.shl i64.const 1 i64.add - set_local $7 - get_local $4 + local.set $7 + local.get $4 i32.const 1 i32.sub - set_local $8 - get_local $7 + local.set $8 + local.get $7 i64.clz - i32.wrap/i64 - set_local $9 - get_local $7 - get_local $9 - i64.extend_s/i32 + i32.wrap_i64 + local.set $9 + local.get $7 + local.get $9 + i64.extend_i32_s i64.shl - set_local $7 - get_local $8 - get_local $9 + local.set $7 + local.get $8 + local.get $9 i32.sub - set_local $8 + local.set $8 i32.const 1 - get_local $6 + local.get $6 i64.const 4503599627370496 i64.eq i32.add - set_local $10 - get_local $7 - set_global $~lib/internal/number/_frc_plus - get_local $6 - get_local $10 - i64.extend_s/i32 + local.set $10 + local.get $7 + global.set $~lib/internal/number/_frc_plus + local.get $6 + local.get $10 + i64.extend_i32_s i64.shl i64.const 1 i64.sub - get_local $4 - get_local $10 + local.get $4 + local.get $10 i32.sub - get_local $8 + local.get $8 i32.sub - i64.extend_s/i32 + i64.extend_i32_s i64.shl - set_global $~lib/internal/number/_frc_minus - get_local $8 - set_global $~lib/internal/number/_exp + global.set $~lib/internal/number/_frc_minus + local.get $8 + global.set $~lib/internal/number/_exp end block - get_global $~lib/internal/number/_exp - set_local $10 + global.get $~lib/internal/number/_exp + local.set $10 i32.const -61 - get_local $10 + local.get $10 i32.sub - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.30102999566398114 f64.mul f64.const 347 f64.add - set_local $11 - get_local $11 - i32.trunc_s/f64 - set_local $9 - get_local $9 - get_local $9 - f64.convert_s/i32 - get_local $11 + local.set $11 + local.get $11 + i32.trunc_f64_s + local.set $9 + local.get $9 + local.get $9 + f64.convert_i32_s + local.get $11 f64.ne i32.add - set_local $9 - get_local $9 + local.set $9 + local.get $9 i32.const 3 i32.shr_s i32.const 1 i32.add - set_local $8 + local.set $8 i32.const 348 - get_local $8 + local.get $8 i32.const 3 i32.shl i32.sub - set_global $~lib/internal/number/_K + global.set $~lib/internal/number/_K block $~lib/internal/number/FRC_POWERS|inlined.0 (result i32) i32.const 4288 end i32.load - set_local $12 + local.set $12 block $~lib/internal/number/EXP_POWERS|inlined.0 (result i32) i32.const 4552 end i32.load - set_local $13 + local.set $13 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 - set_local $14 - get_local $12 - get_local $8 + local.set $14 + local.get $12 + local.get $8 i32.const 3 i32.shl i32.add - get_local $14 + local.get $14 i32.add i64.load offset=8 end - set_global $~lib/internal/number/_frc_pow + global.set $~lib/internal/number/_frc_pow block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 - set_local $14 - get_local $13 - get_local $8 + local.set $14 + local.get $13 + local.get $8 i32.const 1 i32.shl i32.add - get_local $14 + local.get $14 i32.add i32.load16_s offset=8 end - set_global $~lib/internal/number/_exp_pow + global.set $~lib/internal/number/_exp_pow end - get_local $6 + local.get $6 i64.clz - i32.wrap/i64 - set_local $13 - get_local $6 - get_local $13 - i64.extend_s/i32 + i32.wrap_i64 + local.set $13 + local.get $6 + local.get $13 + i64.extend_i32_s i64.shl - set_local $6 - get_local $4 - get_local $13 + local.set $6 + local.get $4 + local.get $13 i32.sub - set_local $4 - get_global $~lib/internal/number/_frc_pow - set_local $7 - get_global $~lib/internal/number/_exp_pow - set_local $12 + local.set $4 + global.get $~lib/internal/number/_frc_pow + local.set $7 + global.get $~lib/internal/number/_exp_pow + local.set $12 block $~lib/internal/number/umul64f|inlined.0 (result i64) - get_local $6 + local.get $6 i64.const 4294967295 i64.and - set_local $15 - get_local $7 + local.set $15 + local.get $7 i64.const 4294967295 i64.and - set_local $16 - get_local $6 + local.set $16 + local.get $6 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $18 - get_local $15 - get_local $16 + local.set $18 + local.get $15 + local.get $16 i64.mul - set_local $19 - get_local $17 - get_local $16 + local.set $19 + local.get $17 + local.get $16 i64.mul - get_local $19 + local.get $19 i64.const 32 i64.shr_u i64.add - set_local $20 - get_local $15 - get_local $18 + local.set $20 + local.get $15 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.const 4294967295 i64.and i64.add - set_local $21 - get_local $21 + local.set $21 + local.get $21 i64.const 2147483647 i64.add - set_local $21 - get_local $20 + local.set $21 + local.get $20 i64.const 32 i64.shr_u - set_local $20 - get_local $21 + local.set $20 + local.get $21 i64.const 32 i64.shr_u - set_local $21 - get_local $17 - get_local $18 + local.set $21 + local.get $17 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.add - get_local $21 + local.get $21 i64.add end - set_local $21 + local.set $21 block $~lib/internal/number/umul64e|inlined.0 (result i32) - get_local $4 - get_local $12 + local.get $4 + local.get $12 i32.add i32.const 64 i32.add end - set_local $8 + local.set $8 block $~lib/internal/number/umul64f|inlined.1 (result i64) - get_global $~lib/internal/number/_frc_plus - set_local $20 - get_local $20 + global.get $~lib/internal/number/_frc_plus + local.set $20 + local.get $20 i64.const 4294967295 i64.and - set_local $19 - get_local $7 + local.set $19 + local.get $7 i64.const 4294967295 i64.and - set_local $18 - get_local $20 + local.set $18 + local.get $20 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $16 - get_local $19 - get_local $18 + local.set $16 + local.get $19 + local.get $18 i64.mul - set_local $15 - get_local $17 - get_local $18 + local.set $15 + local.get $17 + local.get $18 i64.mul - get_local $15 + local.get $15 i64.const 32 i64.shr_u i64.add - set_local $22 - get_local $19 - get_local $16 + local.set $22 + local.get $19 + local.get $16 i64.mul - get_local $22 + local.get $22 i64.const 4294967295 i64.and i64.add - set_local $23 - get_local $23 + local.set $23 + local.get $23 i64.const 2147483647 i64.add - set_local $23 - get_local $22 + local.set $23 + local.get $22 i64.const 32 i64.shr_u - set_local $22 - get_local $23 + local.set $22 + local.get $23 i64.const 32 i64.shr_u - set_local $23 - get_local $17 - get_local $16 + local.set $23 + local.get $17 + local.get $16 i64.mul - get_local $22 + local.get $22 i64.add - get_local $23 + local.get $23 i64.add end i64.const 1 i64.sub - set_local $23 + local.set $23 block $~lib/internal/number/umul64e|inlined.1 (result i32) - get_global $~lib/internal/number/_exp - set_local $9 - get_local $9 - get_local $12 + global.get $~lib/internal/number/_exp + local.set $9 + local.get $9 + local.get $12 i32.add i32.const 64 i32.add end - set_local $9 + local.set $9 block $~lib/internal/number/umul64f|inlined.2 (result i64) - get_global $~lib/internal/number/_frc_minus - set_local $22 - get_local $22 + global.get $~lib/internal/number/_frc_minus + local.set $22 + local.get $22 i64.const 4294967295 i64.and - set_local $15 - get_local $7 + local.set $15 + local.get $7 i64.const 4294967295 i64.and - set_local $16 - get_local $22 + local.set $16 + local.get $22 i64.const 32 i64.shr_u - set_local $17 - get_local $7 + local.set $17 + local.get $7 i64.const 32 i64.shr_u - set_local $18 - get_local $15 - get_local $16 + local.set $18 + local.get $15 + local.get $16 i64.mul - set_local $19 - get_local $17 - get_local $16 + local.set $19 + local.get $17 + local.get $16 i64.mul - get_local $19 + local.get $19 i64.const 32 i64.shr_u i64.add - set_local $20 - get_local $15 - get_local $18 + local.set $20 + local.get $15 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.const 4294967295 i64.and i64.add - set_local $24 - get_local $24 + local.set $24 + local.get $24 i64.const 2147483647 i64.add - set_local $24 - get_local $20 + local.set $24 + local.get $20 i64.const 32 i64.shr_u - set_local $20 - get_local $24 + local.set $20 + local.get $24 i64.const 32 i64.shr_u - set_local $24 - get_local $17 - get_local $18 + local.set $24 + local.get $17 + local.get $18 i64.mul - get_local $20 + local.get $20 i64.add - get_local $24 + local.get $24 i64.add end i64.const 1 i64.add - set_local $24 - get_local $23 - get_local $24 + local.set $24 + local.get $23 + local.get $24 i64.sub - set_local $20 - get_local $0 - get_local $21 - get_local $8 - get_local $23 - get_local $9 - get_local $20 - get_local $2 + local.set $20 + local.get $0 + local.get $21 + local.get $8 + local.get $23 + local.get $9 + local.get $20 + local.get $2 call $~lib/internal/number/genDigits end - set_local $25 - get_local $0 - get_local $2 + local.set $25 + local.get $0 + local.get $2 i32.const 1 i32.shl i32.add - get_local $25 - get_local $2 + local.get $25 + local.get $2 i32.sub - get_global $~lib/internal/number/_K + global.get $~lib/internal/number/_K call $~lib/internal/number/prettify - set_local $25 - get_local $25 - get_local $2 + local.set $25 + local.get $25 + local.get $2 i32.add ) (func $~lib/string/String#substring (; 62 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -6771,7 +6771,7 @@ (local $8 i32) (local $9 i32) (local $10 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -6783,111 +6783,111 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $1 - tee_local $4 + local.set $3 + local.get $1 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $6 - get_local $2 - tee_local $4 + local.set $6 + local.get $2 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $7 - get_local $6 - tee_local $4 - get_local $7 - tee_local $5 - get_local $4 - get_local $5 + 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 - set_local $8 - get_local $6 - tee_local $4 - get_local $7 - tee_local $5 - get_local $4 - get_local $5 + 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 - set_local $9 - get_local $9 - get_local $8 + local.set $9 + local.get $9 + local.get $8 i32.sub - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.eqz if i32.const 256 return end - get_local $8 + local.get $8 i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $9 - get_local $0 + local.get $9 + local.get $0 i32.load i32.eq else - get_local $4 + local.get $4 end if - get_local $0 + local.get $0 return end - get_local $3 + local.get $3 call $~lib/internal/string/allocateUnsafe - set_local $10 - get_local $10 + local.set $10 + local.get $10 i32.const 0 - get_local $0 - get_local $8 - get_local $3 + local.get $0 + local.get $8 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $10 + local.get $10 ) (func $~lib/internal/number/dtoa (; 63 ;) (type $Fi) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 f64.const 0 f64.eq if i32.const 3184 return end - get_local $0 + local.get $0 call $~lib/builtins/isFinite i32.eqz if - get_local $0 + local.get $0 call $~lib/builtins/isNaN if i32.const 3200 @@ -6895,25 +6895,25 @@ end i32.const 3216 i32.const 3240 - get_local $0 + local.get $0 f64.const 0 f64.lt select return end - get_global $~lib/internal/number/MAX_DOUBLE_LENGTH + global.get $~lib/internal/number/MAX_DOUBLE_LENGTH call $~lib/internal/string/allocateUnsafe - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 call $~lib/internal/number/dtoa_core - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 0 - get_local $2 + local.get $2 call $~lib/string/String#substring - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.eqz if i32.const 0 @@ -6925,30 +6925,30 @@ end block $~lib/memory/memory.free|inlined.1 block - get_local $1 + local.get $1 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.1 unreachable end unreachable end - get_local $3 + local.get $3 ) (func $start (; 64 ;) (type $v) (local $0 i32) (local $1 i32) (local $2 i32) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $std/string/str + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + global.get $std/string/str i32.const 8 i32.eq i32.eqz @@ -6960,7 +6960,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.load i32.const 16 i32.eq @@ -6973,7 +6973,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 0 call $~lib/string/String#charCodeAt i32.const 104 @@ -7065,7 +7065,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 192 i32.const 0 call $~lib/string/String#startsWith @@ -7080,8 +7080,8 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 216 i32.const 0 call $~lib/string/String#endsWith|trampoline @@ -7096,15 +7096,15 @@ unreachable end block $~lib/string/String#includes|inlined.0 (result i32) - get_global $std/string/str - set_local $0 + global.get $std/string/str + local.set $0 i32.const 232 - set_local $1 + local.set $1 i32.const 0 - set_local $2 - get_local $0 - get_local $1 - get_local $2 + local.set $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/string/String#indexOf i32.const -1 i32.ne @@ -7122,13 +7122,13 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 0 i32.const 0 call $~lib/string/String#padStart|trampoline end - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -7141,13 +7141,13 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 15 i32.const 0 call $~lib/string/String#padStart|trampoline end - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -7160,7 +7160,7 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 3 i32.const 0 @@ -7209,7 +7209,7 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 288 i32.const 5 i32.const 0 @@ -7258,13 +7258,13 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 0 i32.const 0 call $~lib/string/String#padEnd|trampoline end - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -7277,13 +7277,13 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 15 i32.const 0 call $~lib/string/String#padEnd|trampoline end - get_global $std/string/str + global.get $std/string/str call $~lib/string/String.__eq i32.eqz if @@ -7296,7 +7296,7 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 3 i32.const 0 @@ -7345,7 +7345,7 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 288 i32.const 5 i32.const 0 @@ -7437,8 +7437,8 @@ call $~lib/env/abort unreachable end - get_global $std/string/str - get_global $std/string/str + global.get $std/string/str + global.get $std/string/str i32.const 0 call $~lib/string/String#indexOf i32.const 0 @@ -7452,7 +7452,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 256 i32.const 0 call $~lib/string/String#indexOf @@ -7467,7 +7467,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 0 call $~lib/string/String#indexOf @@ -7482,7 +7482,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 440 i32.const 0 call $~lib/string/String#indexOf @@ -7497,7 +7497,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 2 call $~lib/string/String#indexOf @@ -7512,7 +7512,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 3 call $~lib/string/String#indexOf @@ -7527,7 +7527,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 448 i32.const -1 call $~lib/string/String#indexOf @@ -7544,7 +7544,7 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 256 i32.const 0 @@ -7563,7 +7563,7 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 192 i32.const 0 @@ -7582,13 +7582,13 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 256 i32.const 0 call $~lib/string/String#lastIndexOf|trampoline end - get_global $std/string/str + global.get $std/string/str i32.load i32.eq i32.eqz @@ -7602,8 +7602,8 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 432 i32.const 0 call $~lib/string/String#lastIndexOf|trampoline @@ -7621,8 +7621,8 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 440 i32.const 0 call $~lib/string/String#lastIndexOf|trampoline @@ -7640,8 +7640,8 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 464 i32.const 0 call $~lib/string/String#lastIndexOf|trampoline @@ -7657,7 +7657,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 2 call $~lib/string/String#lastIndexOf @@ -7672,7 +7672,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 432 i32.const 3 call $~lib/string/String#lastIndexOf @@ -7687,7 +7687,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 448 i32.const -1 call $~lib/string/String#lastIndexOf @@ -7702,7 +7702,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 472 i32.const 0 call $~lib/string/String#lastIndexOf @@ -7717,7 +7717,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 192 i32.const 0 call $~lib/string/String#lastIndexOf @@ -7912,8 +7912,8 @@ i32.const 280 i32.const 648 call $~lib/string/String.__concat - set_global $std/string/c - get_global $std/string/c + global.set $std/string/c + global.get $std/string/c i32.const 656 call $~lib/string/String.__eq i32.eqz @@ -7925,7 +7925,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/c + global.get $std/string/c i32.const 280 call $~lib/string/String.__ne i32.eqz @@ -7950,7 +7950,7 @@ unreachable end i32.const 256 - get_global $std/string/nullStr + global.get $std/string/nullStr call $~lib/string/String.__ne i32.eqz if @@ -7961,7 +7961,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/nullStr + global.get $std/string/nullStr i32.const 256 call $~lib/string/String.__ne i32.eqz @@ -8143,7 +8143,7 @@ unreachable end i32.const 648 - get_global $std/string/nullStr + global.get $std/string/nullStr call $~lib/string/String.__lt i32.eqz i32.eqz @@ -8155,7 +8155,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/nullStr + global.get $std/string/nullStr i32.const 648 call $~lib/string/String.__lt i32.eqz @@ -8294,15 +8294,15 @@ end i32.const 65377 call $~lib/string/String.fromCodePoint - set_global $std/string/a + 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 - set_global $std/string/b - get_global $std/string/a - get_global $std/string/b + global.set $std/string/b + global.get $std/string/a + global.get $std/string/b call $~lib/string/String.__gt i32.eqz if @@ -8453,11 +8453,11 @@ unreachable end i32.const 976 - set_global $std/string/str + global.set $std/string/str block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const 0 i32.const 0 call $~lib/string/String#slice|trampoline @@ -8475,8 +8475,8 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const -1 i32.const 0 call $~lib/string/String#slice|trampoline @@ -8494,8 +8494,8 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/string/str + global.set $~argc + global.get $std/string/str i32.const -5 i32.const 0 call $~lib/string/String#slice|trampoline @@ -8511,7 +8511,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 2 i32.const 7 call $~lib/string/String#slice @@ -8526,7 +8526,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const -11 i32.const -6 call $~lib/string/String#slice @@ -8541,7 +8541,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 4 i32.const 3 call $~lib/string/String#slice @@ -8556,7 +8556,7 @@ call $~lib/env/abort unreachable end - get_global $std/string/str + global.get $std/string/str i32.const 0 i32.const -1 call $~lib/string/String#slice @@ -8573,30 +8573,30 @@ end block (result i32) i32.const 0 - set_global $~argc + global.set $~argc i32.const 256 i32.const 0 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.0 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 256 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -8609,17 +8609,17 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 256 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.1 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 0 @@ -8635,30 +8635,30 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 256 i32.const 432 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.2 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 256 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -8671,30 +8671,30 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1192 i32.const 1208 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.3 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 1192 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -8707,50 +8707,50 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1192 i32.const 432 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.4 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 3 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -8763,50 +8763,50 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1224 i32.const 1248 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.5 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 3 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -8819,60 +8819,60 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1256 i32.const 432 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.6 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 4 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 256 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 3 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -8885,60 +8885,60 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1272 i32.const 432 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.7 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 4 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 256 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 3 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -8951,60 +8951,60 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 1288 i32.const 432 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.8 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 4 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 3 call $~lib/array/Array#__get i32.const 256 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -9017,50 +9017,50 @@ end block (result i32) i32.const 1 - set_global $~argc + global.set $~argc i32.const 288 i32.const 256 i32.const 0 call $~lib/string/String#split|trampoline end - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.9 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 3 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -9075,11 +9075,11 @@ i32.const 256 i32.const 0 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.10 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 0 @@ -9097,24 +9097,24 @@ i32.const 256 i32.const 1 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.11 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -9129,24 +9129,24 @@ i32.const 432 i32.const 1 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.12 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 1 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -9161,44 +9161,44 @@ i32.const 256 i32.const 4 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.13 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 3 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -9213,44 +9213,44 @@ i32.const 256 i32.const -1 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.14 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 3 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -9265,44 +9265,44 @@ i32.const 432 i32.const -1 call $~lib/string/String#split - set_global $std/string/sa + global.set $std/string/sa block $~lib/array/Array#get:length|inlined.15 (result i32) - get_global $std/string/sa - set_local $2 - get_local $2 + global.get $std/string/sa + local.set $2 + local.get $2 i32.load offset=4 end i32.const 3 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 0 call $~lib/array/Array#__get i32.const 280 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 1 call $~lib/array/Array#__get i32.const 648 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end - tee_local $2 + local.tee $2 if (result i32) - get_global $std/string/sa + global.get $std/string/sa i32.const 2 call $~lib/array/Array#__get i32.const 1216 call $~lib/string/String.__eq else - get_local $2 + local.get $2 end i32.eqz if @@ -9547,7 +9547,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u32.MAX_VALUE + global.get $~lib/builtins/u32.MAX_VALUE call $~lib/internal/number/utoa32 i32.const 2072 call $~lib/string/String.__eq @@ -9690,7 +9690,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/u64.MAX_VALUE + global.get $~lib/builtins/u64.MAX_VALUE call $~lib/internal/number/utoa64 i32.const 2848 call $~lib/string/String.__eq @@ -9820,7 +9820,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i64.MAX_VALUE + global.get $~lib/builtins/i64.MAX_VALUE call $~lib/internal/number/itoa64 i32.const 3088 call $~lib/string/String.__eq @@ -9833,7 +9833,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/i64.MIN_VALUE + global.get $~lib/builtins/i64.MIN_VALUE call $~lib/internal/number/itoa64 i32.const 3136 call $~lib/string/String.__eq @@ -9912,7 +9912,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.EPSILON + global.get $~lib/builtins/f64.EPSILON call $~lib/internal/number/dtoa i32.const 4632 call $~lib/string/String.__eq @@ -9925,7 +9925,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.EPSILON + global.get $~lib/builtins/f64.EPSILON f64.neg call $~lib/internal/number/dtoa i32.const 4680 @@ -9939,7 +9939,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_VALUE + global.get $~lib/builtins/f64.MAX_VALUE call $~lib/internal/number/dtoa i32.const 4728 call $~lib/string/String.__eq @@ -9952,7 +9952,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/builtins/f64.MAX_VALUE + global.get $~lib/builtins/f64.MAX_VALUE f64.neg call $~lib/internal/number/dtoa i32.const 4784 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index afffd32b..d012a63a 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -38,7 +38,7 @@ (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 anyfunc) + (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)) @@ -62,17 +62,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -81,16 +81,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -98,16 +98,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -116,13 +116,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -135,240 +135,240 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - get_local $1 + local.get $1 i32.eqz if return end - get_local $0 + local.get $0 i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 1 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add i32.const 0 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.sub i32.const 0 i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add i32.const 0 i32.store8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.const 4 i32.sub i32.const 0 i32.store8 - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.sub i32.const -4 i32.and - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.add i32.const 4 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 12 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 8 i32.sub i32.const 0 i32.store - get_local $1 + local.get $1 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add i32.const 0 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 i32.const 28 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 24 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 20 i32.sub i32.const 0 i32.store - get_local $2 + local.get $2 i32.const 16 i32.sub i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - set_local $0 - get_local $1 - get_local $2 + local.set $0 + local.get $1 + local.get $2 i32.sub - set_local $1 + local.set $1 loop $continue|0 - get_local $1 + local.get $1 i32.const 32 i32.ge_u if - get_local $0 + local.get $0 i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add i64.const 0 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add i64.const 0 i64.store - get_local $1 + local.get $1 i32.const 32 i32.sub - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 32 i32.add - set_local $0 + 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) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -379,41 +379,41 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.eqz if - get_local $2 + local.get $2 i32.const 8 i32.add - get_local $0 + local.get $0 call $~lib/internal/memory/memset end - get_local $2 + local.get $2 ) (func $~lib/map/Map#clear (; 5 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 + local.get $0 i32.const 3 i32.store offset=4 - get_local $0 + local.get $0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 + local.get $0 i32.const 4 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) @@ -421,173 +421,173 @@ (local $0 i32) i32.const 24 call $~lib/allocator/arena/__memory_allocate - tee_local $0 + local.tee $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hashStr (; 7 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) i32.const -2128831035 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load i32.const 1 i32.shl - set_local $3 + local.set $3 loop $repeat|0 block $break|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.ge_u br_if $break|0 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add i32.load8_u offset=4 - get_local $2 + local.get $2 i32.xor i32.const 16777619 i32.mul - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $~lib/internal/string/compareUnsafe (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $0 + local.get $0 i32.load16_u offset=4 - get_local $1 + local.get $1 i32.load16_u offset=4 i32.sub - tee_local $3 + local.tee $3 i32.eqz else - get_local $2 + local.get $2 end if - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 br $continue|0 end end - get_local $3 + local.get $3 ) (func $~lib/string/String.__eq (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.eqz - tee_local $2 + local.tee $2 i32.eqz if - get_local $1 + local.get $1 i32.eqz - set_local $2 + local.set $2 end - get_local $2 + local.get $2 if i32.const 0 return end - get_local $0 + local.get $0 i32.load - tee_local $2 - get_local $1 + local.tee $2 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $~lib/map/Map#find (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load - get_local $1 + local.get $1 call $~lib/string/String.__eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end @@ -601,102 +601,102 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load i32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load call $~lib/internal/hash/hashStr - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -704,39 +704,39 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hashStr - tee_local $5 + local.tee $5 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -745,62 +745,62 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/internal/hash/hash32 (; 13 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const -2128831035 i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 8 i32.shr_u i32.const 255 @@ -808,7 +808,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 16 i32.shr_u i32.const 255 @@ -816,7 +816,7 @@ i32.xor i32.const 16777619 i32.mul - get_local $0 + local.get $0 i32.const 24 i32.shr_u i32.xor @@ -824,43 +824,43 @@ i32.mul ) (func $~lib/map/Map#find (; 14 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $2 + local.get $2 i32.and i32.const 2 i32.shl i32.add i32.load offset=8 - set_local $2 + local.set $2 loop $continue|0 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz - tee_local $0 + local.tee $0 if - get_local $2 + local.get $2 i32.load - get_local $1 + local.get $1 i32.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 if - get_local $2 + local.get $2 return end - get_local $2 + local.get $2 i32.load offset=8 i32.const -2 i32.and - set_local $2 + local.set $2 br $continue|0 end end @@ -874,102 +874,102 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - tee_local $2 + local.tee $2 i32.const 2 i32.shl i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $4 - get_local $2 - f64.convert_s/i32 + local.set $4 + local.get $2 + f64.convert_i32_s f64.const 2.6666666666666665 f64.mul - i32.trunc_s/f64 - tee_local $6 + i32.trunc_f64_s + local.tee $6 i32.const 12 i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 8 i32.add - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 8 i32.add - set_local $3 + local.set $3 loop $continue|0 - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.ne if - get_local $2 + local.get $2 i32.load offset=8 i32.const 1 i32.and i32.eqz if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load i32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load offset=4 i32.store offset=4 - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.load call $~lib/internal/hash/hash32 - get_local $1 + local.get $1 i32.and i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - tee_local $8 + local.tee $8 i32.load offset=8 i32.store offset=8 - get_local $8 - get_local $3 + local.get $8 + local.get $3 i32.store offset=8 - get_local $3 + local.get $3 i32.const 12 i32.add - set_local $3 + local.set $3 end - get_local $2 + local.get $2 i32.const 12 i32.add - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -977,39 +977,39 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 - tee_local $5 + local.tee $5 call $~lib/map/Map#find - tee_local $3 + local.tee $3 if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 + f64.convert_i32_s f64.const 0.75 f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1018,71 +1018,71 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 - get_local $0 + local.set $3 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $4 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $4 + local.get $4 i32.const 12 i32.mul i32.add - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.store - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load - get_local $0 + local.get $0 i32.load offset=4 - get_local $5 + local.get $5 i32.and i32.const 2 i32.shl i32.add - tee_local $4 + local.tee $4 i32.load offset=8 i32.store offset=8 - get_local $4 - get_local $3 + local.get $4 + local.get $3 i32.store offset=8 end ) (func $~lib/symbol/Symbol.for (; 17 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) - get_global $~lib/symbol/stringToId + global.get $~lib/symbol/stringToId if - get_global $~lib/symbol/stringToId + global.get $~lib/symbol/stringToId i32.const 8 i32.const 8 call $~lib/internal/hash/hashStr call $~lib/map/Map#find if - get_global $~lib/symbol/stringToId + global.get $~lib/symbol/stringToId i32.const 8 i32.const 8 call $~lib/internal/hash/hashStr call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -1091,48 +1091,48 @@ end else call $~lib/map/Map#constructor - set_global $~lib/symbol/stringToId + global.set $~lib/symbol/stringToId call $~lib/map/Map#constructor - set_global $~lib/symbol/idToString + global.set $~lib/symbol/idToString end - get_global $~lib/symbol/nextId - tee_local $0 + global.get $~lib/symbol/nextId + local.tee $0 i32.const 1 i32.add - set_global $~lib/symbol/nextId - get_local $0 + global.set $~lib/symbol/nextId + local.get $0 i32.eqz if unreachable end - get_global $~lib/symbol/stringToId + global.get $~lib/symbol/stringToId i32.const 8 - get_local $0 + local.get $0 call $~lib/map/Map#set - get_global $~lib/symbol/idToString - get_local $0 + global.get $~lib/symbol/idToString + local.get $0 i32.const 8 call $~lib/map/Map#set - get_local $0 + local.get $0 ) (func $~lib/map/Map#has (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne ) (func $~lib/map/Map#get (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 - get_local $1 + local.get $0 + local.get $1 + local.get $1 call $~lib/internal/hash/hash32 call $~lib/map/Map#find - tee_local $0 + local.tee $0 if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else unreachable @@ -1140,20 +1140,20 @@ ) (func $~lib/symbol/Symbol.keyFor (; 20 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/symbol/idToString + global.get $~lib/symbol/idToString i32.const 0 i32.ne - tee_local $1 + local.tee $1 if - get_global $~lib/symbol/idToString - get_local $0 + global.get $~lib/symbol/idToString + local.get $0 call $~lib/map/Map#has - set_local $1 + local.set $1 end - get_local $1 + local.get $1 if (result i32) - get_global $~lib/symbol/idToString - get_local $0 + global.get $~lib/symbol/idToString + local.get $0 call $~lib/map/Map#get else i32.const 0 @@ -1161,17 +1161,17 @@ ) (func $~lib/internal/string/allocateUnsafe (; 21 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if - get_local $0 + local.get $0 i32.const 536870910 i32.le_s - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.eqz if i32.const 0 @@ -1181,910 +1181,910 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 i32.shl i32.const 4 i32.add call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memcpy (; 22 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) loop $continue|0 - get_local $1 + local.get $1 i32.const 3 i32.and - get_local $2 - get_local $2 + local.get $2 + local.get $2 select if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.eqz if loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|1 end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 8 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 8 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $1 + local.get $1 i32.const 4 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 4 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $1 + local.get $1 i32.const 2 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 2 i32.add - set_local $0 + local.set $0 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block $break|2 block $case2|2 block $case1|2 - get_local $0 + local.get $0 i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.const 1 i32.ne if - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|2 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|2 br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 - tee_local $3 + local.set $5 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 8 i32.shl - get_local $5 + local.get $5 i32.const 24 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 8 i32.shl - get_local $3 + local.get $3 i32.const 24 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|3 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 2 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 16 i32.shl - get_local $5 + local.get $5 i32.const 16 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 16 i32.shl - get_local $3 + local.get $3 i32.const 16 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|4 end end br $break|2 end - get_local $1 + local.get $1 i32.load - set_local $5 - get_local $0 - tee_local $4 + local.set $5 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 3 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - tee_local $3 + local.tee $3 i32.const 24 i32.shl - get_local $5 + local.get $5 i32.const 8 i32.shr_u i32.or i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - tee_local $5 + local.tee $5 i32.const 24 i32.shl - get_local $3 + local.get $3 i32.const 8 i32.shr_u i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 br $continue|5 end end end end - get_local $2 + local.get $2 i32.const 16 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 - tee_local $3 + local.get $0 + local.get $1 + local.tee $3 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $1 - set_local $0 - get_local $1 - get_local $3 + local.tee $1 + local.set $0 + local.get $1 + local.get $3 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $3 - set_local $0 - get_local $3 - get_local $1 + local.tee $3 + local.set $0 + local.get $3 + local.get $1 i32.const 1 i32.add - tee_local $1 + local.tee $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 - get_local $0 + local.get $0 i32.const 1 i32.add - tee_local $4 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 1 i32.add - tee_local $3 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load8_u i32.store8 end @@ -2092,156 +2092,156 @@ (func $~lib/internal/memory/memmove (; 23 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 i32.eqz if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u - set_local $3 + local.set $3 end - get_local $3 + local.get $3 if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 - get_local $0 - tee_local $4 + local.set $2 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 br $continue|0 end end loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 br $continue|1 end end end loop $continue|2 - get_local $2 + local.get $2 if - get_local $0 - tee_local $4 + local.get $0 + local.tee $4 i32.const 1 i32.add - set_local $0 - get_local $1 - tee_local $3 + local.set $0 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $4 - get_local $3 + local.set $1 + local.get $4 + local.get $3 i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|2 end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2249,18 +2249,18 @@ end end loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if - get_local $2 + local.get $2 i32.const 8 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -2269,16 +2269,16 @@ end end loop $continue|5 - get_local $2 + local.get $2 if - get_local $2 + local.get $2 i32.const 1 i32.sub - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2288,17 +2288,17 @@ end ) (func $~lib/internal/string/copyUnsafe (; 24 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - get_local $1 + local.get $1 i32.const 1 i32.shl - get_local $0 + local.get $0 i32.add i32.const 4 i32.add - get_local $2 + local.get $2 i32.const 4 i32.add - get_local $3 + local.get $3 i32.const 1 i32.shl call $~lib/internal/memory/memmove @@ -2307,7 +2307,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.eqz if i32.const 0 @@ -2317,50 +2317,50 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - tee_local $3 - get_local $1 + local.tee $3 + local.get $1 i32.const 488 - get_local $1 + local.get $1 select - tee_local $1 + local.tee $1 i32.load - tee_local $4 + local.tee $4 i32.add - tee_local $2 + local.tee $2 i32.eqz if i32.const 168 return end - get_local $2 + local.get $2 call $~lib/internal/string/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 0 - get_local $0 - get_local $3 + local.get $0 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $2 - get_local $3 - get_local $1 - get_local $4 + local.get $2 + local.get $3 + local.get $1 + local.get $4 call $~lib/internal/string/copyUnsafe - get_local $2 + local.get $2 ) (func $~lib/string/String.__concat (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.const 488 - get_local $0 + local.get $0 select - get_local $1 + local.get $1 call $~lib/string/String#concat ) (func $~lib/symbol/symbol#toString (; 27 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) i32.const 168 - set_local $2 + local.set $2 i32.const 464 block $break|0 (result i32) block $case11|0 @@ -2374,12 +2374,12 @@ block $case3|0 block $case2|0 block $case1|0 - get_local $0 - tee_local $1 + local.get $0 + local.tee $1 i32.const 1 i32.ne if - get_local $1 + local.get $1 i32.const 2 i32.sub br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 $case6|0 $case7|0 $case8|0 $case9|0 $case10|0 $case11|0 @@ -2417,20 +2417,20 @@ i32.const 432 br $break|0 end - get_global $~lib/symbol/idToString + global.get $~lib/symbol/idToString i32.const 0 i32.ne - tee_local $1 + local.tee $1 if - get_global $~lib/symbol/idToString - get_local $0 + global.get $~lib/symbol/idToString + local.get $0 call $~lib/map/Map#has - set_local $1 + local.set $1 end - get_local $1 + local.get $1 if (result i32) - get_global $~lib/symbol/idToString - get_local $0 + global.get $~lib/symbol/idToString + local.get $0 call $~lib/map/Map#get else i32.const 168 @@ -2443,35 +2443,35 @@ (func $start (; 28 ;) (type $v) (local $0 i32) i32.const 760 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset - get_global $~lib/symbol/nextId - tee_local $0 + 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 - set_global $~lib/symbol/nextId - get_local $0 + global.set $~lib/symbol/nextId + local.get $0 i32.eqz if unreachable end - get_local $0 - set_global $std/symbol/sym1 - get_global $~lib/symbol/nextId - tee_local $0 + local.get $0 + global.set $std/symbol/sym1 + global.get $~lib/symbol/nextId + local.tee $0 i32.const 1 i32.add - set_global $~lib/symbol/nextId - get_local $0 + global.set $~lib/symbol/nextId + local.get $0 i32.eqz if unreachable end - get_local $0 - set_global $std/symbol/sym2 - get_global $std/symbol/sym1 - get_global $std/symbol/sym2 + local.get $0 + global.set $std/symbol/sym2 + global.get $std/symbol/sym1 + global.get $std/symbol/sym2 i32.eq if i32.const 0 @@ -2482,11 +2482,11 @@ unreachable end call $~lib/symbol/Symbol.for - set_global $std/symbol/sym3 + global.set $std/symbol/sym3 call $~lib/symbol/Symbol.for - set_global $std/symbol/sym4 - get_global $std/symbol/sym3 - get_global $std/symbol/sym4 + global.set $std/symbol/sym4 + global.get $std/symbol/sym3 + global.get $std/symbol/sym4 i32.ne if i32.const 0 @@ -2496,13 +2496,13 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/sym1 + global.get $std/symbol/sym1 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key1 - get_global $std/symbol/sym2 + global.set $std/symbol/key1 + global.get $std/symbol/sym2 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key2 - get_global $std/symbol/key1 + global.set $std/symbol/key2 + global.get $std/symbol/key1 if i32.const 0 i32.const 24 @@ -2511,7 +2511,7 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/key2 + global.get $std/symbol/key2 if i32.const 0 i32.const 24 @@ -2520,13 +2520,13 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/sym3 + global.get $std/symbol/sym3 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key3 - get_global $std/symbol/sym4 + global.set $std/symbol/key3 + global.get $std/symbol/sym4 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key4 - get_global $std/symbol/key3 + global.set $std/symbol/key4 + global.get $std/symbol/key3 i32.const 8 call $~lib/string/String.__eq i32.eqz @@ -2538,8 +2538,8 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/key3 - get_global $std/symbol/key4 + global.get $std/symbol/key3 + global.get $std/symbol/key4 call $~lib/string/String.__eq i32.eqz if @@ -2550,17 +2550,17 @@ call $~lib/env/abort unreachable end - get_global $~lib/symbol/nextId - tee_local $0 + global.get $~lib/symbol/nextId + local.tee $0 i32.const 1 i32.add - set_global $~lib/symbol/nextId - get_local $0 + global.set $~lib/symbol/nextId + local.get $0 i32.eqz if unreachable end - get_local $0 + local.get $0 call $~lib/symbol/symbol#toString i32.const 600 call $~lib/string/String.__eq @@ -2573,7 +2573,7 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/sym3 + global.get $std/symbol/sym3 call $~lib/symbol/symbol#toString i32.const 624 call $~lib/string/String.__eq @@ -2587,10 +2587,10 @@ unreachable end i32.const 1 - set_global $std/symbol/hasInstance + global.set $std/symbol/hasInstance i32.const 2 - set_global $std/symbol/isConcatSpreadable - get_global $std/symbol/hasInstance + global.set $std/symbol/isConcatSpreadable + global.get $std/symbol/hasInstance call $~lib/symbol/symbol#toString i32.const 656 call $~lib/string/String.__eq @@ -2603,7 +2603,7 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/isConcatSpreadable + global.get $std/symbol/isConcatSpreadable call $~lib/symbol/symbol#toString i32.const 704 call $~lib/string/String.__eq diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 06f8f752..461bebde 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -36,7 +36,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) @@ -78,20 +78,20 @@ (local $1 i32) (local $2 i32) block (result i32) - get_global $~lib/symbol/nextId - tee_local $1 + global.get $~lib/symbol/nextId + local.tee $1 i32.const 1 i32.add - set_global $~lib/symbol/nextId - get_local $1 + global.set $~lib/symbol/nextId + local.get $1 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if unreachable end - get_local $2 + local.get $2 ) (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -100,41 +100,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -144,22 +144,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -168,20 +168,20 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) (func $~lib/internal/arraybuffer/computeSize (; 4 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -192,8 +192,8 @@ (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -205,267 +205,267 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -476,8 +476,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $1 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.gt_u if i32.const 0 @@ -487,260 +487,260 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 0 i32.ne i32.eqz if - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $1 + local.set $5 + local.get $4 + local.get $5 + local.get $1 call $~lib/internal/memory/memset end - get_local $3 + local.get $3 ) (func $~lib/map/Map#clear (; 8 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 9 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/map/Map#clear (; 10 ;) (type $iv) (param $0 i32) - get_local $0 + local.get $0 i32.const 0 i32.const 16 i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.const 1 i32.sub i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.const 48 i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - get_local $0 - get_global $~lib/map/INITIAL_CAPACITY + local.get $0 + global.get $~lib/map/INITIAL_CAPACITY i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 ) (func $~lib/map/Map#constructor (; 11 ;) (type $ii) (param $0 i32) (result i32) block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 24 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 i32.const 0 i32.store offset=12 - get_local $0 + local.get $0 i32.const 0 i32.store offset=16 - get_local $0 + local.get $0 i32.const 0 i32.store offset=20 - get_local $0 + local.get $0 end call $~lib/map/Map#clear - get_local $0 + local.get $0 ) (func $~lib/internal/hash/hashStr (; 12 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 block $break|0 block i32.const 0 - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load i32.const 1 i32.shl - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_u i32.eqz br_if $break|0 - get_local $1 - get_local $0 - get_local $2 + local.get $1 + local.get $0 + local.get $2 i32.add i32.load8_u offset=4 i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $1 + local.get $1 ) (func $~lib/internal/string/compareUnsafe (; 13 ;) (type $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 - set_local $5 - get_local $0 - get_local $1 + local.set $5 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - set_local $6 - get_local $2 - get_local $3 + local.set $6 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - set_local $7 + local.set $7 block $break|0 loop $continue|0 - get_local $4 + local.get $4 if (result i32) - get_local $6 + local.get $6 i32.load16_u offset=4 - get_local $7 + local.get $7 i32.load16_u offset=4 i32.sub - tee_local $5 + local.tee $5 i32.eqz else - get_local $4 + local.get $4 end if block - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 - get_local $6 + local.set $4 + local.get $6 i32.const 2 i32.add - set_local $6 - get_local $7 + local.set $6 + local.get $7 i32.const 2 i32.add - set_local $7 + local.set $7 end br $continue|0 end end end - get_local $5 + local.get $5 ) (func $~lib/string/String.__eq (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if i32.const 1 return end - get_local $0 + local.get $0 i32.const 0 i32.eq - tee_local $2 + local.tee $2 if (result i32) - get_local $2 + local.get $2 else - get_local $1 + local.get $1 i32.const 0 i32.eq end @@ -748,69 +748,69 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $3 - get_local $1 + local.set $3 + local.get $3 + local.get $1 i32.load i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.const 0 - get_local $1 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/compareUnsafe i32.eqz ) (func $~lib/map/Map#find (; 15 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load - get_local $1 + local.get $1 call $~lib/string/String.__eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -819,10 +819,10 @@ i32.const 0 ) (func $~lib/map/Map#has (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.0 end @@ -832,18 +832,18 @@ ) (func $~lib/map/Map#get (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.1 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable @@ -861,131 +861,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load i32.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $9 + local.get $9 i32.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.3 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -995,43 +995,43 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hashStr br $~lib/internal/hash/HASH|inlined.2 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1040,145 +1040,145 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/internal/hash/hash32 (; 20 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/internal/hash/FNV_OFFSET - set_local $1 - get_local $1 - get_local $0 + global.get $~lib/internal/hash/FNV_OFFSET + local.set $1 + local.get $1 + local.get $0 i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 8 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 16 i32.shr_u i32.const 255 i32.and i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.const 24 i32.shr_u i32.xor - get_global $~lib/internal/hash/FNV_PRIME + global.get $~lib/internal/hash/FNV_PRIME i32.mul - set_local $1 - get_local $1 + local.set $1 + local.get $1 ) (func $~lib/map/Map#find (; 21 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add i32.load offset=8 - set_local $3 + local.set $3 block $break|0 loop $continue|0 - get_local $3 + local.get $3 if block - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz - tee_local $4 + local.tee $4 if (result i32) - get_local $3 + local.get $3 i32.load - get_local $1 + local.get $1 i32.eq else - get_local $4 + local.get $4 end if - get_local $3 + local.get $3 return end - get_local $3 + local.get $3 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.const -1 i32.xor i32.and - set_local $3 + local.set $3 end br $continue|0 end @@ -1198,131 +1198,131 @@ (local $10 i32) (local $11 i32) (local $12 i32) - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $2 + local.set $2 i32.const 0 - get_local $2 - get_global $~lib/map/BUCKET_SIZE + local.get $2 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $3 - get_local $2 - f64.convert_s/i32 - get_global $~lib/map/FILL_FACTOR + local.set $3 + local.get $2 + f64.convert_i32_s + global.get $~lib/map/FILL_FACTOR f64.mul - i32.trunc_s/f64 - set_local $4 + i32.trunc_f64_s + local.set $4 i32.const 0 - get_local $4 + local.get $4 block $~lib/map/ENTRY_SIZE|inlined.1 (result i32) i32.const 12 end i32.mul i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $6 - get_local $6 - get_local $0 + local.set $6 + local.get $6 + local.get $0 i32.load offset=16 block $~lib/map/ENTRY_SIZE|inlined.2 (result i32) i32.const 12 end i32.mul i32.add - set_local $7 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $7 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $8 + local.set $8 block $break|0 loop $continue|0 - get_local $6 - get_local $7 + local.get $6 + local.get $7 i32.ne if block - get_local $6 - set_local $9 - get_local $9 + local.get $6 + local.set $9 + local.get $9 i32.load offset=8 - get_global $~lib/map/EMPTY + global.get $~lib/map/EMPTY i32.and i32.eqz if - get_local $8 - set_local $10 - get_local $10 - get_local $9 + local.get $8 + local.set $10 + local.get $10 + local.get $9 i32.load i32.store - get_local $10 - get_local $9 + local.get $10 + local.get $9 i32.load offset=4 i32.store offset=4 block $~lib/internal/hash/HASH|inlined.1 (result i32) - get_local $9 + local.get $9 i32.load - set_local $11 - get_local $11 + local.set $11 + local.get $11 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.1 end - get_local $1 + local.get $1 i32.and - set_local $11 - get_local $3 - get_local $11 - get_global $~lib/map/BUCKET_SIZE + local.set $11 + local.get $3 + local.get $11 + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $12 - get_local $10 - get_local $12 + local.set $12 + local.get $10 + local.get $12 i32.load offset=8 i32.store offset=8 - get_local $12 - get_local $8 + local.get $12 + local.get $8 i32.store offset=8 - get_local $8 + local.get $8 block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - set_local $8 + local.set $8 end - get_local $6 + local.get $6 block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) i32.const 12 end i32.add - set_local $6 + local.set $6 end br $continue|0 end end end - get_local $0 - get_local $3 + local.get $0 + local.get $3 i32.store - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=4 - get_local $0 - get_local $5 + local.get $0 + local.get $5 i32.store offset=8 - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.store offset=12 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -1332,43 +1332,43 @@ (local $5 i32) (local $6 i32) block $~lib/internal/hash/HASH|inlined.0 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.0 end - set_local $3 - get_local $0 - get_local $1 - get_local $3 + local.set $3 + local.get $0 + local.get $1 + local.get $3 call $~lib/map/Map#find - set_local $4 - get_local $4 + local.set $4 + local.get $4 if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 else - get_local $0 + local.get $0 i32.load offset=16 - get_local $0 + local.get $0 i32.load offset=12 i32.eq if - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 - get_local $0 + local.get $0 i32.load offset=12 - f64.convert_s/i32 - get_global $~lib/map/FREE_FACTOR + f64.convert_i32_s + global.get $~lib/map/FREE_FACTOR f64.mul - i32.trunc_s/f64 + i32.trunc_f64_s i32.lt_s if (result i32) - get_local $0 + local.get $0 i32.load offset=4 else - get_local $0 + local.get $0 i32.load offset=4 i32.const 1 i32.shl @@ -1377,111 +1377,111 @@ end call $~lib/map/Map#rehash end - get_local $0 + local.get $0 i32.load offset=8 - set_local $5 - get_local $5 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $5 + local.get $5 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add block (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=16 - tee_local $6 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - get_local $6 + local.get $6 end block $~lib/map/ENTRY_SIZE|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - set_local $4 - get_local $4 - get_local $1 + local.set $4 + local.get $4 + local.get $1 i32.store - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.store offset=4 - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.load offset=20 i32.const 1 i32.add i32.store offset=20 - get_local $0 + local.get $0 i32.load - get_local $3 - get_local $0 + local.get $3 + local.get $0 i32.load offset=4 i32.and - get_global $~lib/map/BUCKET_SIZE + global.get $~lib/map/BUCKET_SIZE i32.mul i32.add - set_local $6 - get_local $4 - get_local $6 + local.set $6 + local.get $4 + local.get $6 i32.load offset=8 i32.store offset=8 - get_local $6 - get_local $4 + local.get $6 + local.get $4 i32.store offset=8 end ) (func $~lib/symbol/Symbol.for (; 24 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_global $~lib/symbol/stringToId + global.get $~lib/symbol/stringToId i32.eqz if i32.const 0 call $~lib/map/Map#constructor - set_global $~lib/symbol/stringToId + global.set $~lib/symbol/stringToId i32.const 0 call $~lib/map/Map#constructor - set_global $~lib/symbol/idToString + global.set $~lib/symbol/idToString else - get_global $~lib/symbol/stringToId - get_local $0 + global.get $~lib/symbol/stringToId + local.get $0 call $~lib/map/Map#has if - get_global $~lib/symbol/stringToId - get_local $0 + global.get $~lib/symbol/stringToId + local.get $0 call $~lib/map/Map#get return end end block (result i32) - get_global $~lib/symbol/nextId - tee_local $1 + global.get $~lib/symbol/nextId + local.tee $1 i32.const 1 i32.add - set_global $~lib/symbol/nextId - get_local $1 + global.set $~lib/symbol/nextId + local.get $1 end - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.eqz if unreachable end - get_global $~lib/symbol/stringToId - get_local $0 - get_local $2 + global.get $~lib/symbol/stringToId + local.get $0 + local.get $2 call $~lib/map/Map#set - get_global $~lib/symbol/idToString - get_local $2 - get_local $0 + global.get $~lib/symbol/idToString + local.get $2 + local.get $0 call $~lib/map/Map#set - get_local $2 + local.get $2 ) (func $~lib/map/Map#has (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.2 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.2 end @@ -1491,18 +1491,18 @@ ) (func $~lib/map/Map#get (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 block $~lib/internal/hash/HASH|inlined.3 (result i32) - get_local $1 + local.get $1 call $~lib/internal/hash/hash32 br $~lib/internal/hash/HASH|inlined.3 end call $~lib/map/Map#find - set_local $2 - get_local $2 + local.set $2 + local.get $2 if (result i32) - get_local $2 + local.get $2 i32.load offset=4 else unreachable @@ -1510,20 +1510,20 @@ ) (func $~lib/symbol/Symbol.keyFor (; 27 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_global $~lib/symbol/idToString + global.get $~lib/symbol/idToString i32.const 0 i32.ne - tee_local $1 + local.tee $1 if (result i32) - get_global $~lib/symbol/idToString - get_local $0 + global.get $~lib/symbol/idToString + local.get $0 call $~lib/map/Map#has else - get_local $1 + local.get $1 end if (result i32) - get_global $~lib/symbol/idToString - get_local $0 + global.get $~lib/symbol/idToString + local.get $0 call $~lib/map/Map#get else i32.const 0 @@ -1532,16 +1532,16 @@ (func $~lib/internal/string/allocateUnsafe (; 28 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 + local.get $0 i32.const 0 i32.gt_s - tee_local $1 + local.tee $1 if (result i32) - get_local $0 - get_global $~lib/internal/string/MAX_LENGTH + local.get $0 + global.get $~lib/internal/string/MAX_LENGTH i32.le_s else - get_local $1 + local.get $1 end i32.eqz if @@ -1553,21 +1553,21 @@ unreachable end block $~lib/memory/memory.allocate|inlined.1 (result i32) - get_global $~lib/internal/string/HEADER_SIZE - get_local $0 + global.get $~lib/internal/string/HEADER_SIZE + local.get $0 i32.const 1 i32.shl i32.add - set_local $1 - get_local $1 + local.set $1 + local.get $1 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_local $2 - get_local $2 - get_local $0 + local.set $2 + local.get $2 + local.get $0 i32.store - get_local $2 + local.get $2 ) (func $~lib/internal/memory/memcpy (; 29 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -1575,44 +1575,44 @@ (local $5 i32) block $break|0 loop $continue|0 - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 3 i32.and else - get_local $2 + local.get $2 end if block block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|0 end end end - get_local $0 + local.get $0 i32.const 3 i32.and i32.const 0 @@ -1620,141 +1620,141 @@ if block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 16 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.const 8 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.const 12 i32.add i32.load i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|1 end end end - get_local $2 + local.get $2 i32.const 8 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.const 4 i32.add i32.load i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 4 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load i32.store - get_local $0 + local.get $0 i32.const 4 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 4 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 2 i32.and if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load16_u i32.store16 - get_local $0 + local.get $0 i32.const 2 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 2 i32.add - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end return end - get_local $2 + local.get $2 i32.const 32 i32.ge_u if @@ -1762,167 +1762,167 @@ block $case2|2 block $case1|2 block $case0|2 - get_local $0 + local.get $0 i32.const 3 i32.and - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 1 i32.eq br_if $case0|2 - get_local $5 + local.get $5 i32.const 2 i32.eq br_if $case1|2 - get_local $5 + local.get $5 i32.const 3 i32.eq br_if $case2|2 br $break|2 end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 3 i32.sub - set_local $2 + local.set $2 block $break|3 loop $continue|3 - get_local $2 + local.get $2 i32.const 17 i32.ge_u if block - get_local $1 + local.get $1 i32.const 1 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 5 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 9 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 24 i32.shr_u - get_local $4 + local.get $4 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 13 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 24 i32.shr_u - get_local $3 + local.get $3 i32.const 8 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|3 end @@ -1934,130 +1934,130 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.sub - set_local $2 + local.set $2 block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 18 i32.ge_u if block - get_local $1 + local.get $1 i32.const 2 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 6 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 10 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 16 i32.shr_u - get_local $4 + local.get $4 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 14 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 16 i32.shr_u - get_local $3 + local.get $3 i32.const 16 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|4 end @@ -2069,112 +2069,112 @@ unreachable end block - get_local $1 + local.get $1 i32.load - set_local $3 + local.set $3 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block $break|5 loop $continue|5 - get_local $2 + local.get $2 i32.const 19 i32.ge_u if block - get_local $1 + local.get $1 i32.const 3 i32.add i32.load - set_local $4 - get_local $0 - get_local $3 + local.set $4 + local.get $0 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 7 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 11 i32.add i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.const 8 i32.add - get_local $3 + local.get $3 i32.const 8 i32.shr_u - get_local $4 + local.get $4 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 15 i32.add i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.const 8 i32.shr_u - get_local $3 + local.get $3 i32.const 24 i32.shl i32.or i32.store - get_local $1 + local.get $1 i32.const 16 i32.add - set_local $1 - get_local $0 + local.set $1 + local.get $0 i32.const 16 i32.add - set_local $0 - get_local $2 + local.set $0 + local.get $2 i32.const 16 i32.sub - set_local $2 + local.set $2 end br $continue|5 end @@ -2186,585 +2186,585 @@ unreachable end end - get_local $2 + local.get $2 i32.const 16 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 8 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 4 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 2 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 end - get_local $2 + local.get $2 i32.const 1 i32.and if block (result i32) - get_local $0 - tee_local $5 + local.get $0 + local.tee $5 i32.const 1 i32.add - set_local $0 - get_local $5 + local.set $0 + local.get $5 end block (result i32) - get_local $1 - tee_local $5 + local.get $1 + local.tee $5 i32.const 1 i32.add - set_local $1 - get_local $5 + local.set $1 + local.get $5 end i32.load8_u i32.store8 @@ -2772,77 +2772,77 @@ ) (func $~lib/internal/memory/memmove (; 30 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.eq if return end - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $0 + local.get $0 i32.le_u - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - get_local $1 + local.get $1 i32.le_u end if - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 call $~lib/internal/memory/memcpy return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.lt_u if - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|0 loop $continue|0 - get_local $0 + local.get $0 i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 @@ -2853,27 +2853,27 @@ end block $break|1 loop $continue|1 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.load i64.store - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 8 i32.add - set_local $0 - get_local $1 + local.set $0 + local.get $1 i32.const 8 i32.add - set_local $1 + local.set $1 end br $continue|1 end @@ -2882,67 +2882,67 @@ end block $break|2 loop $continue|2 - get_local $2 + local.get $2 if block block (result i32) - get_local $0 - tee_local $3 + local.get $0 + local.tee $3 i32.const 1 i32.add - set_local $0 - get_local $3 + local.set $0 + local.get $3 end block (result i32) - get_local $1 - tee_local $3 + local.get $1 + local.tee $3 i32.const 1 i32.add - set_local $1 - get_local $3 + local.set $1 + local.get $3 end i32.load8_u i32.store8 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 end br $continue|2 end end end else - get_local $1 + local.get $1 i32.const 7 i32.and - get_local $0 + local.get $0 i32.const 7 i32.and i32.eq if block $break|3 loop $continue|3 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 7 i32.and if block - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -2953,20 +2953,20 @@ end block $break|4 loop $continue|4 - get_local $2 + local.get $2 i32.const 8 i32.ge_u if block - get_local $2 + local.get $2 i32.const 8 i32.sub - set_local $2 - get_local $0 - get_local $2 + local.set $2 + local.get $0 + local.get $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i64.load i64.store @@ -2978,16 +2978,16 @@ end block $break|5 loop $continue|5 - get_local $2 + local.get $2 if - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.const 1 i32.sub - tee_local $2 + local.tee $2 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add i32.load8_u i32.store8 @@ -3001,29 +3001,29 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $5 - get_local $2 - get_local $3 + local.set $5 + local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - get_global $~lib/internal/string/HEADER_SIZE + global.get $~lib/internal/string/HEADER_SIZE i32.add - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.shl - set_local $7 - get_local $5 - get_local $6 - get_local $7 + local.set $7 + local.get $5 + local.get $6 + local.get $7 call $~lib/internal/memory/memmove ) (func $~lib/string/String#concat (; 32 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -3031,7 +3031,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.const 0 i32.ne i32.eqz @@ -3043,66 +3043,66 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.eq if i32.const 488 - set_local $1 + local.set $1 end - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.load - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.add - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.const 0 i32.eq if i32.const 168 return end - get_local $4 + local.get $4 call $~lib/internal/string/allocateUnsafe - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.const 0 - get_local $0 + local.get $0 i32.const 0 - get_local $2 + local.get $2 call $~lib/internal/string/copyUnsafe - get_local $5 - get_local $2 - get_local $1 + local.get $5 + local.get $2 + local.get $1 i32.const 0 - get_local $3 + local.get $3 call $~lib/internal/string/copyUnsafe - get_local $5 + local.get $5 ) (func $~lib/string/String.__concat (; 33 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 488 - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/string/String#concat ) (func $~lib/symbol/symbol#toString (; 34 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 - set_local $1 + local.get $0 + local.set $1 i32.const 168 - set_local $2 + local.set $2 block $break|0 block $case11|0 block $case10|0 @@ -3116,49 +3116,49 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $1 - set_local $3 - get_local $3 + local.get $1 + local.set $3 + local.get $3 i32.const 1 i32.eq br_if $case0|0 - get_local $3 + local.get $3 i32.const 2 i32.eq br_if $case1|0 - get_local $3 + local.get $3 i32.const 3 i32.eq br_if $case2|0 - get_local $3 + local.get $3 i32.const 4 i32.eq br_if $case3|0 - get_local $3 + local.get $3 i32.const 5 i32.eq br_if $case4|0 - get_local $3 + local.get $3 i32.const 6 i32.eq br_if $case5|0 - get_local $3 + local.get $3 i32.const 7 i32.eq br_if $case6|0 - get_local $3 + local.get $3 i32.const 8 i32.eq br_if $case7|0 - get_local $3 + local.get $3 i32.const 9 i32.eq br_if $case8|0 - get_local $3 + local.get $3 i32.const 10 i32.eq br_if $case9|0 - get_local $3 + local.get $3 i32.const 11 i32.eq br_if $case10|0 @@ -3166,7 +3166,7 @@ end block i32.const 176 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3174,7 +3174,7 @@ end block i32.const 208 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3182,7 +3182,7 @@ end block i32.const 248 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3190,7 +3190,7 @@ end block i32.const 272 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3198,7 +3198,7 @@ end block i32.const 288 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3206,7 +3206,7 @@ end block i32.const 312 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3214,7 +3214,7 @@ end block i32.const 328 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3222,7 +3222,7 @@ end block i32.const 352 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3230,7 +3230,7 @@ end block i32.const 368 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3238,7 +3238,7 @@ end block i32.const 400 - set_local $2 + local.set $2 br $break|0 unreachable end @@ -3246,29 +3246,29 @@ end block i32.const 432 - set_local $2 + local.set $2 br $break|0 unreachable end unreachable end block - get_global $~lib/symbol/idToString + global.get $~lib/symbol/idToString i32.const 0 i32.ne - tee_local $3 + local.tee $3 if (result i32) - get_global $~lib/symbol/idToString - get_local $1 + global.get $~lib/symbol/idToString + local.get $1 call $~lib/map/Map#has else - get_local $3 + local.get $3 end if - get_global $~lib/symbol/idToString - get_local $1 + global.get $~lib/symbol/idToString + local.get $1 call $~lib/map/Map#get - set_local $2 + local.set $2 end br $break|0 unreachable @@ -3276,30 +3276,30 @@ unreachable end i32.const 464 - get_local $2 + local.get $2 call $~lib/string/String.__concat i32.const 592 call $~lib/string/String.__concat ) (func $start (; 35 ;) (type $v) - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 8 call $~lib/symbol/Symbol - set_global $std/symbol/sym1 + global.set $std/symbol/sym1 i32.const 8 call $~lib/symbol/Symbol - set_global $std/symbol/sym2 - get_global $std/symbol/sym1 - get_global $std/symbol/sym2 + global.set $std/symbol/sym2 + global.get $std/symbol/sym1 + global.get $std/symbol/sym2 i32.ne i32.eqz if @@ -3312,12 +3312,12 @@ end i32.const 8 call $~lib/symbol/Symbol.for - set_global $std/symbol/sym3 + global.set $std/symbol/sym3 i32.const 8 call $~lib/symbol/Symbol.for - set_global $std/symbol/sym4 - get_global $std/symbol/sym3 - get_global $std/symbol/sym4 + global.set $std/symbol/sym4 + global.get $std/symbol/sym3 + global.get $std/symbol/sym4 i32.eq i32.eqz if @@ -3328,13 +3328,13 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/sym1 + global.get $std/symbol/sym1 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key1 - get_global $std/symbol/sym2 + global.set $std/symbol/key1 + global.get $std/symbol/sym2 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key2 - get_global $std/symbol/key1 + global.set $std/symbol/key2 + global.get $std/symbol/key1 i32.const 0 i32.eq i32.eqz @@ -3346,7 +3346,7 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/key2 + global.get $std/symbol/key2 i32.const 0 i32.eq i32.eqz @@ -3358,13 +3358,13 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/sym3 + global.get $std/symbol/sym3 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key3 - get_global $std/symbol/sym4 + global.set $std/symbol/key3 + global.get $std/symbol/sym4 call $~lib/symbol/Symbol.keyFor - set_global $std/symbol/key4 - get_global $std/symbol/key3 + global.set $std/symbol/key4 + global.get $std/symbol/key3 i32.const 8 call $~lib/string/String.__eq i32.eqz @@ -3376,8 +3376,8 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/key3 - get_global $std/symbol/key4 + global.get $std/symbol/key3 + global.get $std/symbol/key4 call $~lib/string/String.__eq i32.eqz if @@ -3402,7 +3402,7 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/sym3 + global.get $std/symbol/sym3 call $~lib/symbol/symbol#toString i32.const 624 call $~lib/string/String.__eq @@ -3415,11 +3415,11 @@ call $~lib/env/abort unreachable end - get_global $~lib/symbol/Symbol.hasInstance - set_global $std/symbol/hasInstance - get_global $~lib/symbol/Symbol.isConcatSpreadable - set_global $std/symbol/isConcatSpreadable - get_global $std/symbol/hasInstance + global.get $~lib/symbol/Symbol.hasInstance + global.set $std/symbol/hasInstance + 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/string/String.__eq @@ -3432,7 +3432,7 @@ call $~lib/env/abort unreachable end - get_global $std/symbol/isConcatSpreadable + global.get $std/symbol/isConcatSpreadable call $~lib/symbol/symbol#toString i32.const 704 call $~lib/string/String.__eq @@ -3445,9 +3445,9 @@ call $~lib/env/abort unreachable end - get_global $~lib/symbol/Symbol.hasInstance + global.get $~lib/symbol/Symbol.hasInstance drop - get_global $~lib/symbol/Symbol.isConcatSpreadable + global.get $~lib/symbol/Symbol.isConcatSpreadable drop ) (func $null (; 36 ;) (type $v) diff --git a/tests/compiler/std/trace.optimized.wat b/tests/compiler/std/trace.optimized.wat index 894843dd..7a29f30f 100644 --- a/tests/compiler/std/trace.optimized.wat +++ b/tests/compiler/std/trace.optimized.wat @@ -11,19 +11,19 @@ (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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~started (mut i32) (i32.const 0)) (export "memory" (memory $0)) (export "table" (table $0)) (export "main" (func $std/trace/main)) (func $std/trace/main (; 1 ;) (type $v) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end ) (func $start (; 2 ;) (type $v) diff --git a/tests/compiler/std/trace.untouched.wat b/tests/compiler/std/trace.untouched.wat index ecb288fa..48f8093b 100644 --- a/tests/compiler/std/trace.untouched.wat +++ b/tests/compiler/std/trace.untouched.wat @@ -11,7 +11,7 @@ (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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $~started (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 212)) @@ -19,12 +19,12 @@ (export "table" (table $0)) (export "main" (func $std/trace/main)) (func $std/trace/main (; 1 ;) (type $v) - get_global $~started + global.get $~started i32.eqz if call $start i32.const 1 - set_global $~started + global.set $~started end ) (func $start (; 2 ;) (type $v) diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 73f1840d..204f27b8 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -65,7 +65,7 @@ (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") - (table $0 101 anyfunc) + (table $0 101 funcref) (elem (i32.const 0) $null $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|9 $std/typedarray/testReduce~anonymous|9 $std/typedarray/testReduce~anonymous|11 $std/typedarray/testReduce~anonymous|12 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|9 $std/typedarray/testReduce~anonymous|9 $std/typedarray/testReduce~anonymous|11 $std/typedarray/testReduce~anonymous|12 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|31 $std/typedarray/testArrayMap~anonymous|31 $std/typedarray/testArrayMap~anonymous|33 $std/typedarray/testArrayMap~anonymous|34 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArraySome~anonymous|36 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArraySome~anonymous|36 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArraySome~anonymous|36 $std/typedarray/testArraySome~anonymous|41 $std/typedarray/testArraySome~anonymous|42 $std/typedarray/testArraySome~anonymous|41 $std/typedarray/testArraySome~anonymous|42 $std/typedarray/testArraySome~anonymous|45 $std/typedarray/testArraySome~anonymous|46 $std/typedarray/testArraySome~anonymous|45 $std/typedarray/testArraySome~anonymous|46 $std/typedarray/testArraySome~anonymous|49 $std/typedarray/testArraySome~anonymous|50 $std/typedarray/testArraySome~anonymous|49 $std/typedarray/testArraySome~anonymous|50 $std/typedarray/testArraySome~anonymous|53 $std/typedarray/testArraySome~anonymous|54 $std/typedarray/testArraySome~anonymous|55 $std/typedarray/testArraySome~anonymous|56 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArrayFindIndex~anonymous|58 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArrayFindIndex~anonymous|58 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArrayFindIndex~anonymous|58 $std/typedarray/testArraySome~anonymous|41 $std/typedarray/testArrayFindIndex~anonymous|64 $std/typedarray/testArraySome~anonymous|41 $std/typedarray/testArrayFindIndex~anonymous|64 $std/typedarray/testArraySome~anonymous|45 $std/typedarray/testArrayFindIndex~anonymous|68 $std/typedarray/testArraySome~anonymous|45 $std/typedarray/testArrayFindIndex~anonymous|68 $std/typedarray/testArraySome~anonymous|49 $std/typedarray/testArrayFindIndex~anonymous|72 $std/typedarray/testArraySome~anonymous|49 $std/typedarray/testArrayFindIndex~anonymous|72 $std/typedarray/testArraySome~anonymous|53 $std/typedarray/testArrayFindIndex~anonymous|76 $std/typedarray/testArraySome~anonymous|55 $std/typedarray/testArrayFindIndex~anonymous|78 $std/typedarray/testArrayEvery~anonymous|79 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArrayEvery~anonymous|81 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArrayEvery~anonymous|81 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArrayEvery~anonymous|85 $std/typedarray/testArraySome~anonymous|41 $std/typedarray/testArrayEvery~anonymous|81 $std/typedarray/testArraySome~anonymous|41 $std/typedarray/testArrayEvery~anonymous|89 $std/typedarray/testArraySome~anonymous|45 $std/typedarray/testArrayEvery~anonymous|81 $std/typedarray/testArraySome~anonymous|45 $std/typedarray/testArrayEvery~anonymous|93 $std/typedarray/testArraySome~anonymous|49 $std/typedarray/testArrayEvery~anonymous|95 $std/typedarray/testArraySome~anonymous|49 $std/typedarray/testArrayEvery~anonymous|97 $std/typedarray/testArraySome~anonymous|53 $std/typedarray/testArrayEvery~anonymous|99 $std/typedarray/testArraySome~anonymous|55) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) @@ -88,17 +88,17 @@ (local $1 i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.const 1073741824 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - tee_local $1 - get_local $0 + global.get $~lib/allocator/arena/offset + local.tee $1 + local.get $0 i32.const 1 - get_local $0 + local.get $0 i32.const 1 i32.gt_u select @@ -107,16 +107,16 @@ i32.add i32.const -8 i32.and - tee_local $2 + local.tee $2 current_memory - tee_local $3 + local.tee $3 i32.const 16 i32.shl i32.gt_u if - get_local $3 - get_local $2 - get_local $1 + local.get $3 + local.get $2 + local.get $1 i32.sub i32.const 65535 i32.add @@ -124,16 +124,16 @@ i32.and i32.const 16 i32.shr_u - tee_local $0 - get_local $3 - get_local $0 + local.tee $0 + local.get $3 + local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - get_local $0 + local.get $0 grow_memory i32.const 0 i32.lt_s @@ -142,13 +142,13 @@ end end end - get_local $2 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $2 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) - get_local $0 + local.get $0 i32.const 1073741816 i32.gt_u if @@ -161,256 +161,256 @@ end i32.const 1 i32.const 32 - get_local $0 + local.get $0 i32.const 7 i32.add i32.clz i32.sub i32.shl call $~lib/allocator/arena/__memory_allocate - tee_local $1 - get_local $0 + local.tee $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $3 + local.tee $3 i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $3 + local.get $3 i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $2 + local.get $2 i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - tee_local $3 + local.tee $3 i32.sub - set_local $2 - get_local $0 - get_local $3 + local.set $2 + local.get $0 + local.get $3 i32.add - tee_local $0 - get_local $1 + local.tee $0 + local.get $1 i32.const 255 i32.and i32.const 16843009 i32.mul - tee_local $1 + local.tee $1 i32.store - get_local $2 + local.get $2 i32.const -4 i32.and - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $3 + local.tee $3 i32.const 12 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 8 i32.sub - get_local $1 + local.get $1 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $1 + local.get $1 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add - tee_local $3 + local.tee $3 i32.const 28 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 24 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 20 i32.sub - get_local $1 + local.get $1 i32.store - get_local $3 + local.get $3 i32.const 16 i32.sub - get_local $1 + local.get $1 i32.store - get_local $0 + local.get $0 i32.const 4 i32.and i32.const 24 i32.add - tee_local $3 - get_local $0 + local.tee $3 + local.get $0 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $1 - i64.extend_u/i32 - tee_local $4 - get_local $4 + local.set $2 + local.get $1 + i64.extend_i32_u + local.tee $4 + local.get $4 i64.const 32 i64.shl i64.or - set_local $4 + local.set $4 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if - get_local $0 - get_local $4 + local.get $0 + local.get $4 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 br $continue|0 end end ) (func $~lib/internal/typedarray/TypedArray#constructor (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -421,61 +421,61 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add i32.const 0 - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int8Array#constructor (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 if (result i32) - get_local $0 + local.get $0 else i32.const 12 call $~lib/allocator/arena/__memory_allocate end - get_local $1 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor ) (func $~lib/typedarray/Uint8ClampedArray#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 call $~lib/allocator/arena/__memory_allocate - get_local $0 + local.get $0 call $~lib/typedarray/Int8Array#constructor ) (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 536870908 i32.gt_u if @@ -486,53 +486,53 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.shl - tee_local $1 + local.tee $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add i32.const 0 - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int16Array#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 call $~lib/allocator/arena/__memory_allocate - get_local $0 + local.get $0 call $~lib/internal/typedarray/TypedArray#constructor ) (func $~lib/internal/typedarray/TypedArray#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -543,53 +543,53 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - tee_local $1 + local.tee $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add i32.const 0 - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int32Array#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 call $~lib/allocator/arena/__memory_allocate - get_local $0 + local.get $0 call $~lib/internal/typedarray/TypedArray#constructor ) (func $~lib/internal/typedarray/TypedArray#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - get_local $1 + local.get $1 i32.const 134217727 i32.gt_u if @@ -600,56 +600,56 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 3 i32.shl - tee_local $1 + local.tee $1 call $~lib/internal/arraybuffer/allocateUnsafe - tee_local $2 + local.tee $2 i32.const 8 i32.add i32.const 0 - get_local $1 + local.get $1 call $~lib/internal/memory/memset - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/allocator/arena/__memory_allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int64Array#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 call $~lib/allocator/arena/__memory_allocate - get_local $0 + local.get $0 call $~lib/internal/typedarray/TypedArray#constructor ) (func $std/typedarray/testInstantiate (; 13 ;) (type $iv) (param $0 i32) (local $1 i32) i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Int8Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -659,9 +659,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.ne if i32.const 0 @@ -671,8 +671,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.ne if @@ -684,9 +684,9 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Int8Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -696,9 +696,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.ne if i32.const 0 @@ -708,8 +708,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.ne if @@ -720,9 +720,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -732,9 +732,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.ne if i32.const 0 @@ -744,8 +744,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.ne if @@ -756,9 +756,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int16Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -768,9 +768,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 1 i32.shl i32.ne @@ -782,8 +782,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 1 i32.shr_u @@ -796,9 +796,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int16Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -808,9 +808,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 1 i32.shl i32.ne @@ -822,8 +822,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 1 i32.shr_u @@ -836,9 +836,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int32Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -848,9 +848,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 2 i32.shl i32.ne @@ -862,8 +862,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 2 i32.shr_u @@ -876,9 +876,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int32Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -888,9 +888,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 2 i32.shl i32.ne @@ -902,8 +902,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 2 i32.shr_u @@ -916,9 +916,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int64Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -928,9 +928,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 3 i32.shl i32.ne @@ -942,8 +942,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 3 i32.shr_u @@ -956,9 +956,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int64Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -968,9 +968,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 3 i32.shl i32.ne @@ -982,8 +982,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 3 i32.shr_u @@ -996,9 +996,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int32Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -1008,9 +1008,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 2 i32.shl i32.ne @@ -1022,8 +1022,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 2 i32.shr_u @@ -1036,9 +1036,9 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 call $~lib/typedarray/Int64Array#constructor - tee_local $1 + local.tee $1 i32.load offset=4 if i32.const 0 @@ -1048,9 +1048,9 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 + local.get $0 i32.const 3 i32.shl i32.ne @@ -1062,8 +1062,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.load offset=8 i32.const 3 i32.shr_u @@ -1078,8 +1078,8 @@ end ) (func $~lib/internal/typedarray/TypedArray#__set (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -1092,21 +1092,21 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $~lib/internal/typedarray/TypedArray#__get (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -1119,11 +1119,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add @@ -1134,70 +1134,70 @@ (local $2 i32) (local $3 i32) i32.const 1 - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - tee_local $2 + local.tee $2 i32.const 1 - get_local $2 + local.get $2 i32.lt_s select - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - tee_local $2 - get_local $3 - get_local $2 - get_local $3 + local.tee $2 + local.get $3 + local.get $2 + local.get $3 i32.gt_s select else - get_local $1 - get_local $2 - get_local $1 - get_local $2 + local.get $1 + local.get $2 + local.get $1 + local.get $2 i32.lt_s select - tee_local $2 - get_local $3 - get_local $2 - get_local $3 + local.tee $2 + local.get $3 + local.get $2 + local.get $3 i32.gt_s select end - set_local $1 + local.set $1 i32.const 12 call $~lib/allocator/arena/__memory_allocate - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load i32.store - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 - get_local $3 + local.get $3 i32.const 2 i32.shl i32.add i32.store offset=4 - get_local $2 - get_local $1 - get_local $3 + local.get $2 + local.get $1 + local.get $3 i32.sub i32.const 2 i32.shl i32.store offset=8 - get_local $2 + local.get $2 ) (func $~lib/internal/typedarray/TypedArray#__set (; 17 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -1210,16 +1210,16 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 3 i32.shl i32.add i32.add - get_local $2 + local.get $2 f64.store offset=8 ) (func $~lib/typedarray/Float64Array#subarray (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -1227,51 +1227,51 @@ (local $2 i32) (local $3 i32) i32.const 2 - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - tee_local $1 + local.tee $1 i32.const 2 - get_local $1 + local.get $1 i32.lt_s select - set_local $3 + local.set $3 i32.const 6 - get_local $1 + local.get $1 i32.const 6 - get_local $1 + local.get $1 i32.lt_s select - tee_local $2 - get_local $3 - get_local $2 - get_local $3 + local.tee $2 + local.get $3 + local.get $2 + local.get $3 i32.gt_s select - set_local $1 + local.set $1 i32.const 12 call $~lib/allocator/arena/__memory_allocate - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load i32.store - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 - get_local $3 + local.get $3 i32.const 3 i32.shl i32.add i32.store offset=4 - get_local $2 - get_local $1 - get_local $3 + local.get $2 + local.get $1 + local.get $3 i32.sub i32.const 3 i32.shl i32.store offset=8 - get_local $2 + local.get $2 ) (func $~lib/internal/sort/insertionSort (; 19 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) @@ -1281,82 +1281,82 @@ (local $8 i32) block $break|0 loop $repeat|0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.ge_s br_if $break|0 - get_local $4 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 - set_local $6 - get_local $4 + local.set $6 + local.get $4 i32.const 1 i32.sub - set_local $5 + local.set $5 loop $continue|1 - get_local $5 + local.get $5 i32.const 0 i32.ge_s if block $break|1 - get_local $5 + local.get $5 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 - set_local $7 + local.set $7 i32.const 2 - set_global $~argc - get_local $6 - get_local $7 - get_local $3 + global.set $~argc + local.get $6 + local.get $7 + local.get $3 call_indirect (type $FFi) i32.const 0 i32.ge_s br_if $break|1 - get_local $5 - tee_local $8 + local.get $5 + local.tee $8 i32.const 1 i32.sub - set_local $5 - get_local $8 + local.set $5 + local.get $8 i32.const 1 i32.add i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 f64.store offset=8 br $continue|1 end end end - get_local $5 + local.get $5 i32.const 1 i32.add i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add - get_local $6 + local.get $6 f64.store offset=8 - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -1370,43 +1370,43 @@ (local $7 f64) (local $8 f64) (local $9 i32) - get_local $2 + local.get $2 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - tee_local $6 + local.tee $6 call $~lib/allocator/arena/__memory_allocate - tee_local $9 + local.tee $9 i32.const 0 - get_local $6 + local.get $6 call $~lib/internal/memory/memset - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 + local.get $4 i32.const 0 i32.gt_s if - get_local $4 - set_local $6 + local.get $4 + local.set $6 loop $continue|1 - get_local $6 + local.get $6 i32.const 1 i32.and - get_local $6 + local.get $6 i32.const 6 i32.shr_s i32.const 2 i32.shl - get_local $9 + local.get $9 i32.add i32.load - get_local $6 + local.get $6 i32.const 1 i32.shr_s i32.const 31 @@ -1416,236 +1416,236 @@ i32.and i32.eq if - get_local $6 + local.get $6 i32.const 1 i32.shr_s - set_local $6 + local.set $6 br $continue|1 end end - get_local $6 + local.get $6 i32.const 1 i32.shr_s - tee_local $5 + local.tee $5 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 - set_local $8 - get_local $4 + local.set $8 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 - set_local $7 + local.set $7 i32.const 2 - set_global $~argc - get_local $8 - get_local $7 - get_local $3 + global.set $~argc + local.get $8 + local.get $7 + local.get $3 call_indirect (type $FFi) i32.const 0 i32.lt_s if - get_local $4 + local.get $4 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $9 + local.get $9 i32.add - tee_local $6 - get_local $6 + local.tee $6 + local.get $6 i32.load i32.const 1 - get_local $4 + local.get $4 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $4 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add - get_local $8 + local.get $8 f64.store offset=8 - get_local $5 + local.get $5 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 f64.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 br $repeat|0 end end - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $4 + local.set $4 loop $repeat|2 - get_local $4 + local.get $4 i32.const 2 i32.ge_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - tee_local $2 + local.tee $2 f64.load offset=8 - set_local $7 - get_local $2 - get_local $4 + local.set $7 + local.get $2 + local.get $4 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add - tee_local $2 + local.tee $2 f64.load offset=8 f64.store offset=8 - get_local $2 - get_local $7 + local.get $2 + local.get $7 f64.store offset=8 i32.const 1 - set_local $5 + local.set $5 loop $continue|3 - get_local $5 + local.get $5 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $9 + local.get $9 i32.add i32.load - get_local $5 + local.get $5 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - get_local $5 + local.get $5 i32.const 1 i32.shl i32.add - tee_local $6 - get_local $4 + local.tee $6 + local.get $4 i32.lt_s if - get_local $6 - set_local $5 + local.get $6 + local.set $5 br $continue|3 end end loop $continue|4 - get_local $5 + local.get $5 i32.const 0 i32.gt_s if - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add f64.load offset=8 - set_local $7 - get_local $5 + local.set $7 + local.get $5 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 - set_local $8 + local.set $8 i32.const 2 - set_global $~argc - get_local $7 - get_local $8 - get_local $3 + global.set $~argc + local.get $7 + local.get $8 + local.get $3 call_indirect (type $FFi) i32.const 0 i32.lt_s if - get_local $5 + local.get $5 i32.const 5 i32.shr_s i32.const 2 i32.shl - get_local $9 + local.get $9 i32.add - tee_local $2 - get_local $2 + local.tee $2 + local.get $2 i32.load i32.const 1 - get_local $5 + local.get $5 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $5 + local.get $5 i32.const 3 i32.shl - get_local $0 + local.get $0 i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 f64.store offset=8 - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add - get_local $8 + local.get $8 f64.store offset=8 end - get_local $5 + local.get $5 i32.const 1 i32.shr_s - set_local $5 + local.set $5 br $continue|4 end end - get_local $4 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 br $repeat|2 end end - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $1 + local.get $1 i32.add - tee_local $2 + local.tee $2 f64.load offset=8 - set_local $7 - get_local $2 - get_local $0 - get_local $1 + local.set $7 + local.get $2 + local.get $0 + local.get $1 i32.add - tee_local $0 + local.tee $0 f64.load offset=8 f64.store offset=8 - get_local $0 - get_local $7 + local.get $0 + local.get $7 f64.store offset=8 ) (func $~lib/typedarray/Float64Array#sort (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -1654,112 +1654,112 @@ (local $4 i32) (local $5 f64) (local $6 f64) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 + local.set $2 block $~lib/internal/typedarray/SORT|inlined.0 - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - tee_local $4 + local.tee $4 i32.const 1 i32.le_s br_if $~lib/internal/typedarray/SORT|inlined.0 - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $4 + local.set $3 + local.get $4 i32.const 2 i32.eq if - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $2 + local.get $2 i32.add f64.load offset=8 - set_local $5 - get_local $2 - get_local $3 + local.set $5 + local.get $2 + local.get $3 i32.add f64.load offset=8 - set_local $6 + local.set $6 i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $1 + global.set $~argc + local.get $5 + local.get $6 + local.get $1 call_indirect (type $FFi) i32.const 0 i32.lt_s if - get_local $3 + local.get $3 i32.const 8 i32.add - get_local $2 + local.get $2 i32.add - get_local $6 + local.get $6 f64.store offset=8 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.add - get_local $5 + local.get $5 f64.store offset=8 end br $~lib/internal/typedarray/SORT|inlined.0 end - get_local $4 + local.get $4 i32.const 256 i32.lt_s if - get_local $3 - get_local $2 - get_local $4 - get_local $1 + local.get $3 + local.get $2 + local.get $4 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $3 - get_local $2 - get_local $4 - get_local $1 + local.get $3 + local.get $2 + local.get $4 + local.get $1 call $~lib/internal/sort/weakHeapSort end end - get_local $0 + local.get $0 ) (func $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 (; 22 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) - get_local $0 - i64.reinterpret/f64 - tee_local $2 - get_local $2 + local.get $0 + i64.reinterpret_f64 + local.tee $2 + local.get $2 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - tee_local $2 - get_local $1 - i64.reinterpret/f64 - tee_local $3 - get_local $3 + local.tee $2 + local.get $1 + i64.reinterpret_f64 + local.tee $3 + local.get $3 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - tee_local $3 + local.tee $3 i64.gt_s - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.lt_s i32.sub ) (func $~lib/internal/typedarray/TypedArray#__get (; 23 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -1772,11 +1772,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 3 i32.shl i32.add @@ -1784,8 +1784,8 @@ f64.load offset=8 ) (func $~lib/internal/typedarray/TypedArray#__set (; 24 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.ge_u if @@ -1796,37 +1796,37 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load i32.add i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/typedarray/Uint8ClampedArray#__set (; 25 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - get_local $0 - get_local $1 - get_local $2 + local.get $0 + local.get $1 + local.get $2 i32.const 255 - get_local $2 + local.get $2 i32.const 255 i32.lt_s select - tee_local $3 + local.tee $3 i32.const 0 - get_local $3 + local.get $3 i32.const 0 i32.gt_s select call $~lib/internal/typedarray/TypedArray#__set ) (func $~lib/internal/typedarray/TypedArray#__get (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.ge_u if @@ -1837,10 +1837,10 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load i32.add i32.add @@ -1851,79 +1851,79 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=4 - set_local $7 - get_local $0 + local.set $7 + local.get $0 i32.load offset=8 - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $2 - get_local $4 - get_local $2 - get_local $4 + local.get $2 + local.get $4 + local.get $2 + local.get $4 i32.lt_s select end - tee_local $2 - get_local $3 + local.tee $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $3 - get_local $4 - get_local $3 - get_local $4 + local.get $3 + local.get $4 + local.get $3 + local.get $4 i32.lt_s select end - tee_local $3 + local.tee $3 i32.lt_s if - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.add - get_local $7 + local.get $7 i32.add i32.const 8 i32.add - get_local $1 - get_local $3 - get_local $2 + local.get $1 + local.get $3 + local.get $2 i32.sub call $~lib/internal/memory/memset end - get_local $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#__get (; 28 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.ge_u if @@ -1934,10 +1934,10 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load i32.add i32.add @@ -1947,37 +1947,37 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load offset=8 - get_local $1 + local.get $1 i32.load offset=4 i32.ne if i32.const 0 return end - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 + local.set $3 loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.load - tee_local $4 + local.tee $4 i32.load i32.lt_u if (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add i32.load8_s offset=8 else @@ -1990,10 +1990,10 @@ i32.const 0 return else - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end unreachable @@ -2007,7 +2007,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -2015,167 +2015,167 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end i32.const 2147483647 - set_local $3 + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/typedarray/Int8Array#fill ) (func $~lib/typedarray/Int8Array#subarray (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) i32.const 1 - get_local $0 + local.get $0 i32.load offset=8 - tee_local $2 + local.tee $2 i32.const 1 - get_local $2 + local.get $2 i32.lt_s select - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if (result i32) - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - tee_local $2 - get_local $3 - get_local $2 - get_local $3 + local.tee $2 + local.get $3 + local.get $2 + local.get $3 i32.gt_s select else - get_local $1 - get_local $2 - get_local $1 - get_local $2 + local.get $1 + local.get $2 + local.get $1 + local.get $2 i32.lt_s select - tee_local $2 - get_local $3 - get_local $2 - get_local $3 + local.tee $2 + local.get $3 + local.get $2 + local.get $3 i32.gt_s select end - set_local $1 + local.set $1 i32.const 12 call $~lib/allocator/arena/__memory_allocate - tee_local $2 - get_local $0 + local.tee $2 + local.get $0 i32.load i32.store - get_local $2 - get_local $0 + local.get $2 + local.get $0 i32.load offset=4 - get_local $3 + local.get $3 i32.add i32.store offset=4 - get_local $2 - get_local $1 - get_local $3 + local.get $2 + local.get $1 + local.get $3 i32.sub i32.store offset=8 - get_local $2 + local.get $2 ) (func $~lib/typedarray/Int32Array#fill (; 32 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $6 - get_local $0 + local.set $6 + local.get $0 i32.load offset=4 - set_local $7 - get_local $0 + local.set $7 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $2 - get_local $4 - get_local $2 - get_local $4 + local.get $2 + local.get $4 + local.get $2 + local.get $4 i32.lt_s select end - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $3 - get_local $4 + local.get $3 + local.get $4 i32.add - tee_local $5 + local.tee $5 i32.const 0 - get_local $5 + local.get $5 i32.const 0 i32.gt_s select else - get_local $3 - get_local $4 - get_local $3 - get_local $4 + local.get $3 + local.get $4 + local.get $3 + local.get $4 i32.lt_s select end - set_local $3 + local.set $3 loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s i32.eqz if - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $6 + local.get $6 i32.add - get_local $7 + local.get $7 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $0 + local.get $0 ) (func $std/typedarray/isInt32ArrayEqual (; 33 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - get_local $1 + local.get $1 i32.load offset=4 - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -2184,32 +2184,32 @@ i32.const 0 return end - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 + local.set $3 loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s if - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/internal/typedarray/TypedArray#__get - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.load - tee_local $4 + local.tee $4 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add i32.load offset=8 else @@ -2220,10 +2220,10 @@ i32.const 0 return else - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end unreachable @@ -2237,7 +2237,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -2245,20 +2245,20 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end i32.const 2147483647 - set_local $3 + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/typedarray/Int32Array#fill ) (func $std/typedarray/testReduce~anonymous|2 (; 35 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Int8Array#reduce (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -2267,61 +2267,61 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 - get_local $4 + global.set $~argc + local.get $2 + local.get $1 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_s offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 2 call_indirect (type $iiiii) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 37 ;) (type $v) (local $0 i32) i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Int8Array#reduce i32.const 255 i32.and @@ -2342,61 +2342,61 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=4 - set_local $6 + local.set $6 loop $repeat|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if i32.const 4 - set_global $~argc - get_local $3 - get_local $2 - get_local $5 + global.set $~argc + local.get $3 + local.get $2 + local.get $5 i32.add - get_local $6 + local.get $6 i32.add i32.load8_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiiii) - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $3 + local.get $3 ) (func $std/typedarray/testReduce (; 39 ;) (type $v) (local $0 i32) i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 3 call $~lib/typedarray/Uint8Array#reduce i32.const 255 @@ -2416,19 +2416,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 4 call $~lib/typedarray/Uint8Array#reduce i32.const 255 @@ -2445,8 +2445,8 @@ end ) (func $~lib/internal/typedarray/TypedArray#__set (; 41 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u @@ -2459,16 +2459,16 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 1 i32.shl i32.add i32.add - get_local $2 + local.get $2 i32.store16 offset=8 ) (func $~lib/typedarray/Int16Array#reduce (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -2477,64 +2477,64 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_s offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 5 call_indirect (type $iiiii) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 43 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Int16Array#reduce i32.const 65535 i32.and @@ -2555,64 +2555,64 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_u offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 6 call_indirect (type $iiiii) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 45 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Uint16Array#reduce i32.const 65535 i32.and @@ -2633,64 +2633,64 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=4 - set_local $6 + local.set $6 loop $repeat|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if i32.const 4 - set_global $~argc - get_local $3 - get_local $2 + global.set $~argc + local.get $3 + local.get $2 i32.const 2 i32.shl - get_local $5 + local.get $5 i32.add - get_local $6 + local.get $6 i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiiii) - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $3 + local.get $3 ) (func $std/typedarray/testReduce (; 47 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 7 call $~lib/typedarray/Int32Array#reduce i32.const 6 @@ -2708,19 +2708,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 8 call $~lib/typedarray/Int32Array#reduce i32.const 6 @@ -2735,8 +2735,8 @@ end ) (func $~lib/internal/typedarray/TypedArray#__set (; 49 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -2749,21 +2749,21 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 3 i32.shl i32.add i32.add - get_local $2 + local.get $2 i64.store offset=8 ) (func $std/typedarray/testReduce~anonymous|9 (; 50 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) - get_local $0 - get_local $1 + 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) @@ -2772,64 +2772,64 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=4 - set_local $6 + local.set $6 loop $repeat|0 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.lt_s if i32.const 4 - set_global $~argc - get_local $3 - get_local $2 + global.set $~argc + local.get $3 + local.get $2 i32.const 3 i32.shl - get_local $5 + local.get $5 i32.add - get_local $6 + local.get $6 i32.add i64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $IIiiI) - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $3 + local.get $3 ) (func $std/typedarray/testReduce (; 52 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 9 call $~lib/typedarray/Int64Array#reduce i64.const 6 @@ -2847,19 +2847,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 10 call $~lib/typedarray/Int64Array#reduce i64.const 6 @@ -2874,8 +2874,8 @@ end ) (func $~lib/internal/typedarray/TypedArray#__set (; 54 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -2888,21 +2888,21 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add i32.add - get_local $2 + local.get $2 f32.store offset=8 ) (func $std/typedarray/testReduce~anonymous|11 (; 55 ;) (type $ffiif) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add ) (func $~lib/typedarray/Float32Array#reduce (; 56 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) @@ -2911,64 +2911,64 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f32.load offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 11 call_indirect (type $ffiif) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 57 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Float32Array#reduce f32.const 6 f32.ne @@ -2982,8 +2982,8 @@ end ) (func $std/typedarray/testReduce~anonymous|12 (; 58 ;) (type $FFiiF) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add ) (func $~lib/typedarray/Float64Array#reduce (; 59 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) @@ -2992,64 +2992,64 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 - get_local $1 - get_local $3 + local.get $1 + local.get $3 i32.lt_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f64.load offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 12 call_indirect (type $FFiiF) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 60 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Float64Array#reduce f64.const 6 f64.ne @@ -3067,63 +3067,63 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 i32.const 1 i32.sub - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 - get_local $3 + global.set $~argc + local.get $2 + local.get $1 + local.get $3 i32.add - get_local $4 + local.get $4 i32.add i32.load8_s offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 13 call_indirect (type $iiiii) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.sub - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 62 ;) (type $v) (local $0 i32) i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Int8Array#reduceRight i32.const 255 i32.and @@ -3143,63 +3143,63 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 1 i32.sub - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $3 - get_local $2 - get_local $4 + global.set $~argc + local.get $3 + local.get $2 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiiii) - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $repeat|0 end end - get_local $3 + local.get $3 ) (func $std/typedarray/testReduceRight (; 64 ;) (type $v) (local $0 i32) i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 14 call $~lib/typedarray/Uint8Array#reduceRight i32.const 255 @@ -3219,19 +3219,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 15 call $~lib/typedarray/Uint8Array#reduceRight i32.const 255 @@ -3252,66 +3252,66 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u i32.const 1 i32.sub - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 1 i32.shl - get_local $3 + local.get $3 i32.add - get_local $4 + local.get $4 i32.add i32.load16_s offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 16 call_indirect (type $iiiii) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.sub - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 67 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Int16Array#reduceRight i32.const 65535 i32.and @@ -3331,66 +3331,66 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u i32.const 1 i32.sub - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 1 i32.shl - get_local $3 + local.get $3 i32.add - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 17 call_indirect (type $iiiii) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.sub - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 69 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Uint16Array#reduceRight i32.const 65535 i32.and @@ -3410,66 +3410,66 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u i32.const 1 i32.sub - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $3 - get_local $2 + global.set $~argc + local.get $3 + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiiii) - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $repeat|0 end end - get_local $3 + local.get $3 ) (func $std/typedarray/testReduceRight (; 71 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 18 call $~lib/typedarray/Int32Array#reduceRight i32.const 6 @@ -3487,19 +3487,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 19 call $~lib/typedarray/Int32Array#reduceRight i32.const 6 @@ -3518,66 +3518,66 @@ (local $3 i64) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 - get_local $0 + local.set $5 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u i32.const 1 i32.sub - set_local $2 + local.set $2 loop $repeat|0 - get_local $2 + local.get $2 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $3 - get_local $2 + global.set $~argc + local.get $3 + local.get $2 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $IIiiI) - set_local $3 - get_local $2 + local.set $3 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $repeat|0 end end - get_local $3 + local.get $3 ) (func $std/typedarray/testReduceRight (; 74 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 20 call $~lib/typedarray/Int64Array#reduceRight i64.const 6 @@ -3595,19 +3595,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 21 call $~lib/typedarray/Int64Array#reduceRight i64.const 6 @@ -3626,66 +3626,66 @@ (local $2 f32) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u i32.const 1 i32.sub - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 2 i32.shl - get_local $3 + local.get $3 i32.add - get_local $4 + local.get $4 i32.add f32.load offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 22 call_indirect (type $ffiif) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.sub - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 77 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Float32Array#reduceRight f32.const 6 f32.ne @@ -3703,66 +3703,66 @@ (local $2 f64) (local $3 i32) (local $4 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u i32.const 1 i32.sub - set_local $1 + local.set $1 loop $repeat|0 - get_local $1 + local.get $1 i32.const 0 i32.ge_s if i32.const 4 - set_global $~argc - get_local $2 - get_local $1 + global.set $~argc + local.get $2 + local.get $1 i32.const 3 i32.shl - get_local $3 + local.get $3 i32.add - get_local $4 + local.get $4 i32.add f64.load offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 23 call_indirect (type $FFiiF) - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const 1 i32.sub - set_local $1 + local.set $1 br $repeat|0 end end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 79 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Float64Array#reduceRight f64.const 6 f64.ne @@ -3776,8 +3776,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|24 (; 80 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Int8Array#map (; 81 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -3787,70 +3787,70 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 i32.const 0 - get_local $0 + local.get $0 i32.load offset=8 - tee_local $4 + local.tee $4 call $~lib/typedarray/Int8Array#constructor - tee_local $5 + local.tee $5 i32.load - set_local $6 + local.set $6 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 - get_local $6 + global.set $~argc + local.get $1 + local.get $6 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $3 + local.get $3 i32.add i32.load8_s offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 24 call_indirect (type $iiii) i32.store8 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 82 ;) (type $v) (local $0 i32) i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Int8Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -3865,7 +3865,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -3880,7 +3880,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -3903,70 +3903,70 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 + local.set $3 i32.const 0 - get_local $0 + local.get $0 i32.load offset=8 - tee_local $4 + local.tee $4 call $~lib/typedarray/Int8Array#constructor - tee_local $5 + local.tee $5 i32.load - set_local $6 + local.set $6 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 - get_local $6 + global.set $~argc + local.get $1 + local.get $6 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $3 + local.get $3 i32.add i32.load8_u offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 25 call_indirect (type $iiii) i32.store8 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 84 ;) (type $v) (local $0 i32) i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Uint8Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -3981,7 +3981,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -3996,7 +3996,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -4019,68 +4019,68 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 - tee_local $4 + local.tee $4 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $5 + local.tee $5 i32.load - set_local $6 + local.set $6 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 - get_local $6 + global.set $~argc + local.get $1 + local.get $6 i32.add - get_local $1 - get_local $2 + local.get $1 + local.get $2 i32.add - get_local $3 + local.get $3 i32.add i32.load8_u offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 26 call_indirect (type $iiii) i32.store8 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 86 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Uint8ClampedArray#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -4095,7 +4095,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -4110,7 +4110,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -4134,57 +4134,57 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - tee_local $4 + local.tee $4 call $~lib/typedarray/Int16Array#constructor - tee_local $5 + local.tee $5 i32.load - set_local $6 + local.set $6 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 + global.set $~argc + local.get $1 i32.const 1 i32.shl - tee_local $7 - get_local $6 + local.tee $7 + local.get $6 i32.add - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.add - get_local $3 + local.get $3 i32.add i32.load16_s offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 27 call_indirect (type $iiii) i32.store16 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 88 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u @@ -4197,11 +4197,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 1 i32.shl i32.add @@ -4212,21 +4212,21 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Int16Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -4241,7 +4241,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -4256,7 +4256,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -4280,57 +4280,57 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - tee_local $4 + local.tee $4 call $~lib/typedarray/Int16Array#constructor - tee_local $5 + local.tee $5 i32.load - set_local $6 + local.set $6 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 + global.set $~argc + local.get $1 i32.const 1 i32.shl - tee_local $7 - get_local $6 + local.tee $7 + local.get $6 i32.add - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.add - get_local $3 + local.get $3 i32.add i32.load16_u offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 28 call_indirect (type $iiii) i32.store16 offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 91 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u @@ -4343,11 +4343,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 1 i32.shl i32.add @@ -4358,21 +4358,21 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Uint16Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -4387,7 +4387,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -4402,7 +4402,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -4425,76 +4425,76 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - tee_local $5 + local.tee $5 call $~lib/typedarray/Int32Array#constructor - tee_local $6 + local.tee $6 i32.load - set_local $7 + local.set $7 loop $repeat|0 block $break|0 - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $7 - get_local $2 + global.set $~argc + local.get $7 + local.get $2 i32.const 2 i32.shl i32.add - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $3 + local.get $3 i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) i32.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $6 + local.get $6 ) (func $std/typedarray/testArrayMap (; 94 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 29 call $~lib/typedarray/Int32Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 1 @@ -4507,7 +4507,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 4 @@ -4520,7 +4520,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 9 @@ -4538,22 +4538,22 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 30 call $~lib/typedarray/Int32Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 1 @@ -4566,7 +4566,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 4 @@ -4579,7 +4579,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 9 @@ -4594,8 +4594,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|31 (; 96 ;) (type $IiiI) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i64.mul ) (func $~lib/typedarray/Int64Array#map (; 97 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -4605,59 +4605,59 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - tee_local $5 + local.tee $5 call $~lib/typedarray/Int64Array#constructor - tee_local $6 + local.tee $6 i32.load - set_local $7 + local.set $7 loop $repeat|0 block $break|0 - get_local $2 - get_local $5 + local.get $2 + local.get $5 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $7 - get_local $2 + global.set $~argc + local.get $7 + local.get $2 i32.const 3 i32.shl i32.add - get_local $2 + local.get $2 i32.const 3 i32.shl - get_local $3 + local.get $3 i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $IiiI) i64.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end - get_local $6 + local.get $6 ) (func $~lib/internal/typedarray/TypedArray#__get (; 98 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -4670,11 +4670,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 3 i32.shl i32.add @@ -4685,22 +4685,22 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 31 call $~lib/typedarray/Int64Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i64.const 1 @@ -4713,7 +4713,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i64.const 4 @@ -4726,7 +4726,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i64.const 9 @@ -4744,22 +4744,22 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 32 call $~lib/typedarray/Int64Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i64.const 1 @@ -4772,7 +4772,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i64.const 4 @@ -4785,7 +4785,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i64.const 9 @@ -4800,8 +4800,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|33 (; 101 ;) (type $fiif) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul ) (func $~lib/typedarray/Float32Array#map (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -4812,57 +4812,57 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - tee_local $4 + local.tee $4 call $~lib/typedarray/Int32Array#constructor - tee_local $5 + local.tee $5 i32.load - set_local $6 + local.set $6 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 + global.set $~argc + local.get $1 i32.const 2 i32.shl - tee_local $7 - get_local $6 + local.tee $7 + local.get $6 i32.add - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.add - get_local $3 + local.get $3 i32.add f32.load offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 33 call_indirect (type $fiif) f32.store offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 103 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -4875,11 +4875,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load offset=4 - get_local $0 + local.get $0 i32.load - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add @@ -4890,21 +4890,21 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Float32Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get f32.const 1 @@ -4917,7 +4917,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get f32.const 4 @@ -4930,7 +4930,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get f32.const 9 @@ -4945,8 +4945,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|34 (; 105 ;) (type $FiiF) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul ) (func $~lib/typedarray/Float64Array#map (; 106 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -4957,73 +4957,73 @@ (local $5 i32) (local $6 i32) (local $7 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - tee_local $4 + local.tee $4 call $~lib/typedarray/Int64Array#constructor - tee_local $5 + local.tee $5 i32.load - set_local $6 + local.set $6 loop $repeat|0 - get_local $1 - get_local $4 + local.get $1 + local.get $4 i32.lt_s if i32.const 3 - set_global $~argc - get_local $1 + global.set $~argc + local.get $1 i32.const 3 i32.shl - tee_local $7 - get_local $6 + local.tee $7 + local.get $6 i32.add - get_local $2 - get_local $7 + local.get $2 + local.get $7 i32.add - get_local $3 + local.get $3 i32.add f64.load offset=8 - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.const 34 call_indirect (type $FiiF) f64.store offset=8 - get_local $1 + local.get $1 i32.const 1 i32.add - set_local $1 + local.set $1 br $repeat|0 end end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 107 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 call $~lib/typedarray/Float64Array#map - tee_local $0 + local.tee $0 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get f64.const 1 @@ -5036,7 +5036,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get f64.const 4 @@ -5049,7 +5049,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get f64.const 9 @@ -5064,7 +5064,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|35 (; 108 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -5076,40 +5076,40 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_s offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5117,7 +5117,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|36 (; 110 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.eqz @@ -5127,19 +5127,19 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 35 call $~lib/typedarray/Int8Array#some i32.eqz @@ -5151,7 +5151,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 36 call $~lib/typedarray/Int8Array#some if @@ -5169,40 +5169,40 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 - get_local $4 + local.get $2 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5214,19 +5214,19 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 37 call $~lib/typedarray/Uint8Array#some i32.eqz @@ -5238,7 +5238,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 38 call $~lib/typedarray/Uint8Array#some if @@ -5254,19 +5254,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 39 call $~lib/typedarray/Uint8Array#some i32.eqz @@ -5278,7 +5278,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 40 call $~lib/typedarray/Uint8Array#some if @@ -5291,7 +5291,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|41 (; 115 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 2 @@ -5303,44 +5303,44 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 + local.get $2 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_s offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5348,7 +5348,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|42 (; 117 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.eqz @@ -5357,19 +5357,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 41 call $~lib/typedarray/Int16Array#some i32.eqz @@ -5381,7 +5381,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 42 call $~lib/typedarray/Int16Array#some if @@ -5399,44 +5399,44 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 + local.get $2 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5447,19 +5447,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 43 call $~lib/typedarray/Uint16Array#some i32.eqz @@ -5471,7 +5471,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 44 call $~lib/typedarray/Uint16Array#some if @@ -5484,7 +5484,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|45 (; 121 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.eq ) @@ -5494,44 +5494,44 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5539,26 +5539,26 @@ end ) (func $std/typedarray/testArraySome~anonymous|46 (; 123 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.eqz ) (func $std/typedarray/testArraySome (; 124 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 45 call $~lib/typedarray/Int32Array#some i32.eqz @@ -5570,7 +5570,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 46 call $~lib/typedarray/Int32Array#some if @@ -5586,19 +5586,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 47 call $~lib/typedarray/Int32Array#some i32.eqz @@ -5610,7 +5610,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 48 call $~lib/typedarray/Int32Array#some if @@ -5623,7 +5623,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|49 (; 126 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.eq ) @@ -5633,44 +5633,44 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 + local.get $2 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $Iiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5678,7 +5678,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|50 (; 128 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 0 i64.eq ) @@ -5686,19 +5686,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 49 call $~lib/typedarray/Int64Array#some i32.eqz @@ -5710,7 +5710,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 50 call $~lib/typedarray/Int64Array#some if @@ -5726,19 +5726,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 51 call $~lib/typedarray/Int64Array#some i32.eqz @@ -5750,7 +5750,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 52 call $~lib/typedarray/Int64Array#some if @@ -5763,7 +5763,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|53 (; 131 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 2 f32.eq ) @@ -5773,44 +5773,44 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $fiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5818,7 +5818,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|54 (; 133 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 0 f32.eq ) @@ -5826,19 +5826,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 53 call $~lib/typedarray/Float32Array#some i32.eqz @@ -5850,7 +5850,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 54 call $~lib/typedarray/Float32Array#some if @@ -5863,7 +5863,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|55 (; 135 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 2 f64.eq ) @@ -5873,44 +5873,44 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc + global.set $~argc i32.const 1 - get_local $2 + local.get $2 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $Fiii) br_if $~lib/internal/typedarray/SOME|inlined.0 drop - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -5918,7 +5918,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|56 (; 137 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 0 f64.eq ) @@ -5926,19 +5926,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 55 call $~lib/typedarray/Float64Array#some i32.eqz @@ -5950,7 +5950,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 56 call $~lib/typedarray/Float64Array#some if @@ -5967,49 +5967,49 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 - get_local $4 + global.set $~argc + local.get $2 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_s offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex~anonymous|58 (; 140 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 4 @@ -6020,19 +6020,19 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 57 call $~lib/typedarray/Int8Array#findIndex i32.const 1 @@ -6045,7 +6045,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 58 call $~lib/typedarray/Int8Array#findIndex i32.const -1 @@ -6064,65 +6064,65 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 - get_local $4 + global.set $~argc + local.get $2 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex (; 143 ;) (type $v) (local $0 i32) i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 59 call $~lib/typedarray/Uint8Array#findIndex i32.const 1 @@ -6135,7 +6135,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 60 call $~lib/typedarray/Uint8Array#findIndex i32.const -1 @@ -6153,19 +6153,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 61 call $~lib/typedarray/Uint8Array#findIndex i32.const 1 @@ -6178,7 +6178,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 62 call $~lib/typedarray/Uint8Array#findIndex i32.const -1 @@ -6197,53 +6197,53 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_s offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex~anonymous|64 (; 146 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 4 @@ -6253,19 +6253,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 63 call $~lib/typedarray/Int16Array#findIndex i32.const 1 @@ -6278,7 +6278,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 64 call $~lib/typedarray/Int16Array#findIndex i32.const -1 @@ -6297,68 +6297,68 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex (; 149 ;) (type $v) (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 65 call $~lib/typedarray/Uint16Array#findIndex i32.const 1 @@ -6371,7 +6371,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 66 call $~lib/typedarray/Uint16Array#findIndex i32.const -1 @@ -6390,53 +6390,53 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex~anonymous|68 (; 151 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 4 i32.eq ) @@ -6444,19 +6444,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 67 call $~lib/typedarray/Int32Array#findIndex i32.const 1 @@ -6469,7 +6469,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 68 call $~lib/typedarray/Int32Array#findIndex i32.const -1 @@ -6487,19 +6487,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 69 call $~lib/typedarray/Int32Array#findIndex i32.const 1 @@ -6512,7 +6512,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 70 call $~lib/typedarray/Int32Array#findIndex i32.const -1 @@ -6531,53 +6531,53 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $Iiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex~anonymous|72 (; 155 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 4 i64.eq ) @@ -6585,19 +6585,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 71 call $~lib/typedarray/Int64Array#findIndex i32.const 1 @@ -6610,7 +6610,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 72 call $~lib/typedarray/Int64Array#findIndex i32.const -1 @@ -6628,19 +6628,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 73 call $~lib/typedarray/Int64Array#findIndex i32.const 1 @@ -6653,7 +6653,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 74 call $~lib/typedarray/Int64Array#findIndex i32.const -1 @@ -6672,53 +6672,53 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $fiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex~anonymous|76 (; 159 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 4 f32.eq ) @@ -6726,19 +6726,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 75 call $~lib/typedarray/Float32Array#findIndex i32.const 1 @@ -6751,7 +6751,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 76 call $~lib/typedarray/Float32Array#findIndex i32.const -1 @@ -6770,53 +6770,53 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/FIND_INDEX|inlined.0 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $Fiii) br_if $~lib/internal/typedarray/FIND_INDEX|inlined.0 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end i32.const -1 - set_local $2 + local.set $2 end - get_local $2 + local.get $2 ) (func $std/typedarray/testArrayFindIndex~anonymous|78 (; 162 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 4 f64.eq ) @@ -6824,19 +6824,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 77 call $~lib/typedarray/Float64Array#findIndex i32.const 1 @@ -6849,7 +6849,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 78 call $~lib/typedarray/Float64Array#findIndex i32.const -1 @@ -6864,7 +6864,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|79 (; 164 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -6879,42 +6879,42 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 - get_local $4 + global.set $~argc + local.get $2 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_s offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -6926,19 +6926,19 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 79 call $~lib/typedarray/Int8Array#every i32.eqz @@ -6950,7 +6950,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 80 call $~lib/typedarray/Int8Array#every if @@ -6963,7 +6963,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|81 (; 167 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 1 i32.and i32.eqz @@ -6974,42 +6974,42 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 - get_local $4 + global.set $~argc + local.get $2 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load8_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -7021,19 +7021,19 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 81 call $~lib/typedarray/Uint8Array#every i32.eqz @@ -7045,7 +7045,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 82 call $~lib/typedarray/Uint8Array#every if @@ -7061,19 +7061,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 83 call $~lib/typedarray/Uint8Array#every i32.eqz @@ -7085,7 +7085,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 84 call $~lib/typedarray/Uint8Array#every if @@ -7098,7 +7098,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|85 (; 171 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -7113,46 +7113,46 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_s offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -7163,19 +7163,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 85 call $~lib/typedarray/Int16Array#every i32.eqz @@ -7187,7 +7187,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 86 call $~lib/typedarray/Int16Array#every if @@ -7205,46 +7205,46 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 1 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load16_u offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -7255,19 +7255,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 87 call $~lib/typedarray/Uint16Array#every i32.eqz @@ -7279,7 +7279,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 88 call $~lib/typedarray/Uint16Array#every if @@ -7292,7 +7292,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|89 (; 176 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.rem_s i32.eqz @@ -7303,46 +7303,46 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $iiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -7353,19 +7353,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 89 call $~lib/typedarray/Int32Array#every i32.eqz @@ -7377,7 +7377,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 90 call $~lib/typedarray/Int32Array#every if @@ -7393,19 +7393,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 91 call $~lib/typedarray/Int32Array#every i32.eqz @@ -7417,7 +7417,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 92 call $~lib/typedarray/Int32Array#every if @@ -7430,7 +7430,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|93 (; 180 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.rem_s i64.const 0 @@ -7442,46 +7442,46 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add i64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $Iiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -7492,19 +7492,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 93 call $~lib/typedarray/Int64Array#every i32.eqz @@ -7516,7 +7516,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 94 call $~lib/typedarray/Int64Array#every if @@ -7529,7 +7529,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|95 (; 183 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.rem_u i64.const 0 @@ -7539,19 +7539,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 95 call $~lib/typedarray/Int64Array#every i32.eqz @@ -7563,7 +7563,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 96 call $~lib/typedarray/Int64Array#every if @@ -7580,154 +7580,154 @@ (local $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - i32.reinterpret/f32 - tee_local $1 + local.get $0 + i32.reinterpret_f32 + local.tee $1 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i32.const -2147483648 i32.and - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 255 i32.eq - tee_local $3 + local.tee $3 if (result i32) - get_local $3 + local.get $3 else i32.const 0 end if - get_local $0 + local.get $0 f32.const 2 f32.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f32.div return end block $folding-inner0 - get_local $1 + local.get $1 i32.const 1 i32.shl - tee_local $3 + local.tee $3 i32.const -2147483648 i32.le_u if - get_local $3 + local.get $3 i32.const -2147483648 i32.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 if (result i32) - get_local $1 + local.get $1 i32.const 8388607 i32.and i32.const 8388608 i32.or else - get_local $1 + local.get $1 i32.const 1 - get_local $2 - get_local $1 + local.get $2 + local.get $1 i32.const 9 i32.shl i32.clz i32.sub - tee_local $2 + local.tee $2 i32.sub i32.shl end - set_local $1 + local.set $1 loop $continue|0 - get_local $2 + local.get $2 i32.const 128 i32.gt_s if - get_local $1 + local.get $1 i32.const 8388608 i32.ge_u if - get_local $1 + local.get $1 i32.const 8388608 i32.eq br_if $folding-inner0 - get_local $1 + local.get $1 i32.const 8388608 i32.sub - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $1 - get_local $2 + local.set $1 + local.get $2 i32.const 1 i32.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $1 + local.get $1 i32.const 8388608 i32.ge_u if - get_local $1 + local.get $1 i32.const 8388608 i32.eq br_if $folding-inner0 - get_local $1 + local.get $1 i32.const 8388608 i32.sub - set_local $1 + local.set $1 end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i32.const 8 i32.shl i32.clz - tee_local $3 + local.tee $3 i32.shl - set_local $1 - get_local $2 - get_local $3 + local.set $1 + local.get $2 + local.get $3 i32.sub - tee_local $2 + local.tee $2 i32.const 0 i32.gt_s if (result i32) - get_local $1 + local.get $1 i32.const 8388608 i32.sub - get_local $2 + local.get $2 i32.const 23 i32.shl i32.or else - get_local $1 + local.get $1 i32.const 1 - get_local $2 + local.get $2 i32.sub i32.shr_u end - get_local $4 + local.get $4 i32.or - f32.reinterpret/i32 + f32.reinterpret_i32 return end f32.const 0 - get_local $0 + local.get $0 f32.mul ) (func $std/typedarray/testArrayEvery~anonymous|97 (; 186 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMathf.mod f32.const 0 f32.eq @@ -7738,46 +7738,46 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 2 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f32.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $fiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -7788,19 +7788,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 97 call $~lib/typedarray/Float32Array#every i32.eqz @@ -7812,7 +7812,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 98 call $~lib/typedarray/Float32Array#every if @@ -7830,161 +7830,161 @@ (local $3 i64) (local $4 i64) (local $5 i32) - get_local $0 - i64.reinterpret/f64 - tee_local $1 + local.get $0 + i64.reinterpret_f64 + local.tee $1 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $2 - get_local $1 + local.set $2 + local.get $1 i64.const 63 i64.shr_u - set_local $4 - get_local $2 + local.set $4 + local.get $2 i64.const 2047 i64.eq - tee_local $5 + local.tee $5 if (result i32) - get_local $5 + local.get $5 else i32.const 0 end if - get_local $0 + local.get $0 f64.const 2 f64.mul - tee_local $0 - get_local $0 + local.tee $0 + local.get $0 f64.div return end block $folding-inner0 - get_local $1 + local.get $1 i64.const 1 i64.shl - tee_local $3 + local.tee $3 i64.const -9223372036854775808 i64.le_u if - get_local $3 + local.get $3 i64.const -9223372036854775808 i64.eq br_if $folding-inner0 - get_local $0 + local.get $0 return end - get_local $2 + local.get $2 i64.eqz if (result i64) - get_local $1 + local.get $1 i64.const 0 - get_local $2 - get_local $1 + local.get $2 + local.get $1 i64.const 12 i64.shl i64.clz i64.sub - tee_local $2 + local.tee $2 i64.sub i64.const 1 i64.add i64.shl else - get_local $1 + local.get $1 i64.const 4503599627370495 i64.and i64.const 4503599627370496 i64.or end - set_local $1 + local.set $1 loop $continue|0 - get_local $2 + local.get $2 i64.const 1024 i64.gt_s if - get_local $1 + local.get $1 i64.const 4503599627370496 i64.ge_u if - get_local $1 + local.get $1 i64.const 4503599627370496 i64.eq br_if $folding-inner0 - get_local $1 + local.get $1 i64.const 4503599627370496 i64.sub - set_local $1 + local.set $1 end - get_local $1 + local.get $1 i64.const 1 i64.shl - set_local $1 - get_local $2 + local.set $1 + local.get $2 i64.const 1 i64.sub - set_local $2 + local.set $2 br $continue|0 end end - get_local $1 + local.get $1 i64.const 4503599627370496 i64.ge_u if - get_local $1 + local.get $1 i64.const 4503599627370496 i64.eq br_if $folding-inner0 - get_local $1 + local.get $1 i64.const 4503599627370496 i64.sub - set_local $1 + local.set $1 end - get_local $1 - get_local $1 + local.get $1 + local.get $1 i64.const 11 i64.shl i64.clz - tee_local $3 + local.tee $3 i64.shl - set_local $1 - get_local $2 - get_local $3 + local.set $1 + local.get $2 + local.get $3 i64.sub - tee_local $2 + local.tee $2 i64.const 0 i64.gt_s if (result i64) - get_local $1 + local.get $1 i64.const 4503599627370496 i64.sub - get_local $2 + local.get $2 i64.const 52 i64.shl i64.or else - get_local $1 + local.get $1 i64.const 0 - get_local $2 + local.get $2 i64.sub i64.const 1 i64.add i64.shr_u end - get_local $4 + local.get $4 i64.const 63 i64.shl i64.or - f64.reinterpret/i64 + f64.reinterpret_i64 return end f64.const 0 - get_local $0 + local.get $0 f64.mul ) (func $std/typedarray/testArrayEvery~anonymous|99 (; 190 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 call $~lib/math/NativeMath.mod f64.const 0 f64.eq @@ -7995,46 +7995,46 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 loop $repeat|0 block $break|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_s br_if $break|0 i32.const 3 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 i32.const 3 i32.shl - get_local $4 + local.get $4 i32.add - get_local $5 + local.get $5 i32.add f64.load offset=8 - get_local $2 - get_local $0 - get_local $1 + local.get $2 + local.get $0 + local.get $1 call_indirect (type $Fiii) i32.eqz if i32.const 0 br $~lib/internal/typedarray/EVERY|inlined.0 end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 end end @@ -8045,19 +8045,19 @@ (local $0 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - tee_local $0 + local.tee $0 i32.const 0 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 99 call $~lib/typedarray/Float64Array#every i32.eqz @@ -8069,7 +8069,7 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 100 call $~lib/typedarray/Float64Array#every if @@ -8085,29 +8085,29 @@ (local $0 i32) (local $1 i32) i32.const 624 - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 call $std/typedarray/testInstantiate i32.const 5 call $std/typedarray/testInstantiate i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_global $std/typedarray/arr - get_global $std/typedarray/arr + global.set $std/typedarray/arr + global.get $std/typedarray/arr i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=8 i32.const 2 i32.shr_u @@ -8121,7 +8121,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=4 if i32.const 0 @@ -8131,7 +8131,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=8 i32.const 12 i32.ne @@ -8143,7 +8143,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 1 @@ -8156,7 +8156,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 2 @@ -8169,7 +8169,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 3 @@ -8182,11 +8182,11 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 2 call $~lib/typedarray/Int32Array#subarray - set_global $std/typedarray/arr - get_global $std/typedarray/arr + global.set $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=8 i32.const 2 i32.shr_u @@ -8200,7 +8200,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=4 i32.const 4 i32.ne @@ -8212,7 +8212,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=8 i32.const 4 i32.ne @@ -8224,7 +8224,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 2 @@ -8239,43 +8239,43 @@ end i32.const 8 call $~lib/typedarray/Int64Array#constructor - set_global $std/typedarray/af64 - get_global $std/typedarray/af64 + global.set $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 2 f64.const 7 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 3 f64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 4 f64.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 5 f64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 6 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 7 f64.const 8 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 call $~lib/typedarray/Float64Array#subarray - set_global $std/typedarray/af64 - get_global $std/typedarray/af64 + global.set $std/typedarray/af64 + global.get $std/typedarray/af64 i32.load offset=8 i32.const 3 i32.shr_u @@ -8289,7 +8289,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.load offset=4 i32.const 16 i32.ne @@ -8301,7 +8301,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.load offset=8 i32.const 32 i32.ne @@ -8314,60 +8314,60 @@ unreachable end i32.const 0 - set_global $~argc - get_global $std/typedarray/af64 - set_local $1 + global.set $~argc + global.get $std/typedarray/af64 + local.set $1 block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable end i32.const 1 - set_local $0 + local.set $0 end - get_local $1 - get_local $0 + local.get $1 + local.get $0 call $~lib/typedarray/Float64Array#sort drop block (result i32) block (result i32) - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get f64.const 4 f64.eq - tee_local $0 + local.tee $0 if - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get f64.const 5 f64.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get f64.const 6 f64.eq - set_local $0 + local.set $0 end - get_local $0 + local.get $0 end if (result i32) - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 3 call $~lib/internal/typedarray/TypedArray#__get f64.const 7 f64.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -8380,20 +8380,20 @@ end i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_global $std/typedarray/clampedArr - get_global $std/typedarray/clampedArr + global.set $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 0 i32.const -32 call $~lib/typedarray/Uint8ClampedArray#__set - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 2 i32.const 256 call $~lib/typedarray/Uint8ClampedArray#__set - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -8406,7 +8406,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -8421,7 +8421,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -8439,34 +8439,34 @@ i32.const 0 i32.const 5 call $~lib/typedarray/Int8Array#constructor - set_global $std/typedarray/arr8 - get_global $std/typedarray/arr8 + global.set $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 3 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 4 i32.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 1 i32.const 1 i32.const 3 call $~lib/typedarray/Int8Array#fill drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 192 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -8479,13 +8479,13 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/typedarray/arr8 + global.set $~argc + global.get $std/typedarray/arr8 i32.const 0 i32.const 0 call $~lib/typedarray/Int8Array#fill|trampoline drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 216 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -8497,13 +8497,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 1 i32.const 0 i32.const -3 call $~lib/typedarray/Int8Array#fill drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 240 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -8516,13 +8516,13 @@ unreachable end i32.const 2 - set_global $~argc - get_global $std/typedarray/arr8 + global.set $~argc + global.get $std/typedarray/arr8 i32.const 2 i32.const -2 call $~lib/typedarray/Int8Array#fill|trampoline drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 264 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -8534,13 +8534,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 0 i32.const 1 i32.const 0 call $~lib/typedarray/Int8Array#fill drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 288 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -8552,18 +8552,18 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 4 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/sub8 + global.set $std/typedarray/sub8 i32.const 1 - set_global $~argc - get_global $std/typedarray/sub8 + global.set $~argc + global.get $std/typedarray/sub8 i32.const 0 i32.const 0 call $~lib/typedarray/Int8Array#fill|trampoline drop - get_global $std/typedarray/sub8 + global.get $std/typedarray/sub8 i32.load offset=8 i32.const 3 i32.ne @@ -8575,7 +8575,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub8 + global.get $std/typedarray/sub8 i32.load offset=4 i32.const 1 i32.ne @@ -8587,7 +8587,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub8 + global.get $std/typedarray/sub8 i32.load offset=8 i32.const 3 i32.ne @@ -8599,7 +8599,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub8 + global.get $std/typedarray/sub8 i32.const 312 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -8611,7 +8611,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 336 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -8625,34 +8625,34 @@ end i32.const 5 call $~lib/typedarray/Int32Array#constructor - set_global $std/typedarray/arr32 - get_global $std/typedarray/arr32 + global.set $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 3 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 4 i32.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 1 i32.const 1 i32.const 3 call $~lib/typedarray/Int32Array#fill drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 376 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -8665,13 +8665,13 @@ unreachable end i32.const 1 - set_global $~argc - get_global $std/typedarray/arr32 + global.set $~argc + global.get $std/typedarray/arr32 i32.const 0 i32.const 0 call $~lib/typedarray/Int32Array#fill|trampoline drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 416 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -8683,13 +8683,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 1 i32.const 0 i32.const -3 call $~lib/typedarray/Int32Array#fill drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 456 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -8702,13 +8702,13 @@ unreachable end i32.const 2 - set_global $~argc - get_global $std/typedarray/arr32 + global.set $~argc + global.get $std/typedarray/arr32 i32.const 2 i32.const -2 call $~lib/typedarray/Int32Array#fill|trampoline drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 496 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -8720,13 +8720,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 0 i32.const 1 i32.const 0 call $~lib/typedarray/Int32Array#fill drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 536 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -8738,18 +8738,18 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 4 call $~lib/typedarray/Int32Array#subarray - set_global $std/typedarray/sub32 + global.set $std/typedarray/sub32 i32.const 1 - set_global $~argc - get_global $std/typedarray/sub32 + global.set $~argc + global.get $std/typedarray/sub32 i32.const 0 i32.const 0 call $~lib/typedarray/Int32Array#fill|trampoline drop - get_global $std/typedarray/sub32 + global.get $std/typedarray/sub32 i32.load offset=8 i32.const 2 i32.shr_u @@ -8763,7 +8763,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub32 + global.get $std/typedarray/sub32 i32.load offset=4 i32.const 4 i32.ne @@ -8775,7 +8775,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub32 + global.get $std/typedarray/sub32 i32.load offset=8 i32.const 12 i32.ne @@ -8787,7 +8787,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub32 + global.get $std/typedarray/sub32 i32.const 576 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -8799,7 +8799,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 616 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -8817,36 +8817,36 @@ i32.const 0 i32.const 6 call $~lib/typedarray/Int8Array#constructor - set_global $std/typedarray/multisubarr - get_global $std/typedarray/multisubarr + global.set $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 3 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 4 i32.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 5 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 6 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/multisubarr1 - get_global $std/typedarray/multisubarr1 + global.set $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -8861,7 +8861,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.load offset=8 i32.const 5 i32.ne @@ -8873,7 +8873,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.load offset=4 i32.const 1 i32.ne @@ -8885,7 +8885,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.load offset=8 i32.const 5 i32.ne @@ -8897,11 +8897,11 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.const 5 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/multisubarr2 - get_global $std/typedarray/multisubarr2 + global.set $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -8916,7 +8916,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.load offset=8 i32.const 4 i32.ne @@ -8928,7 +8928,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.load offset=4 i32.const 2 i32.ne @@ -8940,7 +8940,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.load offset=8 i32.const 4 i32.ne @@ -8952,11 +8952,11 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.const 4 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/multisubarr3 - get_global $std/typedarray/multisubarr3 + global.set $std/typedarray/multisubarr3 + global.get $std/typedarray/multisubarr3 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -8971,7 +8971,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr3 + global.get $std/typedarray/multisubarr3 i32.load offset=8 i32.const 3 i32.ne @@ -8983,7 +8983,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr3 + global.get $std/typedarray/multisubarr3 i32.load offset=4 i32.const 3 i32.ne @@ -8995,7 +8995,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr3 + global.get $std/typedarray/multisubarr3 i32.load offset=8 i32.const 3 i32.ne diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index e7b9ff53..9cd27fee 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -61,7 +61,7 @@ (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") - (table $0 101 anyfunc) + (table $0 101 funcref) (elem (i32.const 0) $null $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 $std/typedarray/testReduce~anonymous|2 $std/typedarray/testReduce~anonymous|3 $std/typedarray/testReduce~anonymous|4 $std/typedarray/testReduce~anonymous|5 $std/typedarray/testReduce~anonymous|6 $std/typedarray/testReduce~anonymous|7 $std/typedarray/testReduce~anonymous|8 $std/typedarray/testReduce~anonymous|9 $std/typedarray/testReduce~anonymous|10 $std/typedarray/testReduce~anonymous|11 $std/typedarray/testReduce~anonymous|12 $std/typedarray/testReduceRight~anonymous|13 $std/typedarray/testReduceRight~anonymous|14 $std/typedarray/testReduceRight~anonymous|15 $std/typedarray/testReduceRight~anonymous|16 $std/typedarray/testReduceRight~anonymous|17 $std/typedarray/testReduceRight~anonymous|18 $std/typedarray/testReduceRight~anonymous|19 $std/typedarray/testReduceRight~anonymous|20 $std/typedarray/testReduceRight~anonymous|21 $std/typedarray/testReduceRight~anonymous|22 $std/typedarray/testReduceRight~anonymous|23 $std/typedarray/testArrayMap~anonymous|24 $std/typedarray/testArrayMap~anonymous|25 $std/typedarray/testArrayMap~anonymous|26 $std/typedarray/testArrayMap~anonymous|27 $std/typedarray/testArrayMap~anonymous|28 $std/typedarray/testArrayMap~anonymous|29 $std/typedarray/testArrayMap~anonymous|30 $std/typedarray/testArrayMap~anonymous|31 $std/typedarray/testArrayMap~anonymous|32 $std/typedarray/testArrayMap~anonymous|33 $std/typedarray/testArrayMap~anonymous|34 $std/typedarray/testArraySome~anonymous|35 $std/typedarray/testArraySome~anonymous|36 $std/typedarray/testArraySome~anonymous|37 $std/typedarray/testArraySome~anonymous|38 $std/typedarray/testArraySome~anonymous|39 $std/typedarray/testArraySome~anonymous|40 $std/typedarray/testArraySome~anonymous|41 $std/typedarray/testArraySome~anonymous|42 $std/typedarray/testArraySome~anonymous|43 $std/typedarray/testArraySome~anonymous|44 $std/typedarray/testArraySome~anonymous|45 $std/typedarray/testArraySome~anonymous|46 $std/typedarray/testArraySome~anonymous|47 $std/typedarray/testArraySome~anonymous|48 $std/typedarray/testArraySome~anonymous|49 $std/typedarray/testArraySome~anonymous|50 $std/typedarray/testArraySome~anonymous|51 $std/typedarray/testArraySome~anonymous|52 $std/typedarray/testArraySome~anonymous|53 $std/typedarray/testArraySome~anonymous|54 $std/typedarray/testArraySome~anonymous|55 $std/typedarray/testArraySome~anonymous|56 $std/typedarray/testArrayFindIndex~anonymous|57 $std/typedarray/testArrayFindIndex~anonymous|58 $std/typedarray/testArrayFindIndex~anonymous|59 $std/typedarray/testArrayFindIndex~anonymous|60 $std/typedarray/testArrayFindIndex~anonymous|61 $std/typedarray/testArrayFindIndex~anonymous|62 $std/typedarray/testArrayFindIndex~anonymous|63 $std/typedarray/testArrayFindIndex~anonymous|64 $std/typedarray/testArrayFindIndex~anonymous|65 $std/typedarray/testArrayFindIndex~anonymous|66 $std/typedarray/testArrayFindIndex~anonymous|67 $std/typedarray/testArrayFindIndex~anonymous|68 $std/typedarray/testArrayFindIndex~anonymous|69 $std/typedarray/testArrayFindIndex~anonymous|70 $std/typedarray/testArrayFindIndex~anonymous|71 $std/typedarray/testArrayFindIndex~anonymous|72 $std/typedarray/testArrayFindIndex~anonymous|73 $std/typedarray/testArrayFindIndex~anonymous|74 $std/typedarray/testArrayFindIndex~anonymous|75 $std/typedarray/testArrayFindIndex~anonymous|76 $std/typedarray/testArrayFindIndex~anonymous|77 $std/typedarray/testArrayFindIndex~anonymous|78 $std/typedarray/testArrayEvery~anonymous|79 $std/typedarray/testArrayEvery~anonymous|80 $std/typedarray/testArrayEvery~anonymous|81 $std/typedarray/testArrayEvery~anonymous|82 $std/typedarray/testArrayEvery~anonymous|83 $std/typedarray/testArrayEvery~anonymous|84 $std/typedarray/testArrayEvery~anonymous|85 $std/typedarray/testArrayEvery~anonymous|86 $std/typedarray/testArrayEvery~anonymous|87 $std/typedarray/testArrayEvery~anonymous|88 $std/typedarray/testArrayEvery~anonymous|89 $std/typedarray/testArrayEvery~anonymous|90 $std/typedarray/testArrayEvery~anonymous|91 $std/typedarray/testArrayEvery~anonymous|92 $std/typedarray/testArrayEvery~anonymous|93 $std/typedarray/testArrayEvery~anonymous|94 $std/typedarray/testArrayEvery~anonymous|95 $std/typedarray/testArrayEvery~anonymous|96 $std/typedarray/testArrayEvery~anonymous|97 $std/typedarray/testArrayEvery~anonymous|98 $std/typedarray/testArrayEvery~anonymous|99 $std/typedarray/testArrayEvery~anonymous|100) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) @@ -103,8 +103,8 @@ (func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 - get_local $0 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.get $0 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 1 i32.sub @@ -119,41 +119,41 @@ (local $4 i32) (local $5 i32) (local $6 i32) - get_local $0 - get_global $~lib/internal/allocator/MAX_SIZE_32 + local.get $0 + global.get $~lib/internal/allocator/MAX_SIZE_32 i32.gt_u if unreachable end - get_global $~lib/allocator/arena/offset - set_local $1 - get_local $1 - get_local $0 - tee_local $2 + global.get $~lib/allocator/arena/offset + local.set $1 + local.get $1 + local.get $0 + local.tee $2 i32.const 1 - tee_local $3 - get_local $2 - get_local $3 + local.tee $3 + local.get $2 + local.get $3 i32.gt_u select i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_local $4 + local.set $4 current_memory - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 16 i32.shl i32.gt_u if - get_local $4 - get_local $1 + local.get $4 + local.get $1 i32.sub i32.const 65535 i32.add @@ -163,22 +163,22 @@ i32.and i32.const 16 i32.shr_u - set_local $2 - get_local $5 - tee_local $3 - get_local $2 - tee_local $6 - get_local $3 - get_local $6 + 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 - set_local $3 - get_local $3 + local.set $3 + local.get $3 grow_memory i32.const 0 i32.lt_s if - get_local $2 + local.get $2 grow_memory i32.const 0 i32.lt_s @@ -187,15 +187,15 @@ end end end - get_local $4 - set_global $~lib/allocator/arena/offset - get_local $1 + local.get $4 + global.set $~lib/allocator/arena/offset + local.get $1 ) (func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - get_local $0 - get_global $~lib/internal/arraybuffer/MAX_BLENGTH + local.get $0 + global.get $~lib/internal/arraybuffer/MAX_BLENGTH i32.le_u i32.eqz if @@ -207,267 +207,267 @@ unreachable end block $~lib/memory/memory.allocate|inlined.0 (result i32) - get_local $0 + local.get $0 call $~lib/internal/arraybuffer/computeSize - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.0 end - set_local $1 - get_local $1 - get_local $0 + local.set $1 + local.get $1 + local.get $0 i32.store - get_local $1 + local.get $1 ) (func $~lib/internal/memory/memset (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) - get_local $2 + local.get $2 i32.eqz if return end - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 1 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 2 i32.le_u if return end - get_local $0 + local.get $0 i32.const 1 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 + local.get $0 i32.const 2 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 2 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 3 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 6 i32.le_u if return end - get_local $0 + local.get $0 i32.const 3 i32.add - get_local $1 + local.get $1 i32.store8 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $1 + local.get $1 i32.store8 - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end i32.const 0 - get_local $0 + local.get $0 i32.sub i32.const 3 i32.and - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -4 i32.and - set_local $2 + local.set $2 i32.const -1 i32.const 255 i32.div_u - get_local $1 + local.get $1 i32.const 255 i32.and i32.mul - set_local $4 - get_local $0 - get_local $4 + local.set $4 + local.get $0 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 4 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 8 i32.le_u if return end - get_local $0 + local.get $0 i32.const 4 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 12 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 8 i32.sub - get_local $4 + local.get $4 i32.store - get_local $2 + local.get $2 i32.const 24 i32.le_u if return end - get_local $0 + local.get $0 i32.const 12 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 20 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 28 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 24 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 20 i32.sub - get_local $4 + local.get $4 i32.store - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.add i32.const 16 i32.sub - get_local $4 + local.get $4 i32.store i32.const 24 - get_local $0 + local.get $0 i32.const 4 i32.and i32.add - set_local $3 - get_local $0 - get_local $3 + local.set $3 + local.get $0 + local.get $3 i32.add - set_local $0 - get_local $2 - get_local $3 + local.set $0 + local.get $2 + local.get $3 i32.sub - set_local $2 - get_local $4 - i64.extend_u/i32 - get_local $4 - i64.extend_u/i32 + local.set $2 + local.get $4 + i64.extend_i32_u + local.get $4 + i64.extend_i32_u i64.const 32 i64.shl i64.or - set_local $5 + local.set $5 block $break|0 loop $continue|0 - get_local $2 + local.get $2 i32.const 32 i32.ge_u if block - get_local $0 - get_local $5 + local.get $0 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 8 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 16 i32.add - get_local $5 + local.get $5 i64.store - get_local $0 + local.get $0 i32.const 24 i32.add - get_local $5 + local.get $5 i64.store - get_local $2 + local.get $2 i32.const 32 i32.sub - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.const 32 i32.add - set_local $0 + local.set $0 end br $continue|0 end @@ -475,7 +475,7 @@ end ) (func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 call $~lib/allocator/arena/__memory_allocate return ) @@ -484,7 +484,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -495,72 +495,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int8Array#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 1073741816 i32.gt_u if @@ -571,86 +571,86 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 0 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Uint8Array#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/typedarray/Uint8ClampedArray#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/typedarray/Uint8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 536870908 i32.gt_u if @@ -661,72 +661,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int16Array#constructor (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 536870908 i32.gt_u if @@ -737,72 +737,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Uint16Array#constructor (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -813,72 +813,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int32Array#constructor (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -889,72 +889,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Uint32Array#constructor (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 134217727 i32.gt_u if @@ -965,72 +965,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 3 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Int64Array#constructor (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 134217727 i32.gt_u if @@ -1041,72 +1041,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 3 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Uint64Array#constructor (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 268435454 i32.gt_u if @@ -1117,72 +1117,72 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Float32Array#constructor (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#constructor (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $1 + local.get $1 i32.const 134217727 i32.gt_u if @@ -1193,65 +1193,65 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 3 i32.shl - set_local $2 - get_local $2 + local.set $2 + local.get $2 call $~lib/internal/arraybuffer/allocateUnsafe - set_local $3 - get_local $3 - get_global $~lib/internal/arraybuffer/HEADER_SIZE + local.set $3 + local.get $3 + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $4 + local.set $4 i32.const 0 - set_local $5 - get_local $4 - get_local $5 - get_local $2 + local.set $5 + local.get $4 + local.get $5 + local.get $2 call $~lib/internal/memory/memset block (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 + local.get $0 i32.const 0 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 + local.get $0 i32.const 0 i32.store offset=8 - get_local $0 + local.get $0 end - get_local $3 + local.get $3 i32.store - get_local $0 + local.get $0 i32.const 0 i32.store offset=4 - get_local $0 - get_local $2 + local.get $0 + local.get $2 i32.store offset=8 - get_local $0 + local.get $0 ) (func $~lib/typedarray/Float64Array#constructor (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - get_local $0 + local.get $0 i32.eqz if i32.const 12 call $~lib/memory/memory.allocate - set_local $0 + local.set $0 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/internal/typedarray/TypedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 ) (func $std/typedarray/testInstantiate (; 27 ;) (type $iv) (param $0 i32) (local $1 i32) @@ -1266,10 +1266,10 @@ (local $10 i32) (local $11 i32) i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Int8Array#constructor - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.load offset=4 i32.const 0 i32.eq @@ -1282,10 +1282,10 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1298,12 +1298,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $1 + local.get $1 i32.load offset=8 i32.const 0 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1315,10 +1315,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Uint8Array#constructor - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.load offset=4 i32.const 0 i32.eq @@ -1331,10 +1331,10 @@ call $~lib/env/abort unreachable end - get_local $2 + local.get $2 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1347,12 +1347,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $2 + local.get $2 i32.load offset=8 i32.const 0 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1364,10 +1364,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.load offset=4 i32.const 0 i32.eq @@ -1380,10 +1380,10 @@ call $~lib/env/abort unreachable end - get_local $3 + local.get $3 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1396,12 +1396,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $3 + local.get $3 i32.load offset=8 i32.const 0 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1413,10 +1413,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Int16Array#constructor - set_local $4 - get_local $4 + local.set $4 + local.get $4 i32.load offset=4 i32.const 0 i32.eq @@ -1429,10 +1429,10 @@ call $~lib/env/abort unreachable end - get_local $4 + local.get $4 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1445,12 +1445,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $4 + local.get $4 i32.load offset=8 i32.const 1 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1462,10 +1462,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Uint16Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load offset=4 i32.const 0 i32.eq @@ -1478,10 +1478,10 @@ call $~lib/env/abort unreachable end - get_local $5 + local.get $5 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1494,12 +1494,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $5 + local.get $5 i32.load offset=8 i32.const 1 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1511,10 +1511,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Int32Array#constructor - set_local $6 - get_local $6 + local.set $6 + local.get $6 i32.load offset=4 i32.const 0 i32.eq @@ -1527,10 +1527,10 @@ call $~lib/env/abort unreachable end - get_local $6 + local.get $6 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1543,12 +1543,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $6 + local.get $6 i32.load offset=8 i32.const 2 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1560,10 +1560,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Uint32Array#constructor - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.load offset=4 i32.const 0 i32.eq @@ -1576,10 +1576,10 @@ call $~lib/env/abort unreachable end - get_local $7 + local.get $7 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1592,12 +1592,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $7 + local.get $7 i32.load offset=8 i32.const 2 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1609,10 +1609,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Int64Array#constructor - set_local $8 - get_local $8 + local.set $8 + local.get $8 i32.load offset=4 i32.const 0 i32.eq @@ -1625,10 +1625,10 @@ call $~lib/env/abort unreachable end - get_local $8 + local.get $8 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1641,12 +1641,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $8 + local.get $8 i32.load offset=8 i32.const 3 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1658,10 +1658,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Uint64Array#constructor - set_local $9 - get_local $9 + local.set $9 + local.get $9 i32.load offset=4 i32.const 0 i32.eq @@ -1674,10 +1674,10 @@ call $~lib/env/abort unreachable end - get_local $9 + local.get $9 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1690,12 +1690,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $9 + local.get $9 i32.load offset=8 i32.const 3 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1707,10 +1707,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Float32Array#constructor - set_local $10 - get_local $10 + local.set $10 + local.get $10 i32.load offset=4 i32.const 0 i32.eq @@ -1723,10 +1723,10 @@ call $~lib/env/abort unreachable end - get_local $10 + local.get $10 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1739,12 +1739,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $10 + local.get $10 i32.load offset=8 i32.const 2 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1756,10 +1756,10 @@ unreachable end i32.const 0 - get_local $0 + local.get $0 call $~lib/typedarray/Float64Array#constructor - set_local $11 - get_local $11 + local.set $11 + local.get $11 i32.load offset=4 i32.const 0 i32.eq @@ -1772,10 +1772,10 @@ call $~lib/env/abort unreachable end - get_local $11 + local.get $11 i32.load offset=8 - get_local $0 - get_global $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT + local.get $0 + global.get $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT i32.mul i32.eq i32.eqz @@ -1788,12 +1788,12 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - get_local $11 + local.get $11 i32.load offset=8 i32.const 3 i32.shr_u end - get_local $0 + local.get $0 i32.eq i32.eqz if @@ -1808,8 +1808,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 28 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -1822,27 +1822,27 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $~lib/internal/typedarray/TypedArray#__get (; 29 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -1856,18 +1856,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 end @@ -1877,105 +1877,105 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $1 + local.set $1 else - get_local $1 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.add - tee_local $4 - get_local $1 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $1 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 else - get_local $2 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - tee_local $4 - get_local $1 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $1 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 end block $~lib/memory/memory.allocate|inlined.1 (result i32) i32.const 12 - set_local $4 - get_local $4 + local.set $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.1 end - set_local $4 - get_local $4 - get_local $0 + local.set $4 + local.get $4 + local.get $0 i32.load i32.store - get_local $4 - get_local $0 + local.get $4 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.const 2 i32.shl i32.add i32.store offset=4 - get_local $4 - get_local $2 - get_local $1 + local.get $4 + local.get $2 + local.get $1 i32.sub i32.const 2 i32.shl i32.store offset=8 - get_local $4 + local.get $4 ) (func $~lib/internal/typedarray/TypedArray#__set (; 31 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -1988,20 +1988,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 f64.store offset=8 ) (func $~lib/typedarray/Float64Array#subarray (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -2009,99 +2009,99 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $1 + local.set $1 else - get_local $1 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.add - tee_local $4 - get_local $1 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $1 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 else - get_local $2 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - tee_local $4 - get_local $1 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $1 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 end block $~lib/memory/memory.allocate|inlined.2 (result i32) i32.const 12 - set_local $4 - get_local $4 + local.set $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.2 end - set_local $4 - get_local $4 - get_local $0 + local.set $4 + local.get $4 + local.get $0 i32.load i32.store - get_local $4 - get_local $0 + local.get $4 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.const 3 i32.shl i32.add i32.store offset=4 - get_local $4 - get_local $2 - get_local $1 + local.get $4 + local.get $2 + local.get $1 i32.sub i32.const 3 i32.shl i32.store offset=8 - get_local $4 + local.get $4 ) (func $~lib/internal/sort/insertionSort (; 33 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) @@ -2111,77 +2111,77 @@ (local $8 i32) block $break|0 i32.const 0 - set_local $4 + local.set $4 loop $repeat|0 - get_local $4 - get_local $2 + 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) - get_local $0 - get_local $4 + local.get $0 + local.get $4 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $5 - get_local $4 + local.set $5 + local.get $4 i32.const 1 i32.sub - set_local $6 + local.set $6 block $break|1 loop $continue|1 - get_local $6 + local.get $6 i32.const 0 i32.ge_s if block block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f64) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $5 - get_local $7 - get_local $3 + global.set $~argc + local.get $5 + local.get $7 + local.get $3 call_indirect (type $FFi) end i32.const 0 i32.lt_s if block (result i32) - get_local $6 - tee_local $8 + local.get $6 + local.tee $8 i32.const 1 i32.sub - set_local $6 - get_local $8 + local.set $6 + local.get $8 end i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $7 + local.get $7 f64.store offset=8 else br $break|1 @@ -2191,24 +2191,24 @@ end end end - get_local $6 + local.get $6 i32.const 1 i32.add - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $5 + local.get $5 f64.store offset=8 end - get_local $4 + local.get $4 i32.const 1 i32.add - set_local $4 + local.set $4 br $repeat|0 unreachable end @@ -2228,54 +2228,54 @@ (local $10 f64) (local $11 i32) (local $12 f64) - get_local $2 + local.get $2 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - set_local $4 + local.set $4 block $~lib/memory/memory.allocate|inlined.3 (result i32) - get_local $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.3 end - set_local $5 + local.set $5 i32.const 0 - set_local $6 - get_local $5 - get_local $6 - get_local $4 + local.set $6 + local.get $5 + local.get $6 + local.get $4 call $~lib/internal/memory/memset block $break|0 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 + local.get $6 i32.const 0 i32.gt_s i32.eqz br_if $break|0 block - get_local $6 - set_local $7 + local.get $6 + local.set $7 block $break|1 loop $continue|1 - get_local $7 + local.get $7 i32.const 1 i32.and - get_local $5 - get_local $7 + local.get $5 + local.get $7 i32.const 6 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $7 + local.get $7 i32.const 1 i32.shr_s i32.const 31 @@ -2285,60 +2285,60 @@ i32.and i32.eq if - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $7 + local.set $7 br $continue|1 end end end - get_local $7 + local.get $7 i32.const 1 i32.shr_s - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f64) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $9 + local.set $9 block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f64) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 + local.set $10 block (result i32) i32.const 2 - set_global $~argc - get_local $9 - get_local $10 - get_local $3 + global.set $~argc + local.get $9 + local.get $10 + local.get $3 call_indirect (type $FFi) end i32.const 0 i32.lt_s if - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $6 + local.get $5 + local.get $6 i32.const 5 i32.shr_s i32.const 2 @@ -2346,48 +2346,48 @@ i32.add i32.load i32.const 1 - get_local $6 + local.get $6 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f64.store offset=8 - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end block $break|2 - get_local $2 + local.get $2 i32.const 1 i32.sub - set_local $6 + local.set $6 loop $repeat|2 - get_local $6 + local.get $6 i32.const 2 i32.ge_s i32.eqz @@ -2395,131 +2395,131 @@ block block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f64) i32.const 0 - set_local $8 - get_local $0 - get_local $8 + local.set $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 + local.set $10 i32.const 0 - set_local $8 + local.set $8 block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f64) - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $9 - get_local $0 - get_local $8 + local.set $9 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f64.store offset=8 - get_local $0 - get_local $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 i32.const 1 - set_local $8 + local.set $8 block $break|3 loop $continue|3 - get_local $8 + local.get $8 i32.const 1 i32.shl - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add i32.load - get_local $8 + local.get $8 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and i32.add - tee_local $7 - get_local $6 + local.tee $7 + local.get $6 i32.lt_s if - get_local $7 - set_local $8 + local.get $7 + local.set $8 br $continue|3 end end end block $break|4 loop $continue|4 - get_local $8 + local.get $8 i32.const 0 i32.gt_s if block block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f64) i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 + local.set $10 block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f64) - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $9 + local.set $9 block (result i32) i32.const 2 - set_global $~argc - get_local $10 - get_local $9 - get_local $3 + global.set $~argc + local.get $10 + local.get $9 + local.get $3 call_indirect (type $FFi) end i32.const 0 i32.lt_s if - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 i32.shl i32.add - get_local $5 - get_local $8 + local.get $5 + local.get $8 i32.const 5 i32.shr_s i32.const 2 @@ -2527,47 +2527,47 @@ i32.add i32.load i32.const 1 - get_local $8 + local.get $8 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $8 + local.get $0 + local.get $8 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 i32.const 0 - set_local $11 - get_local $0 - get_local $11 + local.set $11 + local.get $0 + local.get $11 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $9 + local.get $9 f64.store offset=8 end - get_local $8 + local.get $8 i32.const 1 i32.shr_s - set_local $8 + local.set $8 end br $continue|4 end end end end - get_local $6 + local.get $6 i32.const 1 i32.sub - set_local $6 + local.set $6 br $repeat|2 unreachable end @@ -2575,7 +2575,7 @@ end block $~lib/memory/memory.free|inlined.0 block - get_local $5 + local.get $5 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.0 unreachable @@ -2584,51 +2584,51 @@ end block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f64) i32.const 1 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $12 + local.set $12 i32.const 1 - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f64) i32.const 0 - set_local $7 - get_local $0 - get_local $7 + local.set $7 + local.get $0 + local.get $7 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add f64.load offset=8 end - set_local $10 - get_local $0 - get_local $6 + local.set $10 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $10 + local.get $10 f64.store offset=8 i32.const 0 - set_local $6 - get_local $0 - get_local $6 + local.set $6 + local.get $0 + local.get $6 i32.const 3 i32.shl i32.add - get_local $1 + local.get $1 i32.add - get_local $12 + local.get $12 f64.store offset=8 ) (func $~lib/typedarray/Float64Array#sort (; 36 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -2639,142 +2639,142 @@ (local $6 f64) (local $7 f64) block $~lib/internal/typedarray/SORT|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load offset=4 - set_local $2 + local.set $2 block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.le_s if - get_local $0 + local.get $0 br $~lib/internal/typedarray/SORT|inlined.0 end - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 2 i32.eq if block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f64) i32.const 1 - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 3 i32.shl i32.add - get_local $2 + local.get $2 i32.add f64.load offset=8 end - set_local $6 + local.set $6 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f64) i32.const 0 - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 3 i32.shl i32.add - get_local $2 + local.get $2 i32.add f64.load offset=8 end - set_local $7 + local.set $7 block (result i32) i32.const 2 - set_global $~argc - get_local $6 - get_local $7 - get_local $1 + global.set $~argc + local.get $6 + local.get $7 + local.get $1 call_indirect (type $FFi) end i32.const 0 i32.lt_s if i32.const 1 - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 3 i32.shl i32.add - get_local $2 + local.get $2 i32.add - get_local $7 + local.get $7 f64.store offset=8 i32.const 0 - set_local $5 - get_local $4 - get_local $5 + local.set $5 + local.get $4 + local.get $5 i32.const 3 i32.shl i32.add - get_local $2 + local.get $2 i32.add - get_local $6 + local.get $6 f64.store offset=8 end - get_local $0 + local.get $0 br $~lib/internal/typedarray/SORT|inlined.0 end - get_local $3 + local.get $3 i32.const 256 i32.lt_s if - get_local $4 - get_local $2 - get_local $3 - get_local $1 + local.get $4 + local.get $2 + local.get $3 + local.get $1 call $~lib/internal/sort/insertionSort else - get_local $4 - get_local $2 - get_local $3 - get_local $1 + local.get $4 + local.get $2 + local.get $3 + local.get $1 call $~lib/internal/sort/weakHeapSort end - get_local $0 + local.get $0 end ) (func $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 (; 37 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 - get_local $2 + 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 - set_local $2 - get_local $3 - get_local $3 + local.set $2 + local.get $3 + local.get $3 i64.const 63 i64.shr_s i64.const 1 i64.shr_u i64.xor - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i64.gt_s - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.lt_s i32.sub ) @@ -2782,7 +2782,7 @@ block $1of1 block $0of1 block $outOfRange - get_global $~argc + global.get $~argc br_table $0of1 $1of1 $outOfRange end unreachable @@ -2791,17 +2791,17 @@ i32.const 1 br $~lib/internal/sort/COMPARATOR|inlined.0 end - set_local $1 + local.set $1 end - get_local $0 - get_local $1 + local.get $0 + local.get $1 call $~lib/typedarray/Float64Array#sort ) (func $~lib/internal/typedarray/TypedArray#__get (; 39 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -2815,18 +2815,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f64) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 3 i32.shl i32.add - get_local $3 + local.get $3 i32.add f64.load offset=8 end @@ -2834,8 +2834,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 40 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -2848,40 +2848,40 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/typedarray/Uint8ClampedArray#__set (; 41 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $0 - get_local $1 - get_local $2 - tee_local $3 + local.get $0 + local.get $1 + local.get $2 + local.tee $3 i32.const 255 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - tee_local $3 + local.tee $3 i32.const 0 - tee_local $4 - get_local $3 - get_local $4 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select call $~lib/internal/typedarray/TypedArray#__set @@ -2889,8 +2889,8 @@ (func $~lib/internal/typedarray/TypedArray#__get (; 42 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -2904,18 +2904,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 0 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load8_u offset=8 end @@ -2923,8 +2923,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 43 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -2937,20 +2937,20 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store8 offset=8 ) (func $~lib/typedarray/Int8Array#fill (; 44 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) @@ -2959,97 +2959,97 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $6 - get_local $2 + local.get $6 + local.get $2 i32.add - tee_local $7 + local.tee $7 i32.const 0 - tee_local $8 - get_local $7 - get_local $8 + local.tee $8 + local.get $7 + local.get $8 i32.gt_s select else - get_local $2 - tee_local $7 - get_local $6 - tee_local $8 - get_local $7 - get_local $8 + local.get $2 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 i32.lt_s select end - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.add - tee_local $7 + local.tee $7 i32.const 0 - tee_local $8 - get_local $7 - get_local $8 + local.tee $8 + local.get $7 + local.get $8 i32.gt_s select else - get_local $3 - tee_local $7 - get_local $6 - tee_local $8 - get_local $7 - get_local $8 + local.get $3 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 i32.lt_s select end - set_local $3 - get_local $2 - get_local $3 + local.set $3 + local.get $2 + local.get $3 i32.lt_s if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.add - get_local $5 + local.get $5 i32.add - get_global $~lib/internal/arraybuffer/HEADER_SIZE + global.get $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $7 - get_local $3 - get_local $2 + local.set $7 + local.get $3 + local.get $2 i32.sub - set_local $8 - get_local $7 - get_local $1 - get_local $8 + local.set $8 + local.get $7 + local.get $1 + local.get $8 call $~lib/internal/memory/memset end - get_local $0 + local.get $0 ) (func $~lib/internal/typedarray/TypedArray#__get (; 45 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -3063,18 +3063,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 0 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load8_s offset=8 end @@ -3082,24 +3082,24 @@ (func $~lib/array/Array#__get (; 46 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 0 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 0 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load8_s offset=8 else @@ -3110,13 +3110,13 @@ (local $2 i32) (local $3 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end block $~lib/array/Array#get:length|inlined.1 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -3127,30 +3127,30 @@ block $break|0 block i32.const 0 - set_local $2 + local.set $2 block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/internal/typedarray/TypedArray#__get i32.const 24 i32.shl i32.const 24 i32.shr_s - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/array/Array#__get i32.const 24 i32.shl @@ -3161,10 +3161,10 @@ i32.const 0 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -3177,7 +3177,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -3185,15 +3185,15 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $3 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/typedarray/Int8Array#fill ) (func $~lib/typedarray/Int8Array#subarray (; 49 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -3201,99 +3201,99 @@ (local $4 i32) (local $5 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $3 - get_local $1 + local.set $3 + local.get $1 i32.const 0 i32.lt_s if - get_local $3 - get_local $1 + local.get $3 + local.get $1 i32.add - tee_local $4 + local.tee $4 i32.const 0 - tee_local $5 - get_local $4 - get_local $5 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $1 + local.set $1 else - get_local $1 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - set_local $1 + local.set $1 end - get_local $2 + local.get $2 i32.const 0 i32.lt_s if - get_local $3 - get_local $2 + local.get $3 + local.get $2 i32.add - tee_local $4 - get_local $1 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $1 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 else - get_local $2 - tee_local $4 - get_local $3 - tee_local $5 - get_local $4 - get_local $5 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.lt_s select - tee_local $4 - get_local $1 - tee_local $5 - get_local $4 - get_local $5 + local.tee $4 + local.get $1 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - set_local $2 + local.set $2 end block $~lib/memory/memory.allocate|inlined.4 (result i32) i32.const 12 - set_local $4 - get_local $4 + local.set $4 + local.get $4 call $~lib/allocator/arena/__memory_allocate br $~lib/memory/memory.allocate|inlined.4 end - set_local $4 - get_local $4 - get_local $0 + local.set $4 + local.get $4 + local.get $0 i32.load i32.store - get_local $4 - get_local $0 + local.get $4 + local.get $0 i32.load offset=4 - get_local $1 + local.get $1 i32.const 0 i32.shl i32.add i32.store offset=4 - get_local $4 - get_local $2 - get_local $1 + local.get $4 + local.get $2 + local.get $1 i32.sub i32.const 0 i32.shl i32.store offset=8 - get_local $4 + local.get $4 ) (func $~lib/typedarray/Int32Array#fill (; 50 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) @@ -3301,117 +3301,117 @@ (local $6 i32) (local $7 i32) (local $8 i32) - get_local $0 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $6 - get_local $2 + local.set $6 + local.get $2 i32.const 0 i32.lt_s if (result i32) - get_local $6 - get_local $2 + local.get $6 + local.get $2 i32.add - tee_local $7 + local.tee $7 i32.const 0 - tee_local $8 - get_local $7 - get_local $8 + local.tee $8 + local.get $7 + local.get $8 i32.gt_s select else - get_local $2 - tee_local $7 - get_local $6 - tee_local $8 - get_local $7 - get_local $8 + local.get $2 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 i32.lt_s select end - set_local $2 - get_local $3 + local.set $2 + local.get $3 i32.const 0 i32.lt_s if (result i32) - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.add - tee_local $7 + local.tee $7 i32.const 0 - tee_local $8 - get_local $7 - get_local $8 + local.tee $8 + local.get $7 + local.get $8 i32.gt_s select else - get_local $3 - tee_local $7 - get_local $6 - tee_local $8 - get_local $7 - get_local $8 + local.get $3 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 i32.lt_s select end - set_local $3 + local.set $3 block $break|0 loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add - get_local $1 + local.get $1 i32.store offset=8 - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end unreachable end - get_local $0 + local.get $0 ) (func $~lib/array/Array#__get (; 51 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $1 - get_local $2 + local.set $2 + local.get $1 + local.get $2 i32.load i32.const 2 i32.shr_u i32.lt_u if (result i32) i32.const 0 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 else @@ -3422,13 +3422,13 @@ (local $2 i32) (local $3 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end block $~lib/array/Array#get:length|inlined.1 (result i32) - get_local $1 + local.get $1 i32.load offset=4 end i32.ne @@ -3439,36 +3439,36 @@ block $break|0 block i32.const 0 - set_local $2 + local.set $2 block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $3 + local.set $3 end loop $repeat|0 - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - get_local $0 - get_local $2 + local.get $0 + local.get $2 call $~lib/internal/typedarray/TypedArray#__get - get_local $1 - get_local $2 + local.get $1 + local.get $2 call $~lib/array/Array#__get i32.ne if i32.const 0 return end - get_local $2 + local.get $2 i32.const 1 i32.add - set_local $2 + local.set $2 br $repeat|0 unreachable end @@ -3481,7 +3481,7 @@ block $1of2 block $0of2 block $outOfRange - get_global $~argc + global.get $~argc i32.const 1 i32.sub br_table $0of2 $1of2 $2of2 $outOfRange @@ -3489,20 +3489,20 @@ unreachable end i32.const 0 - set_local $2 + local.set $2 end - get_global $~lib/builtins/i32.MAX_VALUE - set_local $3 + global.get $~lib/builtins/i32.MAX_VALUE + local.set $3 end - get_local $0 - get_local $1 - get_local $2 - get_local $3 + local.get $0 + local.get $1 + local.get $2 + local.get $3 call $~lib/typedarray/Int32Array#fill ) (func $std/typedarray/testReduce~anonymous|2 (; 54 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Int8Array#reduce (; 55 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -3511,57 +3511,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 0 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load8_s offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 56 ;) (type $v) (local $0 i32) @@ -3569,25 +3569,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 0 call $~lib/typedarray/Int8Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -3605,8 +3605,8 @@ end ) (func $std/typedarray/testReduce~anonymous|3 (; 57 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Uint8Array#reduce (; 58 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -3615,57 +3615,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 0 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load8_u offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 59 ;) (type $v) (local $0 i32) @@ -3673,25 +3673,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 3 i32.const 0 call $~lib/typedarray/Uint8Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 255 i32.and i32.const 6 @@ -3707,8 +3707,8 @@ end ) (func $std/typedarray/testReduce~anonymous|4 (; 60 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $std/typedarray/testReduce (; 61 ;) (type $v) @@ -3717,25 +3717,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 4 i32.const 0 call $~lib/typedarray/Uint8Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 255 i32.and i32.const 6 @@ -3753,8 +3753,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 62 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u @@ -3767,25 +3767,25 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store16 offset=8 ) (func $std/typedarray/testReduce~anonymous|5 (; 63 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Int16Array#reduce (; 64 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -3794,57 +3794,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load16_s offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 65 ;) (type $v) (local $0 i32) @@ -3852,25 +3852,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 5 i32.const 0 call $~lib/typedarray/Int16Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -3890,8 +3890,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 66 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u @@ -3904,25 +3904,25 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store16 offset=8 ) (func $std/typedarray/testReduce~anonymous|6 (; 67 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Uint16Array#reduce (; 68 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -3931,57 +3931,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 1 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load16_u offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 69 ;) (type $v) (local $0 i32) @@ -3989,25 +3989,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 6 i32.const 0 call $~lib/typedarray/Uint16Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 65535 i32.and i32.const 6 @@ -4023,8 +4023,8 @@ end ) (func $std/typedarray/testReduce~anonymous|7 (; 70 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Int32Array#reduce (; 71 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -4033,57 +4033,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 72 ;) (type $v) (local $0 i32) @@ -4091,25 +4091,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 7 i32.const 0 call $~lib/typedarray/Int32Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 6 i32.eq i32.eqz @@ -4125,8 +4125,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 73 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -4139,25 +4139,25 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i32.store offset=8 ) (func $std/typedarray/testReduce~anonymous|8 (; 74 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Uint32Array#reduce (; 75 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -4166,57 +4166,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add i32.load offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 76 ;) (type $v) (local $0 i32) @@ -4224,25 +4224,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 8 i32.const 0 call $~lib/typedarray/Uint32Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 6 i32.eq i32.eqz @@ -4258,8 +4258,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 77 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -4272,25 +4272,25 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i64.store offset=8 ) (func $std/typedarray/testReduce~anonymous|9 (; 78 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.add ) (func $~lib/typedarray/Int64Array#reduce (; 79 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) @@ -4299,57 +4299,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i64) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 3 i32.shl i32.add - get_local $5 + local.get $5 i32.add i64.load offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $IIiiI) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 80 ;) (type $v) (local $0 i32) @@ -4357,25 +4357,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 9 i64.const 0 call $~lib/typedarray/Int64Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i64.const 6 i64.eq i32.eqz @@ -4391,8 +4391,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 81 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -4405,25 +4405,25 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 i64.store offset=8 ) (func $std/typedarray/testReduce~anonymous|10 (; 82 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.add ) (func $~lib/typedarray/Uint64Array#reduce (; 83 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) @@ -4432,57 +4432,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result i64) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 3 i32.shl i32.add - get_local $5 + local.get $5 i32.add i64.load offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $IIiiI) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 84 ;) (type $v) (local $0 i32) @@ -4490,25 +4490,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 10 i64.const 0 call $~lib/typedarray/Uint64Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 i64.const 6 i64.eq i32.eqz @@ -4524,8 +4524,8 @@ (func $~lib/internal/typedarray/TypedArray#__set (; 85 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) (local $4 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -4538,25 +4538,25 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 - get_local $3 - get_local $1 + local.set $4 + local.get $3 + local.get $1 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add - get_local $2 + local.get $2 f32.store offset=8 ) (func $std/typedarray/testReduce~anonymous|11 (; 86 ;) (type $ffiif) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add ) (func $~lib/typedarray/Float32Array#reduce (; 87 ;) (type $iiff) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) @@ -4565,57 +4565,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result f32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f32) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 2 i32.shl i32.add - get_local $5 + local.get $5 i32.add f32.load offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $ffiif) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 88 ;) (type $v) (local $0 i32) @@ -4623,25 +4623,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 11 f32.const 0 call $~lib/typedarray/Float32Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 f32.const 6 f32.eq i32.eqz @@ -4655,8 +4655,8 @@ end ) (func $std/typedarray/testReduce~anonymous|12 (; 89 ;) (type $FFiiF) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add ) (func $~lib/typedarray/Float64Array#reduce (; 90 ;) (type $iiFF) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) @@ -4665,57 +4665,57 @@ (local $5 i32) (local $6 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load - set_local $4 - get_local $0 + local.set $4 + local.get $0 i32.load offset=4 - set_local $5 + local.set $5 block $break|0 i32.const 0 - set_local $6 + local.set $6 loop $repeat|0 - get_local $6 - get_local $3 + local.get $6 + local.get $3 i32.lt_s i32.eqz br_if $break|0 block (result f64) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.13 (result f64) - get_local $4 - get_local $6 + local.get $4 + local.get $6 i32.const 3 i32.shl i32.add - get_local $5 + local.get $5 i32.add f64.load offset=8 end - get_local $6 - get_local $0 - get_local $1 + local.get $6 + local.get $0 + local.get $1 call_indirect (type $FFiiF) end - set_local $2 - get_local $6 + local.set $2 + local.get $6 i32.const 1 i32.add - set_local $6 + local.set $6 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduce (; 91 ;) (type $v) (local $0 i32) @@ -4723,25 +4723,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 12 f64.const 0 call $~lib/typedarray/Float64Array#reduce - set_local $1 - get_local $1 + local.set $1 + local.get $1 f64.const 6 f64.eq i32.eqz @@ -4755,66 +4755,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|13 (; 92 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Int8Array#reduceRight (; 93 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 94 ;) (type $v) (local $0 i32) @@ -4822,25 +4822,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 13 i32.const 0 call $~lib/typedarray/Int8Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 24 i32.shl i32.const 24 @@ -4858,66 +4858,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|14 (; 95 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Uint8Array#reduceRight (; 96 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 97 ;) (type $v) (local $0 i32) @@ -4925,25 +4925,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 14 i32.const 0 call $~lib/typedarray/Uint8Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 255 i32.and i32.const 6 @@ -4959,8 +4959,8 @@ end ) (func $std/typedarray/testReduceRight~anonymous|15 (; 98 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $std/typedarray/testReduceRight (; 99 ;) (type $v) @@ -4969,25 +4969,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 15 i32.const 0 call $~lib/typedarray/Uint8Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 255 i32.and i32.const 6 @@ -5003,66 +5003,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|16 (; 100 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Int16Array#reduceRight (; 101 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 102 ;) (type $v) (local $0 i32) @@ -5070,25 +5070,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 16 i32.const 0 call $~lib/typedarray/Int16Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 16 i32.shl i32.const 16 @@ -5106,66 +5106,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|17 (; 103 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Uint16Array#reduceRight (; 104 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 105 ;) (type $v) (local $0 i32) @@ -5173,25 +5173,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 17 i32.const 0 call $~lib/typedarray/Uint16Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 65535 i32.and i32.const 6 @@ -5207,66 +5207,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|18 (; 106 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Int32Array#reduceRight (; 107 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 108 ;) (type $v) (local $0 i32) @@ -5274,25 +5274,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 18 i32.const 0 call $~lib/typedarray/Int32Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 6 i32.eq i32.eqz @@ -5306,66 +5306,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|19 (; 109 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i32.add ) (func $~lib/typedarray/Uint32Array#reduceRight (; 110 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiiii) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 111 ;) (type $v) (local $0 i32) @@ -5373,25 +5373,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 19 i32.const 0 call $~lib/typedarray/Uint32Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 6 i32.eq i32.eqz @@ -5405,66 +5405,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|20 (; 112 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.add ) (func $~lib/typedarray/Int64Array#reduceRight (; 113 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i64) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $IIiiI) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 114 ;) (type $v) (local $0 i32) @@ -5472,25 +5472,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 20 i64.const 0 call $~lib/typedarray/Int64Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i64.const 6 i64.eq i32.eqz @@ -5504,66 +5504,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|21 (; 115 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 i64.add ) (func $~lib/typedarray/Uint64Array#reduceRight (; 116 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result i64) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $IIiiI) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 117 ;) (type $v) (local $0 i32) @@ -5571,25 +5571,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 21 i64.const 0 call $~lib/typedarray/Uint64Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 i64.const 6 i64.eq i32.eqz @@ -5603,66 +5603,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|22 (; 118 ;) (type $ffiif) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.add ) (func $~lib/typedarray/Float32Array#reduceRight (; 119 ;) (type $iiff) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result f32) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add f32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $ffiif) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 120 ;) (type $v) (local $0 i32) @@ -5670,25 +5670,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 22 f32.const 0 call $~lib/typedarray/Float32Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 f32.const 6 f32.eq i32.eqz @@ -5702,66 +5702,66 @@ end ) (func $std/typedarray/testReduceRight~anonymous|23 (; 121 ;) (type $FFiiF) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.add ) (func $~lib/typedarray/Float64Array#reduceRight (; 122 ;) (type $iiFF) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) (local $3 i32) (local $4 i32) (local $5 i32) - get_local $0 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end i32.const 1 i32.sub - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 + local.get $5 i32.const 0 i32.ge_s i32.eqz br_if $break|0 block (result f64) i32.const 4 - set_global $~argc - get_local $2 + global.set $~argc + local.get $2 block $~lib/internal/arraybuffer/LOAD|inlined.14 (result f64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add f64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $FFiiF) end - set_local $2 - get_local $5 + local.set $2 + local.get $5 i32.const 1 i32.sub - set_local $5 + local.set $5 br $repeat|0 unreachable end unreachable end - get_local $2 + local.get $2 ) (func $std/typedarray/testReduceRight (; 123 ;) (type $v) (local $0 i32) @@ -5769,25 +5769,25 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 23 f64.const 0 call $~lib/typedarray/Float64Array#reduceRight - set_local $1 - get_local $1 + local.set $1 + local.get $1 f64.const 6 f64.eq i32.eqz @@ -5801,8 +5801,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|24 (; 124 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Int8Array#map (; 125 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -5815,80 +5815,80 @@ (local $8 i32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.12 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Int8Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_s offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 24 i32.shl i32.const 24 i32.shr_s - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 0 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store8 offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 126 ;) (type $v) (local $0 i32) @@ -5896,24 +5896,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 24 call $~lib/typedarray/Int8Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 24 @@ -5931,7 +5931,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 24 @@ -5949,7 +5949,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 24 @@ -5969,8 +5969,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|25 (; 127 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Uint8Array#map (; 128 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -5983,78 +5983,78 @@ (local $8 i32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Uint8Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 255 i32.and - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 0 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store8 offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 129 ;) (type $v) (local $0 i32) @@ -6062,24 +6062,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 25 call $~lib/typedarray/Uint8Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -6095,7 +6095,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -6111,7 +6111,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -6129,8 +6129,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|26 (; 130 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Uint8ClampedArray#map (; 131 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -6143,78 +6143,78 @@ (local $8 i32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 255 i32.and - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 0 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store8 offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 132 ;) (type $v) (local $0 i32) @@ -6222,24 +6222,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 26 call $~lib/typedarray/Uint8ClampedArray#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -6255,7 +6255,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -6271,7 +6271,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -6289,8 +6289,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|27 (; 133 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Int16Array#map (; 134 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -6303,86 +6303,86 @@ (local $8 i32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Int16Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_s offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 16 i32.shl i32.const 16 i32.shr_s - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 1 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store16 offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 135 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u @@ -6396,18 +6396,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 1 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load16_s offset=8 end @@ -6418,24 +6418,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 27 call $~lib/typedarray/Int16Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 16 @@ -6453,7 +6453,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 16 @@ -6471,7 +6471,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 16 @@ -6491,8 +6491,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|28 (; 137 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Uint16Array#map (; 138 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -6505,84 +6505,84 @@ (local $8 i32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Uint16Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 65535 i32.and - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 1 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store16 offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 139 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u @@ -6596,18 +6596,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 1 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load16_u offset=8 end @@ -6618,24 +6618,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 28 call $~lib/typedarray/Uint16Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -6651,7 +6651,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -6667,7 +6667,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 65535 @@ -6685,8 +6685,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|29 (; 141 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Int32Array#map (; 142 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -6699,76 +6699,76 @@ (local $8 i32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Int32Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $iiii) end - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 143 ;) (type $v) (local $0 i32) @@ -6776,24 +6776,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 29 call $~lib/typedarray/Int32Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 1 @@ -6807,7 +6807,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 4 @@ -6821,7 +6821,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 9 @@ -6837,8 +6837,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|30 (; 144 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i32.mul ) (func $~lib/typedarray/Uint32Array#map (; 145 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -6851,82 +6851,82 @@ (local $8 i32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Uint32Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $iiii) end - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i32.store offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 146 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -6940,18 +6940,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add i32.load offset=8 end @@ -6962,24 +6962,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 30 call $~lib/typedarray/Uint32Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 1 @@ -6993,7 +6993,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 4 @@ -7007,7 +7007,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 9 @@ -7023,8 +7023,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|31 (; 148 ;) (type $IiiI) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i64.mul ) (func $~lib/typedarray/Int64Array#map (; 149 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -7037,82 +7037,82 @@ (local $8 i64) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Int64Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i64) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $IiiI) end - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 3 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i64.store offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 150 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -7126,18 +7126,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 3 i32.shl i32.add - get_local $3 + local.get $3 i32.add i64.load offset=8 end @@ -7148,24 +7148,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 31 call $~lib/typedarray/Int64Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i64.const 1 @@ -7179,7 +7179,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i64.const 4 @@ -7193,7 +7193,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i64.const 9 @@ -7209,8 +7209,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|32 (; 152 ;) (type $IiiI) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) - get_local $0 - get_local $0 + local.get $0 + local.get $0 i64.mul ) (func $~lib/typedarray/Uint64Array#map (; 153 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -7223,82 +7223,82 @@ (local $8 i64) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Uint64Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i64) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $IiiI) end - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 3 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 i64.store offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 154 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -7312,18 +7312,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 3 i32.shl i32.add - get_local $3 + local.get $3 i32.add i64.load offset=8 end @@ -7334,24 +7334,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 32 call $~lib/typedarray/Uint64Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i64.const 1 @@ -7365,7 +7365,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i64.const 4 @@ -7379,7 +7379,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i64.const 9 @@ -7395,8 +7395,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|33 (; 156 ;) (type $fiif) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f32.mul ) (func $~lib/typedarray/Float32Array#map (; 157 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -7409,82 +7409,82 @@ (local $8 f32) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Float32Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result f32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f32) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add f32.load offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $fiif) end - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 2 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 f32.store offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $~lib/internal/typedarray/TypedArray#__get (; 158 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (local $2 i32) (local $3 i32) - get_local $1 - get_local $0 + local.get $1 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -7498,18 +7498,18 @@ unreachable end block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f32) - get_local $0 + local.get $0 i32.load - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load offset=4 - set_local $3 - get_local $2 - get_local $1 + local.set $3 + local.get $2 + local.get $1 i32.const 2 i32.shl i32.add - get_local $3 + local.get $3 i32.add f32.load offset=8 end @@ -7520,24 +7520,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 33 call $~lib/typedarray/Float32Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get f32.const 1 @@ -7551,7 +7551,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get f32.const 4 @@ -7565,7 +7565,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get f32.const 9 @@ -7581,8 +7581,8 @@ end ) (func $std/typedarray/testArrayMap~anonymous|34 (; 160 ;) (type $FiiF) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) - get_local $0 - get_local $0 + local.get $0 + local.get $0 f64.mul ) (func $~lib/typedarray/Float64Array#map (; 161 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) @@ -7595,76 +7595,76 @@ (local $8 f64) (local $9 i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 i32.const 0 - get_local $2 + local.get $2 call $~lib/typedarray/Float64Array#constructor - set_local $5 - get_local $5 + local.set $5 + local.get $5 i32.load - set_local $6 + local.set $6 block $break|0 i32.const 0 - set_local $7 + local.set $7 loop $repeat|0 - get_local $7 - get_local $2 + local.get $7 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result f64) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.15 (result f64) - get_local $3 - get_local $7 + local.get $3 + local.get $7 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add f64.load offset=8 end - get_local $7 - get_local $0 - get_local $1 + local.get $7 + local.get $0 + local.get $1 call_indirect (type $FiiF) end - set_local $8 + local.set $8 i32.const 0 - set_local $9 - get_local $6 - get_local $7 + local.set $9 + local.get $6 + local.get $7 i32.const 3 i32.shl i32.add - get_local $9 + local.get $9 i32.add - get_local $8 + local.get $8 f64.store offset=8 end - get_local $7 + local.get $7 i32.const 1 i32.add - set_local $7 + local.set $7 br $repeat|0 unreachable end unreachable end - get_local $5 + local.get $5 ) (func $std/typedarray/testArrayMap (; 162 ;) (type $v) (local $0 i32) @@ -7672,24 +7672,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 34 call $~lib/typedarray/Float64Array#map - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get f64.const 1 @@ -7703,7 +7703,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get f64.const 4 @@ -7717,7 +7717,7 @@ call $~lib/env/abort unreachable end - get_local $1 + local.get $1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get f64.const 9 @@ -7733,7 +7733,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|35 (; 163 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -7748,43 +7748,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.13 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -7793,10 +7793,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -7806,7 +7806,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|36 (; 165 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -7821,24 +7821,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 35 call $~lib/typedarray/Int8Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -7850,11 +7850,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 36 call $~lib/typedarray/Int8Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -7869,7 +7869,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|37 (; 167 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -7882,43 +7882,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -7927,10 +7927,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -7940,7 +7940,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|38 (; 169 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 0 @@ -7953,24 +7953,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 37 call $~lib/typedarray/Uint8Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -7982,11 +7982,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 38 call $~lib/typedarray/Uint8Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8001,7 +8001,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|39 (; 171 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -8014,43 +8014,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -8059,10 +8059,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8072,7 +8072,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|40 (; 173 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 0 @@ -8085,24 +8085,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 39 call $~lib/typedarray/Uint8ClampedArray#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -8114,11 +8114,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 40 call $~lib/typedarray/Uint8ClampedArray#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8133,7 +8133,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|41 (; 175 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -8148,43 +8148,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -8193,10 +8193,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8206,7 +8206,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|42 (; 177 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -8221,24 +8221,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 41 call $~lib/typedarray/Int16Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -8250,11 +8250,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 42 call $~lib/typedarray/Int16Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8269,7 +8269,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|43 (; 179 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 2 @@ -8282,43 +8282,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -8327,10 +8327,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8340,7 +8340,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|44 (; 181 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 0 @@ -8353,24 +8353,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 43 call $~lib/typedarray/Uint16Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -8382,11 +8382,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 44 call $~lib/typedarray/Uint16Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8401,7 +8401,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|45 (; 183 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.eq ) @@ -8412,43 +8412,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.12 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -8457,10 +8457,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8470,7 +8470,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|46 (; 185 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq ) @@ -8481,24 +8481,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 45 call $~lib/typedarray/Int32Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -8510,11 +8510,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 46 call $~lib/typedarray/Int32Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8529,7 +8529,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|47 (; 187 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.eq ) @@ -8540,43 +8540,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -8585,10 +8585,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8598,7 +8598,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|48 (; 189 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 0 i32.eq ) @@ -8609,24 +8609,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 47 call $~lib/typedarray/Uint32Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -8638,11 +8638,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 48 call $~lib/typedarray/Uint32Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8657,7 +8657,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|49 (; 191 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.eq ) @@ -8668,43 +8668,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Iiii) end i32.const 0 @@ -8713,10 +8713,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8726,7 +8726,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|50 (; 193 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 0 i64.eq ) @@ -8737,24 +8737,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 49 call $~lib/typedarray/Int64Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -8766,11 +8766,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 50 call $~lib/typedarray/Int64Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8785,7 +8785,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|51 (; 195 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.eq ) @@ -8796,43 +8796,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Iiii) end i32.const 0 @@ -8841,10 +8841,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8854,7 +8854,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|52 (; 197 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 0 i64.eq ) @@ -8865,24 +8865,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 51 call $~lib/typedarray/Uint64Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -8894,11 +8894,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 52 call $~lib/typedarray/Uint64Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -8913,7 +8913,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|53 (; 199 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 2 f32.eq ) @@ -8924,43 +8924,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add f32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $fiii) end i32.const 0 @@ -8969,10 +8969,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -8982,7 +8982,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|54 (; 201 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 0 f32.eq ) @@ -8993,24 +8993,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 53 call $~lib/typedarray/Float32Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -9022,11 +9022,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 54 call $~lib/typedarray/Float32Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -9041,7 +9041,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|55 (; 203 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 2 f64.eq ) @@ -9052,43 +9052,43 @@ (local $5 i32) block $~lib/internal/typedarray/SOME|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.17 (result f64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add f64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Fiii) end i32.const 0 @@ -9097,10 +9097,10 @@ i32.const 1 br $~lib/internal/typedarray/SOME|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -9110,7 +9110,7 @@ end ) (func $std/typedarray/testArraySome~anonymous|56 (; 205 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 0 f64.eq ) @@ -9121,24 +9121,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 55 call $~lib/typedarray/Float64Array#some - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -9150,11 +9150,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 56 call $~lib/typedarray/Float64Array#some - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -9169,7 +9169,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|57 (; 207 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -9184,55 +9184,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.14 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -9242,7 +9242,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|58 (; 209 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -9257,24 +9257,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 57 call $~lib/typedarray/Int8Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -9286,11 +9286,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 58 call $~lib/typedarray/Int8Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -9304,7 +9304,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|59 (; 211 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -9317,55 +9317,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -9375,7 +9375,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|60 (; 213 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 4 @@ -9388,24 +9388,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 59 call $~lib/typedarray/Uint8Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -9417,11 +9417,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 60 call $~lib/typedarray/Uint8Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -9435,7 +9435,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|61 (; 215 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -9448,55 +9448,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -9506,7 +9506,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|62 (; 217 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 4 @@ -9519,24 +9519,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 61 call $~lib/typedarray/Uint8ClampedArray#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -9548,11 +9548,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 62 call $~lib/typedarray/Uint8ClampedArray#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -9566,7 +9566,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|63 (; 219 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -9581,55 +9581,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -9639,7 +9639,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|64 (; 221 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -9654,24 +9654,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 63 call $~lib/typedarray/Int16Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -9683,11 +9683,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 64 call $~lib/typedarray/Int16Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -9701,7 +9701,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|65 (; 223 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 2 @@ -9714,55 +9714,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -9772,7 +9772,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|66 (; 225 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 4 @@ -9785,24 +9785,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 65 call $~lib/typedarray/Uint16Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -9814,11 +9814,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 66 call $~lib/typedarray/Uint16Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -9832,7 +9832,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|67 (; 227 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.eq ) @@ -9843,55 +9843,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.13 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -9901,7 +9901,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|68 (; 229 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 4 i32.eq ) @@ -9912,24 +9912,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 67 call $~lib/typedarray/Int32Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -9941,11 +9941,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 68 call $~lib/typedarray/Int32Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -9959,7 +9959,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|69 (; 231 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.eq ) @@ -9970,55 +9970,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10028,7 +10028,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|70 (; 233 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 4 i32.eq ) @@ -10039,24 +10039,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 69 call $~lib/typedarray/Uint32Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -10068,11 +10068,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 70 call $~lib/typedarray/Uint32Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -10086,7 +10086,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|71 (; 235 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.eq ) @@ -10097,55 +10097,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10155,7 +10155,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|72 (; 237 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 4 i64.eq ) @@ -10166,24 +10166,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 71 call $~lib/typedarray/Int64Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -10195,11 +10195,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 72 call $~lib/typedarray/Int64Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -10213,7 +10213,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|73 (; 239 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.eq ) @@ -10224,55 +10224,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Iiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10282,7 +10282,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|74 (; 241 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 4 i64.eq ) @@ -10293,24 +10293,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 73 call $~lib/typedarray/Uint64Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -10322,11 +10322,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 74 call $~lib/typedarray/Uint64Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -10340,7 +10340,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|75 (; 243 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 2 f32.eq ) @@ -10351,55 +10351,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add f32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $fiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10409,7 +10409,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|76 (; 245 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 4 f32.eq ) @@ -10420,24 +10420,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 75 call $~lib/typedarray/Float32Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -10449,11 +10449,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 76 call $~lib/typedarray/Float32Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -10467,7 +10467,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|77 (; 247 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 2 f64.eq ) @@ -10478,55 +10478,55 @@ (local $5 i32) block $~lib/internal/typedarray/FIND_INDEX|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.19 (result f64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add f64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Fiii) end i32.const 0 i32.ne if - get_local $5 + local.get $5 br $~lib/internal/typedarray/FIND_INDEX|inlined.0 end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10536,7 +10536,7 @@ end ) (func $std/typedarray/testArrayFindIndex~anonymous|78 (; 249 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 4 f64.eq ) @@ -10547,24 +10547,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 77 call $~lib/typedarray/Float64Array#findIndex - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 1 i32.eq i32.eqz @@ -10576,11 +10576,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 78 call $~lib/typedarray/Float64Array#findIndex - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const -1 i32.eq i32.eqz @@ -10594,7 +10594,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|79 (; 251 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -10611,45 +10611,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.15 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -10663,10 +10663,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10676,7 +10676,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|80 (; 253 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -10691,24 +10691,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 79 call $~lib/typedarray/Int8Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -10720,11 +10720,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 80 call $~lib/typedarray/Int8Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -10739,7 +10739,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|81 (; 255 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -10754,45 +10754,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -10806,10 +10806,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10819,7 +10819,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|82 (; 257 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -10832,24 +10832,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 81 call $~lib/typedarray/Uint8Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -10861,11 +10861,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 82 call $~lib/typedarray/Uint8Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -10880,7 +10880,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|83 (; 259 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -10895,45 +10895,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 0 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load8_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -10947,10 +10947,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -10960,7 +10960,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|84 (; 261 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 255 i32.and i32.const 2 @@ -10973,24 +10973,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/typedarray/Uint8ClampedArray#__set - get_local $0 + local.get $0 i32.const 83 call $~lib/typedarray/Uint8ClampedArray#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -11002,11 +11002,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 84 call $~lib/typedarray/Uint8ClampedArray#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -11021,7 +11021,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|85 (; 263 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -11038,45 +11038,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_s offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -11090,10 +11090,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -11103,7 +11103,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|86 (; 265 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 16 i32.shl i32.const 16 @@ -11118,24 +11118,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 85 call $~lib/typedarray/Int16Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -11147,11 +11147,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 86 call $~lib/typedarray/Int16Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -11166,7 +11166,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|87 (; 267 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 2 @@ -11181,45 +11181,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 1 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load16_u offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -11233,10 +11233,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -11246,7 +11246,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|88 (; 269 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 65535 i32.and i32.const 2 @@ -11259,24 +11259,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint16Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 87 call $~lib/typedarray/Uint16Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -11288,11 +11288,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 88 call $~lib/typedarray/Uint16Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -11307,7 +11307,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|89 (; 271 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.rem_s i32.const 0 @@ -11320,45 +11320,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.14 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -11372,10 +11372,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -11385,7 +11385,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|90 (; 273 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.eq ) @@ -11396,24 +11396,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 89 call $~lib/typedarray/Int32Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -11425,11 +11425,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 90 call $~lib/typedarray/Int32Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -11444,7 +11444,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|91 (; 275 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.rem_u i32.const 0 @@ -11457,45 +11457,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add i32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $iiii) end i32.const 0 @@ -11509,10 +11509,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -11522,7 +11522,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|92 (; 277 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i32.const 2 i32.eq ) @@ -11533,24 +11533,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 91 call $~lib/typedarray/Uint32Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -11562,11 +11562,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 92 call $~lib/typedarray/Uint32Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -11581,7 +11581,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|93 (; 279 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.rem_s i64.const 0 @@ -11594,45 +11594,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Iiii) end i32.const 0 @@ -11646,10 +11646,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -11659,7 +11659,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|94 (; 281 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.eq ) @@ -11670,24 +11670,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 93 call $~lib/typedarray/Int64Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -11699,11 +11699,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 94 call $~lib/typedarray/Int64Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -11718,7 +11718,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|95 (; 283 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.rem_u i64.const 0 @@ -11731,45 +11731,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add i64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Iiii) end i32.const 0 @@ -11783,10 +11783,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -11796,7 +11796,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|96 (; 285 ;) (type $Iiii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 i64.const 2 i64.eq ) @@ -11807,24 +11807,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 i64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 i64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 i64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 95 call $~lib/typedarray/Uint64Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -11836,11 +11836,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 96 call $~lib/typedarray/Uint64Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -11865,251 +11865,251 @@ (local $9 f32) (local $10 i32) (local $11 i32) - get_local $0 - i32.reinterpret/f32 - set_local $2 - get_local $1 - i32.reinterpret/f32 - set_local $3 - get_local $2 + local.get $0 + i32.reinterpret_f32 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $4 - get_local $3 + local.set $4 + local.get $3 i32.const 23 i32.shr_u i32.const 255 i32.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i32.const -2147483648 i32.and - set_local $6 - get_local $3 + local.set $6 + local.get $3 i32.const 1 i32.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i32.const 0 i32.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i32.const 255 i32.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f32.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f32.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f32.div return end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i32.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i32.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i32.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i32.const 9 i32.shl i32.clz i32.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i32.const 0 - get_local $5 + local.get $5 i32.sub i32.const 1 i32.add i32.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i32.const -1 i32.const 9 i32.shr_u i32.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i32.const 1 i32.const 23 i32.shl i32.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i32.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 1 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 1 i32.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.eq if f32.const 0 - get_local $0 + local.get $0 f32.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i32.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i32.const 8 i32.shl i32.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i32.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i32.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i32.const 0 i32.gt_s if - get_local $2 + local.get $2 i32.const 1 i32.const 23 i32.shl i32.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i32.const 23 i32.shl i32.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i32.const 0 - get_local $4 + local.get $4 i32.sub i32.const 1 i32.add i32.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i32.or - set_local $2 - get_local $2 - f32.reinterpret/i32 + local.set $2 + local.get $2 + f32.reinterpret_i32 ) (func $std/typedarray/testArrayEvery~anonymous|97 (; 288 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 2 call $~lib/math/NativeMathf.mod f32.const 0 @@ -12122,45 +12122,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f32) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 2 i32.shl i32.add - get_local $4 + local.get $4 i32.add f32.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $fiii) end i32.const 0 @@ -12174,10 +12174,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -12187,7 +12187,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|98 (; 290 ;) (type $fiii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f32.const 2 f32.eq ) @@ -12198,24 +12198,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float32Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 97 call $~lib/typedarray/Float32Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -12227,11 +12227,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 98 call $~lib/typedarray/Float32Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -12256,253 +12256,253 @@ (local $9 f64) (local $10 i64) (local $11 i64) - get_local $0 - i64.reinterpret/f64 - set_local $2 - get_local $1 - i64.reinterpret/f64 - set_local $3 - get_local $2 + 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 - set_local $4 - get_local $3 + local.set $4 + local.get $3 i64.const 52 i64.shr_u i64.const 2047 i64.and - set_local $5 - get_local $2 + local.set $5 + local.get $2 i64.const 63 i64.shr_u - set_local $6 - get_local $3 + local.set $6 + local.get $3 i64.const 1 i64.shl - set_local $7 - get_local $7 + local.set $7 + local.get $7 i64.const 0 i64.eq - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $4 + local.get $4 i64.const 2047 i64.eq end - tee_local $8 + local.tee $8 if (result i32) - get_local $8 + local.get $8 else - get_local $1 - get_local $1 + local.get $1 + local.get $1 f64.ne end i32.const 0 i32.ne if - get_local $0 - get_local $1 + local.get $0 + local.get $1 f64.mul - set_local $9 - get_local $9 - get_local $9 + local.set $9 + local.get $9 + local.get $9 f64.div return end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $10 - get_local $10 - get_local $7 + local.set $10 + local.get $10 + local.get $7 i64.le_u if - get_local $10 - get_local $7 + local.get $10 + local.get $7 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $0 + local.get $0 return end - get_local $4 + local.get $4 i64.eqz if - get_local $4 - get_local $2 + local.get $4 + local.get $2 i64.const 12 i64.shl i64.clz i64.sub - set_local $4 - get_local $2 + local.set $4 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shl - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $2 - get_local $2 + local.set $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 end - get_local $5 + local.get $5 i64.eqz if - get_local $5 - get_local $3 + local.get $5 + local.get $3 i64.const 12 i64.shl i64.clz i64.sub - set_local $5 - get_local $3 + local.set $5 + local.get $3 i64.const 0 - get_local $5 + local.get $5 i64.sub i64.const 1 i64.add i64.shl - set_local $3 + local.set $3 else - get_local $3 + local.get $3 i64.const -1 i64.const 12 i64.shr_u i64.and - set_local $3 - get_local $3 + local.set $3 + local.get $3 i64.const 1 i64.const 52 i64.shl i64.or - set_local $3 + local.set $3 end block $break|0 loop $continue|0 - get_local $4 - get_local $5 + local.get $4 + local.get $5 i64.gt_s if block - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 1 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 1 i64.sub - set_local $4 + local.set $4 end br $continue|0 end end end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.ge_u if - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.eq if f64.const 0 - get_local $0 + local.get $0 f64.mul return end - get_local $2 - get_local $3 + local.get $2 + local.get $3 i64.sub - set_local $2 + local.set $2 end - get_local $2 + local.get $2 i64.const 11 i64.shl i64.clz - set_local $11 - get_local $4 - get_local $11 + local.set $11 + local.get $4 + local.get $11 i64.sub - set_local $4 - get_local $2 - get_local $11 + local.set $4 + local.get $2 + local.get $11 i64.shl - set_local $2 - get_local $4 + local.set $2 + local.get $4 i64.const 0 i64.gt_s if - get_local $2 + local.get $2 i64.const 1 i64.const 52 i64.shl i64.sub - set_local $2 - get_local $2 - get_local $4 + local.set $2 + local.get $2 + local.get $4 i64.const 52 i64.shl i64.or - set_local $2 + local.set $2 else - get_local $2 + local.get $2 i64.const 0 - get_local $4 + local.get $4 i64.sub i64.const 1 i64.add i64.shr_u - set_local $2 + local.set $2 end - get_local $2 - get_local $6 + local.get $2 + local.get $6 i64.const 63 i64.shl i64.or - set_local $2 - get_local $2 - f64.reinterpret/i64 + local.set $2 + local.get $2 + f64.reinterpret_i64 ) (func $std/typedarray/testArrayEvery~anonymous|99 (; 293 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 2 call $~lib/math/NativeMath.mod f64.const 0 @@ -12515,45 +12515,45 @@ (local $5 i32) block $~lib/internal/typedarray/EVERY|inlined.0 (result i32) block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - get_local $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $2 - get_local $0 + local.set $2 + local.get $0 i32.load - set_local $3 - get_local $0 + local.set $3 + local.get $0 i32.load offset=4 - set_local $4 + local.set $4 block $break|0 i32.const 0 - set_local $5 + local.set $5 loop $repeat|0 block $continue|0 - get_local $5 - get_local $2 + local.get $5 + local.get $2 i32.lt_s i32.eqz br_if $break|0 block block (result i32) i32.const 3 - set_global $~argc + global.set $~argc block $~lib/internal/arraybuffer/LOAD|inlined.21 (result f64) - get_local $3 - get_local $5 + local.get $3 + local.get $5 i32.const 3 i32.shl i32.add - get_local $4 + local.get $4 i32.add f64.load offset=8 end - get_local $5 - get_local $0 - get_local $1 + local.get $5 + local.get $0 + local.get $1 call_indirect (type $Fiii) end i32.const 0 @@ -12567,10 +12567,10 @@ end unreachable end - get_local $5 + local.get $5 i32.const 1 i32.add - set_local $5 + local.set $5 br $repeat|0 unreachable end @@ -12580,7 +12580,7 @@ end ) (func $std/typedarray/testArrayEvery~anonymous|100 (; 295 ;) (type $Fiii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) - get_local $0 + local.get $0 f64.const 2 f64.eq ) @@ -12591,24 +12591,24 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Float64Array#constructor - set_local $0 - get_local $0 + local.set $0 + local.get $0 i32.const 0 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 1 f64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 2 f64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_local $0 + local.get $0 i32.const 99 call $~lib/typedarray/Float64Array#every - set_local $1 - get_local $1 + local.set $1 + local.get $1 i32.const 0 i32.ne i32.eqz @@ -12620,11 +12620,11 @@ call $~lib/env/abort unreachable end - get_local $0 + local.get $0 i32.const 100 call $~lib/typedarray/Float64Array#every - set_local $2 - get_local $2 + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz @@ -12640,7 +12640,7 @@ ) (func $start (; 297 ;) (type $v) (local $0 i32) - get_global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32.const 1 i32.eq i32.eqz @@ -12652,7 +12652,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32.const 1 i32.eq i32.eqz @@ -12664,7 +12664,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT i32.const 1 i32.eq i32.eqz @@ -12676,7 +12676,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT i32.const 2 i32.eq i32.eqz @@ -12688,7 +12688,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT i32.const 2 i32.eq i32.eqz @@ -12700,7 +12700,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT i32.const 4 i32.eq i32.eqz @@ -12712,7 +12712,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT i32.const 4 i32.eq i32.eqz @@ -12724,7 +12724,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT i32.const 8 i32.eq i32.eqz @@ -12736,7 +12736,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT i32.const 8 i32.eq i32.eqz @@ -12748,7 +12748,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32.const 4 i32.eq i32.eqz @@ -12760,7 +12760,7 @@ call $~lib/env/abort unreachable end - get_global $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT + global.get $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT i32.const 8 i32.eq i32.eqz @@ -12772,16 +12772,16 @@ call $~lib/env/abort unreachable end - get_global $HEAP_BASE - get_global $~lib/internal/allocator/AL_MASK + global.get $HEAP_BASE + global.get $~lib/internal/allocator/AL_MASK i32.add - get_global $~lib/internal/allocator/AL_MASK + global.get $~lib/internal/allocator/AL_MASK i32.const -1 i32.xor i32.and - set_global $~lib/allocator/arena/startOffset - get_global $~lib/allocator/arena/startOffset - set_global $~lib/allocator/arena/offset + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset i32.const 0 call $std/typedarray/testInstantiate i32.const 5 @@ -12789,23 +12789,23 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Int32Array#constructor - set_global $std/typedarray/arr - get_global $std/typedarray/arr + global.set $std/typedarray/arr + global.get $std/typedarray/arr i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr + 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) - get_global $std/typedarray/arr - set_local $0 - get_local $0 + global.get $std/typedarray/arr + local.set $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -12821,7 +12821,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=4 i32.const 0 i32.eq @@ -12834,7 +12834,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=8 i32.const 3 i32.const 4 @@ -12849,7 +12849,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 1 @@ -12863,7 +12863,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 2 @@ -12877,7 +12877,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 3 @@ -12891,15 +12891,15 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 1 i32.const 2 call $~lib/typedarray/Int32Array#subarray - set_global $std/typedarray/arr + global.set $std/typedarray/arr block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_global $std/typedarray/arr - set_local $0 - get_local $0 + global.get $std/typedarray/arr + local.set $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -12915,7 +12915,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=4 i32.const 1 i32.const 4 @@ -12930,7 +12930,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.load offset=8 i32.const 1 i32.const 4 @@ -12945,7 +12945,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr + global.get $std/typedarray/arr i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 2 @@ -12962,48 +12962,48 @@ i32.const 0 i32.const 8 call $~lib/typedarray/Float64Array#constructor - set_global $std/typedarray/af64 - get_global $std/typedarray/af64 + global.set $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 0 f64.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 1 f64.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 2 f64.const 7 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 3 f64.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 4 f64.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 5 f64.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 6 f64.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 7 f64.const 8 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 2 i32.const 6 call $~lib/typedarray/Float64Array#subarray - set_global $std/typedarray/af64 + global.set $std/typedarray/af64 block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_global $std/typedarray/af64 - set_local $0 - get_local $0 + global.get $std/typedarray/af64 + local.set $0 + local.get $0 i32.load offset=8 i32.const 3 i32.shr_u @@ -13019,7 +13019,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.load offset=4 i32.const 2 i32.const 8 @@ -13034,7 +13034,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.load offset=8 i32.const 4 i32.const 8 @@ -13051,46 +13051,46 @@ end block (result i32) i32.const 0 - set_global $~argc - get_global $std/typedarray/af64 + global.set $~argc + global.get $std/typedarray/af64 i32.const 0 call $~lib/typedarray/Float64Array#sort|trampoline end drop - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get f64.const 4 f64.eq - tee_local $0 + local.tee $0 if (result i32) - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 1 call $~lib/internal/typedarray/TypedArray#__get f64.const 5 f64.eq else - get_local $0 + local.get $0 end - tee_local $0 + local.tee $0 if (result i32) - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 2 call $~lib/internal/typedarray/TypedArray#__get f64.const 6 f64.eq else - get_local $0 + local.get $0 end - tee_local $0 + local.tee $0 if (result i32) - get_global $std/typedarray/af64 + global.get $std/typedarray/af64 i32.const 3 call $~lib/internal/typedarray/TypedArray#__get f64.const 7 f64.eq else - get_local $0 + local.get $0 end i32.eqz if @@ -13104,20 +13104,20 @@ i32.const 0 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - set_global $std/typedarray/clampedArr - get_global $std/typedarray/clampedArr + global.set $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 0 i32.const -32 call $~lib/typedarray/Uint8ClampedArray#__set - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 2 i32.const 256 call $~lib/typedarray/Uint8ClampedArray#__set - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -13133,7 +13133,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 1 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -13149,7 +13149,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/clampedArr + global.get $std/typedarray/clampedArr i32.const 2 call $~lib/internal/typedarray/TypedArray#__get i32.const 255 @@ -13168,34 +13168,34 @@ i32.const 0 i32.const 5 call $~lib/typedarray/Int8Array#constructor - set_global $std/typedarray/arr8 - get_global $std/typedarray/arr8 + global.set $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 3 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 4 i32.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 1 i32.const 1 i32.const 3 call $~lib/typedarray/Int8Array#fill drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 192 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -13209,15 +13209,15 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/typedarray/arr8 + global.set $~argc + global.get $std/typedarray/arr8 i32.const 0 i32.const 0 i32.const 0 call $~lib/typedarray/Int8Array#fill|trampoline end drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 216 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -13229,13 +13229,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 1 i32.const 0 i32.const -3 call $~lib/typedarray/Int8Array#fill drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 240 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -13249,15 +13249,15 @@ end block (result i32) i32.const 2 - set_global $~argc - get_global $std/typedarray/arr8 + global.set $~argc + global.get $std/typedarray/arr8 i32.const 2 i32.const -2 i32.const 0 call $~lib/typedarray/Int8Array#fill|trampoline end drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 264 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -13269,13 +13269,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 0 i32.const 1 i32.const 0 call $~lib/typedarray/Int8Array#fill drop - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 288 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -13287,15 +13287,15 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 1 i32.const 4 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/sub8 + global.set $std/typedarray/sub8 block (result i32) i32.const 1 - set_global $~argc - get_global $std/typedarray/sub8 + global.set $~argc + global.get $std/typedarray/sub8 i32.const 0 i32.const 0 i32.const 0 @@ -13303,9 +13303,9 @@ end drop block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_global $std/typedarray/sub8 - set_local $0 - get_local $0 + global.get $std/typedarray/sub8 + local.set $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -13321,7 +13321,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub8 + global.get $std/typedarray/sub8 i32.load offset=4 i32.const 1 i32.eq @@ -13334,7 +13334,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub8 + global.get $std/typedarray/sub8 i32.load offset=8 i32.const 3 i32.eq @@ -13347,7 +13347,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub8 + global.get $std/typedarray/sub8 i32.const 312 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -13359,7 +13359,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr8 + global.get $std/typedarray/arr8 i32.const 336 call $std/typedarray/isInt8ArrayEqual i32.eqz @@ -13374,34 +13374,34 @@ i32.const 0 i32.const 5 call $~lib/typedarray/Int32Array#constructor - set_global $std/typedarray/arr32 - get_global $std/typedarray/arr32 + global.set $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 3 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 4 i32.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 1 i32.const 1 i32.const 3 call $~lib/typedarray/Int32Array#fill drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 376 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -13415,15 +13415,15 @@ end block (result i32) i32.const 1 - set_global $~argc - get_global $std/typedarray/arr32 + global.set $~argc + global.get $std/typedarray/arr32 i32.const 0 i32.const 0 i32.const 0 call $~lib/typedarray/Int32Array#fill|trampoline end drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 416 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -13435,13 +13435,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 1 i32.const 0 i32.const -3 call $~lib/typedarray/Int32Array#fill drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 456 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -13455,15 +13455,15 @@ end block (result i32) i32.const 2 - set_global $~argc - get_global $std/typedarray/arr32 + global.set $~argc + global.get $std/typedarray/arr32 i32.const 2 i32.const -2 i32.const 0 call $~lib/typedarray/Int32Array#fill|trampoline end drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 496 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -13475,13 +13475,13 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 0 i32.const 1 i32.const 0 call $~lib/typedarray/Int32Array#fill drop - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 536 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -13493,15 +13493,15 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 1 i32.const 4 call $~lib/typedarray/Int32Array#subarray - set_global $std/typedarray/sub32 + global.set $std/typedarray/sub32 block (result i32) i32.const 1 - set_global $~argc - get_global $std/typedarray/sub32 + global.set $~argc + global.get $std/typedarray/sub32 i32.const 0 i32.const 0 i32.const 0 @@ -13509,9 +13509,9 @@ end drop block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - get_global $std/typedarray/sub32 - set_local $0 - get_local $0 + global.get $std/typedarray/sub32 + local.set $0 + local.get $0 i32.load offset=8 i32.const 2 i32.shr_u @@ -13527,7 +13527,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub32 + global.get $std/typedarray/sub32 i32.load offset=4 i32.const 1 i32.const 4 @@ -13542,7 +13542,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub32 + global.get $std/typedarray/sub32 i32.load offset=8 i32.const 3 i32.const 4 @@ -13557,7 +13557,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/sub32 + global.get $std/typedarray/sub32 i32.const 576 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -13569,7 +13569,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr32 + global.get $std/typedarray/arr32 i32.const 616 call $std/typedarray/isInt32ArrayEqual i32.eqz @@ -13582,43 +13582,43 @@ unreachable end i32.const 0 - get_global $std/typedarray/MAX_F64LENGTH + global.get $std/typedarray/MAX_F64LENGTH call $~lib/typedarray/Float64Array#constructor drop i32.const 0 i32.const 6 call $~lib/typedarray/Int8Array#constructor - set_global $std/typedarray/multisubarr - get_global $std/typedarray/multisubarr + global.set $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 0 i32.const 1 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 1 i32.const 2 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 2 i32.const 3 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 3 i32.const 4 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 4 i32.const 5 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 5 i32.const 6 call $~lib/internal/typedarray/TypedArray#__set - get_global $std/typedarray/multisubarr + global.get $std/typedarray/multisubarr i32.const 1 i32.const 6 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/multisubarr1 - get_global $std/typedarray/multisubarr1 + global.set $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 24 @@ -13637,9 +13637,9 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - get_global $std/typedarray/multisubarr1 - set_local $0 - get_local $0 + global.get $std/typedarray/multisubarr1 + local.set $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -13655,7 +13655,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.load offset=4 i32.const 1 i32.eq @@ -13668,7 +13668,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.load offset=8 i32.const 5 i32.eq @@ -13681,12 +13681,12 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr1 + global.get $std/typedarray/multisubarr1 i32.const 1 i32.const 5 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/multisubarr2 - get_global $std/typedarray/multisubarr2 + global.set $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 24 @@ -13705,9 +13705,9 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - get_global $std/typedarray/multisubarr2 - set_local $0 - get_local $0 + global.get $std/typedarray/multisubarr2 + local.set $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -13723,7 +13723,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.load offset=4 i32.const 2 i32.eq @@ -13736,7 +13736,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.load offset=8 i32.const 4 i32.eq @@ -13749,12 +13749,12 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr2 + global.get $std/typedarray/multisubarr2 i32.const 1 i32.const 4 call $~lib/typedarray/Int8Array#subarray - set_global $std/typedarray/multisubarr3 - get_global $std/typedarray/multisubarr3 + global.set $std/typedarray/multisubarr3 + global.get $std/typedarray/multisubarr3 i32.const 0 call $~lib/internal/typedarray/TypedArray#__get i32.const 24 @@ -13773,9 +13773,9 @@ unreachable end block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - get_global $std/typedarray/multisubarr3 - set_local $0 - get_local $0 + global.get $std/typedarray/multisubarr3 + local.set $0 + local.get $0 i32.load offset=8 i32.const 0 i32.shr_u @@ -13791,7 +13791,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr3 + global.get $std/typedarray/multisubarr3 i32.load offset=4 i32.const 3 i32.eq @@ -13804,7 +13804,7 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/multisubarr3 + global.get $std/typedarray/multisubarr3 i32.load offset=8 i32.const 3 i32.eq diff --git a/tests/compiler/switch.optimized.wat b/tests/compiler/switch.optimized.wat index 95a78264..b5e457a4 100644 --- a/tests/compiler/switch.optimized.wat +++ b/tests/compiler/switch.optimized.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (export "memory" (memory $0)) (export "table" (table $0)) @@ -14,19 +14,19 @@ (local $1 i32) block $case4|0 block $case2|0 - get_local $0 + local.get $0 i32.const 1 i32.ne if - get_local $0 - tee_local $1 + local.get $0 + local.tee $1 i32.eqz br_if $case2|0 - get_local $1 + local.get $1 i32.const 2 i32.eq br_if $case4|0 - get_local $1 + local.get $1 i32.const 3 i32.eq br_if $case4|0 @@ -44,16 +44,16 @@ (local $1 i32) block $break|0 block $case2|0 - get_local $0 + local.get $0 i32.const 1 i32.ne if - get_local $0 - tee_local $1 + local.get $0 + local.tee $1 i32.const 2 i32.eq br_if $case2|0 - get_local $1 + local.get $1 i32.const 3 i32.eq br_if $case2|0 diff --git a/tests/compiler/switch.untouched.wat b/tests/compiler/switch.untouched.wat index 0f9ccc01..d3c290fe 100644 --- a/tests/compiler/switch.untouched.wat +++ b/tests/compiler/switch.untouched.wat @@ -5,7 +5,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) @@ -19,21 +19,21 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $0 - set_local $1 - get_local $1 + local.get $0 + local.set $1 + local.get $1 i32.const 1 i32.eq br_if $case0|0 - get_local $1 + local.get $1 i32.const 0 i32.eq br_if $case1|0 - get_local $1 + local.get $1 i32.const 2 i32.eq br_if $case3|0 - get_local $1 + local.get $1 i32.const 3 i32.eq br_if $case4|0 @@ -60,17 +60,17 @@ block $case2|0 block $case1|0 block $case0|0 - get_local $0 - set_local $1 - get_local $1 + local.get $0 + local.set $1 + local.get $1 i32.const 1 i32.eq br_if $case0|0 - get_local $1 + local.get $1 i32.const 2 i32.eq br_if $case1|0 - get_local $1 + local.get $1 i32.const 3 i32.eq br_if $case2|0 @@ -90,9 +90,9 @@ block $break|0 block $case1|0 block $case0|0 - get_local $0 - set_local $1 - get_local $1 + local.get $0 + local.set $1 + local.get $1 i32.const 1 i32.eq br_if $case0|0 @@ -110,9 +110,9 @@ block $break|0 block $case1|0 block $case0|0 - get_local $0 - set_local $1 - get_local $1 + local.get $0 + local.set $1 + local.get $1 i32.const 1 i32.eq br_if $case0|0 @@ -130,9 +130,9 @@ block $break|0 block $case1|0 block $case0|0 - get_local $0 - set_local $1 - get_local $1 + local.get $0 + local.set $1 + local.get $1 i32.const 1 i32.eq br_if $case1|0 @@ -149,9 +149,9 @@ block $break|0 block $case1|0 block $case0|0 - get_local $0 - set_local $1 - get_local $1 + local.get $0 + local.set $1 + local.get $1 i32.const 1 i32.eq br_if $case0|0 @@ -164,7 +164,7 @@ i32.const 2 ) (func $switch/doSwitchEmpty (; 7 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 drop i32.const 2 ) diff --git a/tests/compiler/ternary.optimized.wat b/tests/compiler/ternary.optimized.wat index 3bbd8da2..5a7ea214 100644 --- a/tests/compiler/ternary.optimized.wat +++ b/tests/compiler/ternary.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $ternary/a (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -9,11 +9,11 @@ (start $start) (func $start (; 0 ;) (type $v) i32.const 1 - set_global $ternary/a + global.set $ternary/a i32.const 1 - set_global $ternary/a + global.set $ternary/a i32.const 1 - set_global $ternary/a + global.set $ternary/a ) (func $null (; 1 ;) (type $v) nop diff --git a/tests/compiler/ternary.untouched.wat b/tests/compiler/ternary.untouched.wat index cd3202df..79d5a247 100644 --- a/tests/compiler/ternary.untouched.wat +++ b/tests/compiler/ternary.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $ternary/a (mut i32) (i32.const 0)) (global $HEAP_BASE i32 (i32.const 8)) @@ -16,11 +16,11 @@ i32.const 1 drop i32.const 1 - set_global $ternary/a + global.set $ternary/a i32.const 1 - set_global $ternary/a + global.set $ternary/a i32.const 1 - set_global $ternary/a + global.set $ternary/a ) (func $null (; 1 ;) (type $v) ) diff --git a/tests/compiler/typealias.optimized.wat b/tests/compiler/typealias.optimized.wat index fb635ddf..eda0f395 100644 --- a/tests/compiler/typealias.optimized.wat +++ b/tests/compiler/typealias.optimized.wat @@ -2,13 +2,13 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) (export "alias" (func $typealias/alias)) (func $typealias/alias (; 0 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $start (; 1 ;) (type $v) nop diff --git a/tests/compiler/typealias.untouched.wat b/tests/compiler/typealias.untouched.wat index 478c79f2..18f313eb 100644 --- a/tests/compiler/typealias.untouched.wat +++ b/tests/compiler/typealias.untouched.wat @@ -2,7 +2,7 @@ (type $ii (func (param i32) (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) @@ -10,7 +10,7 @@ (export "alias" (func $typealias/alias)) (start $start) (func $typealias/alias (; 0 ;) (type $ii) (param $0 i32) (result i32) - get_local $0 + local.get $0 ) (func $start (; 1 ;) (type $v) nop diff --git a/tests/compiler/unary.optimized.wat b/tests/compiler/unary.optimized.wat index 87c2329c..76b51030 100644 --- a/tests/compiler/unary.optimized.wat +++ b/tests/compiler/unary.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -15,226 +15,226 @@ (local $1 f64) (local $2 i32) (local $3 i64) - get_global $unary/i + global.get $unary/i i32.const 1 i32.add - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.sub - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.add - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.sub - set_global $unary/i + global.set $unary/i i32.const 1 - set_global $unary/i + global.set $unary/i i32.const -1 - set_global $unary/i + global.set $unary/i i32.const 0 - set_global $unary/i + global.set $unary/i i32.const -2 - set_global $unary/i + global.set $unary/i i32.const 0 - get_global $unary/i + global.get $unary/i i32.sub - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.eqz - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const -1 i32.xor - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.add - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.sub - set_global $unary/i - get_global $unary/i - tee_local $2 + global.set $unary/i + global.get $unary/i + local.tee $2 i32.const 1 i32.add - set_global $unary/i - get_local $2 - set_global $unary/i - get_global $unary/i - tee_local $2 + global.set $unary/i + local.get $2 + global.set $unary/i + global.get $unary/i + local.tee $2 i32.const 1 i32.sub - set_global $unary/i - get_local $2 - set_global $unary/i - get_global $unary/I + global.set $unary/i + local.get $2 + global.set $unary/i + global.get $unary/I i64.const 1 i64.add - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.sub - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.add - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.sub - set_global $unary/I + global.set $unary/I i64.const 1 - set_global $unary/I + global.set $unary/I i64.const -1 - set_global $unary/I + global.set $unary/I i64.const 0 - set_global $unary/I + global.set $unary/I i64.const -2 - set_global $unary/I + global.set $unary/I i64.const 0 - get_global $unary/I + global.get $unary/I i64.sub - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.eqz - i64.extend_u/i32 - set_global $unary/I - get_global $unary/I + i64.extend_i32_u + global.set $unary/I + global.get $unary/I i64.const -1 i64.xor - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.add - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.sub - set_global $unary/I - get_global $unary/I - tee_local $3 + global.set $unary/I + global.get $unary/I + local.tee $3 i64.const 1 i64.add - set_global $unary/I - get_local $3 - set_global $unary/I - get_global $unary/I - tee_local $3 + global.set $unary/I + local.get $3 + global.set $unary/I + global.get $unary/I + local.tee $3 i64.const 1 i64.sub - set_global $unary/I - get_local $3 - set_global $unary/I - get_global $unary/f + global.set $unary/I + local.get $3 + global.set $unary/I + global.get $unary/f f32.const 1 f32.add - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 1 f32.sub - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 1 f32.add - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 1 f32.sub - set_global $unary/f + global.set $unary/f f32.const 1.25 - set_global $unary/f + global.set $unary/f f32.const -1.25 - set_global $unary/f + global.set $unary/f i32.const 0 - set_global $unary/i - get_global $unary/f + global.set $unary/i + global.get $unary/f f32.neg - set_global $unary/f - get_global $unary/f - tee_local $0 + global.set $unary/f + global.get $unary/f + local.tee $0 f32.const 0 f32.eq - set_global $unary/i - get_local $0 + global.set $unary/i + local.get $0 f32.const 1 f32.add - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 1 f32.sub - set_global $unary/f - get_global $unary/f - tee_local $0 + global.set $unary/f + global.get $unary/f + local.tee $0 f32.const 1 f32.add - set_global $unary/f - get_local $0 - set_global $unary/f - get_global $unary/f - tee_local $0 + global.set $unary/f + local.get $0 + global.set $unary/f + global.get $unary/f + local.tee $0 f32.const 1 f32.sub - set_global $unary/f - get_local $0 - set_global $unary/f - get_global $unary/F + global.set $unary/f + local.get $0 + global.set $unary/f + global.get $unary/F f64.const 1 f64.add - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 1 f64.sub - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 1 f64.add - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 1 f64.sub - set_global $unary/F + global.set $unary/F f64.const 1.25 - set_global $unary/F + global.set $unary/F f64.const -1.25 - set_global $unary/F + global.set $unary/F i64.const 0 - set_global $unary/I - get_global $unary/F + global.set $unary/I + global.get $unary/F f64.neg - set_global $unary/F - get_global $unary/F - tee_local $1 + global.set $unary/F + global.get $unary/F + local.tee $1 f64.const 0 f64.eq - i64.extend_u/i32 - set_global $unary/I - get_local $1 + i64.extend_i32_u + global.set $unary/I + local.get $1 f64.const 1 f64.add - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 1 f64.sub - set_global $unary/F - get_global $unary/F - tee_local $1 + global.set $unary/F + global.get $unary/F + local.tee $1 f64.const 1 f64.add - set_global $unary/F - get_local $1 - set_global $unary/F - get_global $unary/F - tee_local $1 + global.set $unary/F + local.get $1 + global.set $unary/F + global.get $unary/F + local.tee $1 f64.const 1 f64.sub - set_global $unary/F - get_local $1 - set_global $unary/F + global.set $unary/F + local.get $1 + global.set $unary/F ) (func $null (; 1 ;) (type $v) nop diff --git a/tests/compiler/unary.untouched.wat b/tests/compiler/unary.untouched.wat index 00180507..a4a7e635 100644 --- a/tests/compiler/unary.untouched.wat +++ b/tests/compiler/unary.untouched.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (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)) @@ -35,336 +35,336 @@ f64.const 0 f64.eq drop - get_global $unary/i + global.get $unary/i drop i32.const 0 - get_global $unary/i + global.get $unary/i i32.sub drop - get_global $unary/i + global.get $unary/i i32.eqz drop - get_global $unary/i + global.get $unary/i i32.const -1 i32.xor drop - get_global $unary/i + global.get $unary/i i32.const 1 i32.add - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.sub - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.add - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const 1 i32.sub - set_global $unary/i + global.set $unary/i i32.const 1 - set_global $unary/i + global.set $unary/i i32.const -1 - set_global $unary/i + global.set $unary/i i32.const 1 i32.eqz - set_global $unary/i + global.set $unary/i i32.const 1 i32.const -1 i32.xor - set_global $unary/i - get_global $unary/i - set_global $unary/i + global.set $unary/i + global.get $unary/i + global.set $unary/i i32.const 0 - get_global $unary/i + global.get $unary/i i32.sub - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.eqz - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i i32.const -1 i32.xor - set_global $unary/i + global.set $unary/i block (result i32) - get_global $unary/i + global.get $unary/i i32.const 1 i32.add - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i end - set_global $unary/i + global.set $unary/i block (result i32) - get_global $unary/i + global.get $unary/i i32.const 1 i32.sub - set_global $unary/i - get_global $unary/i + global.set $unary/i + global.get $unary/i end - set_global $unary/i + global.set $unary/i block (result i32) - get_global $unary/i - tee_local $0 + global.get $unary/i + local.tee $0 i32.const 1 i32.add - set_global $unary/i - get_local $0 + global.set $unary/i + local.get $0 end - set_global $unary/i + global.set $unary/i block (result i32) - get_global $unary/i - tee_local $0 + global.get $unary/i + local.tee $0 i32.const 1 i32.sub - set_global $unary/i - get_local $0 + global.set $unary/i + local.get $0 end - set_global $unary/i - get_global $unary/I + global.set $unary/i + global.get $unary/I drop i64.const 0 - get_global $unary/I + global.get $unary/I i64.sub drop - get_global $unary/I + global.get $unary/I i64.eqz drop - get_global $unary/I + global.get $unary/I i64.const -1 i64.xor drop - get_global $unary/I + global.get $unary/I i64.const 1 i64.add - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.sub - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.add - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.const 1 i64.sub - set_global $unary/I + global.set $unary/I i64.const 1 - set_global $unary/I + global.set $unary/I i64.const -1 - set_global $unary/I + global.set $unary/I i64.const 1 i64.eqz - i64.extend_u/i32 - set_global $unary/I + i64.extend_i32_u + global.set $unary/I i64.const 1 i64.const -1 i64.xor - set_global $unary/I - get_global $unary/I - set_global $unary/I + global.set $unary/I + global.get $unary/I + global.set $unary/I i64.const 0 - get_global $unary/I + global.get $unary/I i64.sub - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I i64.eqz - i64.extend_u/i32 - set_global $unary/I - get_global $unary/I + i64.extend_i32_u + global.set $unary/I + global.get $unary/I i64.const -1 i64.xor - set_global $unary/I + global.set $unary/I block (result i64) - get_global $unary/I + global.get $unary/I i64.const 1 i64.add - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I end - set_global $unary/I + global.set $unary/I block (result i64) - get_global $unary/I + global.get $unary/I i64.const 1 i64.sub - set_global $unary/I - get_global $unary/I + global.set $unary/I + global.get $unary/I end - set_global $unary/I + global.set $unary/I block (result i64) - get_global $unary/I - tee_local $1 + global.get $unary/I + local.tee $1 i64.const 1 i64.add - set_global $unary/I - get_local $1 + global.set $unary/I + local.get $1 end - set_global $unary/I + global.set $unary/I block (result i64) - get_global $unary/I - tee_local $1 + global.get $unary/I + local.tee $1 i64.const 1 i64.sub - set_global $unary/I - get_local $1 + global.set $unary/I + local.get $1 end - set_global $unary/I - get_global $unary/f + global.set $unary/I + global.get $unary/f drop - get_global $unary/f + global.get $unary/f f32.neg drop - get_global $unary/f + global.get $unary/f f32.const 0 f32.eq drop - get_global $unary/f + global.get $unary/f f32.const 1 f32.add - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 1 f32.sub - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 1 f32.add - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 1 f32.sub - set_global $unary/f + global.set $unary/f f32.const 1.25 - set_global $unary/f + global.set $unary/f f32.const -1.25 - set_global $unary/f + global.set $unary/f f64.const 1.25 f64.const 0 f64.eq - set_global $unary/i - get_global $unary/f - set_global $unary/f - get_global $unary/f + global.set $unary/i + global.get $unary/f + global.set $unary/f + global.get $unary/f f32.neg - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f f32.const 0 f32.eq - set_global $unary/i + global.set $unary/i block (result f32) - get_global $unary/f + global.get $unary/f f32.const 1 f32.add - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f end - set_global $unary/f + global.set $unary/f block (result f32) - get_global $unary/f + global.get $unary/f f32.const 1 f32.sub - set_global $unary/f - get_global $unary/f + global.set $unary/f + global.get $unary/f end - set_global $unary/f + global.set $unary/f block (result f32) - get_global $unary/f - tee_local $2 + global.get $unary/f + local.tee $2 f32.const 1 f32.add - set_global $unary/f - get_local $2 + global.set $unary/f + local.get $2 end - set_global $unary/f + global.set $unary/f block (result f32) - get_global $unary/f - tee_local $2 + global.get $unary/f + local.tee $2 f32.const 1 f32.sub - set_global $unary/f - get_local $2 + global.set $unary/f + local.get $2 end - set_global $unary/f - get_global $unary/F + global.set $unary/f + global.get $unary/F drop - get_global $unary/F + global.get $unary/F f64.neg drop - get_global $unary/F + global.get $unary/F f64.const 0 f64.eq drop - get_global $unary/F + global.get $unary/F f64.const 1 f64.add - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 1 f64.sub - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 1 f64.add - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 1 f64.sub - set_global $unary/F + global.set $unary/F f64.const 1.25 - set_global $unary/F + global.set $unary/F f64.const -1.25 - set_global $unary/F + global.set $unary/F f64.const 1.25 f64.const 0 f64.eq - i64.extend_u/i32 - set_global $unary/I - get_global $unary/F - set_global $unary/F - get_global $unary/F + i64.extend_i32_u + global.set $unary/I + global.get $unary/F + global.set $unary/F + global.get $unary/F f64.neg - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F f64.const 0 f64.eq - i64.extend_u/i32 - set_global $unary/I + i64.extend_i32_u + global.set $unary/I block (result f64) - get_global $unary/F + global.get $unary/F f64.const 1 f64.add - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F end - set_global $unary/F + global.set $unary/F block (result f64) - get_global $unary/F + global.get $unary/F f64.const 1 f64.sub - set_global $unary/F - get_global $unary/F + global.set $unary/F + global.get $unary/F end - set_global $unary/F + global.set $unary/F block (result f64) - get_global $unary/F - tee_local $3 + global.get $unary/F + local.tee $3 f64.const 1 f64.add - set_global $unary/F - get_local $3 + global.set $unary/F + local.get $3 end - set_global $unary/F + global.set $unary/F block (result f64) - get_global $unary/F - tee_local $3 + global.get $unary/F + local.tee $3 f64.const 1 f64.sub - set_global $unary/F - get_local $3 + global.set $unary/F + local.get $3 end - set_global $unary/F + global.set $unary/F ) (func $null (; 1 ;) (type $v) ) diff --git a/tests/compiler/void.optimized.wat b/tests/compiler/void.optimized.wat index be03ea1a..0a57311c 100644 --- a/tests/compiler/void.optimized.wat +++ b/tests/compiler/void.optimized.wat @@ -1,7 +1,7 @@ (module (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $start) (export "memory" (memory $0)) (export "table" (table $0)) diff --git a/tests/compiler/void.untouched.wat b/tests/compiler/void.untouched.wat index 72d1ef66..979a9c8a 100644 --- a/tests/compiler/void.untouched.wat +++ b/tests/compiler/void.untouched.wat @@ -2,7 +2,7 @@ (type $i (func (result i32))) (type $v (func)) (memory $0 0) - (table $0 1 anyfunc) + (table $0 1 funcref) (elem (i32.const 0) $null) (global $void/u8Val1 (mut i32) (i32.const 1)) (global $void/u8Val2 (mut i32) (i32.const 255)) @@ -18,8 +18,8 @@ drop call $void/anInt drop - get_global $void/u8Val1 - get_global $void/u8Val2 + global.get $void/u8Val1 + global.get $void/u8Val2 i32.add drop ) diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 1784151f..6c25da17 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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 anyfunc) + (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)) @@ -15,20 +15,20 @@ (func $start (; 1 ;) (type $v) (local $0 i32) loop $continue|0 - get_global $while/n + global.get $while/n if - get_global $while/n + global.get $while/n i32.const 1 i32.sub - set_global $while/n - get_global $while/m + global.set $while/n + global.get $while/m i32.const 1 i32.add - set_global $while/m + global.set $while/m br $continue|0 end end - get_global $while/n + global.get $while/n if i32.const 0 i32.const 8 @@ -37,7 +37,7 @@ call $~lib/env/abort unreachable end - get_global $while/m + global.get $while/m i32.const 10 i32.ne if @@ -49,35 +49,35 @@ unreachable end i32.const 10 - set_global $while/n + global.set $while/n i32.const 0 - set_global $while/m + global.set $while/m loop $continue|1 - get_global $while/n + global.get $while/n if - get_global $while/n + global.get $while/n i32.const 1 i32.sub - set_global $while/n - get_global $while/m + global.set $while/n + global.get $while/m i32.const 1 i32.add - set_global $while/m + global.set $while/m loop $continue|2 - get_global $while/n + global.get $while/n if - get_global $while/n + global.get $while/n i32.const 1 i32.sub - set_global $while/n - get_global $while/o + global.set $while/n + global.get $while/o i32.const 1 i32.add - set_global $while/o + global.set $while/o br $continue|2 end end - get_global $while/n + global.get $while/n if i32.const 0 i32.const 8 @@ -86,7 +86,7 @@ call $~lib/env/abort unreachable end - get_global $while/o + global.get $while/o i32.const 9 i32.ne if @@ -100,7 +100,7 @@ br $continue|1 end end - get_global $while/n + global.get $while/n if i32.const 0 i32.const 8 @@ -109,7 +109,7 @@ call $~lib/env/abort unreachable end - get_global $while/m + global.get $while/m i32.const 1 i32.ne if @@ -120,7 +120,7 @@ call $~lib/env/abort unreachable end - get_global $while/o + global.get $while/o i32.const 9 i32.ne if @@ -132,28 +132,28 @@ unreachable end i32.const 1 - set_global $while/n + global.set $while/n i32.const 0 - set_global $while/m + global.set $while/m loop $continue|3 - get_global $while/n - tee_local $0 + global.get $while/n + local.tee $0 i32.const 1 i32.sub - set_global $while/n - get_local $0 + global.set $while/n + local.get $0 if - get_global $while/m + global.get $while/m i32.const 1 i32.add - set_global $while/m - get_global $while/m - set_local $0 + global.set $while/m + global.get $while/m + local.set $0 end - get_local $0 + local.get $0 br_if $continue|3 end - get_global $while/n + global.get $while/n i32.const -1 i32.ne if @@ -164,7 +164,7 @@ call $~lib/env/abort unreachable end - get_global $while/m + global.get $while/m i32.const 1 i32.ne if diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index ca31b082..ec41f7f7 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -4,7 +4,7 @@ (import "env" "abort" (func $~lib/env/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") - (table $0 1 anyfunc) + (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)) @@ -17,23 +17,23 @@ (local $0 i32) block $break|0 loop $continue|0 - get_global $while/n + global.get $while/n if block - get_global $while/n + global.get $while/n i32.const 1 i32.sub - set_global $while/n - get_global $while/m + global.set $while/n + global.get $while/m i32.const 1 i32.add - set_global $while/m + global.set $while/m end br $continue|0 end end end - get_global $while/n + global.get $while/n i32.const 0 i32.eq i32.eqz @@ -45,7 +45,7 @@ call $~lib/env/abort unreachable end - get_global $while/m + global.get $while/m i32.const 10 i32.eq i32.eqz @@ -58,41 +58,41 @@ unreachable end i32.const 10 - set_global $while/n + global.set $while/n i32.const 0 - set_global $while/m + global.set $while/m block $break|1 loop $continue|1 - get_global $while/n + global.get $while/n if block - get_global $while/n + global.get $while/n i32.const 1 i32.sub - set_global $while/n - get_global $while/m + global.set $while/n + global.get $while/m i32.const 1 i32.add - set_global $while/m + global.set $while/m block $break|2 loop $continue|2 - get_global $while/n + global.get $while/n if block - get_global $while/n + global.get $while/n i32.const 1 i32.sub - set_global $while/n - get_global $while/o + global.set $while/n + global.get $while/o i32.const 1 i32.add - set_global $while/o + global.set $while/o end br $continue|2 end end end - get_global $while/n + global.get $while/n i32.const 0 i32.eq i32.eqz @@ -104,7 +104,7 @@ call $~lib/env/abort unreachable end - get_global $while/o + global.get $while/o i32.const 9 i32.eq i32.eqz @@ -121,7 +121,7 @@ end end end - get_global $while/n + global.get $while/n i32.const 0 i32.eq i32.eqz @@ -133,7 +133,7 @@ call $~lib/env/abort unreachable end - get_global $while/m + global.get $while/m i32.const 1 i32.eq i32.eqz @@ -145,7 +145,7 @@ call $~lib/env/abort unreachable end - get_global $while/o + global.get $while/o i32.const 9 i32.eq i32.eqz @@ -158,28 +158,28 @@ unreachable end i32.const 1 - set_global $while/n + global.set $while/n i32.const 0 - set_global $while/m + global.set $while/m block $break|3 loop $continue|3 block (result i32) - get_global $while/n - tee_local $0 + global.get $while/n + local.tee $0 i32.const 1 i32.sub - set_global $while/n - get_local $0 + global.set $while/n + local.get $0 end - tee_local $0 + local.tee $0 if (result i32) - get_global $while/m + global.get $while/m i32.const 1 i32.add - set_global $while/m - get_global $while/m + global.set $while/m + global.get $while/m else - get_local $0 + local.get $0 end if nop @@ -187,7 +187,7 @@ end end end - get_global $while/n + global.get $while/n i32.const -1 i32.eq i32.eqz @@ -199,7 +199,7 @@ call $~lib/env/abort unreachable end - get_global $while/m + global.get $while/m i32.const 1 i32.eq i32.eqz