From 3a8f936498b518357a41ece5290c4890b794b320 Mon Sep 17 00:00:00 2001 From: dcode Date: Wed, 11 Mar 2020 23:47:47 +0100 Subject: [PATCH 01/13] Add a WASI abort implementation --- std/assembly/bindings/wasi.ts | 53 +++ tests/compiler/wasi/abort.js | 31 ++ tests/compiler/wasi/abort.json | 7 + tests/compiler/wasi/abort.optimized.wat | 284 ++++++++++++++ tests/compiler/wasi/abort.ts | 5 + tests/compiler/wasi/abort.untouched.wat | 359 ++++++++++++++++++ .../snapshot_preview1.json} | 0 .../snapshot_preview1.optimized.wat} | 4 +- .../snapshot_preview1.ts} | 0 .../snapshot_preview1.untouched.wat} | 8 +- 10 files changed, 745 insertions(+), 6 deletions(-) create mode 100644 tests/compiler/wasi/abort.js create mode 100644 tests/compiler/wasi/abort.json create mode 100644 tests/compiler/wasi/abort.optimized.wat create mode 100644 tests/compiler/wasi/abort.ts create mode 100644 tests/compiler/wasi/abort.untouched.wat rename tests/compiler/{wasi-snapshot-preview1.json => wasi/snapshot_preview1.json} (100%) rename tests/compiler/{wasi-snapshot-preview1.optimized.wat => wasi/snapshot_preview1.optimized.wat} (57%) rename tests/compiler/{wasi-snapshot-preview1.ts => wasi/snapshot_preview1.ts} (100%) rename tests/compiler/{wasi-snapshot-preview1.untouched.wat => wasi/snapshot_preview1.untouched.wat} (68%) diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index dfa28ee97c..fd6e643e5f 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -1 +1,54 @@ +import { + proc_exit, + fd_write, + iovec +} from "./wasi_snapshot_preview1"; + +import { + decimalCount32 +} from "util/number"; + export * from "./wasi_snapshot_preview1"; + +/** A WASI-aware abort implementation. */ +// @ts-ignore: decorator +export function abort( + message: string = "", + fileName: string = "", + lineNumber: u32 = 0, + columnNumber: u32 = 0 +): void { + // 0: iovec.buf / nwritten + // 4: iovec.buf_len + // 8: buf... + var off = offsetof(); + changetype(0).buf = off; + store(off, 0x203A74726F6241); off += 7; // Abort: + for (let i = 0, k = message.length; i < k; ++i) { + let c = message.charCodeAt(i); + store(off++, c >= 32 && c <= 126 ? c : 0x3F); + } + store(off, 0x206E690A); off += 4; // \nin + for (let i = 0, k = fileName.length; i < k; ++i) { + let c = fileName.charCodeAt(i); + store(off++, c >= 32 && c <= 126 ? c : 0x3F); + } + store(off++, 0x28); // ( + var len = decimalCount32(lineNumber); off += len; + do { + let t = lineNumber / 10; + store(--off, 0x30 + lineNumber % 10); + lineNumber = t; + } while (lineNumber); off += len; + store(off++, 0x3A); // : + len = decimalCount32(columnNumber); off += len; + do { + let t = columnNumber / 10; + store(--off, 0x30 + columnNumber % 10); + columnNumber = t; + } while (columnNumber); off += len; + store(off++, 0x29); // ) + changetype(0).buf_len = off - 8; + fd_write(/* fd */ 2, 0, 1, 0); + proc_exit(255); +} diff --git a/tests/compiler/wasi/abort.js b/tests/compiler/wasi/abort.js new file mode 100644 index 0000000000..7cd827d779 --- /dev/null +++ b/tests/compiler/wasi/abort.js @@ -0,0 +1,31 @@ +var memory; +var failed; + +exports.preInstantiate = function(imports, exports) { + imports["wasi_snapshot_preview1"] = { + fd_write: function(fd, iov, iov_len, nptr) { + if (fd != 2) failed = "unexpected fd: " + fd; + const messagePtr = new Uint32Array(memory.buffer)[ iov >>> 2 ]; + const messageLen = new Uint32Array(memory.buffer)[(iov >>> 2) + 1]; + const message = Array.from(new Uint8Array(memory.buffer, messagePtr, messageLen)).map(c => String.fromCharCode(c)).join(""); + if (message != "Abort: the message\nin wasi/abort.ts(4:2)") failed = "unexpected message: " + message; + }, + proc_exit: function(code) { + if (code != 255) failed = "unexpected exit code: " + code; + } + }; + if (failed) throw Error(failed); +}; + +exports.postInstantiate = function(instance) { + const exports = instance.exports; + memory = exports.memory; + var thrown = false; + try { + exports.test(); + } catch (e) { + thrown = true; + } + if (!thrown) failed = "unexpected missing throw"; + if (failed) throw Error(failed); +} diff --git a/tests/compiler/wasi/abort.json b/tests/compiler/wasi/abort.json new file mode 100644 index 0000000000..9487733575 --- /dev/null +++ b/tests/compiler/wasi/abort.json @@ -0,0 +1,7 @@ +{ + "asc_flags": [ + "--runtime none", + "--explicitStart", + "--use abort=~lib/bindings/wasi/abort" + ] +} diff --git a/tests/compiler/wasi/abort.optimized.wat b/tests/compiler/wasi/abort.optimized.wat new file mode 100644 index 0000000000..af556e1b68 --- /dev/null +++ b/tests/compiler/wasi/abort.optimized.wat @@ -0,0 +1,284 @@ +(module + (type $none_=>_none (func)) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (memory $0 1) + (data (i32.const 16) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e") + (data (i32.const 64) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00w\00a\00s\00i\00/\00a\00b\00o\00r\00t\00.\00t\00s") + (export "_start" (func $~start)) + (export "memory" (memory $0)) + (export "test" (func $wasi/abort/test)) + (func $~lib/string/String#get:length (; 2 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#charCodeAt (; 3 ;) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + call $~lib/string/String#get:length + i32.ge_u + if + i32.const -1 + return + end + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_u + ) + (func $~lib/util/number/decimalCount32 (; 4 ;) (param $0 i32) (result i32) + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + i32.const 3 + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.get $0 + i32.const 1000 + i32.lt_u + select + local.get $0 + i32.const 100 + i32.lt_u + select + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + i32.const 8 + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.get $0 + i32.const 100000000 + i32.lt_u + select + local.get $0 + i32.const 10000000 + i32.lt_u + select + local.get $0 + i32.const 100000 + i32.lt_u + select + ) + (func $~lib/bindings/wasi/abort (; 5 ;) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 2 + local.set $4 + i32.const 4 + local.set $5 + i32.const 0 + i32.const 8 + i32.store + i32.const 8 + i64.const 9071471065260609 + i64.store + i32.const 15 + local.set $0 + i32.const 32 + call $~lib/string/String#get:length + local.set $6 + loop $for-loop|0 + local.get $3 + local.get $6 + i32.lt_s + if + local.get $0 + local.tee $1 + i32.const 1 + i32.add + local.set $0 + i32.const 32 + local.get $3 + call $~lib/string/String#charCodeAt + local.tee $2 + i32.const 32 + i32.ge_s + if (result i32) + local.get $2 + i32.const 126 + i32.le_s + else + i32.const 0 + end + i32.eqz + if + i32.const 63 + local.set $2 + end + local.get $1 + local.get $2 + i32.store8 + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $for-loop|0 + end + end + local.get $0 + i32.const 544106762 + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + i32.const 0 + local.set $3 + i32.const 80 + call $~lib/string/String#get:length + local.set $6 + loop $for-loop|1 + local.get $3 + local.get $6 + i32.lt_s + if + local.get $0 + local.tee $1 + i32.const 1 + i32.add + local.set $0 + i32.const 80 + local.get $3 + call $~lib/string/String#charCodeAt + local.tee $2 + i32.const 32 + i32.ge_s + if (result i32) + local.get $2 + i32.const 126 + i32.le_s + else + i32.const 0 + end + i32.eqz + if + i32.const 63 + local.set $2 + end + local.get $1 + local.get $2 + i32.store8 + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $for-loop|1 + end + end + local.get $0 + i32.const 40 + i32.store8 + i32.const 4 + call $~lib/util/number/decimalCount32 + local.tee $2 + local.get $0 + i32.const 1 + i32.add + i32.add + local.set $0 + loop $do-continue|2 + local.get $5 + i32.const 10 + i32.div_u + local.get $0 + i32.const 1 + i32.sub + local.tee $0 + local.get $5 + i32.const 10 + i32.rem_u + i32.const 48 + i32.add + i32.store8 + local.tee $5 + br_if $do-continue|2 + end + local.get $0 + local.get $2 + i32.add + local.tee $1 + i32.const 58 + i32.store8 + i32.const 2 + call $~lib/util/number/decimalCount32 + local.tee $2 + local.get $1 + i32.const 1 + i32.add + i32.add + local.set $0 + loop $do-continue|3 + local.get $4 + i32.const 10 + i32.div_u + local.get $0 + i32.const 1 + i32.sub + local.tee $0 + local.get $4 + i32.const 10 + i32.rem_u + i32.const 48 + i32.add + i32.store8 + local.tee $4 + br_if $do-continue|3 + end + local.get $0 + local.get $2 + i32.add + local.tee $1 + i32.const 41 + i32.store8 + i32.const 4 + local.get $1 + i32.const -7 + i32.add + i32.store + i32.const 2 + i32.const 0 + i32.const 1 + i32.const 0 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + i32.const 255 + call $~lib/bindings/wasi_snapshot_preview1/proc_exit + ) + (func $wasi/abort/test (; 6 ;) + call $~lib/bindings/wasi/abort + unreachable + ) + (func $~start (; 7 ;) + nop + ) +) diff --git a/tests/compiler/wasi/abort.ts b/tests/compiler/wasi/abort.ts new file mode 100644 index 0000000000..45de1f18a9 --- /dev/null +++ b/tests/compiler/wasi/abort.ts @@ -0,0 +1,5 @@ +import "bindings/wasi"; + +export function test(): void { + assert(false, "the message"); +} diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat new file mode 100644 index 0000000000..a5eede8973 --- /dev/null +++ b/tests/compiler/wasi/abort.untouched.wat @@ -0,0 +1,359 @@ +(module + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (memory $0 1) + (data (i32.const 16) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e\00") + (data (i32.const 64) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00w\00a\00s\00i\00/\00a\00b\00o\00r\00t\00.\00t\00s\00") + (table $0 1 funcref) + (export "_start" (func $~start)) + (export "memory" (memory $0)) + (export "test" (func $wasi/abort/test)) + (func $~lib/rt/stub/__retain (; 2 ;) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/string/String#get:length (; 3 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#charCodeAt (; 4 ;) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + call $~lib/string/String#get:length + i32.ge_u + if + i32.const -1 + return + end + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_u + ) + (func $~lib/util/number/decimalCount32 (; 5 ;) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 100000 + i32.lt_u + if + local.get $0 + i32.const 100 + i32.lt_u + if + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + return + else + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.set $1 + i32.const 3 + local.get $1 + local.get $0 + i32.const 1000 + i32.lt_u + select + return + end + unreachable + else + local.get $0 + i32.const 10000000 + i32.lt_u + if + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + return + else + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.set $1 + i32.const 8 + local.get $1 + local.get $0 + i32.const 100000000 + i32.lt_u + select + return + end + unreachable + end + unreachable + ) + (func $~lib/rt/stub/__release (; 6 ;) (param $0 i32) + nop + ) + (func $~lib/bindings/wasi/abort (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $0 + local.get $1 + call $~lib/rt/stub/__retain + local.set $1 + i32.const 8 + local.set $4 + i32.const 0 + local.get $4 + i32.store + local.get $4 + i64.const 9071471065260609 + i64.store + local.get $4 + i32.const 7 + i32.add + local.set $4 + i32.const 0 + local.set $5 + local.get $0 + call $~lib/string/String#get:length + local.set $6 + loop $for-loop|0 + local.get $5 + local.get $6 + i32.lt_s + local.set $7 + local.get $7 + if + local.get $0 + local.get $5 + call $~lib/string/String#charCodeAt + local.set $8 + local.get $4 + local.tee $9 + i32.const 1 + i32.add + local.set $4 + local.get $9 + local.get $8 + i32.const 32 + i32.ge_s + if (result i32) + local.get $8 + i32.const 126 + i32.le_s + else + i32.const 0 + end + if (result i32) + local.get $8 + else + i32.const 63 + end + i32.store8 + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $for-loop|0 + end + end + local.get $4 + i32.const 544106762 + i32.store + local.get $4 + i32.const 4 + i32.add + local.set $4 + i32.const 0 + local.set $6 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + loop $for-loop|1 + local.get $6 + local.get $5 + i32.lt_s + local.set $7 + local.get $7 + if + local.get $1 + local.get $6 + call $~lib/string/String#charCodeAt + local.set $8 + local.get $4 + local.tee $9 + i32.const 1 + i32.add + local.set $4 + local.get $9 + local.get $8 + i32.const 32 + i32.ge_s + if (result i32) + local.get $8 + i32.const 126 + i32.le_s + else + i32.const 0 + end + if (result i32) + local.get $8 + else + i32.const 63 + end + i32.store8 + local.get $6 + i32.const 1 + i32.add + local.set $6 + br $for-loop|1 + end + end + local.get $4 + local.tee $5 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 40 + i32.store8 + local.get $2 + call $~lib/util/number/decimalCount32 + local.set $10 + local.get $4 + local.get $10 + i32.add + local.set $4 + loop $do-continue|2 + local.get $2 + i32.const 10 + i32.div_u + local.set $5 + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + i32.const 48 + local.get $2 + i32.const 10 + i32.rem_u + i32.add + i32.store8 + local.get $5 + local.set $2 + local.get $2 + local.set $6 + local.get $6 + br_if $do-continue|2 + end + local.get $4 + local.get $10 + i32.add + local.set $4 + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + i32.const 58 + i32.store8 + local.get $3 + call $~lib/util/number/decimalCount32 + local.set $10 + local.get $4 + local.get $10 + i32.add + local.set $4 + loop $do-continue|3 + local.get $3 + i32.const 10 + i32.div_u + local.set $6 + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + i32.const 48 + local.get $3 + i32.const 10 + i32.rem_u + i32.add + i32.store8 + local.get $6 + local.set $3 + local.get $3 + local.set $7 + local.get $7 + br_if $do-continue|3 + end + local.get $4 + local.get $10 + i32.add + local.set $4 + local.get $4 + local.tee $7 + i32.const 1 + i32.add + local.set $4 + local.get $7 + i32.const 41 + i32.store8 + i32.const 0 + local.get $4 + i32.const 8 + i32.sub + i32.store offset=4 + i32.const 2 + i32.const 0 + i32.const 1 + i32.const 0 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + i32.const 255 + call $~lib/bindings/wasi_snapshot_preview1/proc_exit + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $wasi/abort/test (; 8 ;) + i32.const 0 + i32.eqz + if + i32.const 32 + i32.const 80 + i32.const 4 + i32.const 2 + call $~lib/bindings/wasi/abort + unreachable + end + ) + (func $~start (; 9 ;) + nop + ) +) diff --git a/tests/compiler/wasi-snapshot-preview1.json b/tests/compiler/wasi/snapshot_preview1.json similarity index 100% rename from tests/compiler/wasi-snapshot-preview1.json rename to tests/compiler/wasi/snapshot_preview1.json diff --git a/tests/compiler/wasi-snapshot-preview1.optimized.wat b/tests/compiler/wasi/snapshot_preview1.optimized.wat similarity index 57% rename from tests/compiler/wasi-snapshot-preview1.optimized.wat rename to tests/compiler/wasi/snapshot_preview1.optimized.wat index c41eb9e526..e1ab832a7d 100644 --- a/tests/compiler/wasi-snapshot-preview1.optimized.wat +++ b/tests/compiler/wasi/snapshot_preview1.optimized.wat @@ -1,11 +1,11 @@ (module (type $none_=>_none (func)) (memory $0 0) - (global $wasi-snapshot-preview1/sig (mut i32) (i32.const 1)) + (global $wasi/snapshot_preview1/sig (mut i32) (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~start (; 0 ;) i32.const 9 - global.set $wasi-snapshot-preview1/sig + global.set $wasi/snapshot_preview1/sig ) ) diff --git a/tests/compiler/wasi-snapshot-preview1.ts b/tests/compiler/wasi/snapshot_preview1.ts similarity index 100% rename from tests/compiler/wasi-snapshot-preview1.ts rename to tests/compiler/wasi/snapshot_preview1.ts diff --git a/tests/compiler/wasi-snapshot-preview1.untouched.wat b/tests/compiler/wasi/snapshot_preview1.untouched.wat similarity index 68% rename from tests/compiler/wasi-snapshot-preview1.untouched.wat rename to tests/compiler/wasi/snapshot_preview1.untouched.wat index 48a75b27eb..a9494f74b6 100644 --- a/tests/compiler/wasi-snapshot-preview1.untouched.wat +++ b/tests/compiler/wasi/snapshot_preview1.untouched.wat @@ -6,14 +6,14 @@ (global $~lib/shared/target/Target.WASM64 i32 (i32.const 1)) (global $~lib/shared/target/Target.JS i32 (i32.const 2)) (global $~lib/ASC_TARGET i32 (i32.const 0)) - (global $wasi-snapshot-preview1/sig (mut i32) (i32.const 1)) + (global $wasi/snapshot_preview1/sig (mut i32) (i32.const 1)) (export "memory" (memory $0)) (start $~start) - (func $start:wasi-snapshot-preview1 (; 0 ;) + (func $start:wasi/snapshot_preview1 (; 0 ;) i32.const 9 - global.set $wasi-snapshot-preview1/sig + global.set $wasi/snapshot_preview1/sig ) (func $~start (; 1 ;) - call $start:wasi-snapshot-preview1 + call $start:wasi/snapshot_preview1 ) ) From 9193f5f03fb6083e1d7664b3e0a047cbae5ad9cc Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 12 Mar 2020 10:27:55 +0100 Subject: [PATCH 02/13] split up UTF8.encode --- std/assembly/bindings/wasi.ts | 47 +- std/assembly/index.d.ts | 4 + std/assembly/string.ts | 31 +- .../std/string-encoding.optimized.wat | 133 +++--- .../std/string-encoding.untouched.wat | 291 +++++++------ tests/compiler/wasi/abort.optimized.wat | 344 +++++++++------ tests/compiler/wasi/abort.untouched.wat | 401 ++++++++++++------ 7 files changed, 729 insertions(+), 522 deletions(-) diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index fd6e643e5f..8878ff131a 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -18,37 +18,34 @@ export function abort( lineNumber: u32 = 0, columnNumber: u32 = 0 ): void { - // 0: iovec.buf / nwritten + // 0: iovec.buf // 4: iovec.buf_len - // 8: buf... - var off = offsetof(); - changetype(0).buf = off; - store(off, 0x203A74726F6241); off += 7; // Abort: - for (let i = 0, k = message.length; i < k; ++i) { - let c = message.charCodeAt(i); - store(off++, c >= 32 && c <= 126 ? c : 0x3F); - } - store(off, 0x206E690A); off += 4; // \nin - for (let i = 0, k = fileName.length; i < k; ++i) { - let c = fileName.charCodeAt(i); - store(off++, c >= 32 && c <= 126 ? c : 0x3F); - } - store(off++, 0x28); // ( - var len = decimalCount32(lineNumber); off += len; + // 8: nwritten + // 12: buf... + const iovPtr: usize = 0; + const bufPtr: usize = iovPtr + offsetof() + sizeof(); + changetype(iovPtr).buf = bufPtr; + var ptr = bufPtr; + store(ptr, 0x203A74726F6241); ptr += 7; // Abort: + ptr += String.UTF8.encodeUnsafe(message, ptr); + store(ptr, 0x206E690A); ptr += 4; // \nin + ptr += String.UTF8.encodeUnsafe(fileName, ptr); + store(ptr++, 0x28); // ( + var len = decimalCount32(lineNumber); ptr += len; do { let t = lineNumber / 10; - store(--off, 0x30 + lineNumber % 10); + store(--ptr, 0x30 + lineNumber % 10); lineNumber = t; - } while (lineNumber); off += len; - store(off++, 0x3A); // : - len = decimalCount32(columnNumber); off += len; + } while (lineNumber); ptr += len; + store(ptr++, 0x3A); // : + len = decimalCount32(columnNumber); ptr += len; do { let t = columnNumber / 10; - store(--off, 0x30 + columnNumber % 10); + store(--ptr, 0x30 + columnNumber % 10); columnNumber = t; - } while (columnNumber); off += len; - store(off++, 0x29); // ) - changetype(0).buf_len = off - 8; - fd_write(/* fd */ 2, 0, 1, 0); + } while (columnNumber); ptr += len; + store(ptr++, 0x29); // ) + changetype(iovPtr).buf_len = ptr - bufPtr; + fd_write(2, iovPtr, 1, offsetof()); proc_exit(255); } diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 66586bc0b9..762396cf94 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1460,6 +1460,8 @@ declare namespace String { export function byteLength(str: string, nullTerminated?: bool): i32; /** Encodes the specified string to UTF-8 bytes, optionally null terminated. */ export function encode(str: string, nullTerminated?: bool): ArrayBuffer; + /** Encodes the specified string to UTF-8 bytes, opionally null terminated. Returns the number of bytes written. */ + export function encodeUnsafe(str: string, buf: usize, nullTerminated?: bool): usize; /** Decodes the specified buffer from UTF-8 bytes to a string, optionally null terminated. */ export function decode(buf: ArrayBuffer, nullTerminated?: bool): string; /** Decodes raw UTF-8 bytes to a string, optionally null terminated. */ @@ -1471,6 +1473,8 @@ declare namespace String { export function byteLength(str: string): i32; /** Encodes the specified string to UTF-16 bytes. */ export function encode(str: string): ArrayBuffer; + /** Encodes the specified string to UTF-16 bytes. Returns the number of bytes written. */ + export function encodeUnsafe(str: string, buf: usize): usize; /** Decodes the specified buffer from UTF-16 bytes to a string. */ export function decode(buf: ArrayBuffer): string; /** Decodes raw UTF-16 bytes to a string. */ diff --git a/std/assembly/string.ts b/std/assembly/string.ts index 078476911f..f28a08e42e 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -677,13 +677,18 @@ export namespace String { } export function encode(str: string, nullTerminated: bool = false): ArrayBuffer { + var buf = __alloc(byteLength(str, nullTerminated), idof()); + encodeUnsafe(str, buf, nullTerminated); + return changetype(buf); // retains + } + + // @ts-ignore: decorator + @unsafe + export function encodeUnsafe(str: string, buf: usize, nullTerminated: bool = false): usize { var strOff = changetype(str); var strEnd = changetype(str) + changetype(changetype(str) - BLOCK_OVERHEAD).rtSize; - var bufLen = UTF8.byteLength(str, nullTerminated); - var buf = __alloc(bufLen, idof()); - var bufEnd = buf + bufLen - usize(nullTerminated); var bufOff = buf; - while (bufOff < bufEnd) { + while (strOff < strEnd) { let c1 = load(strOff); if (c1 < 128) { store(bufOff, c1); @@ -716,11 +721,10 @@ export namespace String { } strOff += 2; } - assert(strOff <= strEnd); if (nullTerminated) { - store(bufOff, 0); + store(bufOff++, 0); } - return changetype(buf); // retains + return bufOff - buf; } export function decode(buf: ArrayBuffer, nullTerminated: bool = false): String { @@ -780,12 +784,19 @@ export namespace String { } export function encode(str: string): ArrayBuffer { - var size = UTF16.byteLength(str); - var buf = __alloc(size, idof()); - memory.copy(buf, changetype(str), size); + var buf = __alloc(byteLength(str), idof()); + encodeUnsafe(str, buf); return changetype(buf); // retains } + // @ts-ignore: decorator + @unsafe + export function encodeUnsafe(str: string, buf: usize): usize { + var size = byteLength(str); + memory.copy(buf, changetype(str), size); + return size; + } + export function decode(buf: ArrayBuffer): String { return decodeUnsafe(changetype(buf), buf.byteLength); } diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index 34d0e0700c..c2fe01fdf1 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1313,17 +1313,16 @@ ) (func $~lib/string/String.UTF16.encode (; 21 ;) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) local.get $0 call $~lib/string/String.UTF16.byteLength - local.tee $1 i32.const 0 call $~lib/rt/tlsf/__alloc - local.tee $2 + local.tee $1 local.get $0 - local.get $1 + local.get $0 + call $~lib/string/String.UTF16.byteLength call $~lib/memory/memory.copy - local.get $2 + local.get $1 call $~lib/rt/pure/__retain ) (func $std/string-encoding/testUTF16Encode (; 22 ;) @@ -1915,13 +1914,10 @@ unreachable end ) - (func $~lib/string/String.UTF8.encode (; 32 ;) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) local.get $0 local.tee $3 local.get $0 @@ -1929,53 +1925,38 @@ i32.sub i32.load offset=12 i32.add - local.set $6 - local.get $0 + local.set $5 local.get $1 - call $~lib/string/String.UTF8.byteLength - local.tee $0 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.set $4 - local.get $0 - local.get $4 - i32.add - local.get $1 - i32.const 0 - i32.ne - i32.sub - local.set $7 - local.get $4 local.set $0 loop $while-continue|0 - local.get $0 - local.get $7 + local.get $3 + local.get $5 i32.lt_u if local.get $3 i32.load16_u - local.tee $2 + local.tee $1 i32.const 128 i32.lt_u if (result i32) local.get $0 - local.get $2 + local.get $1 i32.store8 local.get $0 i32.const 1 i32.add else - local.get $2 + local.get $1 i32.const 2048 i32.lt_u if (result i32) local.get $0 - local.get $2 + local.get $1 i32.const 6 i32.shr_u i32.const 192 i32.or - local.get $2 + local.get $1 i32.const 63 i32.and i32.const 128 @@ -1991,10 +1972,10 @@ local.get $3 i32.const 2 i32.add - local.get $6 + local.get $5 i32.lt_u i32.const 0 - local.get $2 + local.get $1 i32.const 64512 i32.and i32.const 55296 @@ -2003,39 +1984,39 @@ if local.get $3 i32.load16_u offset=2 - local.tee $5 + local.tee $4 i32.const 64512 i32.and i32.const 56320 i32.eq if - local.get $2 + local.get $1 i32.const 1023 i32.and i32.const 10 i32.shl i32.const 65536 i32.add - local.get $5 + local.get $4 i32.const 1023 i32.and i32.or - local.tee $2 + local.tee $1 i32.const 63 i32.and i32.const 128 i32.or - local.set $5 + local.set $4 local.get $0 - local.get $2 + local.get $1 i32.const 18 i32.shr_u i32.const 240 i32.or - local.get $5 + local.get $4 i32.const 24 i32.shl - local.get $2 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -2045,7 +2026,7 @@ i32.const 16 i32.shl i32.or - local.get $2 + local.get $1 i32.const 12 i32.shr_u i32.const 63 @@ -2069,12 +2050,12 @@ end end local.get $0 - local.get $2 + local.get $1 i32.const 12 i32.shr_u i32.const 224 i32.or - local.get $2 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -2086,7 +2067,7 @@ i32.or i32.store16 local.get $0 - local.get $2 + local.get $1 i32.const 63 i32.and i32.const 128 @@ -2105,27 +2086,27 @@ br $while-continue|0 end end - local.get $3 - local.get $6 - i32.gt_u - if - i32.const 0 - i32.const 432 - i32.const 719 - i32.const 6 - call $~lib/builtins/abort - unreachable - end - local.get $1 + local.get $2 if local.get $0 i32.const 0 i32.store8 end - local.get $4 + ) + (func $~lib/string/String.UTF8.encode (; 33 ;) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $0 + local.get $1 + call $~lib/string/String.UTF8.byteLength + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + local.get $1 + call $~lib/string/String.UTF8.encodeUnsafe + local.get $0 call $~lib/rt/pure/__retain ) - (func $std/string-encoding/testUTF8Encode (; 33 ;) + (func $std/string-encoding/testUTF8Encode (; 34 ;) (local $0 i32) (local $1 i32) i32.const 32 @@ -2267,7 +2248,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testUTF8EncodeNullTerminated (; 34 ;) + (func $std/string-encoding/testUTF8EncodeNullTerminated (; 35 ;) (local $0 i32) (local $1 i32) i32.const 32 @@ -2419,7 +2400,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/rt/tlsf/checkUsedBlock (; 35 ;) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/checkUsedBlock (; 36 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 16 @@ -2461,7 +2442,7 @@ end local.get $1 ) - (func $~lib/rt/tlsf/freeBlock (; 36 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/freeBlock (; 37 ;) (param $0 i32) (param $1 i32) local.get $1 local.get $1 i32.load @@ -2474,7 +2455,7 @@ local.get $1 call $~lib/rt/rtrace/onfree ) - (func $~lib/rt/tlsf/reallocateBlock (; 37 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/reallocateBlock (; 38 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2577,7 +2558,7 @@ end local.get $3 ) - (func $~lib/string/String.UTF8.decodeUnsafe (; 38 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String.UTF8.decodeUnsafe (; 39 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2592,7 +2573,7 @@ if i32.const 0 i32.const 432 - i32.const 735 + i32.const 739 i32.const 6 call $~lib/builtins/abort unreachable @@ -2771,14 +2752,14 @@ i32.add call $~lib/rt/pure/__retain ) - (func $~lib/string/String.UTF8.decode (; 39 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.UTF8.decode (; 40 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $0 call $~lib/string/String.UTF16.byteLength local.get $1 call $~lib/string/String.UTF8.decodeUnsafe ) - (func $std/string-encoding/testUTF8Decode (; 40 ;) + (func $std/string-encoding/testUTF8Decode (; 41 ;) (local $0 i32) (local $1 i32) i32.const 32 @@ -2804,7 +2785,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testUTF8DecodeNullTerminated (; 41 ;) + (func $std/string-encoding/testUTF8DecodeNullTerminated (; 42 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -2916,7 +2897,7 @@ local.get $4 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testUTF8DecodeUnsafe (; 42 ;) + (func $std/string-encoding/testUTF8DecodeUnsafe (; 43 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -3113,7 +3094,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testLarge (; 43 ;) (param $0 i32) + (func $std/string-encoding/testLarge (; 44 ;) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3161,7 +3142,7 @@ local.get $3 call $~lib/rt/pure/__release ) - (func $start:std/string-encoding (; 44 ;) + (func $start:std/string-encoding (; 45 ;) i32.const 32 call $~lib/string/String.UTF16.byteLength i32.const 12 @@ -3188,10 +3169,10 @@ i32.const 13696 call $std/string-encoding/testLarge ) - (func $~start (; 45 ;) + (func $~start (; 46 ;) call $start:std/string-encoding ) - (func $~lib/rt/pure/decrement (; 46 ;) (param $0 i32) + (func $~lib/rt/pure/decrement (; 47 ;) (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -3259,7 +3240,7 @@ i32.store offset=4 end ) - (func $~lib/rt/__visit_members (; 47 ;) (param $0 i32) + (func $~lib/rt/__visit_members (; 48 ;) (param $0 i32) block $switch$1$default block $switch$1$case$4 block $switch$1$case$2 diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index d2c27948bd..aab225a1f6 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) @@ -2750,8 +2750,7 @@ end end ) - (func $~lib/string/String.UTF16.encode (; 23 ;) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/string/String.UTF16.encodeUnsafe (; 23 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2759,29 +2758,46 @@ local.set $0 local.get $0 call $~lib/string/String.UTF16.byteLength - local.set $1 - local.get $1 - i32.const 0 - call $~lib/rt/tlsf/__alloc local.set $2 - local.get $2 - local.get $0 local.get $1 + local.get $0 + local.get $2 call $~lib/memory/memory.copy local.get $2 - call $~lib/rt/pure/__retain local.set $3 local.get $0 call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 24 ;) (param $0 i32) (result i32) + (func $~lib/string/String.UTF16.encode (; 24 ;) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + call $~lib/string/String.UTF16.byteLength + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $1 + local.get $0 + local.get $1 + call $~lib/string/String.UTF16.encodeUnsafe + drop + local.get $1 + call $~lib/rt/pure/__retain + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 25 ;) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub i32.load offset=12 ) - (func $std/string-encoding/testUTF16Encode (; 25 ;) + (func $std/string-encoding/testUTF16Encode (; 26 ;) (local $0 i32) (local $1 i32) global.get $std/string-encoding/str @@ -2961,7 +2977,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/string/String.UTF16.decodeUnsafe (; 26 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.UTF16.decodeUnsafe (; 27 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 i32.const 1 @@ -2979,7 +2995,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/string/String.UTF16.decode (; 27 ;) (param $0 i32) (result i32) + (func $~lib/string/String.UTF16.decode (; 28 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2993,7 +3009,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/string/String#get:length (; 28 ;) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 29 ;) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub @@ -3001,7 +3017,7 @@ i32.const 1 i32.shr_u ) - (func $~lib/util/string/compareImpl (; 29 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 30 ;) (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) @@ -3123,7 +3139,7 @@ call $~lib/rt/pure/__release local.get $7 ) - (func $~lib/string/String.__eq (; 30 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 31 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -3196,7 +3212,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/string-encoding/testUTF16Decode (; 31 ;) + (func $std/string-encoding/testUTF16Decode (; 32 ;) (local $0 i32) (local $1 i32) global.get $std/string-encoding/str @@ -3221,7 +3237,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testUTF16DecodeUnsafe (; 32 ;) + (func $std/string-encoding/testUTF16DecodeUnsafe (; 33 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -3370,7 +3386,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/string/String.UTF8.byteLength (; 33 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.UTF8.byteLength (; 34 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3481,7 +3497,7 @@ call $~lib/rt/pure/__release local.get $5 ) - (func $std/string-encoding/testUTF8Length (; 34 ;) + (func $std/string-encoding/testUTF8Length (; 35 ;) global.get $std/string-encoding/str i32.const 0 call $~lib/string/String.UTF8.byteLength @@ -3511,8 +3527,7 @@ unreachable end ) - (func $~lib/string/String.UTF8.encode (; 35 ;) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3523,247 +3538,247 @@ (local $10 i32) (local $11 i32) (local $12 i32) - (local $13 i32) - (local $14 i32) local.get $0 call $~lib/rt/pure/__retain local.set $0 local.get $0 - local.set $2 + local.set $3 local.get $0 local.get $0 i32.const 16 i32.sub i32.load offset=12 i32.add - local.set $3 - local.get $0 - local.get $1 - call $~lib/string/String.UTF8.byteLength local.set $4 - local.get $4 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.set $5 - local.get $5 - local.get $4 - i32.add local.get $1 - i32.const 0 - i32.ne - i32.sub - local.set $6 - local.get $5 - local.set $7 + local.set $5 loop $while-continue|0 - local.get $7 - local.get $6 + local.get $3 + local.get $4 i32.lt_u - local.set $8 - local.get $8 + local.set $6 + local.get $6 if - local.get $2 + local.get $3 i32.load16_u - local.set $9 - local.get $9 + local.set $7 + local.get $7 i32.const 128 i32.lt_u if + local.get $5 local.get $7 - local.get $9 i32.store8 - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 else - local.get $9 + local.get $7 i32.const 2048 i32.lt_u if - local.get $9 + local.get $7 i32.const 6 i32.shr_u i32.const 192 i32.or - local.set $10 - local.get $9 + local.set $8 + local.get $7 i32.const 63 i32.and i32.const 128 i32.or - local.set $11 - local.get $7 - local.get $11 + local.set $9 + local.get $5 + local.get $9 i32.const 8 i32.shl - local.get $10 + local.get $8 i32.or i32.store16 - local.get $7 + local.get $5 i32.const 2 i32.add - local.set $7 + local.set $5 else - local.get $9 + local.get $7 i32.const 64512 i32.and i32.const 55296 i32.eq if (result i32) - local.get $2 + local.get $3 i32.const 2 i32.add - local.get $3 + local.get $4 i32.lt_u else i32.const 0 end if - local.get $2 + local.get $3 i32.load16_u offset=2 - local.set $11 - local.get $11 + local.set $9 + local.get $9 i32.const 64512 i32.and i32.const 56320 i32.eq if i32.const 65536 - local.get $9 + local.get $7 i32.const 1023 i32.and i32.const 10 i32.shl i32.add - local.get $11 + local.get $9 i32.const 1023 i32.and i32.or - local.set $9 - local.get $9 + local.set $7 + local.get $7 i32.const 18 i32.shr_u i32.const 240 i32.or - local.set $10 - local.get $9 + local.set $8 + local.get $7 i32.const 12 i32.shr_u i32.const 63 i32.and i32.const 128 i32.or - local.set $12 - local.get $9 + local.set $10 + local.get $7 i32.const 6 i32.shr_u i32.const 63 i32.and i32.const 128 i32.or - local.set $13 - local.get $9 + local.set $11 + local.get $7 i32.const 63 i32.and i32.const 128 i32.or - local.set $14 - local.get $7 - local.get $14 + local.set $12 + local.get $5 + local.get $12 i32.const 24 i32.shl - local.get $13 + local.get $11 i32.const 16 i32.shl i32.or - local.get $12 + local.get $10 i32.const 8 i32.shl i32.or - local.get $10 + local.get $8 i32.or i32.store - local.get $7 + local.get $5 i32.const 4 i32.add - local.set $7 - local.get $2 + local.set $5 + local.get $3 i32.const 4 i32.add - local.set $2 + local.set $3 br $while-continue|0 end end - local.get $9 + local.get $7 i32.const 12 i32.shr_u i32.const 224 i32.or - local.set $11 - local.get $9 + local.set $9 + local.get $7 i32.const 6 i32.shr_u i32.const 63 i32.and i32.const 128 i32.or - local.set $14 - local.get $9 + local.set $12 + local.get $7 i32.const 63 i32.and i32.const 128 i32.or - local.set $13 - local.get $7 - local.get $14 + local.set $11 + local.get $5 + local.get $12 i32.const 8 i32.shl - local.get $11 + local.get $9 i32.or i32.store16 - local.get $7 - local.get $13 + local.get $5 + local.get $11 i32.store8 offset=2 - local.get $7 + local.get $5 i32.const 3 i32.add - local.set $7 + local.set $5 end end - local.get $2 + local.get $3 i32.const 2 i32.add - local.set $2 + local.set $3 br $while-continue|0 end end local.get $2 - local.get $3 - i32.le_u - i32.eqz if - i32.const 0 - i32.const 432 - i32.const 719 - i32.const 6 - call $~lib/builtins/abort - unreachable - end - local.get $1 - if - local.get $7 + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 i32.const 0 i32.store8 end local.get $5 + local.get $1 + i32.sub + local.set $6 + local.get $0 + call $~lib/rt/pure/__release + local.get $6 + ) + (func $~lib/string/String.UTF8.encode (; 37 ;) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 call $~lib/rt/pure/__retain - local.set $8 + local.set $0 + local.get $0 + local.get $1 + call $~lib/string/String.UTF8.byteLength + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $0 + local.get $2 + local.get $1 + call $~lib/string/String.UTF8.encodeUnsafe + drop + local.get $2 + call $~lib/rt/pure/__retain + local.set $3 local.get $0 call $~lib/rt/pure/__release - local.get $8 + local.get $3 ) - (func $std/string-encoding/testUTF8Encode (; 36 ;) + (func $std/string-encoding/testUTF8Encode (; 38 ;) (local $0 i32) (local $1 i32) global.get $std/string-encoding/str @@ -3918,7 +3933,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testUTF8EncodeNullTerminated (; 37 ;) + (func $std/string-encoding/testUTF8EncodeNullTerminated (; 39 ;) (local $0 i32) (local $1 i32) global.get $std/string-encoding/str @@ -4086,7 +4101,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/rt/tlsf/checkUsedBlock (; 38 ;) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/checkUsedBlock (; 40 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 16 @@ -4132,7 +4147,7 @@ end local.get $1 ) - (func $~lib/rt/tlsf/freeBlock (; 39 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/freeBlock (; 41 ;) (param $0 i32) (param $1 i32) (local $2 i32) local.get $1 i32.load @@ -4148,7 +4163,7 @@ local.get $1 call $~lib/rt/rtrace/onfree ) - (func $~lib/rt/tlsf/reallocateBlock (; 40 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/reallocateBlock (; 42 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4267,7 +4282,7 @@ end local.get $8 ) - (func $~lib/rt/tlsf/__realloc (; 41 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/__realloc (; 43 ;) (param $0 i32) (param $1 i32) (result i32) call $~lib/rt/tlsf/maybeInitialize local.get $0 call $~lib/rt/tlsf/checkUsedBlock @@ -4276,7 +4291,7 @@ i32.const 16 i32.add ) - (func $~lib/string/String.UTF8.decodeUnsafe (; 42 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String.UTF8.decodeUnsafe (; 44 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4300,7 +4315,7 @@ if i32.const 0 i32.const 432 - i32.const 735 + i32.const 739 i32.const 6 call $~lib/builtins/abort unreachable @@ -4492,7 +4507,7 @@ call $~lib/rt/tlsf/__realloc call $~lib/rt/pure/__retain ) - (func $~lib/string/String.UTF8.decode (; 43 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.UTF8.decode (; 45 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -4507,7 +4522,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/string-encoding/testUTF8Decode (; 44 ;) + (func $std/string-encoding/testUTF8Decode (; 46 ;) (local $0 i32) (local $1 i32) global.get $std/string-encoding/str @@ -4534,7 +4549,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testUTF8DecodeNullTerminated (; 45 ;) + (func $std/string-encoding/testUTF8DecodeNullTerminated (; 47 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -4662,7 +4677,7 @@ local.get $6 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testUTF8DecodeUnsafe (; 46 ;) + (func $std/string-encoding/testUTF8DecodeUnsafe (; 48 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -4862,7 +4877,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/string-encoding/testLarge (; 47 ;) (param $0 i32) + (func $std/string-encoding/testLarge (; 49 ;) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4917,7 +4932,7 @@ local.get $3 call $~lib/rt/pure/__release ) - (func $start:std/string-encoding (; 48 ;) + (func $start:std/string-encoding (; 50 ;) call $std/string-encoding/testUTF16Length call $std/string-encoding/testUTF16Encode call $std/string-encoding/testUTF16Decode @@ -4933,10 +4948,10 @@ i32.const 13696 call $std/string-encoding/testLarge ) - (func $~start (; 49 ;) + (func $~start (; 51 ;) call $start:std/string-encoding ) - (func $~lib/rt/pure/decrement (; 50 ;) (param $0 i32) + (func $~lib/rt/pure/decrement (; 52 ;) (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -5013,10 +5028,10 @@ i32.store offset=4 end ) - (func $~lib/rt/pure/__collect (; 51 ;) + (func $~lib/rt/pure/__collect (; 53 ;) return ) - (func $~lib/rt/pure/__visit (; 52 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 54 ;) (param $0 i32) (param $1 i32) local.get $0 global.get $~lib/heap/__heap_base i32.lt_u @@ -5040,7 +5055,7 @@ i32.sub call $~lib/rt/pure/decrement ) - (func $~lib/rt/__visit_members (; 53 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 55 ;) (param $0 i32) (param $1 i32) (local $2 i32) block $switch$1$default block $switch$1$case$4 diff --git a/tests/compiler/wasi/abort.optimized.wat b/tests/compiler/wasi/abort.optimized.wat index af556e1b68..aa37b0747a 100644 --- a/tests/compiler/wasi/abort.optimized.wat +++ b/tests/compiler/wasi/abort.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) @@ -12,31 +12,184 @@ (export "_start" (func $~start)) (export "memory" (memory $0)) (export "test" (func $wasi/abort/test)) - (func $~lib/string/String#get:length (; 2 ;) (param $0 i32) (result i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 2 ;) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + local.tee $3 local.get $0 i32.const 16 i32.sub i32.load offset=12 - i32.const 1 - i32.shr_u - ) - (func $~lib/string/String#charCodeAt (; 3 ;) (param $0 i32) (param $1 i32) (result i32) + i32.add + local.set $5 local.get $1 - local.get $0 - call $~lib/string/String#get:length - i32.ge_u - if - i32.const -1 - return + local.set $0 + loop $while-continue|0 + local.get $3 + local.get $5 + i32.lt_u + if + local.get $3 + i32.load16_u + local.tee $2 + i32.const 128 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + i32.store8 + local.get $0 + i32.const 1 + i32.add + else + local.get $2 + i32.const 2048 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + i32.const 6 + i32.shr_u + i32.const 192 + i32.or + local.get $2 + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 8 + i32.shl + i32.or + i32.store16 + local.get $0 + i32.const 2 + i32.add + else + local.get $3 + i32.const 2 + i32.add + local.get $5 + i32.lt_u + i32.const 0 + local.get $2 + i32.const 64512 + i32.and + i32.const 55296 + i32.eq + select + if + local.get $3 + i32.load16_u offset=2 + local.tee $4 + i32.const 64512 + i32.and + i32.const 56320 + i32.eq + if + local.get $2 + i32.const 1023 + i32.and + i32.const 10 + i32.shl + i32.const 65536 + i32.add + local.get $4 + i32.const 1023 + i32.and + i32.or + local.tee $2 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $4 + local.get $0 + local.get $2 + i32.const 18 + i32.shr_u + i32.const 240 + i32.or + local.get $4 + i32.const 24 + i32.shl + local.get $2 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 16 + i32.shl + i32.or + local.get $2 + i32.const 12 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 8 + i32.shl + i32.or + i32.or + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $while-continue|0 + end + end + local.get $0 + local.get $2 + i32.const 12 + i32.shr_u + i32.const 224 + i32.or + local.get $2 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 8 + i32.shl + i32.or + i32.store16 + local.get $0 + local.get $2 + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=2 + local.get $0 + i32.const 3 + i32.add + end + end + local.set $0 + local.get $3 + i32.const 2 + i32.add + local.set $3 + br $while-continue|0 + end end local.get $0 local.get $1 - i32.const 1 - i32.shl - i32.add - i32.load16_u + i32.sub ) - (func $~lib/util/number/decimalCount32 (; 4 ;) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 3 ;) (param $0 i32) (result i32) i32.const 1 i32.const 2 local.get $0 @@ -84,201 +237,122 @@ i32.lt_u select ) - (func $~lib/bindings/wasi/abort (; 5 ;) + (func $~lib/bindings/wasi/abort (; 4 ;) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) i32.const 2 - local.set $4 + local.set $3 i32.const 4 - local.set $5 + local.set $1 i32.const 0 - i32.const 8 + i32.const 12 i32.store - i32.const 8 + i32.const 12 i64.const 9071471065260609 i64.store - i32.const 15 - local.set $0 i32.const 32 - call $~lib/string/String#get:length - local.set $6 - loop $for-loop|0 - local.get $3 - local.get $6 - i32.lt_s - if - local.get $0 - local.tee $1 - i32.const 1 - i32.add - local.set $0 - i32.const 32 - local.get $3 - call $~lib/string/String#charCodeAt - local.tee $2 - i32.const 32 - i32.ge_s - if (result i32) - local.get $2 - i32.const 126 - i32.le_s - else - i32.const 0 - end - i32.eqz - if - i32.const 63 - local.set $2 - end - local.get $1 - local.get $2 - i32.store8 - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $for-loop|0 - end - end - local.get $0 + i32.const 19 + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 19 + i32.add + local.tee $0 i32.const 544106762 i32.store local.get $0 i32.const 4 i32.add - local.set $0 - i32.const 0 - local.set $3 + local.tee $0 i32.const 80 - call $~lib/string/String#get:length - local.set $6 - loop $for-loop|1 - local.get $3 - local.get $6 - i32.lt_s - if - local.get $0 - local.tee $1 - i32.const 1 - i32.add - local.set $0 - i32.const 80 - local.get $3 - call $~lib/string/String#charCodeAt - local.tee $2 - i32.const 32 - i32.ge_s - if (result i32) - local.get $2 - i32.const 126 - i32.le_s - else - i32.const 0 - end - i32.eqz - if - i32.const 63 - local.set $2 - end - local.get $1 - local.get $2 - i32.store8 - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $for-loop|1 - end - end local.get $0 + call $~lib/string/String.UTF8.encodeUnsafe + i32.add + local.tee $0 i32.const 40 i32.store8 i32.const 4 call $~lib/util/number/decimalCount32 - local.tee $2 + local.tee $4 local.get $0 i32.const 1 i32.add i32.add - local.set $0 - loop $do-continue|2 - local.get $5 + local.set $2 + loop $do-continue|0 + local.get $1 i32.const 10 i32.div_u - local.get $0 + local.get $2 i32.const 1 i32.sub - local.tee $0 - local.get $5 + local.tee $2 + local.get $1 i32.const 10 i32.rem_u i32.const 48 i32.add i32.store8 - local.tee $5 - br_if $do-continue|2 + local.tee $1 + br_if $do-continue|0 end - local.get $0 local.get $2 + local.get $4 i32.add local.tee $1 i32.const 58 i32.store8 i32.const 2 call $~lib/util/number/decimalCount32 - local.tee $2 + local.tee $0 local.get $1 i32.const 1 i32.add i32.add - local.set $0 - loop $do-continue|3 - local.get $4 + local.set $2 + loop $do-continue|1 + local.get $3 i32.const 10 i32.div_u - local.get $0 + local.get $2 i32.const 1 i32.sub - local.tee $0 - local.get $4 + local.tee $2 + local.get $3 i32.const 10 i32.rem_u i32.const 48 i32.add i32.store8 - local.tee $4 - br_if $do-continue|3 + local.tee $3 + br_if $do-continue|1 end local.get $0 local.get $2 i32.add - local.tee $1 + local.tee $3 i32.const 41 i32.store8 i32.const 4 - local.get $1 - i32.const -7 + local.get $3 + i32.const -11 i32.add i32.store i32.const 2 i32.const 0 i32.const 1 - i32.const 0 + i32.const 8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop i32.const 255 call $~lib/bindings/wasi_snapshot_preview1/proc_exit ) - (func $wasi/abort/test (; 6 ;) + (func $wasi/abort/test (; 5 ;) call $~lib/bindings/wasi/abort unreachable ) - (func $~start (; 7 ;) + (func $~start (; 6 ;) nop ) ) diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat index a5eede8973..0bcfe7ae65 100644 --- a/tests/compiler/wasi/abort.untouched.wat +++ b/tests/compiler/wasi/abort.untouched.wat @@ -1,9 +1,9 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) @@ -17,29 +17,235 @@ (func $~lib/rt/stub/__retain (; 2 ;) (param $0 i32) (result i32) local.get $0 ) - (func $~lib/string/String#get:length (; 3 ;) (param $0 i32) (result i32) + (func $~lib/rt/stub/__release (; 3 ;) (param $0 i32) + nop + ) + (func $~lib/string/String.UTF8.encodeUnsafe (; 4 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + local.set $3 + local.get $0 local.get $0 i32.const 16 i32.sub i32.load offset=12 - i32.const 1 - i32.shr_u - ) - (func $~lib/string/String#charCodeAt (; 4 ;) (param $0 i32) (param $1 i32) (result i32) + i32.add + local.set $4 local.get $1 - local.get $0 - call $~lib/string/String#get:length - i32.ge_u + local.set $5 + loop $while-continue|0 + local.get $3 + local.get $4 + i32.lt_u + local.set $6 + local.get $6 + if + local.get $3 + i32.load16_u + local.set $7 + local.get $7 + i32.const 128 + i32.lt_u + if + local.get $5 + local.get $7 + i32.store8 + local.get $5 + i32.const 1 + i32.add + local.set $5 + else + local.get $7 + i32.const 2048 + i32.lt_u + if + local.get $7 + i32.const 6 + i32.shr_u + i32.const 192 + i32.or + local.set $8 + local.get $7 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $9 + local.get $5 + local.get $9 + i32.const 8 + i32.shl + local.get $8 + i32.or + i32.store16 + local.get $5 + i32.const 2 + i32.add + local.set $5 + else + local.get $7 + i32.const 64512 + i32.and + i32.const 55296 + i32.eq + if (result i32) + local.get $3 + i32.const 2 + i32.add + local.get $4 + i32.lt_u + else + i32.const 0 + end + if + local.get $3 + i32.load16_u offset=2 + local.set $9 + local.get $9 + i32.const 64512 + i32.and + i32.const 56320 + i32.eq + if + i32.const 65536 + local.get $7 + i32.const 1023 + i32.and + i32.const 10 + i32.shl + i32.add + local.get $9 + i32.const 1023 + i32.and + i32.or + local.set $7 + local.get $7 + i32.const 18 + i32.shr_u + i32.const 240 + i32.or + local.set $8 + local.get $7 + i32.const 12 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $10 + local.get $7 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $11 + local.get $7 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $12 + local.get $5 + local.get $12 + i32.const 24 + i32.shl + local.get $11 + i32.const 16 + i32.shl + i32.or + local.get $10 + i32.const 8 + i32.shl + i32.or + local.get $8 + i32.or + i32.store + local.get $5 + i32.const 4 + i32.add + local.set $5 + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $while-continue|0 + end + end + local.get $7 + i32.const 12 + i32.shr_u + i32.const 224 + i32.or + local.set $9 + local.get $7 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $12 + local.get $7 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $11 + local.get $5 + local.get $12 + i32.const 8 + i32.shl + local.get $9 + i32.or + i32.store16 + local.get $5 + local.get $11 + i32.store8 offset=2 + local.get $5 + i32.const 3 + i32.add + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.add + local.set $3 + br $while-continue|0 + end + end + local.get $2 if - i32.const -1 - return + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + i32.const 0 + i32.store8 end - local.get $0 + local.get $5 local.get $1 - i32.const 1 - i32.shl - i32.add - i32.load16_u + i32.sub + local.set $6 + local.get $0 + call $~lib/rt/stub/__release + local.get $6 ) (func $~lib/util/number/decimalCount32 (; 5 ;) (param $0 i32) (result i32) (local $1 i32) @@ -107,28 +313,23 @@ end unreachable ) - (func $~lib/rt/stub/__release (; 6 ;) (param $0 i32) - nop - ) - (func $~lib/bindings/wasi/abort (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/bindings/wasi/abort (; 6 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) local.get $0 call $~lib/rt/stub/__retain local.set $0 local.get $1 call $~lib/rt/stub/__retain local.set $1 - i32.const 8 - local.set $4 i32.const 0 - local.get $4 + i32.const 12 i32.store + i32.const 12 + local.set $4 local.get $4 i64.const 9071471065260609 i64.store @@ -136,51 +337,13 @@ i32.const 7 i32.add local.set $4 - i32.const 0 - local.set $5 + local.get $4 local.get $0 - call $~lib/string/String#get:length - local.set $6 - loop $for-loop|0 - local.get $5 - local.get $6 - i32.lt_s - local.set $7 - local.get $7 - if - local.get $0 - local.get $5 - call $~lib/string/String#charCodeAt - local.set $8 - local.get $4 - local.tee $9 - i32.const 1 - i32.add - local.set $4 - local.get $9 - local.get $8 - i32.const 32 - i32.ge_s - if (result i32) - local.get $8 - i32.const 126 - i32.le_s - else - i32.const 0 - end - if (result i32) - local.get $8 - else - i32.const 63 - end - i32.store8 - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end + local.get $4 + i32.const 0 + call $~lib/string/String.UTF8.encodeUnsafe + i32.add + local.set $4 local.get $4 i32.const 544106762 i32.store @@ -188,51 +351,13 @@ i32.const 4 i32.add local.set $4 - i32.const 0 - local.set $6 + local.get $4 local.get $1 - call $~lib/string/String#get:length - local.set $5 - loop $for-loop|1 - local.get $6 - local.get $5 - i32.lt_s - local.set $7 - local.get $7 - if - local.get $1 - local.get $6 - call $~lib/string/String#charCodeAt - local.set $8 - local.get $4 - local.tee $9 - i32.const 1 - i32.add - local.set $4 - local.get $9 - local.get $8 - i32.const 32 - i32.ge_s - if (result i32) - local.get $8 - i32.const 126 - i32.le_s - else - i32.const 0 - end - if (result i32) - local.get $8 - else - i32.const 63 - end - i32.store8 - local.get $6 - i32.const 1 - i32.add - local.set $6 - br $for-loop|1 - end - end + local.get $4 + i32.const 0 + call $~lib/string/String.UTF8.encodeUnsafe + i32.add + local.set $4 local.get $4 local.tee $5 i32.const 1 @@ -243,12 +368,12 @@ i32.store8 local.get $2 call $~lib/util/number/decimalCount32 - local.set $10 + local.set $6 local.get $4 - local.get $10 + local.get $6 i32.add local.set $4 - loop $do-continue|2 + loop $do-continue|0 local.get $2 i32.const 10 i32.div_u @@ -266,34 +391,34 @@ local.get $5 local.set $2 local.get $2 - local.set $6 - local.get $6 - br_if $do-continue|2 + local.set $7 + local.get $7 + br_if $do-continue|0 end local.get $4 - local.get $10 + local.get $6 i32.add local.set $4 local.get $4 - local.tee $6 + local.tee $7 i32.const 1 i32.add local.set $4 - local.get $6 + local.get $7 i32.const 58 i32.store8 local.get $3 call $~lib/util/number/decimalCount32 - local.set $10 + local.set $6 local.get $4 - local.get $10 + local.get $6 i32.add local.set $4 - loop $do-continue|3 + loop $do-continue|1 local.get $3 i32.const 10 i32.div_u - local.set $6 + local.set $7 local.get $4 i32.const 1 i32.sub @@ -304,34 +429,34 @@ i32.rem_u i32.add i32.store8 - local.get $6 + local.get $7 local.set $3 local.get $3 - local.set $7 - local.get $7 - br_if $do-continue|3 + local.set $8 + local.get $8 + br_if $do-continue|1 end local.get $4 - local.get $10 + local.get $6 i32.add local.set $4 local.get $4 - local.tee $7 + local.tee $8 i32.const 1 i32.add local.set $4 - local.get $7 + local.get $8 i32.const 41 i32.store8 i32.const 0 local.get $4 - i32.const 8 + i32.const 12 i32.sub i32.store offset=4 i32.const 2 i32.const 0 i32.const 1 - i32.const 0 + i32.const 8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop i32.const 255 @@ -341,7 +466,7 @@ local.get $1 call $~lib/rt/stub/__release ) - (func $wasi/abort/test (; 8 ;) + (func $wasi/abort/test (; 7 ;) i32.const 0 i32.eqz if @@ -353,7 +478,7 @@ unreachable end ) - (func $~start (; 9 ;) + (func $~start (; 8 ;) nop ) ) From 481e4e2ad6bf246342ecd7445424c9c56d499456 Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 12 Mar 2020 11:35:54 +0100 Subject: [PATCH 03/13] auto-detect WASI --- src/program.ts | 9 ++++----- std/assembly/bindings/wasi.ts | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/program.ts b/src/program.ts index 358f1e8976..743781ee20 100644 --- a/src/program.ts +++ b/src/program.ts @@ -991,12 +991,11 @@ export class Program extends DiagnosticEmitter { this.registerConstantInteger(alias, Type.i32, i64_new(parseInt(name, 10))); } else { let elementsByName = this.elementsByName; - let element = elementsByName.get(name); - if (element) { - if (elementsByName.has(alias)) throw new Error("duplicate global element: " + name); - elementsByName.set(alias, element); + if (elementsByName.has(name)) { + elementsByName.set(alias, assert(elementsByName.get(name))); + } else { + throw new Error("no such global element: " + name); } - else throw new Error("no such global element: " + name); } } } diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index 8878ff131a..c5ecb8300c 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -12,6 +12,7 @@ export * from "./wasi_snapshot_preview1"; /** A WASI-aware abort implementation. */ // @ts-ignore: decorator +@global export function abort( message: string = "", fileName: string = "", From cba6a4c478f304d1af393a4df1642df66ce183dd Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 12 Mar 2020 15:59:12 +0100 Subject: [PATCH 04/13] implement trace and seed --- cli/asc.js | 6 - lib/loader/index.js | 9 +- src/builtins.ts | 9 + src/common.ts | 4 + src/program.ts | 57 +- std/assembly/bindings/wasi.ts | 98 +- std/assembly/builtins.ts | 4 + std/assembly/index.d.ts | 6 +- std/assembly/math.ts | 4 +- tests/compiler.js | 5 +- tests/compiler/std/array.optimized.wat | 823 +++-- tests/compiler/std/array.untouched.wat | 1063 ++++--- tests/compiler/std/math.optimized.wat | 312 +- tests/compiler/std/math.untouched.wat | 343 +- tests/compiler/wasi/abort.js | 2 +- tests/compiler/wasi/abort.json | 3 +- tests/compiler/wasi/abort.optimized.wat | 40 +- tests/compiler/wasi/abort.untouched.wat | 43 +- tests/compiler/wasi/seed.js | 25 + tests/compiler/wasi/seed.json | 6 + tests/compiler/wasi/seed.optimized.wat | 513 +++ tests/compiler/wasi/seed.ts | 5 + tests/compiler/wasi/seed.untouched.wat | 690 ++++ tests/compiler/wasi/trace.js | 22 + tests/compiler/wasi/trace.json | 6 + tests/compiler/wasi/trace.optimized.wat | 2039 ++++++++++++ tests/compiler/wasi/trace.ts | 7 + tests/compiler/wasi/trace.untouched.wat | 3836 +++++++++++++++++++++++ 28 files changed, 8619 insertions(+), 1361 deletions(-) create mode 100644 tests/compiler/wasi/seed.js create mode 100644 tests/compiler/wasi/seed.json create mode 100644 tests/compiler/wasi/seed.optimized.wat create mode 100644 tests/compiler/wasi/seed.ts create mode 100644 tests/compiler/wasi/seed.untouched.wat create mode 100644 tests/compiler/wasi/trace.js create mode 100644 tests/compiler/wasi/trace.json create mode 100644 tests/compiler/wasi/trace.optimized.wat create mode 100644 tests/compiler/wasi/trace.ts create mode 100644 tests/compiler/wasi/trace.untouched.wat diff --git a/cli/asc.js b/cli/asc.js index 3b7f072490..a4a3e49d5c 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -248,12 +248,6 @@ exports.main = function main(argv, options, callback) { assemblyscript.setNoUnsafe(compilerOptions, args.noUnsafe); assemblyscript.setPedantic(compilerOptions, args.pedantic); - // Initialize default aliases - assemblyscript.setGlobalAlias(compilerOptions, "Math", "NativeMath"); - assemblyscript.setGlobalAlias(compilerOptions, "Mathf", "NativeMathf"); - assemblyscript.setGlobalAlias(compilerOptions, "abort", "~lib/builtins/abort"); - assemblyscript.setGlobalAlias(compilerOptions, "trace", "~lib/builtins/trace"); - // Add or override aliases if specified if (args.use) { let aliases = args.use; diff --git a/lib/loader/index.js b/lib/loader/index.js index 7e5d56b42b..96312c2a0b 100644 --- a/lib/loader/index.js +++ b/lib/loader/index.js @@ -69,12 +69,15 @@ function preInstantiate(imports) { const env = (imports.env = imports.env || {}); env.abort = env.abort || function abort(mesg, file, line, colm) { const memory = baseModule.memory || env.memory; // prefer exported, otherwise try imported - throw Error("abort: " + getString(memory, mesg) + " at " + getString(memory, file) + ":" + line + ":" + colm); - } + throw Error("abort: " + getString(memory, mesg) + " in " + getString(memory, file) + "(" + line + ":" + colm + ")"); + }; env.trace = env.trace || function trace(mesg, n) { const memory = baseModule.memory || env.memory; console.log("trace: " + getString(memory, mesg) + (n ? " " : "") + Array.prototype.slice.call(arguments, 2, 2 + n).join(", ")); - } + }; + env.seed = env.seed || function seed() { + return Date.now(); + }; imports.Math = imports.Math || Math; imports.Date = imports.Date || Date; diff --git a/src/builtins.ts b/src/builtins.ts index 7be453c14d..fe09662b1e 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -122,6 +122,10 @@ export namespace BuiltinNames { export const setArgumentsLength = "~setArgumentsLength"; // std/builtins.ts + export const abort = "~lib/builtins/abort"; + export const trace = "~lib/builtins/trace"; + export const seed = "~lib/builtins/seed"; + export const isInteger = "~lib/builtins/isInteger"; export const isFloat = "~lib/builtins/isFloat"; export const isBoolean = "~lib/builtins/isBoolean"; @@ -586,6 +590,11 @@ export namespace BuiltinNames { export const Uint64Array = "~lib/typedarray/Uint64Array"; export const Float32Array = "~lib/typedarray/Float32Array"; export const Float64Array = "~lib/typedarray/Float64Array"; + + // std/bindings/wasi.ts + export const wasiAbort = "~lib/bindings/wasi/abort"; + export const wasiTrace = "~lib/bindings/wasi/trace"; + export const wasiSeed = "~lib/bindings/wasi/seed"; } /** Builtin compilation context. */ diff --git a/src/common.ts b/src/common.ts index 4966af5751..5d2cf8fbdc 100644 --- a/src/common.ts +++ b/src/common.ts @@ -189,6 +189,8 @@ export namespace CommonNames { export const ArrayBuffer = "ArrayBuffer"; export const Math = "Math"; export const Mathf = "Mathf"; + export const NativeMath = "NativeMath"; + export const NativeMathf = "NativeMathf"; export const Int8Array = "Int8Array"; export const Int16Array = "Int16Array"; export const Int32Array = "Int32Array"; @@ -203,6 +205,8 @@ export namespace CommonNames { export const Error = "Error"; // runtime export const abort = "abort"; + export const trace = "trace"; + export const seed = "seed"; export const pow = "pow"; export const mod = "mod"; export const alloc = "__alloc"; diff --git a/src/program.ts b/src/program.ts index 743781ee20..ea61be133b 100644 --- a/src/program.ts +++ b/src/program.ts @@ -118,6 +118,7 @@ import { import { Parser } from "./parser"; +import { BuiltinNames } from "./builtins"; /** Represents a yet unresolved `import`. */ class QueuedImport { @@ -980,22 +981,48 @@ export class Program extends DiagnosticEmitter { // set up global aliases { let globalAliases = options.globalAliases; - if (globalAliases) { - // TODO: for (let [alias, name] of globalAliases) { - for (let _keys = Map_keys(globalAliases), i = 0, k = _keys.length; i < k; ++i) { - let alias = unchecked(_keys[i]); - let name = assert(globalAliases.get(alias)); - if (!name.length) continue; // explicitly disabled - let firstChar = name.charCodeAt(0); - if (firstChar >= CharCode._0 && firstChar <= CharCode._9) { - this.registerConstantInteger(alias, Type.i32, i64_new(parseInt(name, 10))); + if (!globalAliases) globalAliases = new Map(); + if (!globalAliases.has(CommonNames.abort)) { + globalAliases.set(CommonNames.abort, + this.elementsByName.has(BuiltinNames.wasiAbort) + ? BuiltinNames.wasiAbort + : BuiltinNames.abort + ); + } + if (!globalAliases.has(CommonNames.trace)) { + globalAliases.set(CommonNames.trace, + this.elementsByName.has(BuiltinNames.wasiTrace) + ? BuiltinNames.wasiTrace + : BuiltinNames.trace + ); + } + if (!globalAliases.has(CommonNames.seed)) { + globalAliases.set(CommonNames.seed, + this.elementsByName.has(BuiltinNames.wasiSeed) + ? BuiltinNames.wasiSeed + : BuiltinNames.seed + ); + } + if (!globalAliases.has(CommonNames.Math)) { + globalAliases.set(CommonNames.Math, CommonNames.NativeMath); + } + if (!globalAliases.has(CommonNames.Mathf)) { + globalAliases.set(CommonNames.Mathf, CommonNames.NativeMathf); + } + // TODO: for (let [alias, name] of globalAliases) { + for (let _keys = Map_keys(globalAliases), i = 0, k = _keys.length; i < k; ++i) { + let alias = unchecked(_keys[i]); + let name = assert(globalAliases.get(alias)); + if (!name.length) continue; // explicitly disabled + let firstChar = name.charCodeAt(0); + if (firstChar >= CharCode._0 && firstChar <= CharCode._9) { + this.registerConstantInteger(alias, Type.i32, i64_new(parseInt(name, 10))); + } else { + let elementsByName = this.elementsByName; + if (elementsByName.has(name)) { + elementsByName.set(alias, assert(elementsByName.get(name))); } else { - let elementsByName = this.elementsByName; - if (elementsByName.has(name)) { - elementsByName.set(alias, assert(elementsByName.get(name))); - } else { - throw new Error("no such global element: " + name); - } + throw new Error("no such global element: " + name); } } } diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index c5ecb8300c..2fe19a00d9 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -1,36 +1,41 @@ import { proc_exit, fd_write, - iovec + iovec, + random_get } from "./wasi_snapshot_preview1"; import { - decimalCount32 + MAX_DOUBLE_LENGTH, + decimalCount32, + dtoa } from "util/number"; export * from "./wasi_snapshot_preview1"; /** A WASI-aware abort implementation. */ -// @ts-ignore: decorator -@global -export function abort( - message: string = "", - fileName: string = "", +function abort( + message: string | null = null, + fileName: string | null = null, lineNumber: u32 = 0, columnNumber: u32 = 0 ): void { - // 0: iovec.buf - // 4: iovec.buf_len - // 8: nwritten + // 0: iov.buf + // 4: iov.buf_len + // 8: len // 12: buf... const iovPtr: usize = 0; const bufPtr: usize = iovPtr + offsetof() + sizeof(); changetype(iovPtr).buf = bufPtr; var ptr = bufPtr; - store(ptr, 0x203A74726F6241); ptr += 7; // Abort: - ptr += String.UTF8.encodeUnsafe(message, ptr); - store(ptr, 0x206E690A); ptr += 4; // \nin - ptr += String.UTF8.encodeUnsafe(fileName, ptr); + store(ptr, 0x203A74726F6261); ptr += 7; // 'abort: ' + if (message !== null) { + ptr += String.UTF8.encodeUnsafe(message, ptr); + } + store(ptr, 0x206E6920); ptr += 4; // ' in ' + if (fileName !== null) { + ptr += String.UTF8.encodeUnsafe(fileName, ptr); + } store(ptr++, 0x28); // ( var len = decimalCount32(lineNumber); ptr += len; do { @@ -45,8 +50,71 @@ export function abort( store(--ptr, 0x30 + columnNumber % 10); columnNumber = t; } while (columnNumber); ptr += len; - store(ptr++, 0x29); // ) + store(ptr, 0x0A29); ptr += 2; // )\n changetype(iovPtr).buf_len = ptr - bufPtr; fd_write(2, iovPtr, 1, offsetof()); proc_exit(255); } + +/** A WASI-aware trace implementation. */ +function trace( + message: string, + n: i32 = 0, + a0: f64 = 0, + a1: f64 = 0, + a2: f64 = 0, + a3: f64 = 0, + a4: f64 = 0 +): void { + // 0: iov.buf + // 4: iov.buf_len + // 8: len + // 12: buf... + var iovPtr = __alloc(offsetof() + sizeof() + 1 + (max(String.UTF8.byteLength(message), MAX_DOUBLE_LENGTH << 1)), 0); + var lenPtr = iovPtr + offsetof(); + var bufPtr = lenPtr + sizeof(); + changetype(iovPtr).buf = bufPtr; + store(bufPtr, 0x203A6563617274); // 'trace: ' + changetype(iovPtr).buf_len = 7; + fd_write(1, iovPtr, 1, lenPtr); + changetype(iovPtr).buf_len = String.UTF8.encodeUnsafe(message, bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n) { + store(bufPtr++, 0x20); // space + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a0)), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 1) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a1)), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 2) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a2)), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 3) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a3)), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 4) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a4)), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + } + } + } + } + --bufPtr; + } + store(bufPtr, 0x0A); // \n + changetype(iovPtr).buf_len = 1; + fd_write(1, iovPtr, 1, lenPtr); + __free(iovPtr); +} + +/** A WASI-aware seed implementation. */ +function seed(): f64 { + var temp = load(0); + var rand: u64; + do { + random_get(0, 8); // to be sure + rand = load(0); + } while (!rand); + store(0, temp); + return reinterpret(rand); +} diff --git a/std/assembly/builtins.ts b/std/assembly/builtins.ts index ab0223a248..68a3e3da83 100644 --- a/std/assembly/builtins.ts +++ b/std/assembly/builtins.ts @@ -1939,3 +1939,7 @@ declare function trace( a3?: f64, a4?: f64 ): void; + +// @ts-ignore: decorator +@external("env", "seed") +declare function seed(): f64; diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 762396cf94..ee7077eeb0 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1711,8 +1711,12 @@ declare const Math: IMath; /** Alias of {@link NativeMathf} or {@link JSMath} respectively. Defaults to `NativeMathf`. */ declare const Mathf: IMath; -/** Environmental tracing function for debugging purposes. */ +/** Environmental abort function. */ +declare function abort(msg?: string | null, fileName?: string | null, lineNumber?: i32, columnNumber?: i32): never; +/** Environmental tracing function. */ declare function trace(msg: string, n?: i32, a0?: f64, a1?: f64, a2?: f64, a3?: f64, a4?: f64): void; +/** Environmental seeding function. */ +declare function seed(): f64; // Decorators diff --git a/std/assembly/math.ts b/std/assembly/math.ts index 57986c45d7..f38719d0e6 100644 --- a/std/assembly/math.ts +++ b/std/assembly/math.ts @@ -1410,7 +1410,7 @@ export namespace NativeMath { } export function random(): f64 { // see: v8/src/base/utils/random-number-generator.cc - if (!random_seeded) throw new Error("PRNG must be seeded."); + if (!random_seeded) seedRandom(reinterpret(seed())); var s1 = random_state0_64; var s0 = random_state1_64; random_state0_64 = s0; @@ -2603,7 +2603,7 @@ export namespace NativeMathf { // Using xoroshiro64starstar from http://xoshiro.di.unimi.it/xoroshiro64starstar.c export function random(): f32 { - if (!random_seeded) throw new Error("PRNG must be seeded."); + if (!random_seeded) seedRandom(reinterpret(seed())); var s0 = random_state0_32; var s1 = random_state1_32; diff --git a/tests/compiler.js b/tests/compiler.js index a9f8a1f1a8..0376f940ed 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -310,10 +310,13 @@ function testInstantiate(basename, binaryBuffer, name, glue) { env: { memory, abort: function(msg, file, line, column) { - console.log(colorsUtil.red(" abort: " + getString(msg) + " at " + getString(file) + ":" + line + ":" + column)); + console.log(colorsUtil.red(" abort: " + getString(msg) + " in " + getString(file) + "(" + line + ":" + column + ")")); }, trace: function(msg, n) { console.log(" trace: " + getString(msg) + (n ? " " : "") + Array.prototype.slice.call(arguments, 2, 2 + n).join(", ")); + }, + seed: function() { + return 0xA5534817; // make tests deterministic } }, Math, diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 798aea0dba..9b0e4dd97d 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -8,9 +8,9 @@ (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $none_=>_f64 (func (result f64))) (type $none_=>_none (func)) (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) - (type $none_=>_f64 (func (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i64_=>_none (func (param i64))) @@ -30,6 +30,7 @@ (import "rtrace" "onrealloc" (func $~lib/rt/rtrace/onrealloc (param i32 i32))) (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) + (import "env" "seed" (func $~lib/builtins/seed (result f64))) (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) (memory $0 1) (data (i32.const 16) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") @@ -149,72 +150,71 @@ (data (i32.const 4752) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01") (data (i32.const 4784) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01") (data (i32.const 4816) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 4848) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.") - (data (i32.const 4912) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") - (data (i32.const 4944) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") - (data (i32.const 4976) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a") - (data (i32.const 5008) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b") - (data (i32.const 5040) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b") - (data (i32.const 5072) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a") - (data (i32.const 5108) "\01\00\00\00\01") - (data (i32.const 5120) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\80\13\00\00\a0\13\00\00\80\13\00\00\c0\13\00\00\e0\13\00\00\00\14") - (data (i32.const 5168) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\00\14\00\00\80\13\00\00\80\13\00\00\c0\13\00\00\a0\13\00\00\e0\13") - (data (i32.const 5216) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") - (data (i32.const 5248) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01") - (data (i32.const 5280) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e") - (data (i32.const 5312) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e") - (data (i32.const 5344) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,") - (data (i32.const 5376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e") - (data (i32.const 5424) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 5456) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000") - (data (i32.const 5488) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003") - (data (i32.const 5520) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 5552) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-") - (data (i32.const 5584) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 5616) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_") - (data (i32.const 5648) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 5712) "0\00\00\00\01\00\00\00\00\00\00\000") - (data (i32.const 5742) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 5776) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 ") - (data (i32.const 5808) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") - (data (i32.const 5840) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") - (data (i32.const 5872) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5920) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5952) "\b8\02\00\00\01\00\00\00\12\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]") - (data (i32.const 7300) "\01") - (data (i32.const 7312) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") - (data (i32.const 7344) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") - (data (i32.const 7376) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 7408) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002") - (data (i32.const 7440) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003") - (data (i32.const 7472) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff") - (data (i32.const 7504) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000") - (data (i32.const 7536) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff") - (data (i32.const 7568) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000") - (data (i32.const 7616) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff") - (data (i32.const 7664) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000") - (data (i32.const 7728) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") - (data (i32.const 7776) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007") - (data (i32.const 7888) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\00\14\00\00\80\13\00\00\80\13\00\00\c0\13\00\00\a0\13\00\00\e0\13") - (data (i32.const 7936) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,") - (data (i32.const 7984) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002") - (data (i32.const 8016) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004") - (data (i32.const 8048) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\80\1b\00\00@\1f\00\00\00\00\00\00`\1f") - (data (i32.const 8080) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004") - (data (i32.const 8112) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") - (data (i32.const 8144) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04") - (data (i32.const 8176) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004") - (data (i32.const 8208) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") - (data (i32.const 8240) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") - (data (i32.const 8272) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 4848) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 4880) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 4912) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a") + (data (i32.const 4944) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b") + (data (i32.const 4976) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b") + (data (i32.const 5008) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a") + (data (i32.const 5044) "\01\00\00\00\01") + (data (i32.const 5056) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00@\13\00\00`\13\00\00@\13\00\00\80\13\00\00\a0\13\00\00\c0\13") + (data (i32.const 5104) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\c0\13\00\00@\13\00\00@\13\00\00\80\13\00\00`\13\00\00\a0\13") + (data (i32.const 5152) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 5184) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01") + (data (i32.const 5216) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e") + (data (i32.const 5248) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e") + (data (i32.const 5280) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,") + (data (i32.const 5312) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e") + (data (i32.const 5360) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 5392) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000") + (data (i32.const 5424) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003") + (data (i32.const 5456) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 5488) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-") + (data (i32.const 5520) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 5552) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_") + (data (i32.const 5584) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") + (data (i32.const 5648) "0\00\00\00\01\00\00\00\00\00\00\000") + (data (i32.const 5678) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 5712) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 ") + (data (i32.const 5744) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") + (data (i32.const 5776) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") + (data (i32.const 5808) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 5856) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 5888) "\b8\02\00\00\01\00\00\00\12\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]") + (data (i32.const 7236) "\01") + (data (i32.const 7248) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 7280) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 7312) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 7344) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002") + (data (i32.const 7376) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003") + (data (i32.const 7408) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff") + (data (i32.const 7440) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000") + (data (i32.const 7472) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff") + (data (i32.const 7504) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000") + (data (i32.const 7552) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 7600) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000") + (data (i32.const 7664) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") + (data (i32.const 7712) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007") + (data (i32.const 7824) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\c0\13\00\00@\13\00\00@\13\00\00\80\13\00\00`\13\00\00\a0\13") + (data (i32.const 7872) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,") + (data (i32.const 7920) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002") + (data (i32.const 7952) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004") + (data (i32.const 7984) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00@\1b\00\00\00\1f\00\00\00\00\00\00 \1f") + (data (i32.const 8016) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004") + (data (i32.const 8048) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 8080) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04") + (data (i32.const 8112) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004") + (data (i32.const 8144) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") + (data (i32.const 8176) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") + (data (i32.const 8208) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") (table $0 57 funcref) (elem (i32.const 1) $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|2 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|16 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -237,7 +237,7 @@ (export "__setArgumentsLength" (func $~setArgumentsLength)) (export "_start" (func $~start)) (export "memory" (memory $0)) - (func $~lib/rt/tlsf/removeBlock (; 7 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 8 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -403,7 +403,7 @@ end end ) - (func $~lib/rt/tlsf/insertBlock (; 8 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/insertBlock (; 9 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -686,7 +686,7 @@ i32.or i32.store offset=4 ) - (func $~lib/rt/tlsf/addMemory (; 9 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) local.get $2 @@ -800,7 +800,7 @@ local.get $1 call $~lib/rt/tlsf/insertBlock ) - (func $~lib/rt/tlsf/maybeInitialize (; 10 ;) (result i32) + (func $~lib/rt/tlsf/maybeInitialize (; 11 ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -825,11 +825,11 @@ if unreachable end - i32.const 8304 + i32.const 8240 local.tee $0 i32.const 0 i32.store - i32.const 9872 + i32.const 9808 i32.const 0 i32.store loop $for-loop|0 @@ -840,7 +840,7 @@ local.get $1 i32.const 2 i32.shl - i32.const 8304 + i32.const 8240 i32.add i32.const 0 i32.store offset=4 @@ -858,7 +858,7 @@ i32.add i32.const 2 i32.shl - i32.const 8304 + i32.const 8240 i32.add i32.const 0 i32.store offset=96 @@ -876,18 +876,18 @@ br $for-loop|0 end end - i32.const 8304 - i32.const 9888 + i32.const 8240 + i32.const 9824 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 8304 + i32.const 8240 global.set $~lib/rt/tlsf/ROOT end local.get $0 ) - (func $~lib/rt/tlsf/prepareSize (; 11 ;) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (param $0 i32) (result i32) local.get $0 i32.const 1073741808 i32.ge_u @@ -911,7 +911,7 @@ i32.gt_u select ) - (func $~lib/rt/tlsf/searchBlock (; 12 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 i32.const 256 @@ -1042,7 +1042,7 @@ end end ) - (func $~lib/rt/tlsf/growMemory (; 13 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (param $0 i32) (param $1 i32) (local $2 i32) memory.size local.tee $2 @@ -1104,7 +1104,7 @@ i32.shl call $~lib/rt/tlsf/addMemory ) - (func $~lib/rt/tlsf/prepareBlock (; 14 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) local.get $1 @@ -1180,7 +1180,7 @@ i32.store end ) - (func $~lib/rt/tlsf/allocateBlock (; 15 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) global.get $~lib/rt/tlsf/collectLock @@ -1262,7 +1262,7 @@ call $~lib/rt/rtrace/onalloc local.get $3 ) - (func $~lib/rt/tlsf/__alloc (; 16 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (param $0 i32) (param $1 i32) (result i32) call $~lib/rt/tlsf/maybeInitialize local.get $0 local.get $1 @@ -1270,7 +1270,7 @@ i32.const 16 i32.add ) - (func $~lib/memory/memory.fill (; 17 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.fill (; 18 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i64) block $~lib/util/memory/memset|inlined.0 @@ -1495,7 +1495,7 @@ end end ) - (func $~lib/rt/pure/increment (; 18 ;) (param $0 i32) + (func $~lib/rt/pure/increment (; 19 ;) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -1536,9 +1536,9 @@ unreachable end ) - (func $~lib/rt/pure/__retain (; 19 ;) (param $0 i32) (result i32) + (func $~lib/rt/pure/__retain (; 20 ;) (param $0 i32) (result i32) local.get $0 - i32.const 8292 + i32.const 8228 i32.gt_u if local.get $0 @@ -1548,9 +1548,9 @@ end local.get $0 ) - (func $~lib/rt/pure/__release (; 20 ;) (param $0 i32) + (func $~lib/rt/pure/__release (; 21 ;) (param $0 i32) local.get $0 - i32.const 8292 + i32.const 8228 i32.gt_u if local.get $0 @@ -1559,7 +1559,7 @@ call $~lib/rt/pure/decrement end ) - (func $~lib/arraybuffer/ArrayBufferView#constructor (; 21 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 22 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $1 @@ -1628,7 +1628,7 @@ i32.store offset=8 local.get $0 ) - (func $~lib/array/Array#constructor (; 22 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#constructor (; 23 ;) (param $0 i32) (result i32) (local $1 i32) i32.const 16 i32.const 3 @@ -1645,12 +1645,12 @@ i32.store offset=12 local.get $1 ) - (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 23 ;) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 24 ;) (param $0 i32) (result i32) local.get $0 i32.const 0 i32.ne ) - (func $std/array/Ref#constructor (; 24 ;) (param $0 i32) (result i32) + (func $std/array/Ref#constructor (; 25 ;) (param $0 i32) (result i32) (local $1 i32) i32.const 4 i32.const 4 @@ -1661,7 +1661,7 @@ i32.store local.get $1 ) - (func $~lib/memory/memory.copy (; 25 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 26 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) block $~lib/util/memory/memmove|inlined.0 @@ -1834,7 +1834,7 @@ end end ) - (func $~lib/rt/__allocArray (; 26 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/__allocArray (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -1872,7 +1872,7 @@ i32.store offset=12 local.get $2 ) - (func $~lib/array/Array#fill (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#fill (; 28 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) local.get $0 @@ -1939,7 +1939,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#__get (; 28 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 29 ;) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 @@ -1958,7 +1958,7 @@ i32.add i32.load8_u ) - (func $std/array/isArraysEqual (; 29 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual (; 30 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2003,7 +2003,7 @@ end i32.const 1 ) - (func $~lib/array/Array#fill (; 30 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#fill (; 31 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) local.get $0 @@ -2078,7 +2078,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#__get (; 31 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 32 ;) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 @@ -2099,7 +2099,7 @@ i32.add i32.load ) - (func $std/array/isArraysEqual (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 33 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 i32.eqz @@ -2147,7 +2147,7 @@ end i32.const 1 ) - (func $std/array/internalCapacity (; 33 ;) (param $0 i32) (result i32) + (func $std/array/internalCapacity (; 34 ;) (param $0 i32) (result i32) local.get $0 i32.load i32.const 16 @@ -2156,7 +2156,7 @@ i32.const 2 i32.shr_s ) - (func $~lib/rt/tlsf/checkUsedBlock (; 34 ;) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/checkUsedBlock (; 35 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 16 @@ -2198,7 +2198,7 @@ end local.get $1 ) - (func $~lib/rt/tlsf/freeBlock (; 35 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/freeBlock (; 36 ;) (param $0 i32) (param $1 i32) local.get $1 local.get $1 i32.load @@ -2211,7 +2211,7 @@ local.get $1 call $~lib/rt/rtrace/onfree ) - (func $~lib/rt/tlsf/reallocateBlock (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/reallocateBlock (; 37 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2302,7 +2302,7 @@ local.get $2 call $~lib/memory/memory.copy local.get $1 - i32.const 8292 + i32.const 8228 i32.ge_u if local.get $1 @@ -2314,7 +2314,7 @@ end local.get $3 ) - (func $~lib/array/ensureSize (; 37 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/ensureSize (; 38 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2374,7 +2374,7 @@ i32.store offset=8 end ) - (func $~lib/array/Array#push (; 38 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#push (; 39 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2397,7 +2397,7 @@ local.get $3 i32.store offset=12 ) - (func $~lib/array/Array#pop (; 39 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#pop (; 40 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -2427,7 +2427,7 @@ local.get $1 i32.store offset=12 ) - (func $~lib/array/Array#set:length (; 40 ;) (param $0 i32) + (func $~lib/array/Array#set:length (; 41 ;) (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -2465,7 +2465,7 @@ i32.const 0 i32.store offset=12 ) - (func $~lib/array/Array#concat (; 41 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#concat (; 42 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2518,7 +2518,7 @@ call $~lib/memory/memory.copy local.get $2 ) - (func $~lib/array/Array#copyWithin (; 42 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#copyWithin (; 43 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) local.get $3 @@ -2622,7 +2622,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#unshift (; 43 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#unshift (; 44 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2651,7 +2651,7 @@ local.get $2 i32.store offset=12 ) - (func $~lib/array/Array#shift (; 44 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#shift (; 45 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2694,7 +2694,7 @@ local.get $1 i32.store offset=12 ) - (func $~lib/array/Array#reverse (; 45 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#reverse (; 46 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2744,7 +2744,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#indexOf (; 46 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#indexOf (; 47 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load offset=12 @@ -2804,7 +2804,7 @@ end i32.const -1 ) - (func $~lib/array/Array#indexOf (; 47 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#indexOf (; 48 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -2850,7 +2850,7 @@ end i32.const -1 ) - (func $~lib/array/Array#indexOf (; 48 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#indexOf (; 49 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -2896,7 +2896,7 @@ end i32.const -1 ) - (func $~lib/array/Array#includes (; 49 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 50 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 local.get $2 @@ -2904,7 +2904,7 @@ i32.const 0 i32.ge_s ) - (func $~lib/array/Array#includes (; 50 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#includes (; 51 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -2959,7 +2959,7 @@ end i32.const 0 ) - (func $~lib/array/Array#includes (; 51 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#includes (; 52 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 f64) @@ -3014,7 +3014,7 @@ end i32.const 0 ) - (func $~lib/array/Array#splice (; 52 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#splice (; 53 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3104,7 +3104,7 @@ i32.store offset=12 local.get $4 ) - (func $~lib/array/Array#splice (; 53 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#splice (; 54 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3195,7 +3195,7 @@ i32.store offset=12 local.get $4 ) - (func $~lib/array/Array#__unchecked_get (; 54 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 55 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -3205,7 +3205,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#__get (; 55 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 56 ;) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 @@ -3235,7 +3235,7 @@ end local.get $0 ) - (func $~lib/array/Array#splice (; 56 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#splice (; 57 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3313,7 +3313,7 @@ i32.store offset=12 local.get $4 ) - (func $~lib/array/Array#__get (; 57 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 58 ;) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 @@ -3330,7 +3330,7 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $~lib/array/Array#__set (; 58 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 59 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) local.get $1 local.get $0 @@ -3367,15 +3367,15 @@ local.get $2 i32.store ) - (func $start:std/array~anonymous|0 (; 59 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|0 (; 60 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.eqz ) - (func $~setArgumentsLength (; 60 ;) (param $0 i32) + (func $~setArgumentsLength (; 61 ;) (param $0 i32) local.get $0 global.set $~argumentsLength ) - (func $~lib/array/Array#findIndex (; 61 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#findIndex (; 62 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3420,17 +3420,17 @@ end i32.const -1 ) - (func $start:std/array~anonymous|1 (; 62 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|1 (; 63 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 1 i32.eq ) - (func $start:std/array~anonymous|2 (; 63 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|2 (; 64 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 100 i32.eq ) - (func $start:std/array~anonymous|3 (; 64 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|3 (; 65 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3438,7 +3438,7 @@ i32.const 100 i32.eq ) - (func $start:std/array~anonymous|5 (; 65 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|5 (; 66 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/array/Array#pop drop @@ -3446,12 +3446,12 @@ i32.const 100 i32.eq ) - (func $start:std/array~anonymous|6 (; 66 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|6 (; 67 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 0 i32.ge_s ) - (func $~lib/array/Array#every (; 67 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#every (; 68 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3497,12 +3497,12 @@ end i32.const 1 ) - (func $start:std/array~anonymous|7 (; 68 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|7 (; 69 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 0 i32.le_s ) - (func $start:std/array~anonymous|8 (; 69 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|8 (; 70 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3510,12 +3510,12 @@ i32.const 10 i32.lt_s ) - (func $start:std/array~anonymous|9 (; 70 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|9 (; 71 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 10 i32.lt_s ) - (func $start:std/array~anonymous|10 (; 71 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|10 (; 72 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/array/Array#pop drop @@ -3523,12 +3523,12 @@ i32.const 3 i32.lt_s ) - (func $start:std/array~anonymous|11 (; 72 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|11 (; 73 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 3 i32.ge_s ) - (func $~lib/array/Array#some (; 73 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#some (; 74 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3573,12 +3573,12 @@ end i32.const 0 ) - (func $start:std/array~anonymous|12 (; 74 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|12 (; 75 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const -1 i32.le_s ) - (func $start:std/array~anonymous|13 (; 75 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|13 (; 76 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3586,12 +3586,12 @@ i32.const 10 i32.gt_s ) - (func $start:std/array~anonymous|14 (; 76 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|14 (; 77 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 10 i32.gt_s ) - (func $start:std/array~anonymous|15 (; 77 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|15 (; 78 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/array/Array#pop drop @@ -3599,13 +3599,13 @@ i32.const 3 i32.gt_s ) - (func $start:std/array~anonymous|16 (; 78 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|16 (; 79 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 global.get $std/array/i i32.add global.set $std/array/i ) - (func $~lib/array/Array#forEach (; 79 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#forEach (; 80 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3645,7 +3645,7 @@ end end ) - (func $start:std/array~anonymous|17 (; 80 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|17 (; 81 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3654,7 +3654,7 @@ i32.add global.set $std/array/i ) - (func $start:std/array~anonymous|19 (; 81 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|19 (; 82 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/array/Array#pop drop @@ -3663,7 +3663,7 @@ i32.add global.set $std/array/i ) - (func $start:std/array~anonymous|20 (; 82 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|20 (; 83 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) local.get $1 i32.eqz @@ -3756,11 +3756,11 @@ end end ) - (func $start:std/array~anonymous|21 (; 83 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start:std/array~anonymous|21 (; 84 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) local.get $0 f32.convert_i32_s ) - (func $~lib/array/Array#map (; 84 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#map (; 85 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3816,7 +3816,7 @@ end local.get $4 ) - (func $~lib/array/Array#__get (; 85 ;) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__get (; 86 ;) (param $0 i32) (param $1 i32) (result f32) local.get $1 local.get $0 i32.load offset=12 @@ -3837,7 +3837,7 @@ i32.add f32.load ) - (func $start:std/array~anonymous|22 (; 86 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|22 (; 87 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3847,7 +3847,7 @@ global.set $std/array/i local.get $0 ) - (func $~lib/array/Array#map (; 87 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 88 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3906,14 +3906,14 @@ end local.get $5 ) - (func $start:std/array~anonymous|23 (; 88 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|23 (; 89 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 global.get $std/array/i i32.add global.set $std/array/i local.get $0 ) - (func $start:std/array~anonymous|24 (; 89 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|24 (; 90 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/array/Array#pop drop @@ -3923,12 +3923,12 @@ global.set $std/array/i local.get $0 ) - (func $start:std/array~anonymous|25 (; 90 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|25 (; 91 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.const 2 i32.ge_s ) - (func $~lib/array/Array#filter (; 91 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 92 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3984,7 +3984,7 @@ end local.get $4 ) - (func $start:std/array~anonymous|26 (; 92 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|26 (; 93 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3996,7 +3996,7 @@ i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|27 (; 93 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|27 (; 94 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 global.get $std/array/i i32.add @@ -4005,7 +4005,7 @@ i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|28 (; 94 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|28 (; 95 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/array/Array#pop drop @@ -4017,12 +4017,12 @@ i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|29 (; 95 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|29 (; 96 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $0 local.get $1 i32.add ) - (func $~lib/array/Array#reduce (; 96 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 97 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4065,7 +4065,7 @@ end local.get $2 ) - (func $start:std/array~anonymous|31 (; 97 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|31 (; 98 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) i32.const 1 local.get $1 i32.const 2 @@ -4073,7 +4073,7 @@ local.get $0 select ) - (func $start:std/array~anonymous|32 (; 98 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|32 (; 99 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) i32.const 1 local.get $1 i32.const 100 @@ -4081,7 +4081,7 @@ local.get $0 select ) - (func $start:std/array~anonymous|33 (; 99 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|33 (; 100 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $3 i32.const 1 call $~lib/array/Array#push @@ -4089,7 +4089,7 @@ local.get $1 i32.add ) - (func $start:std/array~anonymous|35 (; 100 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|35 (; 101 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $3 call $~lib/array/Array#pop drop @@ -4097,7 +4097,7 @@ local.get $1 i32.add ) - (func $~lib/array/Array#reduceRight (; 101 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 102 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 i32.load offset=12 @@ -4133,7 +4133,7 @@ end local.get $2 ) - (func $~lib/math/murmurHash3 (; 102 ;) (param $0 i64) (result i64) + (func $~lib/math/murmurHash3 (; 103 ;) (param $0 i64) (result i64) local.get $0 local.get $0 i64.const 33 @@ -4154,7 +4154,7 @@ i64.shr_u i64.xor ) - (func $~lib/math/splitMix32 (; 103 ;) (param $0 i32) (result i32) + (func $~lib/math/splitMix32 (; 104 ;) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -4186,7 +4186,7 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 104 ;) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 105 ;) (param $0 i64) i32.const 1 global.set $~lib/math/random_seeded local.get $0 @@ -4230,7 +4230,7 @@ unreachable end ) - (func $~lib/util/sort/insertionSort (; 105 ;) (param $0 i32) (param $1 i32) + (func $~lib/util/sort/insertionSort (; 106 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 f32) @@ -4308,13 +4308,13 @@ end end ) - (func $~lib/rt/tlsf/__free (; 106 ;) (param $0 i32) + (func $~lib/rt/tlsf/__free (; 107 ;) (param $0 i32) call $~lib/rt/tlsf/maybeInitialize local.get $0 call $~lib/rt/tlsf/checkUsedBlock call $~lib/rt/tlsf/freeBlock ) - (func $~lib/util/sort/weakHeapSort (; 107 ;) (param $0 i32) (param $1 i32) + (func $~lib/util/sort/weakHeapSort (; 108 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 f32) @@ -4571,7 +4571,7 @@ local.get $4 f32.store ) - (func $~lib/array/Array#sort (; 108 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#sort (; 109 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -4633,7 +4633,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 109 ;) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 110 ;) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4662,7 +4662,7 @@ i32.lt_s i32.sub ) - (func $std/array/isArraysEqual (; 110 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual (; 111 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 f32) (local $4 i32) @@ -4727,7 +4727,7 @@ end i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 111 ;) (param $0 i32) (param $1 i32) + (func $~lib/util/sort/insertionSort (; 112 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 f64) @@ -4805,7 +4805,7 @@ end end ) - (func $~lib/util/sort/weakHeapSort (; 112 ;) (param $0 i32) (param $1 i32) + (func $~lib/util/sort/weakHeapSort (; 113 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 f64) @@ -5062,7 +5062,7 @@ local.get $4 f64.store ) - (func $~lib/array/Array#sort (; 113 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#sort (; 114 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 f64) @@ -5124,7 +5124,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 114 ;) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 115 ;) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 @@ -5153,7 +5153,7 @@ i64.lt_s i32.sub ) - (func $~lib/array/Array#__get (; 115 ;) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__get (; 116 ;) (param $0 i32) (param $1 i32) (result f64) local.get $1 local.get $0 i32.load offset=12 @@ -5174,7 +5174,7 @@ i32.add f64.load ) - (func $std/array/isArraysEqual (; 116 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual (; 117 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 f64) (local $4 i32) @@ -5239,7 +5239,7 @@ end i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 117 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 118 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5318,7 +5318,7 @@ end end ) - (func $~lib/util/sort/weakHeapSort (; 118 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 119 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5577,7 +5577,7 @@ local.get $1 i32.store ) - (func $~lib/array/Array#sort (; 119 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 120 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5641,12 +5641,12 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 120 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 121 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 121 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 122 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.gt_u @@ -5655,7 +5655,7 @@ i32.lt_u i32.sub ) - (func $std/array/createReverseOrderedArray (; 122 ;) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedArray (; 123 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -5683,18 +5683,15 @@ end local.get $2 ) - (func $~lib/math/NativeMath.random (; 123 ;) (result f64) + (func $~lib/math/NativeMath.random (; 124 ;) (result f64) (local $0 i64) (local $1 i64) global.get $~lib/math/random_seeded i32.eqz if - i32.const 4864 - i32.const 4032 - i32.const 1413 - i32.const 24 - call $~lib/builtins/abort - unreachable + call $~lib/builtins/seed + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom end global.get $~lib/math/random_state0_64 local.set $0 @@ -5727,7 +5724,7 @@ f64.const 1 f64.sub ) - (func $std/array/createRandomOrderedArray (; 124 ;) (param $0 i32) (result i32) + (func $std/array/createRandomOrderedArray (; 125 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -5755,7 +5752,7 @@ end local.get $2 ) - (func $std/array/isSorted (; 125 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted (; 126 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) i32.const 1 @@ -5795,7 +5792,7 @@ end i32.const 1 ) - (func $std/array/assertSorted (; 126 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 127 ;) (param $0 i32) (param $1 i32) local.get $0 local.get $1 call $~lib/array/Array#sort @@ -5814,17 +5811,17 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/array/assertSortedDefault (; 127 ;) (param $0 i32) + (func $std/array/assertSortedDefault (; 128 ;) (param $0 i32) local.get $0 i32.const 48 call $std/array/assertSorted ) - (func $start:std/array~anonymous|44 (; 128 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|44 (; 129 ;) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.sub ) - (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 129 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 130 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 i32.load offset=4 local.get $1 @@ -5845,7 +5842,7 @@ call $~lib/rt/pure/__release end ) - (func $~lib/array/Array<~lib/array/Array>#__set (; 130 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/array/Array>#__set (; 131 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) local.get $1 local.get $0 @@ -5878,7 +5875,7 @@ local.get $2 call $~lib/array/Array<~lib/array/Array>#__unchecked_set ) - (func $std/array/createReverseOrderedNestedArray (; 131 ;) (result i32) + (func $std/array/createReverseOrderedNestedArray (; 132 ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -5923,7 +5920,7 @@ end local.get $1 ) - (func $start:std/array~anonymous|47 (; 132 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|47 (; 133 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.const 0 call $~lib/array/Array#__get @@ -5932,7 +5929,7 @@ call $~lib/array/Array#__get i32.sub ) - (func $~lib/array/Array<~lib/array/Array>#sort (; 133 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#sort (; 134 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5986,7 +5983,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $std/array/isSorted<~lib/array/Array> (; 134 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/array/Array> (; 135 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6038,7 +6035,7 @@ end i32.const 1 ) - (func $std/array/assertSorted<~lib/array/Array> (; 135 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/array/Array> (; 136 ;) (param $0 i32) (param $1 i32) local.get $0 local.get $1 call $~lib/array/Array<~lib/array/Array>#sort @@ -6057,7 +6054,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/array/createReverseOrderedElementsArray (; 136 ;) (result i32) + (func $std/array/createReverseOrderedElementsArray (; 137 ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6103,14 +6100,14 @@ end local.get $1 ) - (func $start:std/array~anonymous|48 (; 137 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|48 (; 138 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load local.get $1 i32.load i32.sub ) - (func $std/array/isSorted<~lib/string/String | null> (; 138 ;) (param $0 i32) (result i32) + (func $std/array/isSorted<~lib/string/String | null> (; 139 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6161,7 +6158,7 @@ end i32.const 1 ) - (func $std/array/assertSorted<~lib/string/String | null> (; 139 ;) (param $0 i32) + (func $std/array/assertSorted<~lib/string/String | null> (; 140 ;) (param $0 i32) local.get $0 i32.const 55 call $~lib/array/Array<~lib/array/Array>#sort @@ -6179,7 +6176,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/string/String#get:length (; 140 ;) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 141 ;) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub @@ -6187,7 +6184,7 @@ i32.const 1 i32.shr_u ) - (func $~lib/util/string/compareImpl (; 141 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/compareImpl (; 142 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -6263,7 +6260,7 @@ end i32.const 0 ) - (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 142 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 143 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) i32.const 1 @@ -6317,7 +6314,7 @@ select call $~lib/util/string/compareImpl ) - (func $~lib/string/String.__eq (; 143 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 144 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -6351,7 +6348,7 @@ call $~lib/util/string/compareImpl i32.eqz ) - (func $std/array/isArraysEqual<~lib/string/String | null> (; 144 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual<~lib/string/String | null> (; 145 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6409,14 +6406,14 @@ end i32.const 1 ) - (func $~lib/string/String#charAt (; 145 ;) (param $0 i32) (result i32) + (func $~lib/string/String#charAt (; 146 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 4080 call $~lib/string/String#get:length i32.ge_u if - i32.const 5120 + i32.const 5056 return end i32.const 2 @@ -6433,7 +6430,7 @@ local.get $1 call $~lib/rt/pure/__retain ) - (func $~lib/string/String#concat (; 146 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 147 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6442,16 +6439,16 @@ local.tee $1 i32.eqz if - i32.const 5232 + i32.const 5168 local.set $3 local.get $1 - i32.const 5232 + i32.const 5168 i32.ne if local.get $1 call $~lib/rt/pure/__release end - i32.const 5232 + i32.const 5168 local.set $1 end local.get $0 @@ -6470,7 +6467,7 @@ if local.get $1 call $~lib/rt/pure/__release - i32.const 5120 + i32.const 5056 local.tee $0 return end @@ -6492,21 +6489,21 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__concat (; 147 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 148 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 5232 + i32.const 5168 local.get $0 select local.get $1 call $~lib/string/String#concat ) - (func $std/array/createRandomString (; 148 ;) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 149 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - i32.const 5120 + i32.const 5056 local.set $1 loop $for-loop|0 local.get $2 @@ -6549,7 +6546,7 @@ end local.get $1 ) - (func $std/array/createRandomStringArray (; 149 ;) (result i32) + (func $std/array/createRandomStringArray (; 150 ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6591,7 +6588,7 @@ end local.get $0 ) - (func $~lib/string/String#substring (; 150 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#substring (; 151 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6637,7 +6634,7 @@ local.tee $3 i32.eqz if - i32.const 5120 + i32.const 5056 return end i32.const 0 @@ -6665,7 +6662,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/string/joinBooleanArray (; 151 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinBooleanArray (; 152 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6680,14 +6677,14 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $2 i32.eqz if - i32.const 5296 - i32.const 5328 + i32.const 5232 + i32.const 5264 local.get $0 i32.load8_u select @@ -6695,7 +6692,7 @@ return end local.get $2 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.tee $4 i32.const 5 @@ -6731,8 +6728,8 @@ i32.const 1 i32.shl i32.add - i32.const 5296 - i32.const 5328 + i32.const 5232 + i32.const 5264 local.get $8 select local.get $6 @@ -6750,7 +6747,7 @@ i32.const 1 i32.shl i32.add - i32.const 5360 + i32.const 5296 local.get $4 i32.const 1 i32.shl @@ -6781,8 +6778,8 @@ i32.const 1 i32.shl i32.add - i32.const 5296 - i32.const 5328 + i32.const 5232 + i32.const 5264 local.get $2 select local.get $0 @@ -6805,7 +6802,7 @@ end local.get $3 ) - (func $~lib/util/number/decimalCount32 (; 152 ;) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 153 ;) (param $0 i32) (result i32) i32.const 1 i32.const 2 local.get $0 @@ -6853,7 +6850,7 @@ i32.lt_u select ) - (func $~lib/util/number/utoa_simple (; 153 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa_simple (; 154 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) loop $do-continue|0 local.get $1 @@ -6877,14 +6874,14 @@ br_if $do-continue|0 end ) - (func $~lib/util/number/itoa32 (; 154 ;) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 155 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 i32.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -6919,7 +6916,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 155 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 156 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 i32.const 1 @@ -6961,7 +6958,7 @@ end local.get $2 ) - (func $~lib/util/string/joinIntegerArray (; 156 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 157 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6974,7 +6971,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $4 @@ -7068,7 +7065,7 @@ end local.get $3 ) - (func $~lib/array/Array#join (; 157 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 158 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 @@ -7076,13 +7073,13 @@ local.get $1 call $~lib/util/string/joinIntegerArray ) - (func $~lib/util/number/utoa32 (; 158 ;) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 159 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 i32.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -7099,7 +7096,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 159 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 160 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 i32.const 1 @@ -7123,7 +7120,7 @@ call $~lib/util/number/utoa_simple local.get $0 ) - (func $~lib/util/string/joinIntegerArray (; 160 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 161 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -7136,7 +7133,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $4 @@ -7230,7 +7227,7 @@ end local.get $3 ) - (func $~lib/array/Array#join (; 161 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 162 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 @@ -7238,7 +7235,7 @@ local.get $1 call $~lib/util/string/joinIntegerArray ) - (func $~lib/util/number/genDigits (; 162 ;) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 163 ;) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i32) (local $9 i64) @@ -7439,7 +7436,7 @@ local.get $4 i32.const 2 i32.shl - i32.const 6880 + i32.const 6816 i32.add i64.load32_u local.get $10 @@ -7566,7 +7563,7 @@ i32.sub i32.const 2 i32.shl - i32.const 6880 + i32.const 6816 i32.add i64.load32_u i64.mul @@ -7628,7 +7625,7 @@ local.get $6 end ) - (func $~lib/util/number/prettify (; 163 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 164 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 i32.eqz @@ -7873,7 +7870,7 @@ end end ) - (func $~lib/util/number/dtoa_core (; 164 ;) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 165 ;) (param $0 i32) (param $1 f64) (result i32) (local $2 i64) (local $3 i32) (local $4 i64) @@ -7998,14 +7995,14 @@ i32.sub global.set $~lib/util/number/_K local.get $6 - i32.const 5968 + i32.const 5904 i32.add i64.load global.set $~lib/util/number/_frc_pow local.get $3 i32.const 1 i32.shl - i32.const 6688 + i32.const 6624 i32.add i32.load16_s global.set $~lib/util/number/_exp_pow @@ -8182,14 +8179,14 @@ local.get $10 i32.add ) - (func $~lib/util/number/dtoa (; 165 ;) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 166 ;) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) local.get $0 f64.const 0 f64.eq if - i32.const 5824 + i32.const 5760 return end local.get $0 @@ -8202,11 +8199,11 @@ local.get $0 f64.ne if - i32.const 5856 + i32.const 5792 return end - i32.const 5888 - i32.const 5936 + i32.const 5824 + i32.const 5872 local.get $0 f64.const 0 f64.lt @@ -8234,7 +8231,7 @@ local.get $1 call $~lib/rt/tlsf/__free ) - (func $~lib/util/number/dtoa_stream (; 166 ;) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) + (func $~lib/util/number/dtoa_stream (; 167 ;) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) local.get $0 local.get $1 @@ -8288,8 +8285,8 @@ i32.add local.set $1 local.get $0 - i32.const 5888 - i32.const 5936 + i32.const 5824 + i32.const 5872 local.get $3 select local.get $1 @@ -8305,7 +8302,7 @@ local.get $2 call $~lib/util/number/dtoa_core ) - (func $~lib/util/string/joinFloatArray (; 167 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinFloatArray (; 168 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8318,7 +8315,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $3 @@ -8330,7 +8327,7 @@ return end local.get $3 - i32.const 5792 + i32.const 5728 call $~lib/string/String#get:length local.tee $4 i32.const 28 @@ -8371,7 +8368,7 @@ i32.const 1 i32.shl i32.add - i32.const 5792 + i32.const 5728 local.get $4 i32.const 1 i32.shl @@ -8412,7 +8409,7 @@ end local.get $2 ) - (func $~lib/util/string/joinReferenceArray<~lib/string/String | null> (; 168 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/string/String | null> (; 169 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8429,7 +8426,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end i32.const 0 @@ -8450,13 +8447,13 @@ local.get $4 call $~lib/rt/pure/__retain else - i32.const 5120 + i32.const 5056 end local.get $4 call $~lib/rt/pure/__release return end - i32.const 5120 + i32.const 5056 local.set $1 local.get $5 call $~lib/string/String#get:length @@ -8580,7 +8577,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/string/String | null>#join (; 169 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#join (; 170 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 @@ -8588,7 +8585,7 @@ local.get $1 call $~lib/util/string/joinReferenceArray<~lib/string/String | null> ) - (func $~lib/util/string/joinReferenceArray (; 170 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinReferenceArray (; 171 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8602,7 +8599,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $5 @@ -8618,15 +8615,15 @@ end local.get $4 call $~lib/rt/pure/__release - i32.const 7104 - i32.const 5120 + i32.const 7040 + i32.const 5056 local.get $4 select return end - i32.const 5120 + i32.const 5056 local.set $1 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.set $7 loop $for-loop|0 @@ -8655,7 +8652,7 @@ if local.get $1 local.get $1 - i32.const 7104 + i32.const 7040 call $~lib/string/String.__concat local.tee $6 local.tee $2 @@ -8676,7 +8673,7 @@ if local.get $1 local.tee $2 - i32.const 5360 + i32.const 5296 call $~lib/string/String.__concat local.tee $6 local.tee $1 @@ -8719,7 +8716,7 @@ if local.get $1 local.get $1 - i32.const 7104 + i32.const 7040 call $~lib/string/String.__concat local.tee $0 local.tee $3 @@ -8740,19 +8737,19 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array#join (; 171 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#join (; 172 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 i32.load offset=12 call $~lib/util/string/joinReferenceArray ) - (func $~lib/array/Array#toString (; 172 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 173 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa_stream (; 173 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 174 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 local.get $1 @@ -8807,7 +8804,7 @@ end local.get $2 ) - (func $~lib/util/string/joinIntegerArray (; 174 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 175 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8820,7 +8817,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $3 @@ -8832,7 +8829,7 @@ return end local.get $3 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.tee $4 i32.const 11 @@ -8871,7 +8868,7 @@ i32.const 1 i32.shl i32.add - i32.const 5360 + i32.const 5296 local.get $4 i32.const 1 i32.shl @@ -8910,7 +8907,7 @@ end local.get $2 ) - (func $~lib/util/number/itoa_stream (; 175 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 176 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 i32.const 1 @@ -8940,7 +8937,7 @@ call $~lib/util/number/utoa_simple local.get $1 ) - (func $~lib/util/string/joinIntegerArray (; 176 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 177 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8953,7 +8950,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $3 @@ -8965,7 +8962,7 @@ return end local.get $3 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.tee $4 i32.const 10 @@ -9006,7 +9003,7 @@ i32.const 1 i32.shl i32.add - i32.const 5360 + i32.const 5296 local.get $4 i32.const 1 i32.shl @@ -9047,7 +9044,7 @@ end local.get $2 ) - (func $~lib/util/number/decimalCount64 (; 177 ;) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 178 ;) (param $0 i64) (result i32) i32.const 10 i32.const 11 i32.const 12 @@ -9100,7 +9097,7 @@ i64.lt_u select ) - (func $~lib/util/number/utoa_simple (; 178 ;) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/util/number/utoa_simple (; 179 ;) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i64) loop $do-continue|0 local.get $1 @@ -9127,14 +9124,14 @@ br_if $do-continue|0 end ) - (func $~lib/util/number/utoa64 (; 179 ;) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 180 ;) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 i64.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -9170,7 +9167,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 180 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 181 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) local.get $0 local.get $1 @@ -9210,7 +9207,7 @@ end local.get $1 ) - (func $~lib/util/string/joinIntegerArray (; 181 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 182 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9223,7 +9220,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $3 @@ -9235,7 +9232,7 @@ return end local.get $3 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.tee $4 i32.const 20 @@ -9276,7 +9273,7 @@ i32.const 1 i32.shl i32.add - i32.const 5360 + i32.const 5296 local.get $4 i32.const 1 i32.shl @@ -9317,7 +9314,7 @@ end local.get $2 ) - (func $~lib/util/number/itoa64 (; 182 ;) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 183 ;) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9325,7 +9322,7 @@ local.get $0 i64.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -9381,7 +9378,7 @@ local.get $3 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 183 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 184 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -9442,7 +9439,7 @@ end local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 184 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 185 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9455,7 +9452,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $3 @@ -9467,7 +9464,7 @@ return end local.get $3 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.tee $4 i32.const 21 @@ -9508,7 +9505,7 @@ i32.const 1 i32.shl i32.add - i32.const 5360 + i32.const 5296 local.get $4 i32.const 1 i32.shl @@ -9549,12 +9546,12 @@ end local.get $2 ) - (func $~lib/array/Array<~lib/string/String | null>#toString (; 185 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#toString (; 186 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array<~lib/string/String | null>#join ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 186 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 187 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9569,7 +9566,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $5 @@ -9588,15 +9585,15 @@ local.get $3 call $~lib/array/Array#toString else - i32.const 5120 + i32.const 5056 end local.get $3 call $~lib/rt/pure/__release return end - i32.const 5120 + i32.const 5056 local.set $1 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.set $7 loop $for-loop|0 @@ -9650,7 +9647,7 @@ if local.get $1 local.tee $2 - i32.const 5360 + i32.const 5296 call $~lib/string/String.__concat local.tee $6 local.tee $1 @@ -9718,7 +9715,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/util/number/itoa_stream (; 187 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 188 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 i32.const 1 @@ -9748,7 +9745,7 @@ call $~lib/util/number/utoa_simple local.get $1 ) - (func $~lib/util/string/joinIntegerArray (; 188 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 189 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9761,7 +9758,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $3 @@ -9773,7 +9770,7 @@ return end local.get $3 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.tee $4 i32.const 10 @@ -9812,7 +9809,7 @@ i32.const 1 i32.shl i32.add - i32.const 5360 + i32.const 5296 local.get $4 i32.const 1 i32.shl @@ -9851,14 +9848,14 @@ end local.get $2 ) - (func $~lib/array/Array#toString (; 189 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 190 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 i32.load offset=12 call $~lib/util/string/joinIntegerArray ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 190 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 191 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9873,7 +9870,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $5 @@ -9892,15 +9889,15 @@ local.get $3 call $~lib/array/Array#toString else - i32.const 5120 + i32.const 5056 end local.get $3 call $~lib/rt/pure/__release return end - i32.const 5120 + i32.const 5056 local.set $1 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.set $7 loop $for-loop|0 @@ -9954,7 +9951,7 @@ if local.get $1 local.tee $2 - i32.const 5360 + i32.const 5296 call $~lib/string/String.__concat local.tee $6 local.tee $1 @@ -10022,12 +10019,12 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array#toString (; 191 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 192 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 192 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 193 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10042,7 +10039,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $5 @@ -10061,15 +10058,15 @@ local.get $3 call $~lib/array/Array#toString else - i32.const 5120 + i32.const 5056 end local.get $3 call $~lib/rt/pure/__release return end - i32.const 5120 + i32.const 5056 local.set $1 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.set $7 loop $for-loop|0 @@ -10123,7 +10120,7 @@ if local.get $1 local.tee $2 - i32.const 5360 + i32.const 5296 call $~lib/string/String.__concat local.tee $6 local.tee $1 @@ -10191,14 +10188,14 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/array/Array>#toString (; 193 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#toString (; 194 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 i32.load offset=12 call $~lib/util/string/joinReferenceArray<~lib/array/Array> ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array<~lib/array/Array>> (; 194 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array<~lib/array/Array>> (; 195 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10213,7 +10210,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 return end local.get $5 @@ -10232,15 +10229,15 @@ local.get $3 call $~lib/array/Array<~lib/array/Array>#toString else - i32.const 5120 + i32.const 5056 end local.get $3 call $~lib/rt/pure/__release return end - i32.const 5120 + i32.const 5056 local.set $1 - i32.const 5360 + i32.const 5296 call $~lib/string/String#get:length local.set $7 loop $for-loop|0 @@ -10294,7 +10291,7 @@ if local.get $1 local.tee $2 - i32.const 5360 + i32.const 5296 call $~lib/string/String.__concat local.tee $6 local.tee $1 @@ -10362,7 +10359,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $start:std/array (; 195 ;) + (func $start:std/array (; 196 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -14874,7 +14871,7 @@ i32.const 1 i32.const 2 i32.const 3 - i32.const 4928 + i32.const 4864 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $21 @@ -14895,7 +14892,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 4960 + i32.const 4896 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $22 @@ -15064,14 +15061,14 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 5136 + i32.const 5072 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $2 i32.const 7 i32.const 2 i32.const 15 - i32.const 5184 + i32.const 5120 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $3 @@ -15107,7 +15104,7 @@ i32.const 2 i32.const 0 i32.const 17 - i32.const 5264 + i32.const 5200 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $0 @@ -15117,7 +15114,7 @@ call $~lib/util/string/joinBooleanArray local.tee $2 local.get $2 - i32.const 5392 + i32.const 5328 call $~lib/string/String.__eq i32.eqz if @@ -15131,14 +15128,14 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 5440 + i32.const 5376 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $8 - i32.const 5120 + i32.const 5056 call $~lib/array/Array#join local.tee $9 - i32.const 5504 + i32.const 5440 call $~lib/string/String.__eq i32.eqz if @@ -15152,14 +15149,14 @@ i32.const 3 i32.const 2 i32.const 7 - i32.const 5536 + i32.const 5472 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $10 - i32.const 5568 + i32.const 5504 call $~lib/array/Array#join local.tee $11 - i32.const 5504 + i32.const 5440 call $~lib/string/String.__eq i32.eqz if @@ -15173,14 +15170,14 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 5600 + i32.const 5536 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $12 - i32.const 5632 + i32.const 5568 call $~lib/array/Array#join local.tee $13 - i32.const 5664 + i32.const 5600 call $~lib/string/String.__eq i32.eqz if @@ -15194,7 +15191,7 @@ i32.const 6 i32.const 3 i32.const 10 - i32.const 5728 + i32.const 5664 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $2 @@ -15205,7 +15202,7 @@ local.tee $3 local.set $14 local.get $3 - i32.const 6944 + i32.const 6880 call $~lib/string/String.__eq i32.eqz if @@ -15219,14 +15216,14 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 7072 + i32.const 7008 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $16 - i32.const 5120 + i32.const 5056 call $~lib/array/Array<~lib/string/String | null>#join local.tee $17 - i32.const 7040 + i32.const 6976 call $~lib/string/String.__eq i32.eqz if @@ -15259,7 +15256,7 @@ local.get $3 call $~lib/array/Array#join local.tee $18 - i32.const 7152 + i32.const 7088 call $~lib/string/String.__eq i32.eqz if @@ -15289,7 +15286,7 @@ local.get $5 call $~lib/array/Array#join local.tee $15 - i32.const 7232 + i32.const 7168 call $~lib/string/String.__eq i32.eqz if @@ -15334,35 +15331,35 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 7312 + i32.const 7248 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $5 i32.const 1 i32.const 2 i32.const 3 - i32.const 7328 + i32.const 7264 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $7 i32.const 2 i32.const 2 i32.const 3 - i32.const 7360 + i32.const 7296 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $8 i32.const 4 i32.const 2 i32.const 3 - i32.const 7392 + i32.const 7328 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $9 local.get $5 call $~lib/array/Array#toString local.tee $14 - i32.const 5120 + i32.const 5056 call $~lib/string/String.__eq i32.eqz if @@ -15376,7 +15373,7 @@ local.get $7 call $~lib/array/Array#toString local.tee $16 - i32.const 7040 + i32.const 6976 call $~lib/string/String.__eq i32.eqz if @@ -15390,7 +15387,7 @@ local.get $8 call $~lib/array/Array#toString local.tee $17 - i32.const 7424 + i32.const 7360 call $~lib/string/String.__eq i32.eqz if @@ -15404,7 +15401,7 @@ local.get $9 call $~lib/array/Array#toString local.tee $18 - i32.const 7456 + i32.const 7392 call $~lib/string/String.__eq i32.eqz if @@ -15418,7 +15415,7 @@ i32.const 3 i32.const 0 i32.const 21 - i32.const 7488 + i32.const 7424 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $10 @@ -15428,7 +15425,7 @@ call $~lib/util/string/joinIntegerArray local.tee $0 local.get $0 - i32.const 7520 + i32.const 7456 call $~lib/string/String.__eq i32.eqz if @@ -15442,7 +15439,7 @@ i32.const 3 i32.const 1 i32.const 22 - i32.const 7552 + i32.const 7488 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $11 @@ -15453,7 +15450,7 @@ local.tee $0 local.set $19 local.get $0 - i32.const 7584 + i32.const 7520 call $~lib/string/String.__eq i32.eqz if @@ -15467,7 +15464,7 @@ i32.const 3 i32.const 3 i32.const 23 - i32.const 7632 + i32.const 7568 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $12 @@ -15478,7 +15475,7 @@ local.tee $0 local.set $20 local.get $0 - i32.const 7680 + i32.const 7616 call $~lib/string/String.__eq i32.eqz if @@ -15492,7 +15489,7 @@ i32.const 4 i32.const 3 i32.const 24 - i32.const 7744 + i32.const 7680 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $13 @@ -15503,7 +15500,7 @@ local.tee $0 local.set $21 local.get $0 - i32.const 7792 + i32.const 7728 call $~lib/string/String.__eq i32.eqz if @@ -15517,13 +15514,13 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 7904 + i32.const 7840 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $22 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $23 - i32.const 7952 + i32.const 7888 call $~lib/string/String.__eq i32.eqz if @@ -15537,13 +15534,13 @@ i32.const 4 i32.const 2 i32.const 15 - i32.const 8064 + i32.const 8000 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $27 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $28 - i32.const 8096 + i32.const 8032 call $~lib/string/String.__eq i32.eqz if @@ -15566,7 +15563,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 8128 + i32.const 8064 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -15574,7 +15571,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 8160 + i32.const 8096 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -15586,7 +15583,7 @@ local.tee $2 local.set $29 local.get $2 - i32.const 8192 + i32.const 8128 call $~lib/string/String.__eq i32.eqz if @@ -15609,7 +15606,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 8224 + i32.const 8160 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -15617,7 +15614,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 8256 + i32.const 8192 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -15629,7 +15626,7 @@ local.tee $3 local.set $30 local.get $3 - i32.const 8192 + i32.const 8128 call $~lib/string/String.__eq i32.eqz if @@ -15659,7 +15656,7 @@ i32.const 1 i32.const 2 i32.const 7 - i32.const 8288 + i32.const 8224 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -15673,7 +15670,7 @@ local.tee $24 local.set $25 local.get $24 - i32.const 7040 + i32.const 6976 call $~lib/string/String.__eq i32.eqz if @@ -15746,7 +15743,7 @@ local.get $3 call $~lib/rt/pure/__release ) - (func $~start (; 196 ;) + (func $~start (; 197 ;) global.get $~started if return @@ -15756,7 +15753,7 @@ end call $start:std/array ) - (func $~lib/rt/pure/decrement (; 197 ;) (param $0 i32) + (func $~lib/rt/pure/decrement (; 198 ;) (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -15824,9 +15821,9 @@ i32.store offset=4 end ) - (func $~lib/rt/pure/__visit (; 198 ;) (param $0 i32) + (func $~lib/rt/pure/__visit (; 199 ;) (param $0 i32) local.get $0 - i32.const 8292 + i32.const 8228 i32.lt_u if return @@ -15836,7 +15833,7 @@ i32.sub call $~lib/rt/pure/decrement ) - (func $~lib/array/Array#__visit_impl (; 199 ;) (param $0 i32) + (func $~lib/array/Array#__visit_impl (; 200 ;) (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -15868,7 +15865,7 @@ end end ) - (func $~lib/rt/__visit_members (; 200 ;) (param $0 i32) + (func $~lib/rt/__visit_members (; 201 ;) (param $0 i32) block $folding-inner0 block $block$4$break block $switch$1$default diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 3ed0943687..9d4b73f3c0 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -10,12 +10,12 @@ (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $none_=>_none (func)) + (type $none_=>_f64 (func (result f64))) (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) - (type $none_=>_f64 (func (result f64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) @@ -33,6 +33,7 @@ (import "rtrace" "onrealloc" (func $~lib/rt/rtrace/onrealloc (param i32 i32))) (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) + (import "env" "seed" (func $~lib/builtins/seed (result f64))) (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) (memory $0 1) (data (i32.const 16) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") @@ -146,72 +147,71 @@ (data (i32.const 4752) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01\00\00\00") (data (i32.const 4784) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00") (data (i32.const 4816) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 4848) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.\00") - (data (i32.const 4912) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") - (data (i32.const 4944) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 4976) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") - (data (i32.const 5008) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b\00") - (data (i32.const 5040) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b\00") - (data (i32.const 5072) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a\00") - (data (i32.const 5104) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 5120) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\80\13\00\00\a0\13\00\00\80\13\00\00\c0\13\00\00\e0\13\00\00\00\14\00\00\00\00\00\00") - (data (i32.const 5168) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\00\14\00\00\80\13\00\00\80\13\00\00\c0\13\00\00\a0\13\00\00\e0\13\00\00\00\00\00\00") - (data (i32.const 5216) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") - (data (i32.const 5248) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\00") - (data (i32.const 5280) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e\00") - (data (i32.const 5312) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e\00") - (data (i32.const 5344) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,\00") - (data (i32.const 5376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") - (data (i32.const 5424) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 5456) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000\00") - (data (i32.const 5488) "\90\01\00\00\01\00\00\00\12\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") - (data (i32.const 5904) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003\00") - (data (i32.const 5936) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 5968) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-\00") - (data (i32.const 6000) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 6032) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_\00") - (data (i32.const 6064) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 6128) "0\00\00\00\01\00\00\00\00\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 6192) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 \00") - (data (i32.const 6224) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000\00") - (data (i32.const 6256) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00") - (data (i32.const 6288) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 6336) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 6368) "\b8\02\00\00\01\00\00\00\13\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00") - (data (i32.const 7712) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 7728) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") - (data (i32.const 7760) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 7792) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 7824) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002\00") - (data (i32.const 7856) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003\00") - (data (i32.const 7888) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff\00") - (data (i32.const 7920) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000\00") - (data (i32.const 7952) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff\00\00") - (data (i32.const 7984) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000\00") - (data (i32.const 8032) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\00\00\00\00") - (data (i32.const 8080) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000\00") - (data (i32.const 8144) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") - (data (i32.const 8192) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007\00") - (data (i32.const 8304) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\00\14\00\00\80\13\00\00\80\13\00\00\c0\13\00\00\a0\13\00\00\e0\13\00\00\00\00\00\00") - (data (i32.const 8352) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,\00") - (data (i32.const 8400) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002\00") - (data (i32.const 8432) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004\00") - (data (i32.const 8464) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00 \1d\00\00\e0 \00\00\00\00\00\00\00!\00\00") - (data (i32.const 8496) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004\00") - (data (i32.const 8528) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 8560) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04\00\00\00") - (data (i32.const 8592) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004\00") - (data (i32.const 8624) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") - (data (i32.const 8656) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") - (data (i32.const 8688) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 4848) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 4880) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 4912) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") + (data (i32.const 4944) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b\00") + (data (i32.const 4976) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b\00") + (data (i32.const 5008) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a\00") + (data (i32.const 5040) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 5056) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00@\13\00\00`\13\00\00@\13\00\00\80\13\00\00\a0\13\00\00\c0\13\00\00\00\00\00\00") + (data (i32.const 5104) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\c0\13\00\00@\13\00\00@\13\00\00\80\13\00\00`\13\00\00\a0\13\00\00\00\00\00\00") + (data (i32.const 5152) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 5184) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\00") + (data (i32.const 5216) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e\00") + (data (i32.const 5248) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e\00") + (data (i32.const 5280) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,\00") + (data (i32.const 5312) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") + (data (i32.const 5360) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 5392) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000\00") + (data (i32.const 5424) "\90\01\00\00\01\00\00\00\12\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") + (data (i32.const 5840) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003\00") + (data (i32.const 5872) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 5904) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-\00") + (data (i32.const 5936) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 5968) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_\00") + (data (i32.const 6000) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") + (data (i32.const 6064) "0\00\00\00\01\00\00\00\00\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 6128) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 \00") + (data (i32.const 6160) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000\00") + (data (i32.const 6192) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00") + (data (i32.const 6224) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 6272) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 6304) "\b8\02\00\00\01\00\00\00\13\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00") + (data (i32.const 7648) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 7664) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 7696) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 7728) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 7760) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002\00") + (data (i32.const 7792) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003\00") + (data (i32.const 7824) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff\00") + (data (i32.const 7856) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000\00") + (data (i32.const 7888) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff\00\00") + (data (i32.const 7920) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000\00") + (data (i32.const 7968) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\00\00\00\00") + (data (i32.const 8016) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000\00") + (data (i32.const 8080) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") + (data (i32.const 8128) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007\00") + (data (i32.const 8240) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\c0\13\00\00@\13\00\00@\13\00\00\80\13\00\00`\13\00\00\a0\13\00\00\00\00\00\00") + (data (i32.const 8288) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,\00") + (data (i32.const 8336) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002\00") + (data (i32.const 8368) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004\00") + (data (i32.const 8400) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\e0\1c\00\00\a0 \00\00\00\00\00\00\c0 \00\00") + (data (i32.const 8432) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004\00") + (data (i32.const 8464) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 8496) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04\00\00\00") + (data (i32.const 8528) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004\00") + (data (i32.const 8560) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") + (data (i32.const 8592) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") + (data (i32.const 8624) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") (table $0 57 funcref) (elem (i32.const 1) $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|4 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|18 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|30 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|34 $start:std/array~anonymous|35 $start:std/array~anonymous|36 $start:std/array~anonymous|37 $start:std/array~anonymous|38 $start:std/array~anonymous|39 $start:std/array~anonymous|40 $start:std/array~anonymous|41 $start:std/array~anonymous|42 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -238,11 +238,11 @@ (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/i64.MAX_VALUE i64 (i64.const 9223372036854775807)) (global $~started (mut i32) (i32.const 0)) - (global $~lib/heap/__heap_base i32 (i32.const 8708)) + (global $~lib/heap/__heap_base i32 (i32.const 8644)) (export "__setArgumentsLength" (func $~setArgumentsLength)) (export "_start" (func $~start)) (export "memory" (memory $0)) - (func $~lib/rt/tlsf/removeBlock (; 7 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 8 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -452,7 +452,7 @@ end end ) - (func $~lib/rt/tlsf/insertBlock (; 8 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/insertBlock (; 9 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -802,7 +802,7 @@ local.get $7 i32.store offset=4 ) - (func $~lib/rt/tlsf/addMemory (; 9 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/addMemory (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -950,7 +950,7 @@ call $~lib/rt/tlsf/insertBlock i32.const 1 ) - (func $~lib/rt/tlsf/maybeInitialize (; 10 ;) (result i32) + (func $~lib/rt/tlsf/maybeInitialize (; 11 ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -1100,7 +1100,7 @@ end local.get $0 ) - (func $~lib/rt/tlsf/prepareSize (; 11 ;) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/prepareSize (; 12 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -1129,7 +1129,7 @@ i32.gt_u select ) - (func $~lib/rt/tlsf/searchBlock (; 12 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/searchBlock (; 13 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1312,7 +1312,7 @@ end local.get $7 ) - (func $~lib/rt/tlsf/growMemory (; 13 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/growMemory (; 14 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1396,7 +1396,7 @@ call $~lib/rt/tlsf/addMemory drop ) - (func $~lib/rt/tlsf/prepareBlock (; 14 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/prepareBlock (; 15 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1491,7 +1491,7 @@ i32.store end ) - (func $~lib/rt/tlsf/allocateBlock (; 15 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/allocateBlock (; 16 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) global.get $~lib/rt/tlsf/collectLock @@ -1602,7 +1602,7 @@ call $~lib/rt/rtrace/onalloc local.get $4 ) - (func $~lib/rt/tlsf/__alloc (; 16 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/__alloc (; 17 ;) (param $0 i32) (param $1 i32) (result i32) call $~lib/rt/tlsf/maybeInitialize local.get $0 local.get $1 @@ -1610,7 +1610,7 @@ i32.const 16 i32.add ) - (func $~lib/memory/memory.fill (; 17 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.fill (; 18 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1874,7 +1874,7 @@ end end ) - (func $~lib/rt/pure/increment (; 18 ;) (param $0 i32) + (func $~lib/rt/pure/increment (; 19 ;) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -1919,7 +1919,7 @@ unreachable end ) - (func $~lib/rt/pure/__retain (; 19 ;) (param $0 i32) (result i32) + (func $~lib/rt/pure/__retain (; 20 ;) (param $0 i32) (result i32) local.get $0 global.get $~lib/heap/__heap_base i32.gt_u @@ -1931,7 +1931,7 @@ end local.get $0 ) - (func $~lib/rt/pure/__release (; 20 ;) (param $0 i32) + (func $~lib/rt/pure/__release (; 21 ;) (param $0 i32) local.get $0 global.get $~lib/heap/__heap_base i32.gt_u @@ -1942,7 +1942,7 @@ call $~lib/rt/pure/decrement end ) - (func $~lib/arraybuffer/ArrayBufferView#constructor (; 21 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 22 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2014,7 +2014,7 @@ i32.store offset=8 local.get $0 ) - (func $~lib/array/Array#constructor (; 22 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 23 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 if (result i32) local.get $0 @@ -2036,7 +2036,7 @@ i32.store offset=12 local.get $0 ) - (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 23 ;) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 24 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2054,7 +2054,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $std/array/Ref#constructor (; 24 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/Ref#constructor (; 25 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.eqz if @@ -2069,7 +2069,7 @@ i32.store local.get $0 ) - (func $~lib/array/Array.isArray (; 25 ;) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray (; 26 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2087,7 +2087,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/typedarray/Uint8Array#constructor (; 26 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#constructor (; 27 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 if (result i32) local.get $0 @@ -2103,7 +2103,7 @@ local.set $0 local.get $0 ) - (func $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> (; 27 ;) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> (; 28 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2121,10 +2121,10 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array.isArray (; 28 ;) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray (; 29 ;) (param $0 i32) (result i32) i32.const 0 ) - (func $~lib/array/Array.isArray<~lib/string/String> (; 29 ;) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/string/String> (; 30 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2142,7 +2142,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array.isArray<~lib/array/Array> (; 30 ;) (param $0 i32) (result i32) + (func $~lib/array/Array.isArray<~lib/array/Array> (; 31 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2160,7 +2160,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/util/memory/memcpy (; 31 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3184,7 +3184,7 @@ i32.store8 end ) - (func $~lib/memory/memory.copy (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 33 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3404,7 +3404,7 @@ end end ) - (func $~lib/rt/__allocBuffer (; 33 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/__allocBuffer (; 34 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 local.get $1 @@ -3419,7 +3419,7 @@ end local.get $3 ) - (func $~lib/rt/__allocArray (; 34 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/__allocArray (; 35 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3451,7 +3451,7 @@ i32.store offset=12 local.get $4 ) - (func $~lib/array/Array#fill (; 35 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#fill (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3528,11 +3528,11 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#get:length (; 36 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 37 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 37 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 38 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -3541,7 +3541,7 @@ i32.add i32.load8_u ) - (func $~lib/array/Array#__get (; 38 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 39 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -3561,7 +3561,7 @@ local.set $2 local.get $2 ) - (func $std/array/isArraysEqual (; 39 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 40 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3646,7 +3646,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#fill (; 40 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#fill (; 41 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3731,11 +3731,11 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#get:length (; 41 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 42 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 42 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 43 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -3744,7 +3744,7 @@ i32.add i32.load ) - (func $~lib/array/Array#__get (; 43 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 44 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -3764,7 +3764,7 @@ local.set $2 local.get $2 ) - (func $std/array/isArraysEqual (; 44 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 45 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3849,17 +3849,17 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#get:length (; 45 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 46 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 46 ;) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 47 ;) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub i32.load offset=12 ) - (func $std/array/internalCapacity (; 47 ;) (param $0 i32) (result i32) + (func $std/array/internalCapacity (; 48 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -3880,7 +3880,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/rt/tlsf/checkUsedBlock (; 48 ;) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/checkUsedBlock (; 49 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 16 @@ -3926,7 +3926,7 @@ end local.get $1 ) - (func $~lib/rt/tlsf/freeBlock (; 49 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/tlsf/freeBlock (; 50 ;) (param $0 i32) (param $1 i32) (local $2 i32) local.get $1 i32.load @@ -3942,7 +3942,7 @@ local.get $1 call $~lib/rt/rtrace/onfree ) - (func $~lib/rt/tlsf/reallocateBlock (; 50 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/reallocateBlock (; 51 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4061,7 +4061,7 @@ end local.get $8 ) - (func $~lib/rt/tlsf/__realloc (; 51 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/__realloc (; 52 ;) (param $0 i32) (param $1 i32) (result i32) call $~lib/rt/tlsf/maybeInitialize local.get $0 call $~lib/rt/tlsf/checkUsedBlock @@ -4070,7 +4070,7 @@ i32.const 16 i32.add ) - (func $~lib/array/ensureSize (; 52 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/ensureSize (; 53 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4132,7 +4132,7 @@ i32.store offset=8 end ) - (func $~lib/array/Array#push (; 53 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#push (; 54 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4159,7 +4159,7 @@ i32.store offset=12 local.get $3 ) - (func $~lib/array/Array#__unchecked_get (; 54 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 55 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -4168,7 +4168,7 @@ i32.add i32.load ) - (func $~lib/array/Array#__get (; 55 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 56 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -4188,7 +4188,7 @@ local.set $2 local.get $2 ) - (func $~lib/array/Array#pop (; 56 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#pop (; 57 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -4221,7 +4221,7 @@ i32.store offset=12 local.get $2 ) - (func $~lib/array/Array#set:length (; 57 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#set:length (; 58 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4273,11 +4273,11 @@ local.get $1 i32.store offset=12 ) - (func $~lib/array/Array#get:length (; 58 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 59 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#concat (; 59 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#concat (; 60 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4350,7 +4350,7 @@ call $~lib/rt/pure/__release local.get $8 ) - (func $~lib/array/Array#copyWithin (; 60 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#copyWithin (; 61 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -4479,7 +4479,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $std/array/isArraysEqual (; 61 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 62 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4564,7 +4564,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#unshift (; 62 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#unshift (; 63 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4597,7 +4597,7 @@ i32.store offset=12 local.get $2 ) - (func $~lib/array/Array#shift (; 63 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#shift (; 64 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4646,7 +4646,7 @@ i32.store offset=12 local.get $3 ) - (func $~lib/array/Array#reverse (; 64 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#reverse (; 65 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4701,7 +4701,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#indexOf (; 65 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#indexOf (; 66 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4770,7 +4770,7 @@ end i32.const -1 ) - (func $~lib/array/Array#indexOf (; 66 ;) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/array/Array#indexOf (; 67 ;) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4839,7 +4839,7 @@ end i32.const -1 ) - (func $~lib/array/Array#indexOf (; 67 ;) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/array/Array#indexOf (; 68 ;) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4908,7 +4908,7 @@ end i32.const -1 ) - (func $~lib/array/Array#includes (; 68 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 69 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 local.get $2 @@ -4917,7 +4917,7 @@ i32.ge_s return ) - (func $~lib/array/Array#includes (; 69 ;) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 70 ;) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5000,7 +5000,7 @@ i32.const 0 return ) - (func $~lib/array/Array#includes (; 70 ;) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 71 ;) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5083,7 +5083,7 @@ i32.const 0 return ) - (func $~lib/array/Array#splice (; 71 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#splice (; 72 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5191,7 +5191,7 @@ i32.store offset=12 local.get $6 ) - (func $~lib/array/Array#splice (; 72 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#splice (; 73 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5299,7 +5299,7 @@ i32.store offset=12 local.get $6 ) - (func $~lib/array/Array#__unchecked_get (; 73 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 74 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -5309,7 +5309,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#__get (; 74 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 75 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -5341,7 +5341,7 @@ end local.get $2 ) - (func $~lib/array/Array#splice (; 75 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#splice (; 76 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5449,11 +5449,11 @@ i32.store offset=12 local.get $6 ) - (func $~lib/array/Array#get:length (; 76 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 77 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 77 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 78 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -5463,7 +5463,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#__get (; 78 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 79 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -5483,7 +5483,7 @@ local.set $2 local.get $2 ) - (func $~lib/array/Array#__unchecked_set (; 79 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__unchecked_set (; 80 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 i32.load offset=4 local.get $1 @@ -5493,7 +5493,7 @@ local.get $2 i32.store ) - (func $~lib/array/Array#__set (; 80 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 81 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=12 @@ -5527,7 +5527,7 @@ local.get $2 call $~lib/array/Array#__unchecked_set ) - (func $start:std/array~anonymous|0 (; 81 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|0 (; 82 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5540,11 +5540,11 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~setArgumentsLength (; 82 ;) (param $0 i32) + (func $~setArgumentsLength (; 83 ;) (param $0 i32) local.get $0 global.set $~argumentsLength ) - (func $~lib/array/Array#findIndex (; 83 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#findIndex (; 84 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5595,7 +5595,7 @@ end i32.const -1 ) - (func $start:std/array~anonymous|1 (; 84 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|1 (; 85 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5608,7 +5608,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|2 (; 85 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|2 (; 86 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5621,7 +5621,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|3 (; 86 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|3 (; 87 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5638,7 +5638,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|4 (; 87 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|4 (; 88 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5651,7 +5651,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|5 (; 88 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|5 (; 89 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5667,7 +5667,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|6 (; 89 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|6 (; 90 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5680,7 +5680,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#every (; 90 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#every (; 91 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5732,7 +5732,7 @@ end i32.const 1 ) - (func $start:std/array~anonymous|7 (; 91 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|7 (; 92 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5745,7 +5745,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|8 (; 92 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|8 (; 93 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5762,7 +5762,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|9 (; 93 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|9 (; 94 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5775,7 +5775,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|10 (; 94 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|10 (; 95 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5791,7 +5791,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|11 (; 95 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|11 (; 96 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5804,7 +5804,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#some (; 96 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#some (; 97 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5855,7 +5855,7 @@ end i32.const 0 ) - (func $start:std/array~anonymous|12 (; 97 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|12 (; 98 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5868,7 +5868,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|13 (; 98 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|13 (; 99 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5885,7 +5885,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|14 (; 99 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|14 (; 100 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5898,7 +5898,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|15 (; 100 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|15 (; 101 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -5914,7 +5914,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|16 (; 101 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|16 (; 102 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain local.set $2 @@ -5925,7 +5925,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/array/Array#forEach (; 102 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#forEach (; 103 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5971,7 +5971,7 @@ end end ) - (func $start:std/array~anonymous|17 (; 103 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|17 (; 104 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain local.set $2 @@ -5986,7 +5986,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|18 (; 104 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|18 (; 105 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain local.set $2 @@ -5997,7 +5997,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|19 (; 105 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|19 (; 106 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain local.set $2 @@ -6011,7 +6011,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|20 (; 106 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|20 (; 107 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) local.get $2 @@ -6124,7 +6124,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|21 (; 107 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start:std/array~anonymous|21 (; 108 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) (local $3 f32) local.get $2 call $~lib/rt/pure/__retain @@ -6136,7 +6136,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#map (; 108 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 109 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6204,11 +6204,11 @@ end local.get $3 ) - (func $~lib/array/Array#get:length (; 109 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 110 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 110 ;) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__unchecked_get (; 111 ;) (param $0 i32) (param $1 i32) (result f32) local.get $0 i32.load offset=4 local.get $1 @@ -6217,7 +6217,7 @@ i32.add f32.load ) - (func $~lib/array/Array#__get (; 111 ;) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__get (; 112 ;) (param $0 i32) (param $1 i32) (result f32) (local $2 f32) local.get $1 local.get $0 @@ -6237,7 +6237,7 @@ local.set $2 local.get $2 ) - (func $start:std/array~anonymous|22 (; 112 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|22 (; 113 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6256,7 +6256,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#map (; 113 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 114 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6323,7 +6323,7 @@ end local.get $3 ) - (func $start:std/array~anonymous|23 (; 114 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|23 (; 115 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6338,7 +6338,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|24 (; 115 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|24 (; 116 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6356,7 +6356,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|25 (; 116 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|25 (; 117 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6369,7 +6369,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array#filter (; 117 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 118 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6432,7 +6432,7 @@ end local.get $2 ) - (func $start:std/array~anonymous|26 (; 118 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|26 (; 119 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6453,7 +6453,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|27 (; 119 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|27 (; 120 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6470,7 +6470,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|28 (; 120 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|28 (; 121 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6490,7 +6490,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $start:std/array~anonymous|29 (; 121 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|29 (; 122 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6503,7 +6503,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#reduce (; 122 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 123 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6555,7 +6555,7 @@ end local.get $3 ) - (func $start:std/array~anonymous|30 (; 123 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|30 (; 124 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6568,7 +6568,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|31 (; 124 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|31 (; 125 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6586,7 +6586,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#reduce (; 125 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 126 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6638,7 +6638,7 @@ end local.get $3 ) - (func $start:std/array~anonymous|32 (; 126 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|32 (; 127 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6656,7 +6656,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|33 (; 127 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|33 (; 128 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6673,7 +6673,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|34 (; 128 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|34 (; 129 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6686,7 +6686,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|35 (; 129 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|35 (; 130 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6702,7 +6702,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|36 (; 130 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|36 (; 131 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6715,7 +6715,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#reduceRight (; 131 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 132 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6757,7 +6757,7 @@ end local.get $3 ) - (func $start:std/array~anonymous|37 (; 132 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|37 (; 133 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6770,7 +6770,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|38 (; 133 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|38 (; 134 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6788,7 +6788,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#reduceRight (; 134 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 135 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6830,7 +6830,7 @@ end local.get $3 ) - (func $start:std/array~anonymous|39 (; 135 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|39 (; 136 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6848,7 +6848,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|40 (; 136 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|40 (; 137 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6865,7 +6865,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|41 (; 137 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|41 (; 138 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6878,7 +6878,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $start:std/array~anonymous|42 (; 138 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|42 (; 139 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) local.get $3 call $~lib/rt/pure/__retain @@ -6894,7 +6894,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/math/murmurHash3 (; 139 ;) (param $0 i64) (result i64) + (func $~lib/math/murmurHash3 (; 140 ;) (param $0 i64) (result i64) local.get $0 local.get $0 i64.const 33 @@ -6923,7 +6923,7 @@ local.set $0 local.get $0 ) - (func $~lib/math/splitMix32 (; 140 ;) (param $0 i32) (result i32) + (func $~lib/math/splitMix32 (; 141 ;) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -6958,7 +6958,7 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 141 ;) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 142 ;) (param $0 i64) i32.const 1 global.set $~lib/math/random_seeded local.get $0 @@ -7010,7 +7010,7 @@ unreachable end ) - (func $~lib/util/sort/insertionSort (; 142 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 143 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f32) @@ -7100,13 +7100,13 @@ end end ) - (func $~lib/rt/tlsf/__free (; 143 ;) (param $0 i32) + (func $~lib/rt/tlsf/__free (; 144 ;) (param $0 i32) call $~lib/rt/tlsf/maybeInitialize local.get $0 call $~lib/rt/tlsf/checkUsedBlock call $~lib/rt/tlsf/freeBlock ) - (func $~lib/util/sort/weakHeapSort (; 144 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 145 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -7395,7 +7395,7 @@ local.get $12 f32.store ) - (func $~lib/array/Array#sort (; 145 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 146 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f32) @@ -7470,7 +7470,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 146 ;) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 147 ;) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -7503,7 +7503,7 @@ i32.lt_s i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 147 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 148 ;) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -7522,7 +7522,7 @@ local.get $1 call $~lib/array/Array#sort ) - (func $std/array/isArraysEqual (; 148 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 149 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 f32) @@ -7629,7 +7629,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/util/sort/insertionSort (; 149 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 150 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) @@ -7719,7 +7719,7 @@ end end ) - (func $~lib/util/sort/weakHeapSort (; 150 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 151 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8008,7 +8008,7 @@ local.get $12 f64.store ) - (func $~lib/array/Array#sort (; 151 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 152 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f64) @@ -8083,7 +8083,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 152 ;) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 153 ;) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 @@ -8116,7 +8116,7 @@ i64.lt_s i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 153 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 154 ;) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -8135,11 +8135,11 @@ local.get $1 call $~lib/array/Array#sort ) - (func $~lib/array/Array#get:length (; 154 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#get:length (; 155 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 155 ;) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__unchecked_get (; 156 ;) (param $0 i32) (param $1 i32) (result f64) local.get $0 i32.load offset=4 local.get $1 @@ -8148,7 +8148,7 @@ i32.add f64.load ) - (func $~lib/array/Array#__get (; 156 ;) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__get (; 157 ;) (param $0 i32) (param $1 i32) (result f64) (local $2 f64) local.get $1 local.get $0 @@ -8168,7 +8168,7 @@ local.set $2 local.get $2 ) - (func $std/array/isArraysEqual (; 157 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 158 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 f64) @@ -8275,7 +8275,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/util/sort/insertionSort (; 158 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 159 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8365,7 +8365,7 @@ end end ) - (func $~lib/util/sort/weakHeapSort (; 159 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 160 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8654,7 +8654,7 @@ local.get $12 i32.store ) - (func $~lib/array/Array#sort (; 160 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 161 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8727,12 +8727,12 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 161 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 162 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 162 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 163 ;) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -8751,7 +8751,7 @@ local.get $1 call $~lib/array/Array#sort ) - (func $~lib/util/sort/insertionSort (; 163 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 164 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -8841,7 +8841,7 @@ end end ) - (func $~lib/util/sort/weakHeapSort (; 164 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 165 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -9130,7 +9130,7 @@ local.get $12 i32.store ) - (func $~lib/array/Array#sort (; 165 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 166 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9203,7 +9203,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 166 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 167 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.gt_u @@ -9212,7 +9212,7 @@ i32.lt_u i32.sub ) - (func $~lib/array/Array#sort|trampoline (; 167 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline (; 168 ;) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -9231,7 +9231,7 @@ local.get $1 call $~lib/array/Array#sort ) - (func $std/array/createReverseOrderedArray (; 168 ;) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedArray (; 169 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9265,19 +9265,16 @@ end local.get $1 ) - (func $~lib/math/NativeMath.random (; 169 ;) (result f64) + (func $~lib/math/NativeMath.random (; 170 ;) (result f64) (local $0 i64) (local $1 i64) (local $2 i64) global.get $~lib/math/random_seeded i32.eqz if - i32.const 4864 - i32.const 4032 - i32.const 1413 - i32.const 24 - call $~lib/builtins/abort - unreachable + call $~lib/builtins/seed + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom end global.get $~lib/math/random_state0_64 local.set $0 @@ -9320,7 +9317,7 @@ f64.const 1 f64.sub ) - (func $std/array/createRandomOrderedArray (; 170 ;) (param $0 i32) (result i32) + (func $std/array/createRandomOrderedArray (; 171 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9354,12 +9351,12 @@ end local.get $1 ) - (func $~lib/util/sort/COMPARATOR~anonymous|1 (; 171 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|1 (; 172 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $std/array/isSorted (; 172 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted (; 173 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9414,7 +9411,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $std/array/assertSorted (; 173 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 174 ;) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -9439,7 +9436,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/array/assertSortedDefault (; 174 ;) (param $0 i32) + (func $std/array/assertSortedDefault (; 175 ;) (param $0 i32) local.get $0 call $~lib/rt/pure/__retain local.set $0 @@ -9452,27 +9449,27 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|43 (; 175 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|43 (; 176 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $start:std/array~anonymous|44 (; 176 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|44 (; 177 ;) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.sub ) - (func $start:std/array~anonymous|45 (; 177 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|45 (; 178 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $start:std/array~anonymous|46 (; 178 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|46 (; 179 ;) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.sub ) - (func $~lib/array/Array<~lib/array/Array>#constructor (; 179 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#constructor (; 180 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 if (result i32) local.get $0 @@ -9494,7 +9491,7 @@ i32.store offset=12 local.get $0 ) - (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 180 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 181 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) local.get $2 @@ -9524,7 +9521,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/array/Array<~lib/array/Array>#__set (; 181 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/array/Array>#__set (; 182 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain local.set $2 @@ -9565,7 +9562,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/array/createReverseOrderedNestedArray (; 182 ;) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedNestedArray (; 183 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9610,7 +9607,7 @@ end local.get $1 ) - (func $start:std/array~anonymous|47 (; 183 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|47 (; 184 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -9632,7 +9629,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 184 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 185 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -9730,7 +9727,7 @@ end end ) - (func $~lib/array/Array<~lib/array/Array>#sort (; 185 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#sort (; 186 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9801,11 +9798,11 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/array/Array>#get:length (; 186 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#get:length (; 187 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 187 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 188 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -9815,7 +9812,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/array/Array>#__get (; 188 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__get (; 189 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -9847,7 +9844,7 @@ end local.get $2 ) - (func $std/array/isSorted<~lib/array/Array> (; 189 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/array/Array> (; 190 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9914,7 +9911,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $std/array/assertSorted<~lib/array/Array> (; 190 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/array/Array> (; 191 ;) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -9939,7 +9936,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/array/Array>#constructor (; 191 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#constructor (; 192 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 if (result i32) local.get $0 @@ -9961,7 +9958,7 @@ i32.store offset=12 local.get $0 ) - (func $std/array/Proxy#constructor (; 192 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/Proxy#constructor (; 193 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.eqz if @@ -9976,7 +9973,7 @@ i32.store local.get $0 ) - (func $~lib/array/Array>#__unchecked_set (; 193 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array>#__unchecked_set (; 194 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) local.get $2 @@ -10006,7 +10003,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/array/Array>#__set (; 194 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array>#__set (; 195 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain local.set $2 @@ -10047,7 +10044,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/array/createReverseOrderedElementsArray (; 195 ;) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedElementsArray (; 196 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10087,7 +10084,7 @@ end local.get $1 ) - (func $start:std/array~anonymous|48 (; 196 ;) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|48 (; 197 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -10107,7 +10104,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/util/sort/insertionSort> (; 197 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort> (; 198 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -10205,7 +10202,7 @@ end end ) - (func $~lib/array/Array>#sort (; 198 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#sort (; 199 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10276,11 +10273,11 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array>#get:length (; 199 ;) (param $0 i32) (result i32) + (func $~lib/array/Array>#get:length (; 200 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array>#__unchecked_get (; 200 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#__unchecked_get (; 201 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -10290,7 +10287,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array>#__get (; 201 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#__get (; 202 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -10322,7 +10319,7 @@ end local.get $2 ) - (func $std/array/isSorted> (; 202 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted> (; 203 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10389,7 +10386,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $std/array/assertSorted> (; 203 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted> (; 204 ;) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -10414,7 +10411,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/util/sort/insertionSort<~lib/string/String | null> (; 204 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort<~lib/string/String | null> (; 205 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -10512,7 +10509,7 @@ end end ) - (func $~lib/array/Array<~lib/string/String | null>#sort (; 205 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#sort (; 206 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10583,11 +10580,11 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/string/String | null>#get:length (; 206 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#get:length (; 207 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/string/String | null>#__unchecked_get (; 207 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#__unchecked_get (; 208 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -10597,7 +10594,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/string/String | null>#__get (; 208 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#__get (; 209 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -10617,7 +10614,7 @@ local.set $2 local.get $2 ) - (func $std/array/isSorted<~lib/string/String | null> (; 209 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/string/String | null> (; 210 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10684,7 +10681,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $std/array/assertSorted<~lib/string/String | null> (; 210 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String | null> (; 211 ;) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -10709,7 +10706,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/string/String#get:length (; 211 ;) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 212 ;) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub @@ -10717,7 +10714,7 @@ i32.const 1 i32.shr_u ) - (func $~lib/util/string/compareImpl (; 212 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 213 ;) (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) @@ -10839,7 +10836,7 @@ call $~lib/rt/pure/__release local.get $7 ) - (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 213 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 214 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10945,7 +10942,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/array/assertSorted<~lib/string/String | null>|trampoline (; 214 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String | null>|trampoline (; 215 ;) (param $0 i32) (param $1 i32) block $1of1 block $0of1 block $outOfRange @@ -10966,7 +10963,7 @@ local.get $1 call $std/array/assertSorted<~lib/string/String | null> ) - (func $~lib/string/String.__eq (; 215 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 216 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -11039,7 +11036,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__ne (; 216 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 217 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -11058,7 +11055,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/array/isArraysEqual<~lib/string/String | null> (; 217 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual<~lib/string/String | null> (; 218 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -11155,7 +11152,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array<~lib/string/String>#constructor (; 218 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#constructor (; 219 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 if (result i32) local.get $0 @@ -11177,14 +11174,14 @@ i32.store offset=12 local.get $0 ) - (func $~lib/string/String#charAt (; 219 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#charAt (; 220 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 call $~lib/string/String#get:length i32.ge_u if - i32.const 5120 + i32.const 5056 call $~lib/rt/pure/__retain return end @@ -11203,7 +11200,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/string/String#concat (; 220 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 221 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11217,7 +11214,7 @@ i32.const 0 i32.eq if - i32.const 5232 + i32.const 5168 local.tee $2 local.get $1 local.tee $3 @@ -11250,7 +11247,7 @@ i32.const 0 i32.eq if - i32.const 5120 + i32.const 5056 call $~lib/rt/pure/__retain local.set $2 local.get $1 @@ -11279,7 +11276,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__concat (; 221 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 222 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -11288,7 +11285,7 @@ call $~lib/rt/pure/__retain local.set $1 local.get $0 - i32.const 5232 + i32.const 5168 local.get $0 i32.const 0 i32.ne @@ -11302,7 +11299,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/array/createRandomString (; 222 ;) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 223 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11311,7 +11308,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) - i32.const 5120 + i32.const 5056 local.set $1 i32.const 0 local.set $2 @@ -11363,7 +11360,7 @@ end local.get $1 ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 223 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 224 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) local.get $2 @@ -11393,7 +11390,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/array/Array<~lib/string/String>#__set (; 224 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/string/String>#__set (; 225 ;) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain local.set $2 @@ -11434,7 +11431,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/array/createRandomStringArray (; 225 ;) (param $0 i32) (result i32) + (func $std/array/createRandomStringArray (; 226 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11472,7 +11469,7 @@ end local.get $1 ) - (func $~lib/util/sort/insertionSort<~lib/string/String> (; 226 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort<~lib/string/String> (; 227 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -11570,7 +11567,7 @@ end end ) - (func $~lib/array/Array<~lib/string/String>#sort (; 227 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#sort (; 228 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11641,11 +11638,11 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/string/String>#get:length (; 228 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#get:length (; 229 ;) (param $0 i32) (result i32) local.get $0 i32.load offset=12 ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 229 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 230 ;) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -11655,7 +11652,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/string/String>#__get (; 230 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__get (; 231 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 local.get $0 @@ -11687,7 +11684,7 @@ end local.get $2 ) - (func $std/array/isSorted<~lib/string/String> (; 231 ;) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/string/String> (; 232 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11754,7 +11751,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $std/array/assertSorted<~lib/string/String> (; 232 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String> (; 233 ;) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -11779,7 +11776,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 233 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 234 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11885,7 +11882,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/array/assertSorted<~lib/string/String>|trampoline (; 234 ;) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String>|trampoline (; 235 ;) (param $0 i32) (param $1 i32) block $1of1 block $0of1 block $outOfRange @@ -11906,7 +11903,7 @@ local.get $1 call $std/array/assertSorted<~lib/string/String> ) - (func $~lib/string/String#substring (; 235 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#substring (; 236 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -11980,7 +11977,7 @@ local.get $10 i32.eqz if - i32.const 5120 + i32.const 5056 call $~lib/rt/pure/__retain return end @@ -12013,7 +12010,7 @@ local.get $11 call $~lib/rt/pure/__retain ) - (func $~lib/util/string/joinBooleanArray (; 236 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinBooleanArray (; 237 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12035,7 +12032,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -12045,8 +12042,8 @@ local.get $3 i32.eqz if - i32.const 5296 - i32.const 5328 + i32.const 5232 + i32.const 5264 local.get $0 i32.load8_u select @@ -12103,8 +12100,8 @@ i32.const 1 i32.shl i32.add - i32.const 5296 - i32.const 5328 + i32.const 5232 + i32.const 5264 local.get $10 select local.get $6 @@ -12154,8 +12151,8 @@ i32.const 1 i32.shl i32.add - i32.const 5296 - i32.const 5328 + i32.const 5232 + i32.const 5264 local.get $10 select local.get $6 @@ -12188,7 +12185,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 237 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 238 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -12211,7 +12208,7 @@ local.get $4 return ) - (func $~lib/util/number/decimalCount32 (; 238 ;) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 239 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 100000 @@ -12277,7 +12274,7 @@ end unreachable ) - (func $~lib/util/number/utoa32_lut (; 239 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa32_lut (; 240 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12312,14 +12309,14 @@ i32.const 100 i32.rem_u local.set $7 - i32.const 5504 + i32.const 5440 local.get $6 i32.const 2 i32.shl i32.add i64.load32_u local.set $8 - i32.const 5504 + i32.const 5440 local.get $7 i32.const 2 i32.shl @@ -12362,7 +12359,7 @@ i32.const 2 i32.sub local.set $2 - i32.const 5504 + i32.const 5440 local.get $10 i32.const 2 i32.shl @@ -12385,7 +12382,7 @@ i32.const 2 i32.sub local.set $2 - i32.const 5504 + i32.const 5440 local.get $1 i32.const 2 i32.shl @@ -12417,7 +12414,7 @@ i32.store16 end ) - (func $~lib/util/number/itoa32 (; 240 ;) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 241 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12427,7 +12424,7 @@ local.get $0 i32.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -12471,12 +12468,12 @@ local.get $3 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa (; 241 ;) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 242 ;) (param $0 i32) (result i32) local.get $0 call $~lib/util/number/itoa32 return ) - (func $~lib/util/number/itoa_stream (; 242 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 243 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12533,7 +12530,7 @@ end local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 243 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 244 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12553,7 +12550,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -12676,7 +12673,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 244 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 245 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -12699,7 +12696,7 @@ local.get $4 return ) - (func $~lib/util/number/utoa32 (; 245 ;) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 246 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12708,7 +12705,7 @@ local.get $0 i32.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -12733,12 +12730,12 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa (; 246 ;) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 247 ;) (param $0 i32) (result i32) local.get $0 call $~lib/util/number/utoa32 return ) - (func $~lib/util/number/itoa_stream (; 247 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 248 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12775,7 +12772,7 @@ call $~lib/util/number/utoa32_lut local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 248 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 249 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -12795,7 +12792,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -12918,7 +12915,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 249 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 250 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -12941,7 +12938,7 @@ local.get $4 return ) - (func $~lib/util/number/genDigits (; 250 ;) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 251 ;) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i64) (local $9 i64) @@ -13210,7 +13207,7 @@ local.set $23 local.get $19 local.set $22 - i32.const 7296 + i32.const 7232 local.get $14 i32.const 2 i32.shl @@ -13351,7 +13348,7 @@ i32.add global.set $~lib/util/number/_K local.get $10 - i32.const 7296 + i32.const 7232 i32.const 0 local.get $14 i32.sub @@ -13444,7 +13441,7 @@ end unreachable ) - (func $~lib/util/number/prettify (; 251 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 252 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -13761,7 +13758,7 @@ end unreachable ) - (func $~lib/util/number/dtoa_core (; 252 ;) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 253 ;) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -13926,14 +13923,14 @@ i32.shl i32.sub global.set $~lib/util/number/_K - i32.const 6384 + i32.const 6320 local.get $14 i32.const 3 i32.shl i32.add i64.load global.set $~lib/util/number/_frc_pow - i32.const 7104 + i32.const 7040 local.get $14 i32.const 1 i32.shl @@ -14189,7 +14186,7 @@ local.get $2 i32.add ) - (func $~lib/util/number/dtoa (; 253 ;) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 254 ;) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -14197,7 +14194,7 @@ f64.const 0 f64.eq if - i32.const 6240 + i32.const 6176 return end local.get $0 @@ -14211,11 +14208,11 @@ local.get $0 f64.ne if - i32.const 6272 + i32.const 6208 return end - i32.const 6304 - i32.const 6352 + i32.const 6240 + i32.const 6288 local.get $0 f64.const 0 f64.lt @@ -14250,7 +14247,7 @@ call $~lib/rt/tlsf/__free local.get $3 ) - (func $~lib/util/number/dtoa_stream (; 254 ;) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) + (func $~lib/util/number/dtoa_stream (; 255 ;) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -14307,8 +14304,8 @@ i32.add local.set $4 local.get $0 - i32.const 6304 - i32.const 6352 + i32.const 6240 + i32.const 6288 local.get $3 select local.get $4 @@ -14324,7 +14321,7 @@ local.get $2 call $~lib/util/number/dtoa_core ) - (func $~lib/util/string/joinFloatArray (; 255 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinFloatArray (; 256 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -14344,7 +14341,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -14467,7 +14464,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 256 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 257 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -14490,7 +14487,7 @@ local.get $4 return ) - (func $~lib/util/string/joinStringArray (; 257 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinStringArray (; 258 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -14512,7 +14509,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -14529,7 +14526,7 @@ local.get $4 call $~lib/rt/pure/__retain else - i32.const 5120 + i32.const 5056 end local.set $4 local.get $2 @@ -14719,7 +14716,7 @@ call $~lib/rt/pure/__release local.get $8 ) - (func $~lib/array/Array<~lib/string/String | null>#join (; 258 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#join (; 259 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -14742,10 +14739,10 @@ local.get $4 return ) - (func $std/array/Ref#toString (; 259 ;) (param $0 i32) (result i32) - i32.const 7520 + (func $std/array/Ref#toString (; 260 ;) (param $0 i32) (result i32) + i32.const 7456 ) - (func $~lib/util/string/joinReferenceArray (; 260 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinReferenceArray (; 261 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -14767,7 +14764,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -14801,7 +14798,7 @@ local.get $5 call $std/array/Ref#toString else - i32.const 5120 + i32.const 5056 end local.set $4 local.get $2 @@ -14811,7 +14808,7 @@ local.get $4 return end - i32.const 5120 + i32.const 5056 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -14956,7 +14953,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 261 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 262 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -14979,7 +14976,7 @@ local.get $4 return ) - (func $~lib/util/string/joinReferenceArray (; 262 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinReferenceArray (; 263 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -15001,7 +14998,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -15035,7 +15032,7 @@ local.get $5 call $std/array/Ref#toString else - i32.const 5120 + i32.const 5056 end local.set $4 local.get $2 @@ -15045,7 +15042,7 @@ local.get $4 return end - i32.const 5120 + i32.const 5056 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -15190,7 +15187,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 263 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 264 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -15213,12 +15210,12 @@ local.get $4 return ) - (func $~lib/array/Array#toString (; 264 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 265 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa (; 265 ;) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 266 ;) (param $0 i32) (result i32) local.get $0 i32.const 24 i32.shl @@ -15227,7 +15224,7 @@ call $~lib/util/number/itoa32 return ) - (func $~lib/util/number/itoa_stream (; 266 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 267 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -15300,7 +15297,7 @@ end local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 267 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 268 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -15320,7 +15317,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -15443,7 +15440,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 268 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 269 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -15466,19 +15463,19 @@ local.get $4 return ) - (func $~lib/array/Array#toString (; 269 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 270 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa (; 270 ;) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 271 ;) (param $0 i32) (result i32) local.get $0 i32.const 65535 i32.and call $~lib/util/number/utoa32 return ) - (func $~lib/util/number/itoa_stream (; 271 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 272 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -15521,7 +15518,7 @@ call $~lib/util/number/utoa32_lut local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 272 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 273 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -15541,7 +15538,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -15664,7 +15661,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 273 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 274 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -15687,12 +15684,12 @@ local.get $4 return ) - (func $~lib/array/Array#toString (; 274 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 275 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/number/decimalCount64 (; 275 ;) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 276 ;) (param $0 i64) (result i32) (local $1 i32) local.get $0 i64.const 1000000000000000 @@ -15765,7 +15762,7 @@ end unreachable ) - (func $~lib/util/number/utoa64_lut (; 276 ;) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/util/number/utoa64_lut (; 277 ;) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) (local $4 i64) (local $5 i32) @@ -15821,14 +15818,14 @@ i32.const 100 i32.rem_u local.set $11 - i32.const 5504 + i32.const 5440 local.get $10 i32.const 2 i32.shl i32.add i64.load32_u local.set $12 - i32.const 5504 + i32.const 5440 local.get $11 i32.const 2 i32.shl @@ -15850,14 +15847,14 @@ i64.shl i64.or i64.store - i32.const 5504 + i32.const 5440 local.get $8 i32.const 2 i32.shl i32.add i64.load32_u local.set $12 - i32.const 5504 + i32.const 5440 local.get $9 i32.const 2 i32.shl @@ -15888,7 +15885,7 @@ local.get $2 call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 277 ;) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 278 ;) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -15901,7 +15898,7 @@ i64.ne i32.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -15954,12 +15951,12 @@ local.get $1 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa (; 278 ;) (param $0 i64) (result i32) + (func $~lib/util/number/itoa (; 279 ;) (param $0 i64) (result i32) local.get $0 call $~lib/util/number/utoa64 return ) - (func $~lib/util/number/itoa_stream (; 279 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 280 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16022,7 +16019,7 @@ end local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 280 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 281 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16042,7 +16039,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -16165,7 +16162,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 281 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 282 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -16188,12 +16185,12 @@ local.get $4 return ) - (func $~lib/array/Array#toString (; 282 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 283 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa64 (; 283 ;) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 284 ;) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -16207,7 +16204,7 @@ i64.ne i32.eqz if - i32.const 5472 + i32.const 5408 return end local.get $0 @@ -16281,12 +16278,12 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa (; 284 ;) (param $0 i64) (result i32) + (func $~lib/util/number/itoa (; 285 ;) (param $0 i64) (result i32) local.get $0 call $~lib/util/number/itoa64 return ) - (func $~lib/util/number/itoa_stream (; 285 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 286 ;) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16371,7 +16368,7 @@ end local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 286 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 287 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16391,7 +16388,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -16514,7 +16511,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 287 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 288 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -16537,17 +16534,17 @@ local.get $4 return ) - (func $~lib/array/Array#toString (; 288 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 289 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/array/Array<~lib/string/String | null>#toString (; 289 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#toString (; 290 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array<~lib/string/String | null>#join ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 290 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 291 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16569,7 +16566,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -16603,7 +16600,7 @@ local.get $5 call $~lib/array/Array#toString else - i32.const 5120 + i32.const 5056 end local.set $4 local.get $2 @@ -16613,7 +16610,7 @@ local.get $4 return end - i32.const 5120 + i32.const 5056 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -16758,7 +16755,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 291 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 292 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -16781,19 +16778,19 @@ local.get $4 return ) - (func $~lib/array/Array<~lib/array/Array>#toString (; 292 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#toString (; 293 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array<~lib/array/Array>#join ) - (func $~lib/util/number/itoa (; 293 ;) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 294 ;) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and call $~lib/util/number/utoa32 return ) - (func $~lib/util/number/itoa_stream (; 294 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 295 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16836,7 +16833,7 @@ call $~lib/util/number/utoa32_lut local.get $3 ) - (func $~lib/util/string/joinIntegerArray (; 295 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinIntegerArray (; 296 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16856,7 +16853,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -16979,7 +16976,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array#join (; 296 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 297 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -17002,12 +16999,12 @@ local.get $4 return ) - (func $~lib/array/Array#toString (; 297 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 298 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 298 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 299 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -17029,7 +17026,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -17063,7 +17060,7 @@ local.get $5 call $~lib/array/Array#toString else - i32.const 5120 + i32.const 5056 end local.set $4 local.get $2 @@ -17073,7 +17070,7 @@ local.get $4 return end - i32.const 5120 + i32.const 5056 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -17218,7 +17215,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 299 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 300 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -17241,17 +17238,17 @@ local.get $4 return ) - (func $~lib/array/Array<~lib/array/Array>#toString (; 300 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#toString (; 301 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array<~lib/array/Array>#join ) - (func $~lib/array/Array#toString (; 301 ;) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 302 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 302 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (; 303 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -17273,7 +17270,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -17307,7 +17304,7 @@ local.get $5 call $~lib/array/Array#toString else - i32.const 5120 + i32.const 5056 end local.set $4 local.get $2 @@ -17317,7 +17314,7 @@ local.get $4 return end - i32.const 5120 + i32.const 5056 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -17462,7 +17459,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 303 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 304 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -17485,12 +17482,12 @@ local.get $4 return ) - (func $~lib/array/Array<~lib/array/Array>#toString (; 304 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#toString (; 305 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array<~lib/array/Array>#join ) - (func $~lib/util/string/joinReferenceArray<~lib/array/Array<~lib/array/Array>> (; 305 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/joinReferenceArray<~lib/array/Array<~lib/array/Array>> (; 306 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -17512,7 +17509,7 @@ i32.const 0 i32.lt_s if - i32.const 5120 + i32.const 5056 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -17546,7 +17543,7 @@ local.get $5 call $~lib/array/Array<~lib/array/Array>#toString else - i32.const 5120 + i32.const 5056 end local.set $4 local.get $2 @@ -17556,7 +17553,7 @@ local.get $4 return end - i32.const 5120 + i32.const 5056 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -17701,7 +17698,7 @@ call $~lib/rt/pure/__release local.get $4 ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 306 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 307 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -17724,12 +17721,12 @@ local.get $4 return ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString (; 307 ;) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString (; 308 ;) (param $0 i32) (result i32) local.get $0 - i32.const 5360 + i32.const 5296 call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join ) - (func $start:std/array (; 308 ;) + (func $start:std/array (; 309 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -22725,7 +22722,7 @@ i32.const 1 i32.const 2 i32.const 3 - i32.const 4928 + i32.const 4864 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $29 @@ -22746,7 +22743,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 4960 + i32.const 4896 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $31 @@ -22919,14 +22916,14 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 5136 + i32.const 5072 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $31 i32.const 7 i32.const 2 i32.const 15 - i32.const 5184 + i32.const 5120 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $34 @@ -22965,14 +22962,14 @@ i32.const 2 i32.const 0 i32.const 17 - i32.const 5264 + i32.const 5200 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $34 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join local.tee $29 - i32.const 5392 + i32.const 5328 call $~lib/string/String.__eq i32.eqz if @@ -22986,14 +22983,14 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 5440 + i32.const 5376 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $32 - i32.const 5120 + i32.const 5056 call $~lib/array/Array#join local.tee $31 - i32.const 5920 + i32.const 5856 call $~lib/string/String.__eq i32.eqz if @@ -23007,14 +23004,14 @@ i32.const 3 i32.const 2 i32.const 7 - i32.const 5952 + i32.const 5888 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $37 - i32.const 5984 + i32.const 5920 call $~lib/array/Array#join local.tee $36 - i32.const 5920 + i32.const 5856 call $~lib/string/String.__eq i32.eqz if @@ -23028,14 +23025,14 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 6016 + i32.const 5952 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $35 - i32.const 6048 + i32.const 5984 call $~lib/array/Array#join local.tee $54 - i32.const 6080 + i32.const 6016 call $~lib/string/String.__eq i32.eqz if @@ -23049,14 +23046,14 @@ i32.const 6 i32.const 3 i32.const 10 - i32.const 6144 + i32.const 6080 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $40 - i32.const 6208 + i32.const 6144 call $~lib/array/Array#join local.tee $39 - i32.const 7360 + i32.const 7296 call $~lib/string/String.__eq i32.eqz if @@ -23070,14 +23067,14 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 7488 + i32.const 7424 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $42 - i32.const 5120 + i32.const 5056 call $~lib/array/Array<~lib/string/String | null>#join local.tee $38 - i32.const 7456 + i32.const 7392 call $~lib/string/String.__eq i32.eqz if @@ -23115,10 +23112,10 @@ local.get $43 local.set $41 local.get $41 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join local.tee $43 - i32.const 7568 + i32.const 7504 call $~lib/string/String.__eq i32.eqz if @@ -23152,10 +23149,10 @@ local.get $44 local.set $47 local.get $47 - i32.const 5360 + i32.const 5296 call $~lib/array/Array#join local.tee $44 - i32.const 7648 + i32.const 7584 call $~lib/string/String.__eq i32.eqz if @@ -23201,35 +23198,35 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 7728 + i32.const 7664 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $47 i32.const 1 i32.const 2 i32.const 3 - i32.const 7744 + i32.const 7680 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $43 i32.const 2 i32.const 2 i32.const 3 - i32.const 7776 + i32.const 7712 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $41 i32.const 4 i32.const 2 i32.const 3 - i32.const 7808 + i32.const 7744 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $38 local.get $47 call $~lib/array/Array#toString local.tee $44 - i32.const 5120 + i32.const 5056 call $~lib/string/String.__eq i32.eqz if @@ -23243,7 +23240,7 @@ local.get $43 call $~lib/array/Array#toString local.tee $42 - i32.const 7456 + i32.const 7392 call $~lib/string/String.__eq i32.eqz if @@ -23257,7 +23254,7 @@ local.get $41 call $~lib/array/Array#toString local.tee $39 - i32.const 7840 + i32.const 7776 call $~lib/string/String.__eq i32.eqz if @@ -23271,7 +23268,7 @@ local.get $38 call $~lib/array/Array#toString local.tee $40 - i32.const 7872 + i32.const 7808 call $~lib/string/String.__eq i32.eqz if @@ -23285,13 +23282,13 @@ i32.const 3 i32.const 0 i32.const 21 - i32.const 7904 + i32.const 7840 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $35 call $~lib/array/Array#toString local.tee $54 - i32.const 7936 + i32.const 7872 call $~lib/string/String.__eq i32.eqz if @@ -23305,13 +23302,13 @@ i32.const 3 i32.const 1 i32.const 22 - i32.const 7968 + i32.const 7904 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $37 call $~lib/array/Array#toString local.tee $36 - i32.const 8000 + i32.const 7936 call $~lib/string/String.__eq i32.eqz if @@ -23325,13 +23322,13 @@ i32.const 3 i32.const 3 i32.const 23 - i32.const 8048 + i32.const 7984 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $32 call $~lib/array/Array#toString local.tee $31 - i32.const 8096 + i32.const 8032 call $~lib/string/String.__eq i32.eqz if @@ -23345,13 +23342,13 @@ i32.const 4 i32.const 3 i32.const 24 - i32.const 8160 + i32.const 8096 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $34 call $~lib/array/Array#toString local.tee $29 - i32.const 8208 + i32.const 8144 call $~lib/string/String.__eq i32.eqz if @@ -23365,14 +23362,14 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 8320 + i32.const 8256 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $49 local.get $49 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $48 - i32.const 8368 + i32.const 8304 call $~lib/string/String.__eq i32.eqz if @@ -23386,13 +23383,13 @@ i32.const 4 i32.const 2 i32.const 15 - i32.const 8480 + i32.const 8416 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $50 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $51 - i32.const 8512 + i32.const 8448 call $~lib/string/String.__eq i32.eqz if @@ -23417,7 +23414,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 8544 + i32.const 8480 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -23425,7 +23422,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 8576 + i32.const 8512 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -23434,7 +23431,7 @@ local.get $56 call $~lib/array/Array<~lib/array/Array>#toString local.tee $30 - i32.const 8608 + i32.const 8544 call $~lib/string/String.__eq i32.eqz if @@ -23459,7 +23456,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 8640 + i32.const 8576 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -23467,7 +23464,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 8672 + i32.const 8608 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -23476,7 +23473,7 @@ local.get $57 call $~lib/array/Array<~lib/array/Array>#toString local.tee $26 - i32.const 8608 + i32.const 8544 call $~lib/string/String.__eq i32.eqz if @@ -23512,7 +23509,7 @@ i32.const 1 i32.const 2 i32.const 7 - i32.const 8704 + i32.const 8640 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -23523,7 +23520,7 @@ local.get $58 call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString local.tee $28 - i32.const 7456 + i32.const 7392 call $~lib/string/String.__eq i32.eqz if @@ -23597,7 +23594,7 @@ local.get $58 call $~lib/rt/pure/__release ) - (func $~start (; 309 ;) + (func $~start (; 310 ;) global.get $~started if return @@ -23607,10 +23604,10 @@ end call $start:std/array ) - (func $~lib/rt/pure/__collect (; 310 ;) + (func $~lib/rt/pure/__collect (; 311 ;) return ) - (func $~lib/rt/pure/decrement (; 311 ;) (param $0 i32) + (func $~lib/rt/pure/decrement (; 312 ;) (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -23687,7 +23684,7 @@ i32.store offset=4 end ) - (func $~lib/rt/pure/__visit (; 312 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 313 ;) (param $0 i32) (param $1 i32) local.get $0 global.get $~lib/heap/__heap_base i32.lt_u @@ -23711,16 +23708,16 @@ i32.sub call $~lib/rt/pure/decrement ) - (func $~lib/array/Array#__visit_impl (; 313 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 314 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 314 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 315 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 315 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 316 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 316 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 317 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -23759,13 +23756,13 @@ end end ) - (func $~lib/array/Array#__visit_impl (; 317 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 318 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 318 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 319 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 319 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 320 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -23804,7 +23801,7 @@ end end ) - (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 320 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 321 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -23843,7 +23840,7 @@ end end ) - (func $~lib/array/Array>#__visit_impl (; 321 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array>#__visit_impl (; 322 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -23882,7 +23879,7 @@ end end ) - (func $~lib/array/Array<~lib/string/String | null>#__visit_impl (; 322 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/string/String | null>#__visit_impl (; 323 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -23921,7 +23918,7 @@ end end ) - (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 323 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 324 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -23960,31 +23957,31 @@ end end ) - (func $~lib/array/Array#__visit_impl (; 324 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 325 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/staticarray/StaticArray#__visit_impl (; 325 ;) (param $0 i32) (param $1 i32) + (func $~lib/staticarray/StaticArray#__visit_impl (; 326 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/staticarray/StaticArray#__visit_impl (; 326 ;) (param $0 i32) (param $1 i32) + (func $~lib/staticarray/StaticArray#__visit_impl (; 327 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/staticarray/StaticArray#__visit_impl (; 327 ;) (param $0 i32) (param $1 i32) + (func $~lib/staticarray/StaticArray#__visit_impl (; 328 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 328 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 329 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 329 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 330 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 330 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 331 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 331 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 332 ;) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 332 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 333 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -24023,7 +24020,7 @@ end end ) - (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 333 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 334 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -24062,7 +24059,7 @@ end end ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl (; 334 ;) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl (; 335 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -24101,7 +24098,7 @@ end end ) - (func $~lib/rt/__visit_members (; 335 ;) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 336 ;) (param $0 i32) (param $1 i32) (local $2 i32) block $block$4$break block $switch$1$default diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index b50f8038e5..bc9a12c360 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -9,9 +9,9 @@ (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $f32_f32_f32_f32_=>_i32 (func (param f32 f32 f32 f32) (result i32))) (type $f64_f64_f64_f64_=>_i32 (func (param f64 f64 f64 f64) (result i32))) + (type $none_=>_f64 (func (result f64))) (type $none_=>_none (func)) (type $f32_i32_=>_f32 (func (param f32 i32) (result f32))) - (type $none_=>_f64 (func (result f64))) (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i64_=>_none (func (param i64))) @@ -60,6 +60,7 @@ (import "Math" "min" (func $~lib/bindings/Math/min (param f64 f64) (result f64))) (import "math" "mod" (func $std/math/mod (param f64 f64) (result f64))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) + (import "env" "seed" (func $~lib/builtins/seed (result f64))) (import "Math" "sign" (func $~lib/bindings/Math/sign (param f64) (result f64))) (import "Math" "sin" (func $~lib/bindings/Math/sin (param f64) (result f64))) (import "Math" "sinh" (func $~lib/bindings/Math/sinh (param f64) (result f64))) @@ -76,7 +77,6 @@ (data (i32.const 2385) "\01\00\00\01\00\00\00\03\00\00\00\00\01\00\00\00\00\00\00\00\00\f0?t\85\15\d3\b0\d9\ef?\0f\89\f9lX\b5\ef?Q[\12\d0\01\93\ef?{Q}<\b8r\ef?\aa\b9h1\87T\ef?8bunz8\ef?\e1\de\1f\f5\9d\1e\ef?\15\b71\n\fe\06\ef?\cb\a9:7\a7\f1\ee?\"4\12L\a6\de\ee?-\89a`\08\ce\ee?\'*6\d5\da\bf\ee?\82O\9dV+\b4\ee?)TH\dd\07\ab\ee?\85U:\b0~\a4\ee?\cd;\7ff\9e\a0\ee?t_\ec\e8u\9f\ee?\87\01\ebs\14\a1\ee?\13\ceL\99\89\a5\ee?\db\a0*B\e5\ac\ee?\e5\c5\cd\b07\b7\ee?\90\f0\a3\82\91\c4\ee?]%>\b2\03\d5\ee?\ad\d3Z\99\9f\e8\ee?G^\fb\f2v\ff\ee?\9cR\85\dd\9b\19\ef?i\90\ef\dc 7\ef?\87\a4\fb\dc\18X\ef?_\9b{3\97|\ef?\da\90\a4\a2\af\a4\ef?@En[v\d0\ef?") (data (i32.const 2657) "\01\00\00\01\00\00\00\04\00\00\00\00\01\00\00\be\f3\f8y\eca\f6?\190\96[\c6\fe\de\bf=\88\afJ\edq\f5?\a4\fc\d42h\0b\db\bf\b0\10\f0\f09\95\f4?{\b7\1f\n\8bA\d7\bf\85\03\b8\b0\95\c9\f3?{\cfm\1a\e9\9d\d3\bf\a5d\88\0c\19\0d\f3?1\b6\f2\f3\9b\1d\d0\bf\a0\8e\0b{\"^\f2?\f0z;\1b\1d|\c9\bf?4\1aJJ\bb\f1?\9f<\af\93\e3\f9\c2\bf\ba\e5\8a\f0X#\f1?\\\8dx\bf\cb`\b9\bf\a7\00\99A?\95\f0?\ce_G\b6\9do\aa\bf\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\acG\9a\fd\8c`\ee?=\f5$\9f\ca8\b3?\a0j\02\1f\b3\a4\ec?\ba\918T\a9v\c4?\e6\fcjW6 \eb?\d2\e4\c4J\0b\84\ce?-\aa\a1c\d1\c2\e9?\1ce\c6\f0E\06\d4?\edAx\03\e6\86\e8?\f8\9f\1b,\9c\8e\d8?bHS\f5\dcg\e7?\cc{\b1N\a4\e0\dc?") (data (i32.const 2928) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") - (data (i32.const 2976) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.") (global $~lib/math/rempio2_y0 (mut f64) (f64.const 0)) (global $~lib/math/rempio2_y1 (mut f64) (f64.const 0)) (global $~lib/math/res128_hi (mut i64) (i64.const 0)) @@ -90,7 +90,7 @@ (global $~lib/math/NativeMath.sincos_cos (mut f64) (f64.const 0)) (export "memory" (memory $0)) (start $~start) - (func $~lib/math/NativeMath.scalbn (; 32 ;) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/NativeMath.scalbn (; 33 ;) (param $0 f64) (param $1 i32) (result f64) local.get $1 i32.const 1023 i32.gt_s @@ -167,7 +167,7 @@ f64.reinterpret_i64 f64.mul ) - (func $std/math/ulperr (; 33 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) + (func $std/math/ulperr (; 34 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) (local $3 i32) local.get $1 local.get $1 @@ -257,7 +257,7 @@ local.get $2 f64.add ) - (func $std/math/check (; 34 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/check (; 35 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.eq @@ -287,7 +287,7 @@ end i32.const 1 ) - (func $~lib/math/NativeMathf.scalbn (; 35 ;) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/math/NativeMathf.scalbn (; 36 ;) (param $0 f32) (param $1 i32) (result f32) local.get $1 i32.const 127 i32.gt_s @@ -363,7 +363,7 @@ f32.reinterpret_i32 f32.mul ) - (func $std/math/ulperrf (; 36 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) + (func $std/math/ulperrf (; 37 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) (local $3 i32) local.get $1 local.get $1 @@ -450,7 +450,7 @@ local.get $2 f32.add ) - (func $std/math/check (; 37 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/check (; 38 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.eq @@ -480,7 +480,7 @@ end i32.const 1 ) - (func $std/math/test_scalbn (; 38 ;) (param $0 f64) (param $1 i32) (param $2 f64) (result i32) + (func $std/math/test_scalbn (; 39 ;) (param $0 f64) (param $1 i32) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.scalbn @@ -488,7 +488,7 @@ f64.const 0 call $std/math/check ) - (func $std/math/test_scalbnf (; 39 ;) (param $0 f32) (param $1 i32) (param $2 f32) (result i32) + (func $std/math/test_scalbnf (; 40 ;) (param $0 f32) (param $1 i32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.scalbn @@ -496,7 +496,7 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_abs (; 40 ;) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_abs (; 41 ;) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.abs local.get $1 @@ -512,14 +512,14 @@ i32.const 0 end ) - (func $std/math/test_absf (; 41 ;) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_absf (; 42 ;) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.abs local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/R (; 42 ;) (param $0 f64) (result f64) + (func $~lib/math/R (; 43 ;) (param $0 f64) (result f64) local.get $0 f64.const 0.16666666666666666 local.get $0 @@ -562,7 +562,7 @@ f64.add f64.div ) - (func $~lib/math/NativeMath.acos (; 43 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acos (; 44 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) @@ -686,7 +686,7 @@ f64.add f64.mul ) - (func $std/math/test_acos (; 44 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_acos (; 45 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.acos local.get $1 @@ -702,7 +702,7 @@ i32.const 0 end ) - (func $~lib/math/Rf (; 45 ;) (param $0 f32) (result f32) + (func $~lib/math/Rf (; 46 ;) (param $0 f32) (result f32) local.get $0 f32.const 0.16666586697101593 local.get $0 @@ -721,7 +721,7 @@ f32.add f32.div ) - (func $~lib/math/NativeMathf.acos (; 46 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.acos (; 47 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) @@ -837,14 +837,14 @@ f32.add f32.mul ) - (func $std/math/test_acosf (; 47 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_acosf (; 48 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.acos local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.log1p (; 48 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log1p (; 49 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) @@ -1042,7 +1042,7 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.log (; 49 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log (; 50 ;) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) (local $3 f64) @@ -1210,7 +1210,7 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.acosh (; 50 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acosh (; 51 ;) (param $0 f64) (result f64) (local $1 i64) local.get $0 i64.reinterpret_f64 @@ -1264,7 +1264,7 @@ f64.const 0.6931471805599453 f64.add ) - (func $std/math/test_acosh (; 51 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_acosh (; 52 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.acosh local.get $1 @@ -1280,7 +1280,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log1p (; 52 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log1p (; 53 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) @@ -1450,7 +1450,7 @@ f32.mul f32.add ) - (func $~lib/math/NativeMathf.log (; 53 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log (; 54 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -1584,7 +1584,7 @@ f32.mul f32.add ) - (func $~lib/math/NativeMathf.acosh (; 54 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.acosh (; 55 ;) (param $0 f32) (result f32) (local $1 i32) local.get $0 i32.reinterpret_f32 @@ -1634,14 +1634,14 @@ f32.const 0.6931471824645996 f32.add ) - (func $std/math/test_acoshf (; 55 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_acoshf (; 56 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.acosh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.asin (; 56 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asin (; 57 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -1779,7 +1779,7 @@ end local.get $0 ) - (func $std/math/test_asin (; 57 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_asin (; 58 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.asin local.get $1 @@ -1795,7 +1795,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.asin (; 58 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asin (; 59 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f64) @@ -1875,14 +1875,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_asinf (; 59 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_asinf (; 60 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.asin local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.asinh (; 60 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asinh (; 61 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) local.get $0 @@ -1952,7 +1952,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_asinh (; 61 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_asinh (; 62 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.asinh local.get $1 @@ -1968,7 +1968,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.asinh (; 62 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asinh (; 63 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -2033,14 +2033,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_asinhf (; 63 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_asinhf (; 64 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.asinh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atan (; 64 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atan (; 65 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -2263,7 +2263,7 @@ local.get $3 f64.copysign ) - (func $std/math/test_atan (; 65 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_atan (; 66 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.atan local.get $1 @@ -2279,7 +2279,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atan (; 66 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atan (; 67 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -2475,14 +2475,14 @@ local.get $4 f32.copysign ) - (func $std/math/test_atanf (; 67 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_atanf (; 68 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.atan local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atanh (; 68 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atanh (; 69 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 f64) @@ -2536,7 +2536,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_atanh (; 69 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_atanh (; 70 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.atanh local.get $1 @@ -2552,7 +2552,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atanh (; 70 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atanh (; 71 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -2600,14 +2600,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_atanhf (; 71 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_atanhf (; 72 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.atanh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atan2 (; 72 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.atan2 (; 73 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2817,7 +2817,7 @@ i32.and select ) - (func $std/math/test_atan2 (; 73 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) + (func $std/math/test_atan2 (; 74 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 @@ -2835,7 +2835,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atan2 (; 74 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.atan2 (; 75 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3028,7 +3028,7 @@ i32.and select ) - (func $std/math/test_atan2f (; 75 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_atan2f (; 76 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.atan2 @@ -3036,7 +3036,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.cbrt (; 76 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cbrt (; 77 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -3158,7 +3158,7 @@ f64.mul f64.add ) - (func $std/math/test_cbrt (; 77 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_cbrt (; 78 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.cbrt local.get $1 @@ -3174,7 +3174,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.cbrt (; 78 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cbrt (; 79 ;) (param $0 f32) (result f32) (local $1 f64) (local $2 f64) (local $3 i32) @@ -3273,14 +3273,14 @@ f64.div f32.demote_f64 ) - (func $std/math/test_cbrtf (; 79 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_cbrtf (; 80 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cbrt local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_ceil (; 80 ;) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_ceil (; 81 ;) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.ceil local.get $1 @@ -3296,14 +3296,14 @@ i32.const 0 end ) - (func $std/math/test_ceilf (; 81 ;) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_ceilf (; 82 ;) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.ceil local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/pio2_large_quot (; 82 ;) (param $0 i64) (result i32) + (func $~lib/math/pio2_large_quot (; 83 ;) (param $0 i64) (result i32) (local $1 i64) (local $2 i64) (local $3 i64) @@ -3589,7 +3589,7 @@ i64.sub i32.wrap_i64 ) - (func $~lib/math/NativeMath.cos (; 83 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cos (; 84 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 f64) @@ -3927,7 +3927,7 @@ end local.get $0 ) - (func $std/math/test_cos (; 84 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_cos (; 85 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.cos local.get $1 @@ -3943,7 +3943,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.cos (; 85 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cos (; 86 ;) (param $0 f32) (result f32) (local $1 f64) (local $2 i32) (local $3 f64) @@ -4212,14 +4212,14 @@ end local.get $0 ) - (func $std/math/test_cosf (; 86 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_cosf (; 87 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cos local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.expm1 (; 87 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.expm1 (; 88 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -4490,7 +4490,7 @@ local.get $4 f64.mul ) - (func $~lib/math/NativeMath.exp (; 88 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp (; 89 ;) (param $0 f64) (result f64) (local $1 i32) (local $2 f64) (local $3 i32) @@ -4642,7 +4642,7 @@ end local.get $0 ) - (func $~lib/math/NativeMath.cosh (; 89 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cosh (; 90 ;) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) local.get $0 @@ -4706,7 +4706,7 @@ f64.const 2247116418577894884661631e283 f64.mul ) - (func $std/math/test_cosh (; 90 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_cosh (; 91 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.cosh local.get $1 @@ -4722,7 +4722,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.expm1 (; 91 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.expm1 (; 92 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -4972,7 +4972,7 @@ local.get $4 f32.mul ) - (func $~lib/math/NativeMathf.exp (; 92 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.exp (; 93 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -5106,7 +5106,7 @@ end local.get $0 ) - (func $~lib/math/NativeMathf.cosh (; 93 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cosh (; 94 ;) (param $0 f32) (result f32) (local $1 i32) local.get $0 i32.reinterpret_f32 @@ -5165,14 +5165,14 @@ f32.const 1661534994731144841129758e11 f32.mul ) - (func $std/math/test_coshf (; 94 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_coshf (; 95 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cosh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_exp (; 95 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_exp (; 96 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.exp local.get $1 @@ -5188,14 +5188,14 @@ i32.const 0 end ) - (func $std/math/test_expf (; 96 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_expf (; 97 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.exp local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_expm1 (; 97 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_expm1 (; 98 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.expm1 local.get $1 @@ -5211,14 +5211,14 @@ i32.const 0 end ) - (func $std/math/test_expm1f (; 98 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_expm1f (; 99 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.expm1 local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.exp2 (; 99 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp2 (; 100 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 i32) @@ -5424,7 +5424,7 @@ f64.add end ) - (func $std/math/test_exp2 (; 100 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_exp2 (; 101 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.exp2 local.get $1 @@ -5441,7 +5441,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.exp2 (; 101 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.exp2 (; 102 ;) (param $0 f32) (result f32) (local $1 f64) (local $2 i64) (local $3 i32) @@ -5536,14 +5536,14 @@ f32.demote_f64 end ) - (func $std/math/test_exp2f (; 102 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_exp2f (; 103 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.exp2 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_floor (; 103 ;) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_floor (; 104 ;) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.floor local.get $1 @@ -5559,14 +5559,14 @@ i32.const 0 end ) - (func $std/math/test_floorf (; 104 ;) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_floorf (; 105 ;) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.floor local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.hypot (; 105 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.hypot (; 106 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) (local $3 i64) (local $4 i64) @@ -5735,7 +5735,7 @@ f64.sqrt f64.mul ) - (func $std/math/test_hypot (; 106 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) + (func $std/math/test_hypot (; 107 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot @@ -5743,7 +5743,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMathf.hypot (; 107 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.hypot (; 108 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 f32) @@ -5848,7 +5848,7 @@ f32.sqrt f32.mul ) - (func $std/math/test_hypotf (; 108 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_hypotf (; 109 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.hypot @@ -5856,7 +5856,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_log (; 109 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log (; 110 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log local.get $1 @@ -5872,14 +5872,14 @@ i32.const 0 end ) - (func $std/math/test_logf (; 110 ;) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_logf (; 111 ;) (param $0 f32) (param $1 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.log10 (; 111 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log10 (; 112 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -6081,7 +6081,7 @@ local.get $1 f64.add ) - (func $std/math/test_log10 (; 112 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log10 (; 113 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log10 local.get $1 @@ -6097,7 +6097,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log10 (; 113 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log10 (; 114 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -6255,14 +6255,14 @@ f32.mul f32.add ) - (func $std/math/test_log10f (; 114 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log10f (; 115 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log10 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_log1p (; 115 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log1p (; 116 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log1p local.get $1 @@ -6278,14 +6278,14 @@ i32.const 0 end ) - (func $std/math/test_log1pf (; 116 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log1pf (; 117 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log1p local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.log2 (; 117 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log2 (; 118 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -6480,7 +6480,7 @@ local.get $1 f64.add ) - (func $std/math/test_log2 (; 118 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log2 (; 119 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log2 local.get $1 @@ -6496,7 +6496,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log2 (; 119 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log2 (; 120 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -6646,14 +6646,14 @@ f32.convert_i32_s f32.add ) - (func $std/math/test_log2f (; 120 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log2f (; 121 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log2 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_max (; 121 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_max (; 122 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.max @@ -6671,7 +6671,7 @@ i32.const 0 end ) - (func $std/math/test_maxf (; 122 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_maxf (; 123 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.max @@ -6679,7 +6679,7 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_min (; 123 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_min (; 124 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.min @@ -6697,7 +6697,7 @@ i32.const 0 end ) - (func $std/math/test_minf (; 124 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_minf (; 125 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.min @@ -6705,7 +6705,7 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.mod (; 125 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.mod (; 126 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) @@ -6908,7 +6908,7 @@ local.get $0 f64.mul ) - (func $std/math/test_mod (; 126 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_mod (; 127 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod @@ -6926,7 +6926,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.mod (; 127 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.mod (; 128 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7118,7 +7118,7 @@ local.get $0 f32.mul ) - (func $std/math/test_modf (; 128 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_modf (; 129 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.mod @@ -7126,7 +7126,7 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.pow (; 129 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.pow (; 130 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) (local $3 f64) (local $4 i32) @@ -8082,7 +8082,7 @@ f64.const 1e-300 f64.mul ) - (func $std/math/test_pow (; 130 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) + (func $std/math/test_pow (; 131 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.pow @@ -8100,7 +8100,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.pow (; 131 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.pow (; 132 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 f64) @@ -8558,7 +8558,7 @@ end local.get $0 ) - (func $std/math/test_powf (; 132 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_powf (; 133 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.pow @@ -8566,7 +8566,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/murmurHash3 (; 133 ;) (param $0 i64) (result i64) + (func $~lib/math/murmurHash3 (; 134 ;) (param $0 i64) (result i64) local.get $0 local.get $0 i64.const 33 @@ -8587,7 +8587,7 @@ i64.shr_u i64.xor ) - (func $~lib/math/splitMix32 (; 134 ;) (param $0 i32) (result i32) + (func $~lib/math/splitMix32 (; 135 ;) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -8619,7 +8619,7 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 135 ;) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 136 ;) (param $0 i64) i32.const 1 global.set $~lib/math/random_seeded local.get $0 @@ -8663,18 +8663,15 @@ unreachable end ) - (func $~lib/math/NativeMath.random (; 136 ;) (result f64) + (func $~lib/math/NativeMath.random (; 137 ;) (result f64) (local $0 i64) (local $1 i64) global.get $~lib/math/random_seeded i32.eqz if - i32.const 2992 - i32.const 2944 - i32.const 1413 - i32.const 24 - call $~lib/builtins/abort - unreachable + call $~lib/builtins/seed + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom end global.get $~lib/math/random_state0_64 local.set $0 @@ -8707,18 +8704,15 @@ f64.const 1 f64.sub ) - (func $~lib/math/NativeMathf.random (; 137 ;) (result f32) + (func $~lib/math/NativeMathf.random (; 138 ;) (result f32) (local $0 i32) (local $1 i32) global.get $~lib/math/random_seeded i32.eqz if - i32.const 2992 - i32.const 2944 - i32.const 2606 - i32.const 24 - call $~lib/builtins/abort - unreachable + call $~lib/builtins/seed + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom end global.get $~lib/math/random_state0_32 local.tee $0 @@ -8753,7 +8747,7 @@ f32.const 1 f32.sub ) - (func $std/math/test_round (; 138 ;) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_round (; 139 ;) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.const 0.5 f64.add @@ -8764,7 +8758,7 @@ f64.const 0 call $std/math/check ) - (func $std/math/test_roundf (; 139 ;) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_roundf (; 140 ;) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.const 0.5 f32.add @@ -8775,7 +8769,7 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_sign (; 140 ;) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_sign (; 141 ;) (param $0 f64) (param $1 f64) (result i32) f64.const 1 local.get $0 f64.copysign @@ -8798,7 +8792,7 @@ i32.const 0 end ) - (func $std/math/test_signf (; 141 ;) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_signf (; 142 ;) (param $0 f32) (param $1 f32) (result i32) f32.const 1 local.get $0 f32.copysign @@ -8812,7 +8806,7 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.rem (; 142 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.rem (; 143 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) @@ -9061,7 +9055,7 @@ end local.get $0 ) - (func $std/math/test_rem (; 143 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_rem (; 144 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.rem @@ -9069,7 +9063,7 @@ f64.const 0 call $std/math/check ) - (func $~lib/math/NativeMathf.rem (; 144 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.rem (; 145 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9310,7 +9304,7 @@ end local.get $0 ) - (func $std/math/test_remf (; 145 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_remf (; 146 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.rem @@ -9318,7 +9312,7 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.sin (; 146 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sin (; 147 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 f64) @@ -9638,7 +9632,7 @@ end local.get $0 ) - (func $std/math/test_sin (; 147 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_sin (; 148 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.sin local.get $1 @@ -9654,7 +9648,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.sin (; 148 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sin (; 149 ;) (param $0 f32) (result f32) (local $1 f64) (local $2 i32) (local $3 f64) @@ -9924,14 +9918,14 @@ end local.get $0 ) - (func $std/math/test_sinf (; 149 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_sinf (; 150 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.sin local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.sinh (; 150 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sinh (; 151 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 i32) @@ -10008,7 +10002,7 @@ f64.mul f64.mul ) - (func $std/math/test_sinh (; 151 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_sinh (; 152 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.sinh local.get $1 @@ -10024,7 +10018,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.sinh (; 152 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sinh (; 153 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 f32) @@ -10096,14 +10090,14 @@ f32.mul f32.mul ) - (func $std/math/test_sinhf (; 153 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_sinhf (; 154 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.sinh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_sqrt (; 154 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_sqrt (; 155 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 f64.sqrt local.get $1 @@ -10119,14 +10113,14 @@ i32.const 0 end ) - (func $std/math/test_sqrtf (; 155 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_sqrtf (; 156 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 f32.sqrt local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/tan_kern (; 156 ;) (param $0 f64) (param $1 f64) (param $2 i32) (result f64) + (func $~lib/math/tan_kern (; 157 ;) (param $0 f64) (param $1 f64) (param $2 i32) (result f64) (local $3 f64) (local $4 f64) (local $5 f64) @@ -10308,7 +10302,7 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.tan (; 157 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tan (; 158 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -10485,7 +10479,7 @@ i32.sub call $~lib/math/tan_kern ) - (func $std/math/test_tan (; 158 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_tan (; 159 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.tan local.get $1 @@ -10501,7 +10495,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.tan (; 159 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.tan (; 160 ;) (param $0 f32) (result f32) (local $1 f64) (local $2 i32) (local $3 f64) @@ -10755,14 +10749,14 @@ local.get $1 f32.demote_f64 ) - (func $std/math/test_tanf (; 160 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_tanf (; 161 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.tan local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.tanh (; 161 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tanh (; 162 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -10841,7 +10835,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_tanh (; 162 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_tanh (; 163 ;) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.tanh local.get $1 @@ -10857,7 +10851,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.tanh (; 163 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.tanh (; 164 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -10931,14 +10925,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_tanhf (; 164 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_tanhf (; 165 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.tanh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_trunc (; 165 ;) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_trunc (; 166 ;) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.trunc local.get $1 @@ -10954,14 +10948,14 @@ i32.const 0 end ) - (func $std/math/test_truncf (; 166 ;) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_truncf (; 167 ;) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.trunc local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.sincos (; 167 ;) (param $0 f64) + (func $~lib/math/NativeMath.sincos (; 168 ;) (param $0 f64) (local $1 f64) (local $2 f64) (local $3 f64) @@ -11356,7 +11350,7 @@ local.get $1 global.set $~lib/math/NativeMath.sincos_cos ) - (func $std/math/test_sincos (; 168 ;) (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) + (func $std/math/test_sincos (; 169 ;) (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (local $5 f64) (local $6 f64) local.get $3 @@ -11382,7 +11376,7 @@ drop end ) - (func $~lib/math/dtoi32 (; 169 ;) (param $0 f64) (result i32) + (func $~lib/math/dtoi32 (; 170 ;) (param $0 f64) (result i32) local.get $0 f64.const 4294967296 local.get $0 @@ -11394,7 +11388,7 @@ i64.trunc_f64_s i32.wrap_i64 ) - (func $~lib/math/NativeMath.imul (; 170 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.imul (; 171 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) local.get $0 local.get $1 @@ -11415,7 +11409,7 @@ i32.mul f64.convert_i32_s ) - (func $~lib/math/NativeMath.clz32 (; 171 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.clz32 (; 172 ;) (param $0 f64) (result f64) local.get $0 local.get $0 f64.sub @@ -11430,7 +11424,7 @@ i32.clz f64.convert_i32_s ) - (func $~lib/math/ipow64 (; 172 ;) (param $0 i64) (param $1 i32) (result i64) + (func $~lib/math/ipow64 (; 173 ;) (param $0 i64) (param $1 i32) (result i64) (local $2 i64) i64.const 1 local.set $2 @@ -11461,7 +11455,7 @@ end local.get $2 ) - (func $~lib/math/ipow32f (; 173 ;) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/math/ipow32f (; 174 ;) (param $0 f32) (param $1 i32) (result f32) (local $2 f32) (local $3 i32) local.get $1 @@ -11507,7 +11501,7 @@ end local.get $2 ) - (func $~lib/math/ipow64f (; 174 ;) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/ipow64f (; 175 ;) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) (local $3 i32) local.get $1 @@ -11553,7 +11547,7 @@ end local.get $2 ) - (func $start:std/math (; 175 ;) + (func $start:std/math (; 176 ;) (local $0 f64) (local $1 f32) (local $2 i32) @@ -47254,7 +47248,7 @@ unreachable end ) - (func $~start (; 176 ;) + (func $~start (; 177 ;) call $start:std/math ) ) diff --git a/tests/compiler/std/math.untouched.wat b/tests/compiler/std/math.untouched.wat index baa0a69ddd..15c743b551 100644 --- a/tests/compiler/std/math.untouched.wat +++ b/tests/compiler/std/math.untouched.wat @@ -7,10 +7,10 @@ (type $f32_f32_f32_f32_i32_=>_i32 (func (param f32 f32 f32 f32 i32) (result i32))) (type $f64_f64_f64_f64_i32_=>_i32 (func (param f64 f64 f64 f64 i32) (result i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $none_=>_f64 (func (result f64))) (type $none_=>_none (func)) (type $f64_=>_i32 (func (param f64) (result i32))) (type $f32_i32_=>_f32 (func (param f32 i32) (result f32))) - (type $none_=>_f64 (func (result f64))) (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i64_=>_none (func (param i64))) @@ -59,6 +59,7 @@ (import "Math" "min" (func $~lib/bindings/Math/min (param f64 f64) (result f64))) (import "math" "mod" (func $std/math/mod (param f64 f64) (result f64))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) + (import "env" "seed" (func $~lib/builtins/seed (result f64))) (import "Math" "sign" (func $~lib/bindings/Math/sign (param f64) (result f64))) (import "Math" "sin" (func $~lib/bindings/Math/sin (param f64) (result f64))) (import "Math" "sinh" (func $~lib/bindings/Math/sinh (param f64) (result f64))) @@ -80,7 +81,6 @@ (data (i32.const 9136) "\00\01\00\00\01\00\00\00\03\00\00\00\00\01\00\00\be\f3\f8y\eca\f6?\190\96[\c6\fe\de\bf=\88\afJ\edq\f5?\a4\fc\d42h\0b\db\bf\b0\10\f0\f09\95\f4?{\b7\1f\n\8bA\d7\bf\85\03\b8\b0\95\c9\f3?{\cfm\1a\e9\9d\d3\bf\a5d\88\0c\19\0d\f3?1\b6\f2\f3\9b\1d\d0\bf\a0\8e\0b{\"^\f2?\f0z;\1b\1d|\c9\bf?4\1aJJ\bb\f1?\9f<\af\93\e3\f9\c2\bf\ba\e5\8a\f0X#\f1?\\\8dx\bf\cb`\b9\bf\a7\00\99A?\95\f0?\ce_G\b6\9do\aa\bf\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\acG\9a\fd\8c`\ee?=\f5$\9f\ca8\b3?\a0j\02\1f\b3\a4\ec?\ba\918T\a9v\c4?\e6\fcjW6 \eb?\d2\e4\c4J\0b\84\ce?-\aa\a1c\d1\c2\e9?\1ce\c6\f0E\06\d4?\edAx\03\e6\86\e8?\f8\9f\1b,\9c\8e\d8?bHS\f5\dcg\e7?\cc{\b1N\a4\e0\dc?") (data (i32.const 9408) "\00\10\00\00\01\00\00\00\03\00\00\00\00\10\00\00\00\00\00\00\00\a0\f6?\00\00\00\00\00\00\00\00\00\c8\b9\f2\82,\d6\bf\80V7($\b4\fa<\00\00\00\00\00\80\f6?\00\00\00\00\00\00\00\00\00\08X\bf\bd\d1\d5\bf \f7\e0\d8\08\a5\1c\bd\00\00\00\00\00`\f6?\00\00\00\00\00\00\00\00\00XE\17wv\d5\bfmP\b6\d5\a4b#\bd\00\00\00\00\00@\f6?\00\00\00\00\00\00\00\00\00\f8-\87\ad\1a\d5\bf\d5g\b0\9e\e4\84\e6\bc\00\00\00\00\00 \f6?\00\00\00\00\00\00\00\00\00xw\95_\be\d4\bf\e0>)\93i\1b\04\bd\00\00\00\00\00\00\f6?\00\00\00\00\00\00\00\00\00`\1c\c2\8ba\d4\bf\cc\84LH/\d8\13=\00\00\00\00\00\e0\f5?\00\00\00\00\00\00\00\00\00\a8\86\860\04\d4\bf:\0b\82\ed\f3B\dc<\00\00\00\00\00\c0\f5?\00\00\00\00\00\00\00\00\00HiUL\a6\d3\bf`\94Q\86\c6\b1 =\00\00\00\00\00\a0\f5?\00\00\00\00\00\00\00\00\00\80\98\9a\ddG\d3\bf\92\80\c5\d4MY%=\00\00\00\00\00\80\f5?\00\00\00\00\00\00\00\00\00 \e1\ba\e2\e8\d2\bf\d8+\b7\99\1e{&=\00\00\00\00\00`\f5?\00\00\00\00\00\00\00\00\00\88\de\13Z\89\d2\bf?\b0\cf\b6\14\ca\15=\00\00\00\00\00`\f5?\00\00\00\00\00\00\00\00\00\88\de\13Z\89\d2\bf?\b0\cf\b6\14\ca\15=\00\00\00\00\00@\f5?\00\00\00\00\00\00\00\00\00x\cf\fbA)\d2\bfv\daS($Z\16\bd\00\00\00\00\00 \f5?\00\00\00\00\00\00\00\00\00\98i\c1\98\c8\d1\bf\04T\e7h\bc\af\1f\bd\00\00\00\00\00\00\f5?\00\00\00\00\00\00\00\00\00\a8\ab\ab\\g\d1\bf\f0\a8\823\c6\1f\1f=\00\00\00\00\00\e0\f4?\00\00\00\00\00\00\00\00\00H\ae\f9\8b\05\d1\bffZ\05\fd\c4\a8&\bd\00\00\00\00\00\c0\f4?\00\00\00\00\00\00\00\00\00\90s\e2$\a3\d0\bf\0e\03\f4~\eek\0c\bd\00\00\00\00\00\a0\f4?\00\00\00\00\00\00\00\00\00\d0\b4\94%@\d0\bf\7f-\f4\9e\b86\f0\bc\00\00\00\00\00\a0\f4?\00\00\00\00\00\00\00\00\00\d0\b4\94%@\d0\bf\7f-\f4\9e\b86\f0\bc\00\00\00\00\00\80\f4?\00\00\00\00\00\00\00\00\00@^m\18\b9\cf\bf\87<\99\ab*W\0d=\00\00\00\00\00`\f4?\00\00\00\00\00\00\00\00\00`\dc\cb\ad\f0\ce\bf$\af\86\9c\b7&+=\00\00\00\00\00@\f4?\00\00\00\00\00\00\00\00\00\f0*n\07\'\ce\bf\10\ff?TO/\17\bd\00\00\00\00\00 \f4?\00\00\00\00\00\00\00\00\00\c0Ok!\\\cd\bf\1bh\ca\bb\91\ba!=\00\00\00\00\00\00\f4?\00\00\00\00\00\00\00\00\00\a0\9a\c7\f7\8f\cc\bf4\84\9fhOy\'=\00\00\00\00\00\00\f4?\00\00\00\00\00\00\00\00\00\a0\9a\c7\f7\8f\cc\bf4\84\9fhOy\'=\00\00\00\00\00\e0\f3?\00\00\00\00\00\00\00\00\00\90-t\86\c2\cb\bf\8f\b7\8b1\b0N\19=\00\00\00\00\00\c0\f3?\00\00\00\00\00\00\00\00\00\c0\80N\c9\f3\ca\bff\90\cd?cN\ba<\00\00\00\00\00\a0\f3?\00\00\00\00\00\00\00\00\00\b0\e2\1f\bc#\ca\bf\ea\c1F\dcd\8c%\bd\00\00\00\00\00\a0\f3?\00\00\00\00\00\00\00\00\00\b0\e2\1f\bc#\ca\bf\ea\c1F\dcd\8c%\bd\00\00\00\00\00\80\f3?\00\00\00\00\00\00\00\00\00P\f4\9cZR\c9\bf\e3\d4\c1\04\d9\d1*\bd\00\00\00\00\00`\f3?\00\00\00\00\00\00\00\00\00\d0 e\a0\7f\c8\bf\t\fa\db\7f\bf\bd+=\00\00\00\00\00@\f3?\00\00\00\00\00\00\00\00\00\e0\10\02\89\ab\c7\bfXJSr\90\db+=\00\00\00\00\00@\f3?\00\00\00\00\00\00\00\00\00\e0\10\02\89\ab\c7\bfXJSr\90\db+=\00\00\00\00\00 \f3?\00\00\00\00\00\00\00\00\00\d0\19\e7\0f\d6\c6\bff\e2\b2\a3j\e4\10\bd\00\00\00\00\00\00\f3?\00\00\00\00\00\00\00\00\00\90\a7p0\ff\c5\bf9P\10\9fC\9e\1e\bd\00\00\00\00\00\00\f3?\00\00\00\00\00\00\00\00\00\90\a7p0\ff\c5\bf9P\10\9fC\9e\1e\bd\00\00\00\00\00\e0\f2?\00\00\00\00\00\00\00\00\00\b0\a1\e3\e5&\c5\bf\8f[\07\90\8b\de \bd\00\00\00\00\00\c0\f2?\00\00\00\00\00\00\00\00\00\80\cbl+M\c4\bf\11\0e\bd\00\00\00\00\00\e0\ed?\00\00\00\00\00\00\00\00\00`F\d1;\97\b1?\9b\9e\0dV]2%\bd\00\00\00\00\00\a0\ed?\00\00\00\00\00\00\00\00\00\e0\d1\a7\f5\bd\b3?\d7N\db\a5^\c8,=\00\00\00\00\00`\ed?\00\00\00\00\00\00\00\00\00\a0\97MZ\e9\b5?\1e\1d]<\06i,\bd\00\00\00\00\00@\ed?\00\00\00\00\00\00\00\00\00\c0\ea\n\d3\00\b7?2\ed\9d\a9\8d\1e\ec<\00\00\00\00\00\00\ed?\00\00\00\00\00\00\00\00\00@Y]^3\b9?\daG\bd:\\\11#=\00\00\00\00\00\c0\ec?\00\00\00\00\00\00\00\00\00`\ad\8d\c8j\bb?\e5h\f7+\80\90\13\bd\00\00\00\00\00\a0\ec?\00\00\00\00\00\00\00\00\00@\bc\01X\88\bc?\d3\acZ\c6\d1F&=\00\00\00\00\00`\ec?\00\00\00\00\00\00\00\00\00 \n\839\c7\be?\e0E\e6\afh\c0-\bd\00\00\00\00\00@\ec?\00\00\00\00\00\00\00\00\00\e0\db9\91\e8\bf?\fd\n\a1O\d64%\bd\00\00\00\00\00\00\ec?\00\00\00\00\00\00\00\00\00\e0\'\82\8e\17\c1?\f2\07-\cex\ef!=\00\00\00\00\00\e0\eb?\00\00\00\00\00\00\00\00\00\f0#~+\aa\c1?4\998D\8e\a7,=\00\00\00\00\00\a0\eb?\00\00\00\00\00\00\00\00\00\80\86\0ca\d1\c2?\a1\b4\81\cbl\9d\03=\00\00\00\00\00\80\eb?\00\00\00\00\00\00\00\00\00\90\15\b0\fce\c3?\89rK#\a8/\c6<\00\00\00\00\00@\eb?\00\00\00\00\00\00\00\00\00\b03\83=\91\c4?x\b6\fdTy\83%=\00\00\00\00\00 \eb?\00\00\00\00\00\00\00\00\00\b0\a1\e4\e5\'\c5?\c7}i\e5\e83&=\00\00\00\00\00\e0\ea?\00\00\00\00\00\00\00\00\00\10\8c\beNW\c6?x.<,\8b\cf\19=\00\00\00\00\00\c0\ea?\00\00\00\00\00\00\00\00\00pu\8b\12\f0\c6?\e1!\9c\e5\8d\11%\bd\00\00\00\00\00\a0\ea?\00\00\00\00\00\00\00\00\00PD\85\8d\89\c7?\05C\91p\10f\1c\bd\00\00\00\00\00`\ea?\00\00\00\00\00\00\00\00\00\009\eb\af\be\c8?\d1,\e9\aaT=\07\bd\00\00\00\00\00@\ea?\00\00\00\00\00\00\00\00\00\00\f7\dcZZ\c9?o\ff\a0X(\f2\07=\00\00\00\00\00\00\ea?\00\00\00\00\00\00\00\00\00\e0\8a<\ed\93\ca?i!VPCr(\bd\00\00\00\00\00\e0\e9?\00\00\00\00\00\00\00\00\00\d0[W\d81\cb?\aa\e1\acN\8d5\0c\bd\00\00\00\00\00\c0\e9?\00\00\00\00\00\00\00\00\00\e0;8\87\d0\cb?\b6\12TY\c4K-\bd\00\00\00\00\00\a0\e9?\00\00\00\00\00\00\00\00\00\10\f0\c6\fbo\cc?\d2+\96\c5r\ec\f1\bc\00\00\00\00\00`\e9?\00\00\00\00\00\00\00\00\00\90\d4\b0=\b1\cd?5\b0\15\f7*\ff*\bd\00\00\00\00\00@\e9?\00\00\00\00\00\00\00\00\00\10\e7\ff\0eS\ce?0\f4A`\'\12\c2<\00\00\00\00\00 \e9?\00\00\00\00\00\00\00\00\00\00\dd\e4\ad\f5\ce?\11\8e\bbe\15!\ca\bc\00\00\00\00\00\00\e9?\00\00\00\00\00\00\00\00\00\b0\b3l\1c\99\cf?0\df\0c\ca\ec\cb\1b=\00\00\00\00\00\c0\e8?\00\00\00\00\00\00\00\00\00XM`8q\d0?\91N\ed\16\db\9c\f8<\00\00\00\00\00\a0\e8?\00\00\00\00\00\00\00\00\00`ag-\c4\d0?\e9\ea<\16\8b\18\'=\00\00\00\00\00\80\e8?\00\00\00\00\00\00\00\00\00\e8\'\82\8e\17\d1?\1c\f0\a5c\0e!,\bd\00\00\00\00\00`\e8?\00\00\00\00\00\00\00\00\00\f8\ac\cb\\k\d1?\81\16\a5\f7\cd\9a+=\00\00\00\00\00@\e8?\00\00\00\00\00\00\00\00\00hZc\99\bf\d1?\b7\bdGQ\ed\a6,=\00\00\00\00\00 \e8?\00\00\00\00\00\00\00\00\00\b8\0emE\14\d2?\ea\baF\ba\de\87\n=\00\00\00\00\00\e0\e7?\00\00\00\00\00\00\00\00\00\90\dc|\f0\be\d2?\f4\04PJ\fa\9c*=\00\00\00\00\00\c0\e7?\00\00\00\00\00\00\00\00\00`\d3\e1\f1\14\d3?\b8 (; 35 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/check (; 36 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) local.get $0 local.get $1 @@ -357,7 +357,7 @@ end i32.const 1 ) - (func $std/math/eulpf (; 36 ;) (param $0 f32) (result i32) + (func $std/math/eulpf (; 37 ;) (param $0 f32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -383,7 +383,7 @@ i32.const 23 i32.sub ) - (func $~lib/math/NativeMathf.scalbn (; 37 ;) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/math/NativeMathf.scalbn (; 38 ;) (param $0 f32) (param $1 i32) (result f32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -473,7 +473,7 @@ f32.reinterpret_i32 f32.mul ) - (func $std/math/ulperrf (; 38 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) + (func $std/math/ulperrf (; 39 ;) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) (local $3 f32) local.get $0 local.get $0 @@ -552,7 +552,7 @@ local.get $2 f32.add ) - (func $std/math/check (; 39 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/check (; 40 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) local.get $0 local.get $1 @@ -585,7 +585,7 @@ end i32.const 1 ) - (func $std/math/test_scalbn (; 40 ;) (param $0 f64) (param $1 i32) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_scalbn (; 41 ;) (param $0 f64) (param $1 i32) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.scalbn @@ -594,7 +594,7 @@ local.get $4 call $std/math/check ) - (func $std/math/test_scalbnf (; 41 ;) (param $0 f32) (param $1 i32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_scalbnf (; 42 ;) (param $0 f32) (param $1 i32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.scalbn @@ -603,7 +603,7 @@ local.get $4 call $std/math/check ) - (func $std/math/test_abs (; 42 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_abs (; 43 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) local.get $0 local.set $4 @@ -630,7 +630,7 @@ i32.const 0 end ) - (func $std/math/test_absf (; 43 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_absf (; 44 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) local.get $0 local.set $4 @@ -641,7 +641,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/R (; 44 ;) (param $0 f64) (result f64) + (func $~lib/math/R (; 45 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) local.get $0 @@ -690,7 +690,7 @@ local.get $2 f64.div ) - (func $~lib/math/NativeMath.acos (; 45 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acos (; 46 ;) (param $0 f64) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -842,7 +842,7 @@ f64.add f64.mul ) - (func $std/math/test_acos (; 46 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_acos (; 47 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.acos local.get $1 @@ -866,7 +866,7 @@ i32.const 0 end ) - (func $~lib/math/Rf (; 47 ;) (param $0 f32) (result f32) + (func $~lib/math/Rf (; 48 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 f32) local.get $0 @@ -891,7 +891,7 @@ local.get $2 f32.div ) - (func $~lib/math/NativeMathf.acos (; 48 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.acos (; 49 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -1031,7 +1031,7 @@ f32.add f32.mul ) - (func $std/math/test_acosf (; 49 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_acosf (; 50 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.acos local.get $1 @@ -1039,7 +1039,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.log1p (; 50 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log1p (; 51 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -1281,7 +1281,7 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.log (; 51 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log (; 52 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 f64) @@ -1599,7 +1599,7 @@ end return ) - (func $~lib/math/NativeMath.acosh (; 52 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acosh (; 53 ;) (param $0 f64) (result f64) (local $1 i64) local.get $0 i64.reinterpret_f64 @@ -1659,7 +1659,7 @@ f64.const 0.6931471805599453 f64.add ) - (func $std/math/test_acosh (; 53 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_acosh (; 54 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.acosh local.get $1 @@ -1683,7 +1683,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log1p (; 54 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log1p (; 55 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -1892,7 +1892,7 @@ f32.mul f32.add ) - (func $~lib/math/NativeMathf.log (; 55 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log (; 56 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) @@ -2057,7 +2057,7 @@ end return ) - (func $~lib/math/NativeMathf.acosh (; 56 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.acosh (; 57 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -2113,7 +2113,7 @@ f32.const 0.6931471824645996 f32.add ) - (func $std/math/test_acoshf (; 57 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_acoshf (; 58 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.acosh local.get $1 @@ -2121,7 +2121,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.asin (; 58 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asin (; 59 ;) (param $0 f64) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2280,7 +2280,7 @@ end local.get $0 ) - (func $std/math/test_asin (; 59 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_asin (; 60 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.asin local.get $1 @@ -2304,7 +2304,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.asin (; 60 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asin (; 61 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 f32) @@ -2396,7 +2396,7 @@ local.get $1 f32.copysign ) - (func $std/math/test_asinf (; 61 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_asinf (; 62 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.asin local.get $1 @@ -2404,7 +2404,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.asinh (; 62 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asinh (; 63 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 f64) @@ -2480,7 +2480,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_asinh (; 63 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_asinh (; 64 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.asinh local.get $1 @@ -2504,7 +2504,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.asinh (; 64 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asinh (; 65 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) local.get $0 @@ -2573,7 +2573,7 @@ local.get $0 f32.copysign ) - (func $std/math/test_asinhf (; 65 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_asinhf (; 66 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.asinh local.get $1 @@ -2581,7 +2581,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.atan (; 66 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atan (; 67 ;) (param $0 f64) (result f64) (local $1 i32) (local $2 f64) (local $3 f64) @@ -2839,7 +2839,7 @@ local.get $2 f64.copysign ) - (func $std/math/test_atan (; 67 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_atan (; 68 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.atan local.get $1 @@ -2863,7 +2863,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atan (; 68 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atan (; 69 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -3093,7 +3093,7 @@ local.get $2 f32.copysign ) - (func $std/math/test_atanf (; 69 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_atanf (; 70 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.atan local.get $1 @@ -3101,7 +3101,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.atanh (; 70 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atanh (; 71 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 f64) @@ -3160,7 +3160,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_atanh (; 71 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_atanh (; 72 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.atanh local.get $1 @@ -3184,7 +3184,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atanh (; 72 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atanh (; 73 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) local.get $0 @@ -3234,7 +3234,7 @@ local.get $0 f32.copysign ) - (func $std/math/test_atanhf (; 73 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_atanhf (; 74 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.atanh local.get $1 @@ -3242,7 +3242,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.atan2 (; 74 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.atan2 (; 75 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i32) (local $4 i32) @@ -3542,7 +3542,7 @@ end unreachable ) - (func $std/math/test_atan2 (; 75 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_atan2 (; 76 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 @@ -3568,7 +3568,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atan2 (; 76 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.atan2 (; 77 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3840,7 +3840,7 @@ end unreachable ) - (func $std/math/test_atan2f (; 77 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_atan2f (; 78 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.atan2 @@ -3849,7 +3849,7 @@ local.get $4 call $std/math/check ) - (func $~lib/math/NativeMath.cbrt (; 78 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cbrt (; 79 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 f64) @@ -3993,7 +3993,7 @@ local.set $3 local.get $3 ) - (func $std/math/test_cbrt (; 79 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_cbrt (; 80 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.cbrt local.get $1 @@ -4017,7 +4017,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.cbrt (; 80 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cbrt (; 81 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f64) @@ -4133,7 +4133,7 @@ local.get $3 f32.demote_f64 ) - (func $std/math/test_cbrtf (; 81 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_cbrtf (; 82 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.cbrt local.get $1 @@ -4141,7 +4141,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_ceil (; 82 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_ceil (; 83 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) local.get $0 local.set $4 @@ -4168,7 +4168,7 @@ i32.const 0 end ) - (func $std/math/test_ceilf (; 83 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_ceilf (; 84 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) local.get $0 local.set $4 @@ -4179,7 +4179,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/pio2_large_quot (; 84 ;) (param $0 f64) (param $1 i64) (result i32) + (func $~lib/math/pio2_large_quot (; 85 ;) (param $0 f64) (param $1 i64) (result i32) (local $2 i64) (local $3 i64) (local $4 i64) @@ -4577,7 +4577,7 @@ local.get $30 i32.wrap_i64 ) - (func $~lib/math/NativeMath.cos (; 85 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cos (; 86 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -5095,7 +5095,7 @@ local.get $0 end ) - (func $std/math/test_cos (; 86 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_cos (; 87 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.cos local.get $1 @@ -5119,7 +5119,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.cos (; 87 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cos (; 88 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f64) @@ -5733,7 +5733,7 @@ local.get $26 end ) - (func $std/math/test_cosf (; 88 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_cosf (; 89 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.cos local.get $1 @@ -5741,7 +5741,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.expm1 (; 89 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.expm1 (; 90 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -6054,7 +6054,7 @@ local.get $14 f64.mul ) - (func $~lib/math/NativeMath.exp (; 90 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp (; 91 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 i32) @@ -6332,7 +6332,7 @@ end return ) - (func $~lib/math/NativeMath.cosh (; 91 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cosh (; 92 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 f64) @@ -6421,7 +6421,7 @@ local.set $3 local.get $3 ) - (func $std/math/test_cosh (; 92 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_cosh (; 93 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.cosh local.get $1 @@ -6445,7 +6445,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.expm1 (; 93 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.expm1 (; 94 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6738,7 +6738,7 @@ local.get $13 f32.mul ) - (func $~lib/math/NativeMathf.exp (; 94 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.exp (; 95 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 f64) (local $3 i32) @@ -6869,7 +6869,7 @@ end return ) - (func $~lib/math/NativeMathf.cosh (; 95 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cosh (; 96 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -6946,7 +6946,7 @@ local.get $3 f32.mul ) - (func $std/math/test_coshf (; 96 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_coshf (; 97 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.cosh local.get $1 @@ -6954,7 +6954,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_exp (; 97 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_exp (; 98 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.exp local.get $1 @@ -6978,7 +6978,7 @@ i32.const 0 end ) - (func $std/math/test_expf (; 98 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_expf (; 99 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.exp local.get $1 @@ -6986,7 +6986,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_expm1 (; 99 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_expm1 (; 100 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.expm1 local.get $1 @@ -7010,7 +7010,7 @@ i32.const 0 end ) - (func $std/math/test_expm1f (; 100 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_expm1f (; 101 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.expm1 local.get $1 @@ -7018,7 +7018,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.exp2 (; 101 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp2 (; 102 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 i32) @@ -7285,7 +7285,7 @@ f64.add end ) - (func $std/math/test_exp2 (; 102 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_exp2 (; 103 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.exp2 local.get $1 @@ -7310,7 +7310,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.exp2 (; 103 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.exp2 (; 104 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 f64) (local $3 i32) @@ -7433,7 +7433,7 @@ f32.demote_f64 end ) - (func $std/math/test_exp2f (; 104 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_exp2f (; 105 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.exp2 local.get $1 @@ -7441,7 +7441,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_floor (; 105 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_floor (; 106 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) local.get $0 local.set $4 @@ -7468,7 +7468,7 @@ i32.const 0 end ) - (func $std/math/test_floorf (; 106 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_floorf (; 107 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) local.get $0 local.set $4 @@ -7479,7 +7479,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.hypot (; 107 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.hypot (; 108 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) @@ -7674,7 +7674,7 @@ f64.sqrt f64.mul ) - (func $std/math/test_hypot (; 108 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_hypot (; 109 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot @@ -7683,7 +7683,7 @@ local.get $4 call $std/math/check ) - (func $~lib/math/NativeMathf.hypot (; 109 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.hypot (; 110 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7800,7 +7800,7 @@ f32.sqrt f32.mul ) - (func $std/math/test_hypotf (; 110 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_hypotf (; 111 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.hypot @@ -7809,7 +7809,7 @@ local.get $4 call $std/math/check ) - (func $std/math/test_log (; 111 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_log (; 112 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.log local.get $1 @@ -7833,7 +7833,7 @@ i32.const 0 end ) - (func $std/math/test_logf (; 112 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_logf (; 113 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.log local.get $1 @@ -7841,7 +7841,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.log10 (; 113 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log10 (; 114 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -8101,7 +8101,7 @@ local.get $8 f64.add ) - (func $std/math/test_log10 (; 114 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_log10 (; 115 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.log10 local.get $1 @@ -8125,7 +8125,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log10 (; 115 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log10 (; 116 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -8325,7 +8325,7 @@ f32.mul f32.add ) - (func $std/math/test_log10f (; 116 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_log10f (; 117 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.log10 local.get $1 @@ -8333,7 +8333,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_log1p (; 117 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_log1p (; 118 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.log1p local.get $1 @@ -8357,7 +8357,7 @@ i32.const 0 end ) - (func $std/math/test_log1pf (; 118 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_log1pf (; 119 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.log1p local.get $1 @@ -8365,7 +8365,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.log2 (; 119 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log2 (; 120 ;) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 f64) @@ -8708,7 +8708,7 @@ end return ) - (func $std/math/test_log2 (; 120 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_log2 (; 121 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.log2 local.get $1 @@ -8732,7 +8732,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log2 (; 121 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log2 (; 122 ;) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) @@ -8901,7 +8901,7 @@ end return ) - (func $std/math/test_log2f (; 122 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_log2f (; 123 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.log2 local.get $1 @@ -8909,7 +8909,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_max (; 123 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_max (; 124 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 f64) (local $6 f64) local.get $0 @@ -8941,7 +8941,7 @@ i32.const 0 end ) - (func $std/math/test_maxf (; 124 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_maxf (; 125 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) (local $5 f32) (local $6 f32) local.get $0 @@ -8956,7 +8956,7 @@ local.get $4 call $std/math/check ) - (func $std/math/test_min (; 125 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_min (; 126 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 f64) (local $6 f64) local.get $0 @@ -8988,7 +8988,7 @@ i32.const 0 end ) - (func $std/math/test_minf (; 126 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_minf (; 127 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) (local $5 f32) (local $6 f32) local.get $0 @@ -9003,7 +9003,7 @@ local.get $4 call $std/math/check ) - (func $~lib/math/NativeMath.mod (; 127 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.mod (; 128 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) @@ -9257,7 +9257,7 @@ local.get $2 f64.reinterpret_i64 ) - (func $std/math/test_mod (; 128 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_mod (; 129 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod @@ -9283,7 +9283,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.mod (; 129 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.mod (; 130 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9531,7 +9531,7 @@ local.get $2 f32.reinterpret_i32 ) - (func $std/math/test_modf (; 130 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_modf (; 131 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.mod @@ -9540,7 +9540,7 @@ local.get $4 call $std/math/check ) - (func $~lib/math/NativeMath.pow (; 131 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.pow (; 132 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) (local $3 f64) (local $4 i32) @@ -10500,7 +10500,7 @@ end return ) - (func $std/math/test_pow (; 132 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_pow (; 133 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.pow @@ -10526,7 +10526,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.pow (; 133 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.pow (; 134 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 f32) (local $3 f32) (local $4 i32) @@ -11111,7 +11111,7 @@ f32.demote_f64 end ) - (func $std/math/test_powf (; 134 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_powf (; 135 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.pow @@ -11120,7 +11120,7 @@ local.get $4 call $std/math/check ) - (func $~lib/math/murmurHash3 (; 135 ;) (param $0 i64) (result i64) + (func $~lib/math/murmurHash3 (; 136 ;) (param $0 i64) (result i64) local.get $0 local.get $0 i64.const 33 @@ -11149,7 +11149,7 @@ local.set $0 local.get $0 ) - (func $~lib/math/splitMix32 (; 136 ;) (param $0 i32) (result i32) + (func $~lib/math/splitMix32 (; 137 ;) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -11184,7 +11184,7 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 137 ;) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 138 ;) (param $0 i64) i32.const 1 global.set $~lib/math/random_seeded local.get $0 @@ -11236,19 +11236,16 @@ unreachable end ) - (func $~lib/math/NativeMath.random (; 138 ;) (result f64) + (func $~lib/math/NativeMath.random (; 139 ;) (result f64) (local $0 i64) (local $1 i64) (local $2 i64) global.get $~lib/math/random_seeded i32.eqz if - i32.const 13584 - i32.const 13536 - i32.const 1413 - i32.const 24 - call $~lib/builtins/abort - unreachable + call $~lib/builtins/seed + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom end global.get $~lib/math/random_state0_64 local.set $0 @@ -11291,51 +11288,51 @@ f64.const 1 f64.sub ) - (func $~lib/math/NativeMathf.random (; 139 ;) (result f32) - (local $0 i32) + (func $~lib/math/NativeMathf.random (; 140 ;) (result f32) + (local $0 i64) (local $1 i32) (local $2 i32) + (local $3 i32) global.get $~lib/math/random_seeded i32.eqz if - i32.const 13584 - i32.const 13536 - i32.const 2606 - i32.const 24 - call $~lib/builtins/abort - unreachable + call $~lib/builtins/seed + i64.reinterpret_f64 + local.set $0 + local.get $0 + call $~lib/math/NativeMath.seedRandom end global.get $~lib/math/random_state0_32 - local.set $0 - global.get $~lib/math/random_state1_32 local.set $1 - local.get $0 + global.get $~lib/math/random_state1_32 + local.set $2 + local.get $1 i32.const -1640531525 i32.mul i32.const 5 i32.rotl i32.const 5 i32.mul - local.set $2 + local.set $3 + local.get $2 local.get $1 - local.get $0 i32.xor - local.set $1 - local.get $0 + local.set $2 + local.get $1 i32.const 26 i32.rotl - local.get $1 + local.get $2 i32.xor - local.get $1 + local.get $2 i32.const 9 i32.shl i32.xor global.set $~lib/math/random_state0_32 - local.get $1 + local.get $2 i32.const 13 i32.rotl global.set $~lib/math/random_state1_32 - local.get $2 + local.get $3 i32.const 9 i32.shr_u i32.const 127 @@ -11346,7 +11343,7 @@ f32.const 1 f32.sub ) - (func $std/math/test_round (; 140 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_round (; 141 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) local.get $0 local.set $4 @@ -11361,7 +11358,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_roundf (; 141 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_roundf (; 142 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) local.get $0 local.set $4 @@ -11376,7 +11373,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_sign (; 142 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_sign (; 143 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) block $~lib/math/NativeMath.sign|inlined.0 (result f64) local.get $0 @@ -11419,7 +11416,7 @@ i32.const 0 end ) - (func $std/math/test_signf (; 143 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_signf (; 144 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) block $~lib/math/NativeMathf.sign|inlined.0 (result f32) local.get $0 @@ -11446,7 +11443,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.rem (; 144 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.rem (; 145 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) @@ -11764,7 +11761,7 @@ local.get $0 end ) - (func $std/math/test_rem (; 145 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) + (func $std/math/test_rem (; 146 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.rem @@ -11773,7 +11770,7 @@ local.get $4 call $std/math/check ) - (func $~lib/math/NativeMathf.rem (; 146 ;) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.rem (; 147 ;) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -12084,7 +12081,7 @@ local.get $0 end ) - (func $std/math/test_remf (; 147 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) + (func $std/math/test_remf (; 148 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.rem @@ -12093,7 +12090,7 @@ local.get $4 call $std/math/check ) - (func $~lib/math/NativeMath.sin (; 148 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sin (; 149 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -12622,7 +12619,7 @@ local.get $0 end ) - (func $std/math/test_sin (; 149 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_sin (; 150 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.sin local.get $1 @@ -12646,7 +12643,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.sin (; 150 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sin (; 151 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f64) @@ -13252,7 +13249,7 @@ local.get $26 end ) - (func $std/math/test_sinf (; 151 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_sinf (; 152 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.sin local.get $1 @@ -13260,7 +13257,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.sinh (; 152 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sinh (; 153 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 f64) (local $3 i32) @@ -13358,7 +13355,7 @@ local.set $4 local.get $4 ) - (func $std/math/test_sinh (; 153 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_sinh (; 154 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.sinh local.get $1 @@ -13382,7 +13379,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.sinh (; 154 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sinh (; 155 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -13471,7 +13468,7 @@ local.set $3 local.get $3 ) - (func $std/math/test_sinhf (; 155 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_sinhf (; 156 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.sinh local.get $1 @@ -13479,7 +13476,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_sqrt (; 156 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_sqrt (; 157 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) local.get $0 local.set $4 @@ -13506,7 +13503,7 @@ i32.const 0 end ) - (func $std/math/test_sqrtf (; 157 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_sqrtf (; 158 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) local.get $0 local.set $4 @@ -13517,7 +13514,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/tan_kern (; 158 ;) (param $0 f64) (param $1 f64) (param $2 i32) (result f64) + (func $~lib/math/tan_kern (; 159 ;) (param $0 f64) (param $1 f64) (param $2 i32) (result f64) (local $3 f64) (local $4 f64) (local $5 f64) @@ -13730,7 +13727,7 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.tan (; 159 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tan (; 160 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -14042,7 +14039,7 @@ i32.sub call $~lib/math/tan_kern ) - (func $std/math/test_tan (; 160 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_tan (; 161 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.tan local.get $1 @@ -14066,7 +14063,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.tan (; 161 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.tan (; 162 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -14713,7 +14710,7 @@ end f32.demote_f64 ) - (func $std/math/test_tanf (; 162 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_tanf (; 163 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.tan local.get $1 @@ -14721,7 +14718,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.tanh (; 163 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tanh (; 164 ;) (param $0 f64) (result f64) (local $1 i64) (local $2 f64) (local $3 i32) @@ -14813,7 +14810,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_tanh (; 164 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_tanh (; 165 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMath.tanh local.get $1 @@ -14837,7 +14834,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.tanh (; 165 ;) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.tanh (; 166 ;) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -14923,7 +14920,7 @@ local.get $0 f32.copysign ) - (func $std/math/test_tanhf (; 166 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_tanhf (; 167 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) local.get $0 call $~lib/math/NativeMathf.tanh local.get $1 @@ -14931,7 +14928,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_trunc (; 167 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) + (func $std/math/test_trunc (; 168 ;) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) local.get $0 local.set $4 @@ -14958,7 +14955,7 @@ i32.const 0 end ) - (func $std/math/test_truncf (; 168 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) + (func $std/math/test_truncf (; 169 ;) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) (local $4 f32) local.get $0 local.set $4 @@ -14969,7 +14966,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.sincos (; 169 ;) (param $0 f64) + (func $~lib/math/NativeMath.sincos (; 170 ;) (param $0 f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -15588,7 +15585,7 @@ local.get $23 global.set $~lib/math/NativeMath.sincos_cos ) - (func $std/math/test_sincos (; 170 ;) (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i32) (result i32) + (func $std/math/test_sincos (; 171 ;) (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i32) (result i32) (local $6 f64) (local $7 f64) (local $8 f64) @@ -15626,7 +15623,7 @@ i32.const 0 end ) - (func $~lib/math/dtoi32 (; 171 ;) (param $0 f64) (result i32) + (func $~lib/math/dtoi32 (; 172 ;) (param $0 f64) (result i32) (local $1 i32) (local $2 i64) (local $3 i64) @@ -15697,7 +15694,7 @@ local.get $1 return ) - (func $~lib/math/NativeMath.imul (; 172 ;) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.imul (; 173 ;) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) local.get $0 local.get $1 @@ -15719,7 +15716,7 @@ i32.mul f64.convert_i32_s ) - (func $~lib/math/NativeMath.clz32 (; 173 ;) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.clz32 (; 174 ;) (param $0 f64) (result f64) local.get $0 local.get $0 f64.sub @@ -15735,7 +15732,7 @@ i32.clz f64.convert_i32_s ) - (func $~lib/math/ipow64 (; 174 ;) (param $0 i64) (param $1 i32) (result i64) + (func $~lib/math/ipow64 (; 175 ;) (param $0 i64) (param $1 i32) (result i64) (local $2 i64) (local $3 i32) (local $4 i32) @@ -15955,7 +15952,7 @@ end local.get $2 ) - (func $~lib/math/ipow32f (; 175 ;) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/math/ipow32f (; 176 ;) (param $0 f32) (param $1 i32) (result f32) (local $2 i32) (local $3 f32) (local $4 i32) @@ -16005,7 +16002,7 @@ local.get $3 end ) - (func $~lib/math/ipow64f (; 176 ;) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/ipow64f (; 177 ;) (param $0 f64) (param $1 i32) (result f64) (local $2 i32) (local $3 f64) (local $4 i32) @@ -16055,7 +16052,7 @@ local.get $3 end ) - (func $start:std/math (; 177 ;) + (func $start:std/math (; 178 ;) (local $0 f64) (local $1 i32) (local $2 i32) @@ -55931,7 +55928,7 @@ unreachable end ) - (func $~start (; 178 ;) + (func $~start (; 179 ;) call $start:std/math ) ) diff --git a/tests/compiler/wasi/abort.js b/tests/compiler/wasi/abort.js index 7cd827d779..739723b416 100644 --- a/tests/compiler/wasi/abort.js +++ b/tests/compiler/wasi/abort.js @@ -8,7 +8,7 @@ exports.preInstantiate = function(imports, exports) { const messagePtr = new Uint32Array(memory.buffer)[ iov >>> 2 ]; const messageLen = new Uint32Array(memory.buffer)[(iov >>> 2) + 1]; const message = Array.from(new Uint8Array(memory.buffer, messagePtr, messageLen)).map(c => String.fromCharCode(c)).join(""); - if (message != "Abort: the message\nin wasi/abort.ts(4:2)") failed = "unexpected message: " + message; + if (message != "abort: the message in wasi/abort.ts(4:2)\n") failed = "unexpected message: " + message; }, proc_exit: function(code) { if (code != 255) failed = "unexpected exit code: " + code; diff --git a/tests/compiler/wasi/abort.json b/tests/compiler/wasi/abort.json index 9487733575..3d9e8b70ba 100644 --- a/tests/compiler/wasi/abort.json +++ b/tests/compiler/wasi/abort.json @@ -1,7 +1,6 @@ { "asc_flags": [ "--runtime none", - "--explicitStart", - "--use abort=~lib/bindings/wasi/abort" + "--explicitStart" ] } diff --git a/tests/compiler/wasi/abort.optimized.wat b/tests/compiler/wasi/abort.optimized.wat index aa37b0747a..9415161516 100644 --- a/tests/compiler/wasi/abort.optimized.wat +++ b/tests/compiler/wasi/abort.optimized.wat @@ -244,14 +244,14 @@ (local $3 i32) (local $4 i32) i32.const 2 - local.set $3 + local.set $2 i32.const 4 local.set $1 i32.const 0 i32.const 12 i32.store i32.const 12 - i64.const 9071471065260609 + i64.const 9071471065260641 i64.store i32.const 32 i32.const 19 @@ -259,7 +259,7 @@ i32.const 19 i32.add local.tee $0 - i32.const 544106762 + i32.const 544106784 i32.store local.get $0 i32.const 4 @@ -279,15 +279,15 @@ i32.const 1 i32.add i32.add - local.set $2 + local.set $0 loop $do-continue|0 local.get $1 i32.const 10 i32.div_u - local.get $2 + local.get $0 i32.const 1 i32.sub - local.tee $2 + local.tee $0 local.get $1 i32.const 10 i32.rem_u @@ -297,7 +297,7 @@ local.tee $1 br_if $do-continue|0 end - local.get $2 + local.get $0 local.get $4 i32.add local.tee $1 @@ -305,38 +305,38 @@ i32.store8 i32.const 2 call $~lib/util/number/decimalCount32 - local.tee $0 + local.tee $3 local.get $1 i32.const 1 i32.add i32.add - local.set $2 + local.set $0 loop $do-continue|1 - local.get $3 + local.get $2 i32.const 10 i32.div_u - local.get $2 + local.get $0 i32.const 1 i32.sub - local.tee $2 - local.get $3 + local.tee $0 + local.get $2 i32.const 10 i32.rem_u i32.const 48 i32.add i32.store8 - local.tee $3 + local.tee $2 br_if $do-continue|1 end local.get $0 - local.get $2 + local.get $3 i32.add - local.tee $3 - i32.const 41 - i32.store8 + local.tee $2 + i32.const 2601 + i32.store16 i32.const 4 - local.get $3 - i32.const -11 + local.get $2 + i32.const -10 i32.add i32.store i32.const 2 diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat index 0bcfe7ae65..b56e2c75f5 100644 --- a/tests/compiler/wasi/abort.untouched.wat +++ b/tests/compiler/wasi/abort.untouched.wat @@ -331,33 +331,43 @@ i32.const 12 local.set $4 local.get $4 - i64.const 9071471065260609 + i64.const 9071471065260641 i64.store local.get $4 i32.const 7 i32.add local.set $4 - local.get $4 local.get $0 - local.get $4 i32.const 0 - call $~lib/string/String.UTF8.encodeUnsafe - i32.add - local.set $4 + i32.ne + if + local.get $4 + local.get $0 + local.get $4 + i32.const 0 + call $~lib/string/String.UTF8.encodeUnsafe + i32.add + local.set $4 + end local.get $4 - i32.const 544106762 + i32.const 544106784 i32.store local.get $4 i32.const 4 i32.add local.set $4 - local.get $4 local.get $1 - local.get $4 i32.const 0 - call $~lib/string/String.UTF8.encodeUnsafe - i32.add - local.set $4 + i32.ne + if + local.get $4 + local.get $1 + local.get $4 + i32.const 0 + call $~lib/string/String.UTF8.encodeUnsafe + i32.add + local.set $4 + end local.get $4 local.tee $5 i32.const 1 @@ -441,13 +451,12 @@ i32.add local.set $4 local.get $4 - local.tee $8 - i32.const 1 + i32.const 2601 + i32.store16 + local.get $4 + i32.const 2 i32.add local.set $4 - local.get $8 - i32.const 41 - i32.store8 i32.const 0 local.get $4 i32.const 12 diff --git a/tests/compiler/wasi/seed.js b/tests/compiler/wasi/seed.js new file mode 100644 index 0000000000..167da2f42e --- /dev/null +++ b/tests/compiler/wasi/seed.js @@ -0,0 +1,25 @@ +var memory; + +exports.preInstantiate = function(imports, exports) { + imports["wasi_snapshot_preview1"] = { + fd_write: function(fd, iov, iov_len, nptr) { + if (fd != 2) failed = "unexpected fd: " + fd; + const messagePtr = new Uint32Array(memory.buffer)[ iov >>> 2 ]; + const messageLen = new Uint32Array(memory.buffer)[(iov >>> 2) + 1]; + const message = Array.from(new Uint8Array(memory.buffer, messagePtr, messageLen)).map(c => String.fromCharCode(c)).join(""); + (fd == 1 ? process.stdout : process.stderr).write(message); + }, + proc_exit: function(code) { + console.log("exit: " + code); + }, + random_get: function(buf, len) { + new Uint8Array(memory.buffer, buf, len).set(require("crypto").randomBytes(len)); + } + }; +}; + +exports.postInstantiate = function(instance) { + const exports = instance.exports; + memory = exports.memory; + console.log("Math.random = " + exports.test()); +} diff --git a/tests/compiler/wasi/seed.json b/tests/compiler/wasi/seed.json new file mode 100644 index 0000000000..3d9e8b70ba --- /dev/null +++ b/tests/compiler/wasi/seed.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime none", + "--explicitStart" + ] +} diff --git a/tests/compiler/wasi/seed.optimized.wat b/tests/compiler/wasi/seed.optimized.wat new file mode 100644 index 0000000000..8ed3924eb4 --- /dev/null +++ b/tests/compiler/wasi/seed.optimized.wat @@ -0,0 +1,513 @@ +(module + (type $none_=>_f64 (func (result f64))) + (type $none_=>_none (func)) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_=>_none (func (param i32))) + (type $i64_=>_none (func (param i64))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i64_=>_i64 (func (param i64) (result i64))) + (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (memory $0 1) + (data (i32.const 16) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") + (global $~lib/math/random_seeded (mut i32) (i32.const 0)) + (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) + (global $~lib/math/random_state1_64 (mut i64) (i64.const 0)) + (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) + (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) + (export "_start" (func $~start)) + (export "memory" (memory $0)) + (export "test" (func $wasi/seed/test)) + (func $~lib/bindings/wasi/seed (; 3 ;) (result f64) + (local $0 i64) + (local $1 i64) + i32.const 0 + i64.load + local.set $0 + loop $do-continue|0 + i32.const 0 + i32.const 8 + call $~lib/bindings/wasi_snapshot_preview1/random_get + drop + i32.const 0 + i64.load + local.tee $1 + i64.eqz + br_if $do-continue|0 + end + i32.const 0 + local.get $0 + i64.store + local.get $1 + f64.reinterpret_i64 + ) + (func $~lib/math/murmurHash3 (; 4 ;) (param $0 i64) (result i64) + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + i64.const -49064778989728563 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + i64.const -4265267296055464877 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + ) + (func $~lib/math/splitMix32 (; 5 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 1831565813 + i32.add + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + local.get $0 + i32.const 1 + i32.or + i32.mul + local.tee $0 + local.get $0 + local.get $0 + i32.const 61 + i32.or + local.get $0 + local.get $0 + i32.const 7 + i32.shr_u + i32.xor + i32.mul + i32.add + i32.xor + local.tee $0 + local.get $0 + i32.const 14 + i32.shr_u + i32.xor + ) + (func $~lib/string/String.UTF8.encodeUnsafe (; 6 ;) (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 32 + local.set $2 + i32.const 28 + i32.load + i32.const 32 + i32.add + local.set $4 + i32.const 23 + local.set $1 + loop $while-continue|0 + local.get $2 + local.get $4 + i32.lt_u + if + local.get $2 + i32.load16_u + local.tee $0 + i32.const 128 + i32.lt_u + if (result i32) + local.get $1 + local.get $0 + i32.store8 + local.get $1 + i32.const 1 + i32.add + else + local.get $0 + i32.const 2048 + i32.lt_u + if (result i32) + local.get $1 + local.get $0 + i32.const 6 + i32.shr_u + i32.const 192 + i32.or + local.get $0 + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 8 + i32.shl + i32.or + i32.store16 + local.get $1 + i32.const 2 + i32.add + else + local.get $2 + i32.const 2 + i32.add + local.get $4 + i32.lt_u + i32.const 0 + local.get $0 + i32.const 64512 + i32.and + i32.const 55296 + i32.eq + select + if + local.get $2 + i32.load16_u offset=2 + local.tee $3 + i32.const 64512 + i32.and + i32.const 56320 + i32.eq + if + local.get $0 + i32.const 1023 + i32.and + i32.const 10 + i32.shl + i32.const 65536 + i32.add + local.get $3 + i32.const 1023 + i32.and + i32.or + local.tee $0 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $3 + local.get $1 + local.get $0 + i32.const 18 + i32.shr_u + i32.const 240 + i32.or + local.get $3 + i32.const 24 + i32.shl + local.get $0 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 16 + i32.shl + i32.or + local.get $0 + i32.const 12 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 8 + i32.shl + i32.or + i32.or + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $while-continue|0 + end + end + local.get $1 + local.get $0 + i32.const 12 + i32.shr_u + i32.const 224 + i32.or + local.get $0 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.const 8 + i32.shl + i32.or + i32.store16 + local.get $1 + local.get $0 + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=2 + local.get $1 + i32.const 3 + i32.add + end + end + local.set $1 + local.get $2 + i32.const 2 + i32.add + local.set $2 + br $while-continue|0 + end + end + local.get $1 + i32.const 23 + i32.sub + ) + (func $~lib/util/number/decimalCount32 (; 7 ;) (param $0 i32) (result i32) + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + i32.const 3 + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.get $0 + i32.const 1000 + i32.lt_u + select + local.get $0 + i32.const 100 + i32.lt_u + select + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + i32.const 8 + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.get $0 + i32.const 100000000 + i32.lt_u + select + local.get $0 + i32.const 10000000 + i32.lt_u + select + local.get $0 + i32.const 100000 + i32.lt_u + select + ) + (func $~lib/bindings/wasi/abort (; 8 ;) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 4 + local.set $2 + i32.const 1406 + local.set $1 + i32.const 0 + i32.const 12 + i32.store + i32.const 12 + i64.const 9071471065260641 + i64.store + i32.const 19 + i32.const 544106784 + i32.store + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 23 + i32.add + local.tee $0 + i32.const 40 + i32.store8 + i32.const 1406 + call $~lib/util/number/decimalCount32 + local.tee $4 + local.get $0 + i32.const 1 + i32.add + i32.add + local.set $0 + loop $do-continue|0 + local.get $1 + i32.const 10 + i32.div_u + local.get $0 + i32.const 1 + i32.sub + local.tee $0 + local.get $1 + i32.const 10 + i32.rem_u + i32.const 48 + i32.add + i32.store8 + local.tee $1 + br_if $do-continue|0 + end + local.get $0 + local.get $4 + i32.add + local.tee $1 + i32.const 58 + i32.store8 + i32.const 4 + call $~lib/util/number/decimalCount32 + local.tee $3 + local.get $1 + i32.const 1 + i32.add + i32.add + local.set $0 + loop $do-continue|1 + local.get $2 + i32.const 10 + i32.div_u + local.get $0 + i32.const 1 + i32.sub + local.tee $0 + local.get $2 + i32.const 10 + i32.rem_u + i32.const 48 + i32.add + i32.store8 + local.tee $2 + br_if $do-continue|1 + end + local.get $0 + local.get $3 + i32.add + local.tee $2 + i32.const 2601 + i32.store16 + i32.const 4 + local.get $2 + i32.const -10 + i32.add + i32.store + i32.const 2 + i32.const 0 + i32.const 1 + i32.const 8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + i32.const 255 + call $~lib/bindings/wasi_snapshot_preview1/proc_exit + ) + (func $~lib/math/NativeMath.seedRandom (; 9 ;) (param $0 i64) + i32.const 1 + global.set $~lib/math/random_seeded + local.get $0 + call $~lib/math/murmurHash3 + global.set $~lib/math/random_state0_64 + global.get $~lib/math/random_state0_64 + i64.const -1 + i64.xor + call $~lib/math/murmurHash3 + global.set $~lib/math/random_state1_64 + local.get $0 + i32.wrap_i64 + call $~lib/math/splitMix32 + global.set $~lib/math/random_state0_32 + global.get $~lib/math/random_state0_32 + call $~lib/math/splitMix32 + global.set $~lib/math/random_state1_32 + global.get $~lib/math/random_state1_32 + i32.const 0 + i32.ne + i32.const 0 + global.get $~lib/math/random_state0_32 + i32.const 0 + global.get $~lib/math/random_state1_64 + i64.const 0 + i64.ne + i32.const 0 + global.get $~lib/math/random_state0_64 + i64.const 0 + i64.ne + select + select + select + i32.eqz + if + call $~lib/bindings/wasi/abort + unreachable + end + ) + (func $~lib/math/NativeMath.random (; 10 ;) (result f64) + (local $0 i64) + (local $1 i64) + global.get $~lib/math/random_seeded + i32.eqz + if + call $~lib/bindings/wasi/seed + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom + end + global.get $~lib/math/random_state0_64 + local.set $0 + global.get $~lib/math/random_state1_64 + local.tee $1 + global.set $~lib/math/random_state0_64 + local.get $1 + local.get $0 + local.get $0 + i64.const 23 + i64.shl + i64.xor + local.tee $0 + local.get $0 + i64.const 17 + i64.shr_u + i64.xor + i64.xor + local.get $1 + i64.const 26 + i64.shr_u + i64.xor + global.set $~lib/math/random_state1_64 + local.get $1 + i64.const 12 + i64.shr_u + i64.const 4607182418800017408 + i64.or + f64.reinterpret_i64 + f64.const 1 + f64.sub + ) + (func $wasi/seed/test (; 11 ;) (result f64) + call $~lib/math/NativeMath.random + ) + (func $~start (; 12 ;) + nop + ) +) diff --git a/tests/compiler/wasi/seed.ts b/tests/compiler/wasi/seed.ts new file mode 100644 index 0000000000..fba2068120 --- /dev/null +++ b/tests/compiler/wasi/seed.ts @@ -0,0 +1,5 @@ +import "bindings/wasi"; + +export function test(): f64 { + return Math.random(); +} diff --git a/tests/compiler/wasi/seed.untouched.wat b/tests/compiler/wasi/seed.untouched.wat new file mode 100644 index 0000000000..31899d94f0 --- /dev/null +++ b/tests/compiler/wasi/seed.untouched.wat @@ -0,0 +1,690 @@ +(module + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $none_=>_f64 (func (result f64))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i64_=>_none (func (param i64))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i64_=>_i64 (func (param i64) (result i64))) + (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (memory $0 1) + (data (i32.const 16) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") + (table $0 1 funcref) + (global $~lib/math/random_seeded (mut i32) (i32.const 0)) + (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) + (global $~lib/math/random_state1_64 (mut i64) (i64.const 0)) + (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) + (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) + (export "_start" (func $~start)) + (export "memory" (memory $0)) + (export "test" (func $wasi/seed/test)) + (func $~lib/bindings/wasi/seed (; 3 ;) (result f64) + (local $0 i64) + (local $1 i64) + (local $2 i32) + i32.const 0 + i64.load + local.set $0 + loop $do-continue|0 + i32.const 0 + i32.const 8 + call $~lib/bindings/wasi_snapshot_preview1/random_get + drop + i32.const 0 + i64.load + local.set $1 + local.get $1 + i64.const 0 + i64.ne + i32.eqz + local.set $2 + local.get $2 + br_if $do-continue|0 + end + i32.const 0 + local.get $0 + i64.store + local.get $1 + f64.reinterpret_i64 + ) + (func $~lib/math/murmurHash3 (; 4 ;) (param $0 i64) (result i64) + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + i64.const -49064778989728563 + i64.mul + local.set $0 + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + i64.const -4265267296055464877 + i64.mul + local.set $0 + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + ) + (func $~lib/math/splitMix32 (; 5 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 1831565813 + i32.add + local.set $0 + local.get $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + local.get $0 + i32.const 1 + i32.or + i32.mul + local.set $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 + i32.const 7 + i32.shr_u + i32.xor + local.get $0 + i32.const 61 + i32.or + i32.mul + i32.add + i32.xor + local.set $0 + local.get $0 + local.get $0 + i32.const 14 + i32.shr_u + i32.xor + ) + (func $~lib/rt/stub/__retain (; 6 ;) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 7 ;) (param $0 i32) + nop + ) + (func $~lib/string/String.UTF8.encodeUnsafe (; 8 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + local.set $3 + local.get $0 + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.add + local.set $4 + local.get $1 + local.set $5 + loop $while-continue|0 + local.get $3 + local.get $4 + i32.lt_u + local.set $6 + local.get $6 + if + local.get $3 + i32.load16_u + local.set $7 + local.get $7 + i32.const 128 + i32.lt_u + if + local.get $5 + local.get $7 + i32.store8 + local.get $5 + i32.const 1 + i32.add + local.set $5 + else + local.get $7 + i32.const 2048 + i32.lt_u + if + local.get $7 + i32.const 6 + i32.shr_u + i32.const 192 + i32.or + local.set $8 + local.get $7 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $9 + local.get $5 + local.get $9 + i32.const 8 + i32.shl + local.get $8 + i32.or + i32.store16 + local.get $5 + i32.const 2 + i32.add + local.set $5 + else + local.get $7 + i32.const 64512 + i32.and + i32.const 55296 + i32.eq + if (result i32) + local.get $3 + i32.const 2 + i32.add + local.get $4 + i32.lt_u + else + i32.const 0 + end + if + local.get $3 + i32.load16_u offset=2 + local.set $9 + local.get $9 + i32.const 64512 + i32.and + i32.const 56320 + i32.eq + if + i32.const 65536 + local.get $7 + i32.const 1023 + i32.and + i32.const 10 + i32.shl + i32.add + local.get $9 + i32.const 1023 + i32.and + i32.or + local.set $7 + local.get $7 + i32.const 18 + i32.shr_u + i32.const 240 + i32.or + local.set $8 + local.get $7 + i32.const 12 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $10 + local.get $7 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $11 + local.get $7 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $12 + local.get $5 + local.get $12 + i32.const 24 + i32.shl + local.get $11 + i32.const 16 + i32.shl + i32.or + local.get $10 + i32.const 8 + i32.shl + i32.or + local.get $8 + i32.or + i32.store + local.get $5 + i32.const 4 + i32.add + local.set $5 + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $while-continue|0 + end + end + local.get $7 + i32.const 12 + i32.shr_u + i32.const 224 + i32.or + local.set $9 + local.get $7 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $12 + local.get $7 + i32.const 63 + i32.and + i32.const 128 + i32.or + local.set $11 + local.get $5 + local.get $12 + i32.const 8 + i32.shl + local.get $9 + i32.or + i32.store16 + local.get $5 + local.get $11 + i32.store8 offset=2 + local.get $5 + i32.const 3 + i32.add + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.add + local.set $3 + br $while-continue|0 + end + end + local.get $2 + if + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + i32.const 0 + i32.store8 + end + local.get $5 + local.get $1 + i32.sub + local.set $6 + local.get $0 + call $~lib/rt/stub/__release + local.get $6 + ) + (func $~lib/util/number/decimalCount32 (; 9 ;) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 100000 + i32.lt_u + if + local.get $0 + i32.const 100 + i32.lt_u + if + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + return + else + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.set $1 + i32.const 3 + local.get $1 + local.get $0 + i32.const 1000 + i32.lt_u + select + return + end + unreachable + else + local.get $0 + i32.const 10000000 + i32.lt_u + if + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + return + else + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.set $1 + i32.const 8 + local.get $1 + local.get $0 + i32.const 100000000 + i32.lt_u + select + return + end + unreachable + end + unreachable + ) + (func $~lib/bindings/wasi/abort (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $0 + local.get $1 + call $~lib/rt/stub/__retain + local.set $1 + i32.const 0 + i32.const 12 + i32.store + i32.const 12 + local.set $4 + local.get $4 + i64.const 9071471065260641 + i64.store + local.get $4 + i32.const 7 + i32.add + local.set $4 + local.get $0 + i32.const 0 + i32.ne + if + local.get $4 + local.get $0 + local.get $4 + i32.const 0 + call $~lib/string/String.UTF8.encodeUnsafe + i32.add + local.set $4 + end + local.get $4 + i32.const 544106784 + i32.store + local.get $4 + i32.const 4 + i32.add + local.set $4 + local.get $1 + i32.const 0 + i32.ne + if + local.get $4 + local.get $1 + local.get $4 + i32.const 0 + call $~lib/string/String.UTF8.encodeUnsafe + i32.add + local.set $4 + end + local.get $4 + local.tee $5 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 40 + i32.store8 + local.get $2 + call $~lib/util/number/decimalCount32 + local.set $6 + local.get $4 + local.get $6 + i32.add + local.set $4 + loop $do-continue|0 + local.get $2 + i32.const 10 + i32.div_u + local.set $5 + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + i32.const 48 + local.get $2 + i32.const 10 + i32.rem_u + i32.add + i32.store8 + local.get $5 + local.set $2 + local.get $2 + local.set $7 + local.get $7 + br_if $do-continue|0 + end + local.get $4 + local.get $6 + i32.add + local.set $4 + local.get $4 + local.tee $7 + i32.const 1 + i32.add + local.set $4 + local.get $7 + i32.const 58 + i32.store8 + local.get $3 + call $~lib/util/number/decimalCount32 + local.set $6 + local.get $4 + local.get $6 + i32.add + local.set $4 + loop $do-continue|1 + local.get $3 + i32.const 10 + i32.div_u + local.set $7 + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + i32.const 48 + local.get $3 + i32.const 10 + i32.rem_u + i32.add + i32.store8 + local.get $7 + local.set $3 + local.get $3 + local.set $8 + local.get $8 + br_if $do-continue|1 + end + local.get $4 + local.get $6 + i32.add + local.set $4 + local.get $4 + i32.const 2601 + i32.store16 + local.get $4 + i32.const 2 + i32.add + local.set $4 + i32.const 0 + local.get $4 + i32.const 12 + i32.sub + i32.store offset=4 + i32.const 2 + i32.const 0 + i32.const 1 + i32.const 8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + i32.const 255 + call $~lib/bindings/wasi_snapshot_preview1/proc_exit + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $~lib/math/NativeMath.seedRandom (; 11 ;) (param $0 i64) + i32.const 1 + global.set $~lib/math/random_seeded + local.get $0 + call $~lib/math/murmurHash3 + global.set $~lib/math/random_state0_64 + global.get $~lib/math/random_state0_64 + i64.const -1 + i64.xor + call $~lib/math/murmurHash3 + global.set $~lib/math/random_state1_64 + local.get $0 + i32.wrap_i64 + call $~lib/math/splitMix32 + global.set $~lib/math/random_state0_32 + global.get $~lib/math/random_state0_32 + call $~lib/math/splitMix32 + global.set $~lib/math/random_state1_32 + global.get $~lib/math/random_state0_64 + i64.const 0 + i64.ne + if (result i32) + global.get $~lib/math/random_state1_64 + i64.const 0 + i64.ne + else + i32.const 0 + end + if (result i32) + global.get $~lib/math/random_state0_32 + i32.const 0 + i32.ne + else + i32.const 0 + end + if (result i32) + global.get $~lib/math/random_state1_32 + i32.const 0 + i32.ne + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 1406 + i32.const 4 + call $~lib/bindings/wasi/abort + unreachable + end + ) + (func $~lib/math/NativeMath.random (; 12 ;) (result f64) + (local $0 i64) + (local $1 i64) + (local $2 i64) + global.get $~lib/math/random_seeded + i32.eqz + if + call $~lib/bindings/wasi/seed + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom + end + global.get $~lib/math/random_state0_64 + local.set $0 + global.get $~lib/math/random_state1_64 + local.set $1 + local.get $1 + global.set $~lib/math/random_state0_64 + local.get $0 + local.get $0 + i64.const 23 + i64.shl + i64.xor + local.set $0 + local.get $0 + local.get $0 + i64.const 17 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + local.get $1 + i64.xor + local.set $0 + local.get $0 + local.get $1 + i64.const 26 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + global.set $~lib/math/random_state1_64 + local.get $1 + i64.const 12 + i64.shr_u + i64.const 4607182418800017408 + i64.or + local.set $2 + local.get $2 + f64.reinterpret_i64 + f64.const 1 + f64.sub + ) + (func $wasi/seed/test (; 13 ;) (result f64) + call $~lib/math/NativeMath.random + ) + (func $~start (; 14 ;) + nop + ) +) diff --git a/tests/compiler/wasi/trace.js b/tests/compiler/wasi/trace.js new file mode 100644 index 0000000000..0bee988b52 --- /dev/null +++ b/tests/compiler/wasi/trace.js @@ -0,0 +1,22 @@ +var memory; + +exports.preInstantiate = function(imports, exports) { + imports["wasi_snapshot_preview1"] = { + fd_write: function(fd, iov, iov_len, nptr) { + if (fd != 1) failed = "unexpected fd: " + fd; + const messagePtr = new Uint32Array(memory.buffer)[ iov >>> 2 ]; + const messageLen = new Uint32Array(memory.buffer)[(iov >>> 2) + 1]; + const message = Array.from(new Uint8Array(memory.buffer, messagePtr, messageLen)).map(c => String.fromCharCode(c)).join(""); + process.stdout.write(message); + }, + proc_exit: function(code) { + console.log("exit: " + code); + } + }; +}; + +exports.postInstantiate = function(instance) { + const exports = instance.exports; + memory = exports.memory; + exports.test(); +} diff --git a/tests/compiler/wasi/trace.json b/tests/compiler/wasi/trace.json new file mode 100644 index 0000000000..3d9e8b70ba --- /dev/null +++ b/tests/compiler/wasi/trace.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime none", + "--explicitStart" + ] +} diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat new file mode 100644 index 0000000000..58926e1930 --- /dev/null +++ b/tests/compiler/wasi/trace.optimized.wat @@ -0,0 +1,2039 @@ +(module + (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_f64_f64_f64_f64_f64_=>_none (func (param i32 f64 f64 f64 f64 f64))) + (type $none_=>_i32 (func (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (memory $0 1) + (data (i32.const 16) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e") + (data (i32.const 64) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") + (data (i32.const 96) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") + (data (i32.const 128) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 176) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 208) "\b8\02\00\00\01\00\00\00\03\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 9 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + loop $do-continue|0 + local.get $1 + i32.const 10 + i32.div_u + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + i32.add + local.get $1 + i32.const 10 + i32.rem_u + i32.const 48 + i32.add + i32.store16 + local.tee $1 + br_if $do-continue|0 + end + ) + (func $~lib/util/number/prettify (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + i32.eqz + if + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.const 3145774 + i32.store + local.get $1 + i32.const 2 + i32.add + return + end + local.get $1 + local.get $1 + local.get $2 + i32.add + local.tee $3 + i32.le_s + if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else + i32.const 0 + end + if (result i32) + loop $for-loop|0 + local.get $1 + local.get $3 + i32.lt_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.const 48 + i32.store16 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $for-loop|0 + end + end + local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.const 3145774 + i32.store + local.get $3 + i32.const 2 + i32.add + else + local.get $3 + i32.const 21 + i32.le_s + i32.const 0 + local.get $3 + i32.const 0 + i32.gt_s + select + if (result i32) + local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.tee $0 + i32.const 2 + i32.add + local.get $0 + i32.const 0 + local.get $2 + i32.sub + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + i32.const 46 + i32.store16 + local.get $1 + i32.const 1 + i32.add + else + local.get $3 + i32.const 0 + i32.le_s + i32.const 0 + i32.const -6 + local.get $3 + i32.lt_s + select + if (result i32) + local.get $0 + i32.const 2 + local.get $3 + i32.sub + local.tee $3 + i32.const 1 + i32.shl + i32.add + local.get $0 + local.get $1 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + i32.const 3014704 + i32.store + i32.const 2 + local.set $2 + loop $for-loop|1 + local.get $2 + local.get $3 + i32.lt_s + if + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + i32.const 48 + i32.store16 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $for-loop|1 + end + end + local.get $1 + local.get $3 + i32.add + else + local.get $1 + i32.const 1 + i32.eq + if (result i32) + local.get $0 + i32.const 101 + i32.store16 offset=2 + local.get $0 + i32.const 4 + i32.add + local.tee $1 + local.get $3 + i32.const 1 + i32.sub + local.tee $0 + i32.const 0 + i32.lt_s + local.tee $2 + if + i32.const 0 + local.get $0 + i32.sub + local.set $0 + end + local.get $0 + local.get $0 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.tee $0 + call $~lib/util/number/utoa_simple + local.get $1 + i32.const 45 + i32.const 43 + local.get $2 + select + i32.store16 + local.get $0 + i32.const 2 + i32.add + else + local.get $0 + i32.const 4 + i32.add + local.get $0 + i32.const 2 + i32.add + local.get $1 + i32.const 1 + i32.shl + local.tee $2 + i32.const 2 + i32.sub + call $~lib/memory/memory.copy + local.get $0 + i32.const 46 + i32.store16 offset=2 + local.get $0 + local.get $2 + i32.add + local.tee $0 + i32.const 101 + i32.store16 offset=2 + local.get $0 + i32.const 4 + i32.add + local.tee $2 + local.get $3 + i32.const 1 + i32.sub + local.tee $0 + i32.const 0 + i32.lt_s + local.tee $3 + if + i32.const 0 + local.get $0 + i32.sub + local.set $0 + end + local.get $0 + local.get $0 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.tee $0 + call $~lib/util/number/utoa_simple + local.get $2 + i32.const 45 + i32.const 43 + local.get $3 + select + i32.store16 + local.get $0 + local.get $1 + i32.add + i32.const 2 + i32.add + end + end + end + end + ) + (func $~lib/util/number/dtoa_core (; 11 ;) (param $0 i32) (param $1 f64) (result i32) + (local $2 i64) + (local $3 i32) + (local $4 i64) + (local $5 i32) + (local $6 i32) + (local $7 i64) + (local $8 i64) + (local $9 i64) + (local $10 i32) + (local $11 i64) + (local $12 i64) + (local $13 i64) + (local $14 i64) + (local $15 i64) + (local $16 i64) + (local $17 i64) + (local $18 i64) + local.get $1 + f64.const 0 + f64.lt + local.tee $10 + if (result f64) + local.get $0 + i32.const 45 + i32.store16 + local.get $1 + f64.neg + else + local.get $1 + end + i64.reinterpret_f64 + local.tee $2 + i64.const 9218868437227405312 + i64.and + i64.const 52 + i64.shr_u + i32.wrap_i64 + local.set $5 + local.get $2 + i64.const 4503599627370495 + i64.and + local.get $5 + i32.const 0 + i32.ne + local.tee $6 + i64.extend_i32_u + i64.const 52 + i64.shl + i64.add + local.tee $2 + i64.const 1 + i64.shl + i64.const 1 + i64.add + local.tee $7 + i64.clz + i32.wrap_i64 + local.set $3 + local.get $7 + local.get $3 + i64.extend_i32_s + i64.shl + global.set $~lib/util/number/_frc_plus + local.get $5 + i32.const 1 + local.get $6 + select + i32.const 1075 + i32.sub + local.tee $5 + i32.const 1 + i32.sub + local.get $3 + i32.sub + local.set $3 + local.get $2 + local.get $2 + i64.const 4503599627370496 + i64.eq + i32.const 1 + i32.add + local.tee $6 + i64.extend_i32_s + i64.shl + i64.const 1 + i64.sub + local.get $5 + local.get $6 + i32.sub + local.get $3 + i32.sub + i64.extend_i32_s + i64.shl + global.set $~lib/util/number/_frc_minus + local.get $3 + global.set $~lib/util/number/_exp + i32.const 348 + i32.const -61 + global.get $~lib/util/number/_exp + i32.sub + f64.convert_i32_s + f64.const 0.30102999566398114 + f64.mul + f64.const 347 + f64.add + local.tee $1 + i32.trunc_f64_s + local.tee $3 + local.get $3 + f64.convert_i32_s + local.get $1 + f64.ne + i32.add + i32.const 3 + i32.shr_s + i32.const 1 + i32.add + local.tee $3 + i32.const 3 + i32.shl + local.tee $6 + i32.sub + global.set $~lib/util/number/_K + local.get $6 + i32.const 224 + i32.add + i64.load + global.set $~lib/util/number/_frc_pow + local.get $3 + i32.const 1 + i32.shl + i32.const 944 + i32.add + i32.load16_s + global.set $~lib/util/number/_exp_pow + local.get $2 + local.get $2 + i64.clz + i32.wrap_i64 + local.tee $3 + i64.extend_i32_s + i64.shl + local.tee $7 + i64.const 4294967295 + i64.and + local.tee $11 + global.get $~lib/util/number/_frc_pow + local.tee $2 + i64.const 4294967295 + i64.and + local.tee $13 + i64.mul + local.set $14 + global.get $~lib/util/number/_frc_plus + local.tee $8 + i64.const 4294967295 + i64.and + local.tee $4 + local.get $2 + i64.const 4294967295 + i64.and + local.tee $9 + i64.mul + local.set $12 + global.get $~lib/util/number/_frc_minus + local.tee $15 + i64.const 4294967295 + i64.and + local.tee $16 + local.get $2 + i64.const 4294967295 + i64.and + local.tee $17 + i64.mul + local.set $18 + local.get $4 + local.get $2 + i64.const 32 + i64.shr_u + local.tee $4 + i64.mul + local.get $9 + local.get $8 + i64.const 32 + i64.shr_u + local.tee $8 + i64.mul + local.get $12 + i64.const 32 + i64.shr_u + i64.add + local.tee $9 + i64.const 4294967295 + i64.and + i64.add + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + local.get $4 + local.get $8 + i64.mul + local.get $9 + i64.const 32 + i64.shr_u + i64.add + i64.add + i64.const 1 + i64.sub + local.tee $8 + local.get $16 + local.get $2 + i64.const 32 + i64.shr_u + local.tee $4 + i64.mul + local.get $17 + local.get $15 + i64.const 32 + i64.shr_u + local.tee $9 + i64.mul + local.get $18 + i64.const 32 + i64.shr_u + i64.add + local.tee $12 + i64.const 4294967295 + i64.and + i64.add + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + local.get $4 + local.get $9 + i64.mul + local.get $12 + i64.const 32 + i64.shr_u + i64.add + i64.add + i64.const 1 + i64.add + i64.sub + local.set $4 + local.get $0 + local.get $10 + i32.const 1 + i32.shl + i32.add + local.get $0 + local.get $11 + local.get $2 + i64.const 32 + i64.shr_u + local.tee $2 + i64.mul + local.get $13 + local.get $7 + i64.const 32 + i64.shr_u + local.tee $7 + i64.mul + local.get $14 + i64.const 32 + i64.shr_u + i64.add + local.tee $11 + i64.const 4294967295 + i64.and + i64.add + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + local.get $2 + local.get $7 + i64.mul + local.get $11 + i64.const 32 + i64.shr_u + i64.add + i64.add + global.get $~lib/util/number/_exp_pow + local.tee $0 + local.get $5 + local.get $3 + i32.sub + i32.add + i32.const -64 + i32.sub + local.get $8 + local.get $0 + global.get $~lib/util/number/_exp + i32.add + i32.const -64 + i32.sub + local.get $4 + local.get $10 + call $~lib/util/number/genDigits + local.get $10 + i32.sub + global.get $~lib/util/number/_K + call $~lib/util/number/prettify + local.get $10 + i32.add + ) + (func $~lib/string/String#substring (; 12 ;) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 0 + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + local.tee $2 + i32.const 0 + local.get $2 + i32.lt_s + select + local.tee $3 + local.get $1 + i32.const 0 + local.get $1 + i32.const 0 + i32.gt_s + select + local.tee $1 + local.get $2 + local.get $1 + local.get $2 + i32.lt_s + select + local.tee $1 + local.get $3 + local.get $1 + i32.gt_s + select + i32.const 1 + i32.shl + local.tee $4 + local.get $3 + local.get $1 + local.get $3 + local.get $1 + i32.lt_s + select + i32.const 1 + i32.shl + local.tee $1 + i32.sub + local.tee $3 + i32.eqz + if + i32.const 1200 + return + end + i32.const 0 + local.get $4 + local.get $2 + i32.const 1 + i32.shl + i32.eq + local.get $1 + select + if + local.get $0 + return + end + local.get $3 + i32.const 1 + call $~lib/rt/stub/__alloc + local.tee $2 + local.get $0 + local.get $1 + i32.add + local.get $3 + call $~lib/memory/memory.copy + local.get $2 + ) + (func $~lib/bindings/wasi/abort (; 13 ;) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 0 + i32.const 12 + i32.store + i32.const 12 + i64.const 9071471065260641 + i64.store + i32.const 19 + i32.const 544106784 + i32.store + i32.const 1216 + i32.const 23 + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 23 + i32.add + local.tee $2 + i32.const 40 + i32.store8 + local.get $0 + call $~lib/util/number/decimalCount32 + local.tee $4 + local.get $2 + i32.const 1 + i32.add + i32.add + local.set $2 + loop $do-continue|0 + local.get $0 + i32.const 10 + i32.div_u + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.const 10 + i32.rem_u + i32.const 48 + i32.add + i32.store8 + local.tee $0 + br_if $do-continue|0 + end + local.get $2 + local.get $4 + i32.add + local.tee $0 + i32.const 58 + i32.store8 + local.get $1 + call $~lib/util/number/decimalCount32 + local.tee $3 + local.get $0 + i32.const 1 + i32.add + i32.add + local.set $2 + loop $do-continue|1 + local.get $1 + i32.const 10 + i32.div_u + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $1 + i32.const 10 + i32.rem_u + i32.const 48 + i32.add + i32.store8 + local.tee $1 + br_if $do-continue|1 + end + local.get $2 + local.get $3 + i32.add + local.tee $0 + i32.const 2601 + i32.store16 + i32.const 4 + local.get $0 + i32.const -10 + i32.add + i32.store + i32.const 2 + i32.const 0 + i32.const 1 + i32.const 8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + i32.const 255 + call $~lib/bindings/wasi_snapshot_preview1/proc_exit + ) + (func $~lib/rt/stub/__free (; 14 ;) (param $0 i32) + (local $1 i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 70 + i32.const 2 + call $~lib/bindings/wasi/abort + unreachable + end + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + i32.load offset=4 + i32.const 1 + i32.ne + if + i32.const 72 + i32.const 13 + call $~lib/bindings/wasi/abort + unreachable + end + global.get $~lib/rt/stub/offset + local.get $0 + local.get $1 + i32.load + i32.add + i32.eq + if + local.get $1 + global.set $~lib/rt/stub/offset + end + ) + (func $~lib/util/number/dtoa (; 15 ;) (param $0 f64) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + f64.const 0 + f64.eq + if + i32.const 80 + return + end + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.ne + if + local.get $0 + local.get $0 + f64.ne + if + i32.const 112 + return + end + i32.const 144 + i32.const 192 + local.get $0 + f64.const 0 + f64.lt + select + return + end + i32.const 56 + i32.const 1 + call $~lib/rt/stub/__alloc + local.tee $1 + local.get $0 + call $~lib/util/number/dtoa_core + local.tee $2 + i32.const 28 + i32.eq + if + local.get $1 + return + end + local.get $1 + local.get $2 + call $~lib/string/String#substring + local.get $1 + call $~lib/rt/stub/__free + ) + (func $~lib/bindings/wasi/trace (; 16 ;) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) + (local $6 i32) + (local $7 i32) + (local $8 i32) + call $~lib/string/String.UTF8.byteLength + local.tee $6 + i32.const 56 + local.get $6 + i32.const 56 + i32.gt_s + select + i32.const 13 + i32.add + i32.const 0 + call $~lib/rt/stub/__alloc + local.tee $6 + i32.const 8 + i32.add + local.tee $8 + i32.const 4 + i32.add + local.set $7 + local.get $6 + local.get $7 + i32.store + local.get $7 + i64.const 9071406388179572 + i64.store + local.get $6 + i32.const 7 + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + local.get $6 + i32.const 32 + local.get $7 + call $~lib/string/String.UTF8.encodeUnsafe + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + local.get $0 + if (result i32) + local.get $7 + i32.const 32 + i32.store8 + local.get $6 + local.get $1 + call $~lib/util/number/dtoa + local.get $7 + i32.const 1 + i32.add + local.tee $7 + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 1 + i32.add + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + local.get $0 + i32.const 1 + i32.gt_s + if + local.get $6 + local.get $2 + call $~lib/util/number/dtoa + local.get $7 + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 1 + i32.add + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + local.get $0 + i32.const 2 + i32.gt_s + if + local.get $6 + local.get $3 + call $~lib/util/number/dtoa + local.get $7 + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 1 + i32.add + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + local.get $0 + i32.const 3 + i32.gt_s + if + local.get $6 + local.get $4 + call $~lib/util/number/dtoa + local.get $7 + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 1 + i32.add + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + local.get $0 + i32.const 4 + i32.gt_s + if + local.get $6 + local.get $5 + call $~lib/util/number/dtoa + local.get $7 + call $~lib/string/String.UTF8.encodeUnsafe + i32.const 1 + i32.add + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + end + end + end + end + local.get $7 + i32.const 1 + i32.sub + else + local.get $7 + end + i32.const 10 + i32.store8 + local.get $6 + i32.const 1 + i32.store offset=4 + i32.const 1 + local.get $6 + i32.const 1 + local.get $8 + call $~lib/bindings/wasi_snapshot_preview1/fd_write + drop + local.get $6 + call $~lib/rt/stub/__free + ) + (func $wasi/trace/test (; 17 ;) + i32.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/bindings/wasi/trace + i32.const 1 + f64.const 1.5 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/bindings/wasi/trace + i32.const 5 + f64.const -2.00001 + f64.const 3 + f64.const nan:0x8000000000000 + f64.const inf + f64.const -inf + call $~lib/bindings/wasi/trace + ) + (func $~start (; 18 ;) + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end + i32.const 1248 + global.set $~lib/rt/stub/startOffset + i32.const 1248 + global.set $~lib/rt/stub/offset + ) +) diff --git a/tests/compiler/wasi/trace.ts b/tests/compiler/wasi/trace.ts new file mode 100644 index 0000000000..f0875fb4b2 --- /dev/null +++ b/tests/compiler/wasi/trace.ts @@ -0,0 +1,7 @@ +import "bindings/wasi"; + +export function test(): void { + trace("the message"); + trace("the message", 1, 1.5); + trace("the message", 5, -2.00001, 3, NaN, Infinity, -Infinity); +} diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat new file mode 100644 index 0000000000..22652ca65c --- /dev/null +++ b/tests/compiler/wasi/trace.untouched.wat @@ -0,0 +1,3836 @@ +(module + (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) + (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (memory $0 1) + (data (i32.const 16) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e\00") + (data (i32.const 64) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000\00") + (data (i32.const 96) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00") + (data (i32.const 128) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 176) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 208) "\b8\02\00\00\01\00\00\00\03\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 Date: Thu, 12 Mar 2020 16:53:08 +0100 Subject: [PATCH 05/13] make encodeUnsafe more general --- std/assembly/bindings/wasi.ts | 18 +- std/assembly/index.d.ts | 8 +- std/assembly/string.ts | 25 +- tests/compiler/wasi/abort.optimized.wat | 107 +- tests/compiler/wasi/abort.untouched.wat | 68 +- tests/compiler/wasi/seed.optimized.wat | 91 +- tests/compiler/wasi/seed.untouched.wat | 70 +- tests/compiler/wasi/trace.optimized.wat | 869 ++++----- tests/compiler/wasi/trace.untouched.wat | 2321 +++++++++++------------ 9 files changed, 1718 insertions(+), 1859 deletions(-) diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index 2fe19a00d9..448114b028 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -8,7 +8,7 @@ import { import { MAX_DOUBLE_LENGTH, decimalCount32, - dtoa + dtoa_stream } from "util/number"; export * from "./wasi_snapshot_preview1"; @@ -30,11 +30,11 @@ function abort( var ptr = bufPtr; store(ptr, 0x203A74726F6261); ptr += 7; // 'abort: ' if (message !== null) { - ptr += String.UTF8.encodeUnsafe(message, ptr); + ptr += String.UTF8.encodeUnsafe(changetype(message), message.length, ptr); } store(ptr, 0x206E6920); ptr += 4; // ' in ' if (fileName !== null) { - ptr += String.UTF8.encodeUnsafe(fileName, ptr); + ptr += String.UTF8.encodeUnsafe(changetype(fileName), fileName.length, ptr); } store(ptr++, 0x28); // ( var len = decimalCount32(lineNumber); ptr += len; @@ -77,23 +77,23 @@ function trace( store(bufPtr, 0x203A6563617274); // 'trace: ' changetype(iovPtr).buf_len = 7; fd_write(1, iovPtr, 1, lenPtr); - changetype(iovPtr).buf_len = String.UTF8.encodeUnsafe(message, bufPtr); + changetype(iovPtr).buf_len = String.UTF8.encodeUnsafe(changetype(message), message.length, bufPtr); fd_write(1, iovPtr, 1, lenPtr); if (n) { store(bufPtr++, 0x20); // space - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a0)), bufPtr); + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a0), bufPtr); fd_write(1, iovPtr, 1, lenPtr); if (n > 1) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a1)), bufPtr); + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a1), bufPtr); fd_write(1, iovPtr, 1, lenPtr); if (n > 2) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a2)), bufPtr); + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a2), bufPtr); fd_write(1, iovPtr, 1, lenPtr); if (n > 3) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a3)), bufPtr); + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a3), bufPtr); fd_write(1, iovPtr, 1, lenPtr); if (n > 4) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(changetype(dtoa(a4)), bufPtr); + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a4), bufPtr); fd_write(1, iovPtr, 1, lenPtr); } } diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index ee7077eeb0..8de871e432 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1460,8 +1460,8 @@ declare namespace String { export function byteLength(str: string, nullTerminated?: bool): i32; /** Encodes the specified string to UTF-8 bytes, optionally null terminated. */ export function encode(str: string, nullTerminated?: bool): ArrayBuffer; - /** Encodes the specified string to UTF-8 bytes, opionally null terminated. Returns the number of bytes written. */ - export function encodeUnsafe(str: string, buf: usize, nullTerminated?: bool): usize; + /** Encodes the specified raw string to UTF-8 bytes, opionally null terminated. Returns the number of bytes written. */ + export function encodeUnsafe(str: usize, len: i32, buf: usize, nullTerminated?: bool): usize; /** Decodes the specified buffer from UTF-8 bytes to a string, optionally null terminated. */ export function decode(buf: ArrayBuffer, nullTerminated?: bool): string; /** Decodes raw UTF-8 bytes to a string, optionally null terminated. */ @@ -1473,8 +1473,8 @@ declare namespace String { export function byteLength(str: string): i32; /** Encodes the specified string to UTF-16 bytes. */ export function encode(str: string): ArrayBuffer; - /** Encodes the specified string to UTF-16 bytes. Returns the number of bytes written. */ - export function encodeUnsafe(str: string, buf: usize): usize; + /** Encodes the specified raw string to UTF-16 bytes. Returns the number of bytes written. */ + export function encodeUnsafe(str: usize, len: i32, buf: usize): usize; /** Decodes the specified buffer from UTF-16 bytes to a string. */ export function decode(buf: ArrayBuffer): string; /** Decodes raw UTF-16 bytes to a string. */ diff --git a/std/assembly/string.ts b/std/assembly/string.ts index f28a08e42e..c5d245bcf1 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -678,18 +678,17 @@ export namespace String { export function encode(str: string, nullTerminated: bool = false): ArrayBuffer { var buf = __alloc(byteLength(str, nullTerminated), idof()); - encodeUnsafe(str, buf, nullTerminated); + encodeUnsafe(changetype(str), str.length, buf, nullTerminated); return changetype(buf); // retains } // @ts-ignore: decorator @unsafe - export function encodeUnsafe(str: string, buf: usize, nullTerminated: bool = false): usize { - var strOff = changetype(str); - var strEnd = changetype(str) + changetype(changetype(str) - BLOCK_OVERHEAD).rtSize; + export function encodeUnsafe(str: usize, len: i32, buf: usize, nullTerminated: bool = false): usize { + var strEnd = str + (len << 1); var bufOff = buf; - while (strOff < strEnd) { - let c1 = load(strOff); + while (str < strEnd) { + let c1 = load(str); if (c1 < 128) { store(bufOff, c1); bufOff++; @@ -699,8 +698,8 @@ export namespace String { store(bufOff, b1 << 8 | b0); bufOff += 2; } else { - if ((c1 & 0xFC00) == 0xD800 && strOff + 2 < strEnd) { - let c2 = load(strOff, 2); + if ((c1 & 0xFC00) == 0xD800 && str + 2 < strEnd) { + let c2 = load(str, 2); if ((c2 & 0xFC00) == 0xDC00) { c1 = 0x10000 + ((c1 & 0x03FF) << 10) | (c2 & 0x03FF); let b0 = c1 >> 18 | 240; @@ -708,7 +707,7 @@ export namespace String { let b2 = c1 >> 6 & 63 | 128; let b3 = c1 & 63 | 128; store(bufOff, b3 << 24 | b2 << 16 | b1 << 8 | b0); - bufOff += 4; strOff += 4; + bufOff += 4; str += 4; continue; } } @@ -719,7 +718,7 @@ export namespace String { store(bufOff, b2, 2); bufOff += 3; } - strOff += 2; + str += 2; } if (nullTerminated) { store(bufOff++, 0); @@ -785,14 +784,14 @@ export namespace String { export function encode(str: string): ArrayBuffer { var buf = __alloc(byteLength(str), idof()); - encodeUnsafe(str, buf); + encodeUnsafe(changetype(str), str.length, buf); return changetype(buf); // retains } // @ts-ignore: decorator @unsafe - export function encodeUnsafe(str: string, buf: usize): usize { - var size = byteLength(str); + export function encodeUnsafe(str: usize, len: i32, buf: usize): usize { + var size = len << 1; memory.copy(buf, changetype(str), size); return size; } diff --git a/tests/compiler/wasi/abort.optimized.wat b/tests/compiler/wasi/abort.optimized.wat index 9415161516..1a1f024c14 100644 --- a/tests/compiler/wasi/abort.optimized.wat +++ b/tests/compiler/wasi/abort.optimized.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) @@ -12,50 +12,55 @@ (export "_start" (func $~start)) (export "memory" (memory $0)) (export "test" (func $wasi/abort/test)) - (func $~lib/string/String.UTF8.encodeUnsafe (; 2 ;) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - local.tee $3 + (func $~lib/string/String#get:length (; 2 ;) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String.UTF8.encodeUnsafe (; 3 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.shl i32.add local.set $5 - local.get $1 - local.set $0 + local.get $2 + local.set $1 loop $while-continue|0 - local.get $3 + local.get $0 local.get $5 i32.lt_u if - local.get $3 + local.get $0 i32.load16_u - local.tee $2 + local.tee $3 i32.const 128 i32.lt_u if (result i32) - local.get $0 - local.get $2 + local.get $1 + local.get $3 i32.store8 - local.get $0 + local.get $1 i32.const 1 i32.add else - local.get $2 + local.get $3 i32.const 2048 i32.lt_u if (result i32) - local.get $0 - local.get $2 + local.get $1 + local.get $3 i32.const 6 i32.shr_u i32.const 192 i32.or - local.get $2 + local.get $3 i32.const 63 i32.and i32.const 128 @@ -64,24 +69,24 @@ i32.shl i32.or i32.store16 - local.get $0 + local.get $1 i32.const 2 i32.add else - local.get $3 + local.get $0 i32.const 2 i32.add local.get $5 i32.lt_u i32.const 0 - local.get $2 + local.get $3 i32.const 64512 i32.and i32.const 55296 i32.eq select if - local.get $3 + local.get $0 i32.load16_u offset=2 local.tee $4 i32.const 64512 @@ -89,7 +94,7 @@ i32.const 56320 i32.eq if - local.get $2 + local.get $3 i32.const 1023 i32.and i32.const 10 @@ -100,14 +105,14 @@ i32.const 1023 i32.and i32.or - local.tee $2 + local.tee $3 i32.const 63 i32.and i32.const 128 i32.or local.set $4 - local.get $0 - local.get $2 + local.get $1 + local.get $3 i32.const 18 i32.shr_u i32.const 240 @@ -115,7 +120,7 @@ local.get $4 i32.const 24 i32.shl - local.get $2 + local.get $3 i32.const 6 i32.shr_u i32.const 63 @@ -125,7 +130,7 @@ i32.const 16 i32.shl i32.or - local.get $2 + local.get $3 i32.const 12 i32.shr_u i32.const 63 @@ -137,24 +142,24 @@ i32.or i32.or i32.store - local.get $0 + local.get $1 i32.const 4 i32.add - local.set $0 - local.get $3 + local.set $1 + local.get $0 i32.const 4 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end - local.get $0 - local.get $2 + local.get $1 + local.get $3 i32.const 12 i32.shr_u i32.const 224 i32.or - local.get $2 + local.get $3 i32.const 6 i32.shr_u i32.const 63 @@ -165,31 +170,31 @@ i32.shl i32.or i32.store16 - local.get $0 - local.get $2 + local.get $1 + local.get $3 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=2 - local.get $0 + local.get $1 i32.const 3 i32.add end end - local.set $0 - local.get $3 + local.set $1 + local.get $0 i32.const 2 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end - local.get $0 local.get $1 + local.get $2 i32.sub ) - (func $~lib/util/number/decimalCount32 (; 3 ;) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 4 ;) (param $0 i32) (result i32) i32.const 1 i32.const 2 local.get $0 @@ -237,7 +242,7 @@ i32.lt_u select ) - (func $~lib/bindings/wasi/abort (; 4 ;) + (func $~lib/bindings/wasi/abort (; 5 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -254,6 +259,8 @@ i64.const 9071471065260641 i64.store i32.const 32 + i32.const 32 + call $~lib/string/String#get:length i32.const 19 call $~lib/string/String.UTF8.encodeUnsafe i32.const 19 @@ -266,6 +273,8 @@ i32.add local.tee $0 i32.const 80 + i32.const 80 + call $~lib/string/String#get:length local.get $0 call $~lib/string/String.UTF8.encodeUnsafe i32.add @@ -348,11 +357,11 @@ i32.const 255 call $~lib/bindings/wasi_snapshot_preview1/proc_exit ) - (func $wasi/abort/test (; 5 ;) + (func $wasi/abort/test (; 6 ;) call $~lib/bindings/wasi/abort unreachable ) - (func $~start (; 6 ;) + (func $~start (; 7 ;) nop ) ) diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat index b56e2c75f5..7c1870785e 100644 --- a/tests/compiler/wasi/abort.untouched.wat +++ b/tests/compiler/wasi/abort.untouched.wat @@ -1,10 +1,9 @@ (module + (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (memory $0 1) @@ -17,11 +16,15 @@ (func $~lib/rt/stub/__retain (; 2 ;) (param $0 i32) (result i32) local.get $0 ) - (func $~lib/rt/stub/__release (; 3 ;) (param $0 i32) - nop + (func $~lib/string/String#get:length (; 3 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u ) - (func $~lib/string/String.UTF8.encodeUnsafe (; 4 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 4 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -32,27 +35,21 @@ (local $11 i32) (local $12 i32) local.get $0 - call $~lib/rt/stub/__retain - local.set $0 - local.get $0 - local.set $3 - local.get $0 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + local.get $1 + i32.const 1 + i32.shl i32.add local.set $4 - local.get $1 + local.get $2 local.set $5 loop $while-continue|0 - local.get $3 + local.get $0 local.get $4 i32.lt_u local.set $6 local.get $6 if - local.get $3 + local.get $0 i32.load16_u local.set $7 local.get $7 @@ -101,7 +98,7 @@ i32.const 55296 i32.eq if (result i32) - local.get $3 + local.get $0 i32.const 2 i32.add local.get $4 @@ -110,7 +107,7 @@ i32.const 0 end if - local.get $3 + local.get $0 i32.load16_u offset=2 local.set $9 local.get $9 @@ -178,10 +175,10 @@ i32.const 4 i32.add local.set $5 - local.get $3 + local.get $0 i32.const 4 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end @@ -221,14 +218,14 @@ local.set $5 end end - local.get $3 + local.get $0 i32.const 2 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end - local.get $2 + local.get $3 if local.get $5 local.tee $6 @@ -240,12 +237,8 @@ i32.store8 end local.get $5 - local.get $1 + local.get $2 i32.sub - local.set $6 - local.get $0 - call $~lib/rt/stub/__release - local.get $6 ) (func $~lib/util/number/decimalCount32 (; 5 ;) (param $0 i32) (result i32) (local $1 i32) @@ -313,7 +306,10 @@ end unreachable ) - (func $~lib/bindings/wasi/abort (; 6 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/rt/stub/__release (; 6 ;) (param $0 i32) + nop + ) + (func $~lib/bindings/wasi/abort (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -343,6 +339,8 @@ if local.get $4 local.get $0 + local.get $0 + call $~lib/string/String#get:length local.get $4 i32.const 0 call $~lib/string/String.UTF8.encodeUnsafe @@ -362,6 +360,8 @@ if local.get $4 local.get $1 + local.get $1 + call $~lib/string/String#get:length local.get $4 i32.const 0 call $~lib/string/String.UTF8.encodeUnsafe @@ -475,7 +475,7 @@ local.get $1 call $~lib/rt/stub/__release ) - (func $wasi/abort/test (; 7 ;) + (func $wasi/abort/test (; 8 ;) i32.const 0 i32.eqz if @@ -487,7 +487,7 @@ unreachable end ) - (func $~start (; 8 ;) + (func $~start (; 9 ;) nop ) ) diff --git a/tests/compiler/wasi/seed.optimized.wat b/tests/compiler/wasi/seed.optimized.wat index 8ed3924eb4..d2ee0647d3 100644 --- a/tests/compiler/wasi/seed.optimized.wat +++ b/tests/compiler/wasi/seed.optimized.wat @@ -1,10 +1,9 @@ (module + (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_f64 (func (result f64))) (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i64_=>_none (func (param i64))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i64_=>_i64 (func (param i64) (result i64))) @@ -97,21 +96,21 @@ i32.shr_u i32.xor ) - (func $~lib/string/String.UTF8.encodeUnsafe (; 6 ;) (result i32) - (local $0 i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 6 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) i32.const 32 local.set $2 - i32.const 28 - i32.load + local.get $0 + i32.const 1 + i32.shl i32.const 32 i32.add local.set $4 i32.const 23 - local.set $1 + local.set $0 loop $while-continue|0 local.get $2 local.get $4 @@ -119,28 +118,28 @@ if local.get $2 i32.load16_u - local.tee $0 + local.tee $1 i32.const 128 i32.lt_u if (result i32) - local.get $1 local.get $0 - i32.store8 local.get $1 + i32.store8 + local.get $0 i32.const 1 i32.add else - local.get $0 + local.get $1 i32.const 2048 i32.lt_u if (result i32) - local.get $1 local.get $0 + local.get $1 i32.const 6 i32.shr_u i32.const 192 i32.or - local.get $0 + local.get $1 i32.const 63 i32.and i32.const 128 @@ -149,7 +148,7 @@ i32.shl i32.or i32.store16 - local.get $1 + local.get $0 i32.const 2 i32.add else @@ -159,7 +158,7 @@ local.get $4 i32.lt_u i32.const 0 - local.get $0 + local.get $1 i32.const 64512 i32.and i32.const 55296 @@ -174,7 +173,7 @@ i32.const 56320 i32.eq if - local.get $0 + local.get $1 i32.const 1023 i32.and i32.const 10 @@ -185,14 +184,14 @@ i32.const 1023 i32.and i32.or - local.tee $0 + local.tee $1 i32.const 63 i32.and i32.const 128 i32.or local.set $3 - local.get $1 local.get $0 + local.get $1 i32.const 18 i32.shr_u i32.const 240 @@ -200,7 +199,7 @@ local.get $3 i32.const 24 i32.shl - local.get $0 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -210,7 +209,7 @@ i32.const 16 i32.shl i32.or - local.get $0 + local.get $1 i32.const 12 i32.shr_u i32.const 63 @@ -222,10 +221,10 @@ i32.or i32.or i32.store - local.get $1 + local.get $0 i32.const 4 i32.add - local.set $1 + local.set $0 local.get $2 i32.const 4 i32.add @@ -233,13 +232,13 @@ br $while-continue|0 end end - local.get $1 local.get $0 + local.get $1 i32.const 12 i32.shr_u i32.const 224 i32.or - local.get $0 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -250,19 +249,19 @@ i32.shl i32.or i32.store16 - local.get $1 local.get $0 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=2 - local.get $1 + local.get $0 i32.const 3 i32.add end end - local.set $1 + local.set $0 local.get $2 i32.const 2 i32.add @@ -270,7 +269,7 @@ br $while-continue|0 end end - local.get $1 + local.get $0 i32.const 23 i32.sub ) @@ -331,7 +330,7 @@ i32.const 4 local.set $2 i32.const 1406 - local.set $1 + local.set $0 i32.const 0 i32.const 12 i32.store @@ -341,59 +340,63 @@ i32.const 19 i32.const 544106784 i32.store + i32.const 28 + i32.load + i32.const 1 + i32.shr_u call $~lib/string/String.UTF8.encodeUnsafe i32.const 23 i32.add - local.tee $0 + local.tee $3 i32.const 40 i32.store8 i32.const 1406 call $~lib/util/number/decimalCount32 local.tee $4 - local.get $0 + local.get $3 i32.const 1 i32.add i32.add - local.set $0 + local.set $1 loop $do-continue|0 - local.get $1 + local.get $0 i32.const 10 i32.div_u - local.get $0 + local.get $1 i32.const 1 i32.sub - local.tee $0 - local.get $1 + local.tee $1 + local.get $0 i32.const 10 i32.rem_u i32.const 48 i32.add i32.store8 - local.tee $1 + local.tee $0 br_if $do-continue|0 end - local.get $0 + local.get $1 local.get $4 i32.add - local.tee $1 + local.tee $0 i32.const 58 i32.store8 i32.const 4 call $~lib/util/number/decimalCount32 local.tee $3 - local.get $1 + local.get $0 i32.const 1 i32.add i32.add - local.set $0 + local.set $1 loop $do-continue|1 local.get $2 i32.const 10 i32.div_u - local.get $0 + local.get $1 i32.const 1 i32.sub - local.tee $0 + local.tee $1 local.get $2 i32.const 10 i32.rem_u @@ -403,7 +406,7 @@ local.tee $2 br_if $do-continue|1 end - local.get $0 + local.get $1 local.get $3 i32.add local.tee $2 diff --git a/tests/compiler/wasi/seed.untouched.wat b/tests/compiler/wasi/seed.untouched.wat index 31899d94f0..bbce972517 100644 --- a/tests/compiler/wasi/seed.untouched.wat +++ b/tests/compiler/wasi/seed.untouched.wat @@ -2,12 +2,11 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_f64 (func (result f64))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i64_=>_none (func (param i64))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i64_=>_i64 (func (param i64) (result i64))) (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) @@ -119,11 +118,15 @@ (func $~lib/rt/stub/__retain (; 6 ;) (param $0 i32) (result i32) local.get $0 ) - (func $~lib/rt/stub/__release (; 7 ;) (param $0 i32) - nop + (func $~lib/string/String#get:length (; 7 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u ) - (func $~lib/string/String.UTF8.encodeUnsafe (; 8 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 8 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -134,27 +137,21 @@ (local $11 i32) (local $12 i32) local.get $0 - call $~lib/rt/stub/__retain - local.set $0 - local.get $0 - local.set $3 - local.get $0 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + local.get $1 + i32.const 1 + i32.shl i32.add local.set $4 - local.get $1 + local.get $2 local.set $5 loop $while-continue|0 - local.get $3 + local.get $0 local.get $4 i32.lt_u local.set $6 local.get $6 if - local.get $3 + local.get $0 i32.load16_u local.set $7 local.get $7 @@ -203,7 +200,7 @@ i32.const 55296 i32.eq if (result i32) - local.get $3 + local.get $0 i32.const 2 i32.add local.get $4 @@ -212,7 +209,7 @@ i32.const 0 end if - local.get $3 + local.get $0 i32.load16_u offset=2 local.set $9 local.get $9 @@ -280,10 +277,10 @@ i32.const 4 i32.add local.set $5 - local.get $3 + local.get $0 i32.const 4 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end @@ -323,14 +320,14 @@ local.set $5 end end - local.get $3 + local.get $0 i32.const 2 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end - local.get $2 + local.get $3 if local.get $5 local.tee $6 @@ -342,12 +339,8 @@ i32.store8 end local.get $5 - local.get $1 + local.get $2 i32.sub - local.set $6 - local.get $0 - call $~lib/rt/stub/__release - local.get $6 ) (func $~lib/util/number/decimalCount32 (; 9 ;) (param $0 i32) (result i32) (local $1 i32) @@ -415,7 +408,10 @@ end unreachable ) - (func $~lib/bindings/wasi/abort (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/rt/stub/__release (; 10 ;) (param $0 i32) + nop + ) + (func $~lib/bindings/wasi/abort (; 11 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -445,6 +441,8 @@ if local.get $4 local.get $0 + local.get $0 + call $~lib/string/String#get:length local.get $4 i32.const 0 call $~lib/string/String.UTF8.encodeUnsafe @@ -464,6 +462,8 @@ if local.get $4 local.get $1 + local.get $1 + call $~lib/string/String#get:length local.get $4 i32.const 0 call $~lib/string/String.UTF8.encodeUnsafe @@ -577,7 +577,7 @@ local.get $1 call $~lib/rt/stub/__release ) - (func $~lib/math/NativeMath.seedRandom (; 11 ;) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 12 ;) (param $0 i64) i32.const 1 global.set $~lib/math/random_seeded local.get $0 @@ -629,7 +629,7 @@ unreachable end ) - (func $~lib/math/NativeMath.random (; 12 ;) (result f64) + (func $~lib/math/NativeMath.random (; 13 ;) (result f64) (local $0 i64) (local $1 i64) (local $2 i64) @@ -681,10 +681,10 @@ f64.const 1 f64.sub ) - (func $wasi/seed/test (; 13 ;) (result f64) + (func $wasi/seed/test (; 14 ;) (result f64) call $~lib/math/NativeMath.random ) - (func $~start (; 14 ;) + (func $~start (; 15 ;) nop ) ) diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index 58926e1930..d955221565 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1,30 +1,25 @@ (module (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_f64_f64_f64_f64_f64_=>_none (func (param i32 f64 f64 f64 f64 f64))) (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (memory $0 1) (data (i32.const 16) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e") - (data (i32.const 64) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") - (data (i32.const 96) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") - (data (i32.const 128) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 176) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 208) "\b8\02\00\00\01\00\00\00\03\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 9 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa_simple (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) loop $do-continue|0 local.get $1 @@ -1017,7 +1017,7 @@ br_if $do-continue|0 end ) - (func $~lib/util/number/prettify (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 11 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 i32.eqz @@ -1262,7 +1262,7 @@ end end ) - (func $~lib/util/number/dtoa_core (; 11 ;) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 12 ;) (param $0 i32) (param $1 f64) (result i32) (local $2 i64) (local $3 i32) (local $4 i64) @@ -1387,14 +1387,14 @@ i32.sub global.set $~lib/util/number/_K local.get $6 - i32.const 224 + i32.const 160 i32.add i64.load global.set $~lib/util/number/_frc_pow local.get $3 i32.const 1 i32.shl - i32.const 944 + i32.const 880 i32.add i32.load16_s global.set $~lib/util/number/_exp_pow @@ -1571,83 +1571,73 @@ local.get $10 i32.add ) - (func $~lib/string/String#substring (; 12 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/number/dtoa_stream (; 13 ;) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) - i32.const 0 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.tee $2 - i32.const 0 - local.get $2 - i32.lt_s - select - local.tee $3 - local.get $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - local.tee $1 - local.get $2 - local.get $1 - local.get $2 - i32.lt_s - select - local.tee $1 - local.get $3 - local.get $1 - i32.gt_s - select - i32.const 1 - i32.shl - local.tee $4 - local.get $3 - local.get $1 - local.get $3 local.get $1 - i32.lt_s - select - i32.const 1 - i32.shl - local.tee $1 - i32.sub - local.tee $3 - i32.eqz + f64.const 0 + f64.eq if - i32.const 1200 + local.get $0 + i32.const 48 + i32.store16 + local.get $0 + i32.const 46 + i32.store16 offset=2 + local.get $0 + i32.const 48 + i32.store16 offset=4 + i32.const 3 return end - i32.const 0 - local.get $4 - local.get $2 - i32.const 1 - i32.shl - i32.eq local.get $1 - select + local.get $1 + f64.sub + f64.const 0 + f64.ne if - local.get $0 - return + local.get $1 + local.get $1 + f64.ne + if + local.get $0 + i32.const 78 + i32.store16 + local.get $0 + i32.const 97 + i32.store16 offset=2 + local.get $0 + i32.const 78 + i32.store16 offset=4 + i32.const 3 + return + else + local.get $1 + f64.const 0 + f64.lt + local.tee $3 + i32.const 8 + i32.add + local.set $2 + local.get $0 + i32.const 80 + i32.const 128 + local.get $3 + select + local.get $2 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $2 + return + end + unreachable end - local.get $3 - i32.const 1 - call $~lib/rt/stub/__alloc - local.tee $2 local.get $0 local.get $1 - i32.add - local.get $3 - call $~lib/memory/memory.copy - local.get $2 + call $~lib/util/number/dtoa_core ) - (func $~lib/bindings/wasi/abort (; 13 ;) (param $0 i32) (param $1 i32) + (func $~lib/bindings/wasi/abort (; 14 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1660,7 +1650,9 @@ i32.const 19 i32.const 544106784 i32.store - i32.const 1216 + i32.const 1136 + i32.const 1136 + call $~lib/string/String#get:length i32.const 23 call $~lib/string/String.UTF8.encodeUnsafe i32.const 23 @@ -1744,7 +1736,7 @@ i32.const 255 call $~lib/bindings/wasi_snapshot_preview1/proc_exit ) - (func $~lib/rt/stub/__free (; 14 ;) (param $0 i32) + (func $~lib/rt/stub/__free (; 15 ;) (param $0 i32) (local $1 i32) local.get $0 i32.const 15 @@ -1784,122 +1776,75 @@ global.set $~lib/rt/stub/offset end ) - (func $~lib/util/number/dtoa (; 15 ;) (param $0 f64) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - f64.const 0 - f64.eq - if - i32.const 80 - return - end - local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne - if - local.get $0 - local.get $0 - f64.ne - if - i32.const 112 - return - end - i32.const 144 - i32.const 192 - local.get $0 - f64.const 0 - f64.lt - select - return - end - i32.const 56 - i32.const 1 - call $~lib/rt/stub/__alloc - local.tee $1 - local.get $0 - call $~lib/util/number/dtoa_core - local.tee $2 - i32.const 28 - i32.eq - if - local.get $1 - return - end - local.get $1 - local.get $2 - call $~lib/string/String#substring - local.get $1 - call $~lib/rt/stub/__free - ) (func $~lib/bindings/wasi/trace (; 16 ;) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (local $6 i32) (local $7 i32) (local $8 i32) call $~lib/string/String.UTF8.byteLength - local.tee $6 + local.tee $7 i32.const 56 - local.get $6 + local.get $7 i32.const 56 i32.gt_s select i32.const 13 i32.add - i32.const 0 call $~lib/rt/stub/__alloc - local.tee $6 + local.tee $7 i32.const 8 i32.add local.tee $8 i32.const 4 i32.add - local.set $7 - local.get $6 + local.set $6 local.get $7 + local.get $6 i32.store - local.get $7 + local.get $6 i64.const 9071406388179572 i64.store - local.get $6 + local.get $7 i32.const 7 i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop - local.get $6 - i32.const 32 local.get $7 + i32.const 32 + i32.const 32 + call $~lib/string/String#get:length + local.get $6 call $~lib/string/String.UTF8.encodeUnsafe i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop local.get $0 if (result i32) - local.get $7 + local.get $6 i32.const 32 i32.store8 - local.get $6 - local.get $1 - call $~lib/util/number/dtoa local.get $7 + local.get $6 i32.const 1 i32.add - local.tee $7 + local.tee $6 + local.get $6 + local.get $1 + call $~lib/util/number/dtoa_stream + local.get $6 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1908,16 +1853,18 @@ i32.const 1 i32.gt_s if + local.get $7 + local.get $6 local.get $6 local.get $2 - call $~lib/util/number/dtoa - local.get $7 + call $~lib/util/number/dtoa_stream + local.get $6 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1926,16 +1873,18 @@ i32.const 2 i32.gt_s if + local.get $7 + local.get $6 local.get $6 local.get $3 - call $~lib/util/number/dtoa - local.get $7 + call $~lib/util/number/dtoa_stream + local.get $6 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1944,16 +1893,18 @@ i32.const 3 i32.gt_s if + local.get $7 + local.get $6 local.get $6 local.get $4 - call $~lib/util/number/dtoa - local.get $7 + call $~lib/util/number/dtoa_stream + local.get $6 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1962,16 +1913,18 @@ i32.const 4 i32.gt_s if + local.get $7 + local.get $6 local.get $6 local.get $5 - call $~lib/util/number/dtoa - local.get $7 + call $~lib/util/number/dtoa_stream + local.get $6 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1980,24 +1933,24 @@ end end end - local.get $7 + local.get $6 i32.const 1 i32.sub else - local.get $7 + local.get $6 end i32.const 10 i32.store8 - local.get $6 + local.get $7 i32.const 1 i32.store offset=4 i32.const 1 - local.get $6 + local.get $7 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop - local.get $6 + local.get $7 call $~lib/rt/stub/__free ) (func $wasi/trace/test (; 17 ;) @@ -2031,9 +1984,9 @@ i32.const 1 global.set $~started end - i32.const 1248 + i32.const 1168 global.set $~lib/rt/stub/startOffset - i32.const 1248 + i32.const 1168 global.set $~lib/rt/stub/offset ) ) diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index 22652ca65c..d0b49cb614 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -2,41 +2,38 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_f64_=>_i32 (func (param i32 i32 f64) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (memory $0 1) (data (i32.const 16) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e\00") - (data (i32.const 64) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000\00") - (data (i32.const 96) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00") - (data (i32.const 128) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 176) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 208) "\b8\02\00\00\01\00\00\00\03\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 Date: Thu, 12 Mar 2020 16:59:40 +0100 Subject: [PATCH 06/13] fix --- .../std/string-encoding.optimized.wat | 119 +++++++++--------- .../std/string-encoding.untouched.wat | 99 +++++++-------- 2 files changed, 104 insertions(+), 114 deletions(-) diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index c2fe01fdf1..5b572292df 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1138,7 +1138,15 @@ i32.const 16 i32.add ) - (func $~lib/memory/memory.copy (; 20 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/string/String#get:length (; 20 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/memory/memory.copy (; 21 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) block $~lib/util/memory/memmove|inlined.0 @@ -1311,7 +1319,7 @@ end end ) - (func $~lib/string/String.UTF16.encode (; 21 ;) (param $0 i32) (result i32) + (func $~lib/string/String.UTF16.encode (; 22 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/string/String.UTF16.byteLength @@ -1320,12 +1328,14 @@ local.tee $1 local.get $0 local.get $0 - call $~lib/string/String.UTF16.byteLength + call $~lib/string/String#get:length + i32.const 1 + i32.shl call $~lib/memory/memory.copy local.get $1 call $~lib/rt/pure/__retain ) - (func $std/string-encoding/testUTF16Encode (; 22 ;) + (func $std/string-encoding/testUTF16Encode (; 23 ;) (local $0 i32) (local $1 i32) i32.const 32 @@ -1486,7 +1496,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/string/String.UTF16.decodeUnsafe (; 23 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.UTF16.decodeUnsafe (; 24 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 i32.const -2 @@ -1501,20 +1511,12 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/string/String.UTF16.decode (; 24 ;) (param $0 i32) (result i32) + (func $~lib/string/String.UTF16.decode (; 25 ;) (param $0 i32) (result i32) local.get $0 local.get $0 call $~lib/string/String.UTF16.byteLength call $~lib/string/String.UTF16.decodeUnsafe ) - (func $~lib/string/String#get:length (; 25 ;) (param $0 i32) (result i32) - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - ) (func $~lib/util/string/compareImpl (; 26 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -1914,49 +1916,46 @@ unreachable end ) - (func $~lib/string/String.UTF8.encodeUnsafe (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) local.get $0 - local.tee $3 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + local.get $1 + i32.const 1 + i32.shl i32.add local.set $5 - local.get $1 - local.set $0 + local.get $2 + local.set $1 loop $while-continue|0 - local.get $3 + local.get $0 local.get $5 i32.lt_u if - local.get $3 + local.get $0 i32.load16_u - local.tee $1 + local.tee $2 i32.const 128 i32.lt_u if (result i32) - local.get $0 local.get $1 + local.get $2 i32.store8 - local.get $0 + local.get $1 i32.const 1 i32.add else - local.get $1 + local.get $2 i32.const 2048 i32.lt_u if (result i32) - local.get $0 local.get $1 + local.get $2 i32.const 6 i32.shr_u i32.const 192 i32.or - local.get $1 + local.get $2 i32.const 63 i32.and i32.const 128 @@ -1965,24 +1964,24 @@ i32.shl i32.or i32.store16 - local.get $0 + local.get $1 i32.const 2 i32.add else - local.get $3 + local.get $0 i32.const 2 i32.add local.get $5 i32.lt_u i32.const 0 - local.get $1 + local.get $2 i32.const 64512 i32.and i32.const 55296 i32.eq select if - local.get $3 + local.get $0 i32.load16_u offset=2 local.tee $4 i32.const 64512 @@ -1990,7 +1989,7 @@ i32.const 56320 i32.eq if - local.get $1 + local.get $2 i32.const 1023 i32.and i32.const 10 @@ -2001,14 +2000,14 @@ i32.const 1023 i32.and i32.or - local.tee $1 + local.tee $2 i32.const 63 i32.and i32.const 128 i32.or local.set $4 - local.get $0 local.get $1 + local.get $2 i32.const 18 i32.shr_u i32.const 240 @@ -2016,7 +2015,7 @@ local.get $4 i32.const 24 i32.shl - local.get $1 + local.get $2 i32.const 6 i32.shr_u i32.const 63 @@ -2026,7 +2025,7 @@ i32.const 16 i32.shl i32.or - local.get $1 + local.get $2 i32.const 12 i32.shr_u i32.const 63 @@ -2038,24 +2037,24 @@ i32.or i32.or i32.store - local.get $0 + local.get $1 i32.const 4 i32.add - local.set $0 - local.get $3 + local.set $1 + local.get $0 i32.const 4 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end - local.get $0 local.get $1 + local.get $2 i32.const 12 i32.shr_u i32.const 224 i32.or - local.get $1 + local.get $2 i32.const 6 i32.shr_u i32.const 63 @@ -2066,44 +2065,48 @@ i32.shl i32.or i32.store16 - local.get $0 local.get $1 + local.get $2 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=2 - local.get $0 + local.get $1 i32.const 3 i32.add end end - local.set $0 - local.get $3 + local.set $1 + local.get $0 i32.const 2 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end - local.get $2 + local.get $3 if - local.get $0 + local.get $1 i32.const 0 i32.store8 end ) (func $~lib/string/String.UTF8.encode (; 33 ;) (param $0 i32) (param $1 i32) (result i32) - local.get $0 + (local $2 i32) local.get $0 local.get $1 call $~lib/string/String.UTF8.byteLength i32.const 0 call $~lib/rt/tlsf/__alloc - local.tee $0 + local.set $2 + local.get $0 + local.get $0 + call $~lib/string/String#get:length + local.get $2 local.get $1 call $~lib/string/String.UTF8.encodeUnsafe - local.get $0 + local.get $2 call $~lib/rt/pure/__retain ) (func $std/string-encoding/testUTF8Encode (; 34 ;) @@ -2573,7 +2576,7 @@ if i32.const 0 i32.const 432 - i32.const 739 + i32.const 738 i32.const 6 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index aab225a1f6..d4dceff863 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -1,13 +1,14 @@ (module (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) @@ -1506,7 +1507,15 @@ i32.const 16 i32.add ) - (func $~lib/util/memory/memcpy (; 21 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/string/String#get:length (; 21 ;) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/memory/memcpy (; 22 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2530,7 +2539,7 @@ i32.store8 end ) - (func $~lib/memory/memory.copy (; 22 ;) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 23 ;) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2750,26 +2759,19 @@ end end ) - (func $~lib/string/String.UTF16.encodeUnsafe (; 23 ;) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/string/String.UTF16.encodeUnsafe (; 24 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - call $~lib/string/String.UTF16.byteLength - local.set $2 local.get $1 - local.get $0 - local.get $2 - call $~lib/memory/memory.copy - local.get $2 + i32.const 1 + i32.shl local.set $3 + local.get $2 local.get $0 - call $~lib/rt/pure/__release + local.get $3 + call $~lib/memory/memory.copy local.get $3 ) - (func $~lib/string/String.UTF16.encode (; 24 ;) (param $0 i32) (result i32) + (func $~lib/string/String.UTF16.encode (; 25 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -2781,6 +2783,8 @@ call $~lib/rt/tlsf/__alloc local.set $1 local.get $0 + local.get $0 + call $~lib/string/String#get:length local.get $1 call $~lib/string/String.UTF16.encodeUnsafe drop @@ -2791,13 +2795,13 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 25 ;) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 26 ;) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub i32.load offset=12 ) - (func $std/string-encoding/testUTF16Encode (; 26 ;) + (func $std/string-encoding/testUTF16Encode (; 27 ;) (local $0 i32) (local $1 i32) global.get $std/string-encoding/str @@ -2977,7 +2981,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/string/String.UTF16.decodeUnsafe (; 27 ;) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.UTF16.decodeUnsafe (; 28 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 i32.const 1 @@ -2995,7 +2999,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/string/String.UTF16.decode (; 28 ;) (param $0 i32) (result i32) + (func $~lib/string/String.UTF16.decode (; 29 ;) (param $0 i32) (result i32) (local $1 i32) local.get $0 call $~lib/rt/pure/__retain @@ -3009,14 +3013,6 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/string/String#get:length (; 29 ;) (param $0 i32) (result i32) - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - ) (func $~lib/util/string/compareImpl (; 30 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) @@ -3527,8 +3523,7 @@ unreachable end ) - (func $~lib/string/String.UTF8.encodeUnsafe (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $~lib/string/String.UTF8.encodeUnsafe (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3539,27 +3534,21 @@ (local $11 i32) (local $12 i32) local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - local.set $3 - local.get $0 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + local.get $1 + i32.const 1 + i32.shl i32.add local.set $4 - local.get $1 + local.get $2 local.set $5 loop $while-continue|0 - local.get $3 + local.get $0 local.get $4 i32.lt_u local.set $6 local.get $6 if - local.get $3 + local.get $0 i32.load16_u local.set $7 local.get $7 @@ -3608,7 +3597,7 @@ i32.const 55296 i32.eq if (result i32) - local.get $3 + local.get $0 i32.const 2 i32.add local.get $4 @@ -3617,7 +3606,7 @@ i32.const 0 end if - local.get $3 + local.get $0 i32.load16_u offset=2 local.set $9 local.get $9 @@ -3685,10 +3674,10 @@ i32.const 4 i32.add local.set $5 - local.get $3 + local.get $0 i32.const 4 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end @@ -3728,14 +3717,14 @@ local.set $5 end end - local.get $3 + local.get $0 i32.const 2 i32.add - local.set $3 + local.set $0 br $while-continue|0 end end - local.get $2 + local.get $3 if local.get $5 local.tee $6 @@ -3747,12 +3736,8 @@ i32.store8 end local.get $5 - local.get $1 + local.get $2 i32.sub - local.set $6 - local.get $0 - call $~lib/rt/pure/__release - local.get $6 ) (func $~lib/string/String.UTF8.encode (; 37 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3767,6 +3752,8 @@ call $~lib/rt/tlsf/__alloc local.set $2 local.get $0 + local.get $0 + call $~lib/string/String#get:length local.get $2 local.get $1 call $~lib/string/String.UTF8.encodeUnsafe @@ -4315,7 +4302,7 @@ if i32.const 0 i32.const 432 - i32.const 739 + i32.const 738 i32.const 6 call $~lib/builtins/abort unreachable From 4f43eda04e4f41325d0592d9467abc1ea48e5fb6 Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 12 Mar 2020 17:02:46 +0100 Subject: [PATCH 07/13] account for trailing \n --- std/assembly/bindings/wasi.ts | 2 +- tests/compiler/wasi/trace.optimized.wat | 2 +- tests/compiler/wasi/trace.untouched.wat | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index 448114b028..aba7d79d22 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -70,7 +70,7 @@ function trace( // 4: iov.buf_len // 8: len // 12: buf... - var iovPtr = __alloc(offsetof() + sizeof() + 1 + (max(String.UTF8.byteLength(message), MAX_DOUBLE_LENGTH << 1)), 0); + var iovPtr = __alloc(offsetof() + sizeof() + 1 + (max(String.UTF8.byteLength(message), MAX_DOUBLE_LENGTH << 1) + 1), 0); var lenPtr = iovPtr + offsetof(); var bufPtr = lenPtr + sizeof(); changetype(iovPtr).buf = bufPtr; diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index d955221565..7b1e7ec689 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1787,7 +1787,7 @@ i32.const 56 i32.gt_s select - i32.const 13 + i32.const 14 i32.add call $~lib/rt/stub/__alloc local.tee $7 diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index d0b49cb614..e5d0293392 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -3499,6 +3499,8 @@ local.get $8 i32.gt_s select + i32.const 1 + i32.add i32.add i32.const 0 call $~lib/rt/stub/__alloc From c8be2b792baa6af7fba95d48aa17b362168771f0 Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 12 Mar 2020 17:03:53 +0100 Subject: [PATCH 08/13] actually don't, not part of a string --- std/assembly/bindings/wasi.ts | 2 +- tests/compiler/wasi/trace.optimized.wat | 2 +- tests/compiler/wasi/trace.untouched.wat | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index aba7d79d22..448114b028 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -70,7 +70,7 @@ function trace( // 4: iov.buf_len // 8: len // 12: buf... - var iovPtr = __alloc(offsetof() + sizeof() + 1 + (max(String.UTF8.byteLength(message), MAX_DOUBLE_LENGTH << 1) + 1), 0); + var iovPtr = __alloc(offsetof() + sizeof() + 1 + (max(String.UTF8.byteLength(message), MAX_DOUBLE_LENGTH << 1)), 0); var lenPtr = iovPtr + offsetof(); var bufPtr = lenPtr + sizeof(); changetype(iovPtr).buf = bufPtr; diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index 7b1e7ec689..d955221565 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1787,7 +1787,7 @@ i32.const 56 i32.gt_s select - i32.const 14 + i32.const 13 i32.add call $~lib/rt/stub/__alloc local.tee $7 diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index e5d0293392..d0b49cb614 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -3499,8 +3499,6 @@ local.get $8 i32.gt_s select - i32.const 1 - i32.add i32.add i32.const 0 call $~lib/rt/stub/__alloc From a0f221dd7e53e58d8b2c7ed194e805d51e3d7ea8 Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 12 Mar 2020 18:59:27 +0100 Subject: [PATCH 09/13] simplify --- tests/compiler.js | 10 ++++++--- tests/compiler/features/mutable-globals.js | 2 +- tests/compiler/wasi/trace.js | 1 - tests/compiler/wasi/trace.optimized.wat | 12 +++++------ tests/compiler/wasi/trace.ts | 8 +++----- tests/compiler/wasi/trace.untouched.wat | 24 +++++++++++----------- 6 files changed, 29 insertions(+), 28 deletions(-) diff --git a/tests/compiler.js b/tests/compiler.js index 0376f940ed..cc78226c2a 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -329,13 +329,17 @@ function testInstantiate(basename, binaryBuffer, name, glue) { } var instance = new WebAssembly.Instance(new WebAssembly.Module(binaryBuffer), imports); Object.setPrototypeOf(exports, instance.exports); + if (glue.postInstantiate) { + console.log(colorsUtil.white(" [postInstantiate]")); + glue.postInstantiate(instance); + } if (exports._start) { console.log(colorsUtil.white(" [start]")); exports._start(); } - if (glue.postInstantiate) { - console.log(colorsUtil.white(" [postInstantiate]")); - glue.postInstantiate(instance); + if (glue.postStart) { + console.log(colorsUtil.white(" [postStart]")); + glue.postStart(instance); } }); let leakCount = rtr.check(); diff --git a/tests/compiler/features/mutable-globals.js b/tests/compiler/features/mutable-globals.js index bd30b85a39..a9856f6aec 100644 --- a/tests/compiler/features/mutable-globals.js +++ b/tests/compiler/features/mutable-globals.js @@ -3,7 +3,7 @@ exports.preInstantiate = function(imports, exports) { external: new WebAssembly.Global({ value: "i32", mutable: true }, 123) }; }; -exports.postInstantiate = function(instance) { +exports.postStart = function(instance) { // adds 10 to both const exports = instance.exports; if (exports.external.valueOf() != 133) throw Error("unexpected value"); diff --git a/tests/compiler/wasi/trace.js b/tests/compiler/wasi/trace.js index 0bee988b52..c4c6cc303c 100644 --- a/tests/compiler/wasi/trace.js +++ b/tests/compiler/wasi/trace.js @@ -18,5 +18,4 @@ exports.preInstantiate = function(imports, exports) { exports.postInstantiate = function(instance) { const exports = instance.exports; memory = exports.memory; - exports.test(); } diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index d955221565..13129517cc 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -31,7 +31,6 @@ (global $~started (mut i32) (i32.const 0)) (export "_start" (func $~start)) (export "memory" (memory $0)) - (export "test" (func $wasi/trace/test)) (func $~lib/string/String.UTF8.byteLength (; 2 ;) (result i32) (local $0 i32) (local $1 i32) @@ -1953,7 +1952,11 @@ local.get $7 call $~lib/rt/stub/__free ) - (func $wasi/trace/test (; 17 ;) + (func $start:wasi/trace (; 17 ;) + i32.const 1168 + global.set $~lib/rt/stub/startOffset + i32.const 1168 + global.set $~lib/rt/stub/offset i32.const 0 f64.const 0 f64.const 0 @@ -1984,9 +1987,6 @@ i32.const 1 global.set $~started end - i32.const 1168 - global.set $~lib/rt/stub/startOffset - i32.const 1168 - global.set $~lib/rt/stub/offset + call $start:wasi/trace ) ) diff --git a/tests/compiler/wasi/trace.ts b/tests/compiler/wasi/trace.ts index f0875fb4b2..d81af36dfd 100644 --- a/tests/compiler/wasi/trace.ts +++ b/tests/compiler/wasi/trace.ts @@ -1,7 +1,5 @@ import "bindings/wasi"; -export function test(): void { - trace("the message"); - trace("the message", 1, 1.5); - trace("the message", 5, -2.00001, 3, NaN, Infinity, -Infinity); -} +trace("the message"); +trace("the message", 1, 1.5); +trace("the message", 5, -2.00001, 3, NaN, Infinity, -Infinity); diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index d0b49cb614..5fcd6f136b 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -36,7 +36,6 @@ (global $~lib/heap/__heap_base i32 (i32.const 1584)) (export "_start" (func $~start)) (export "memory" (memory $0)) - (export "test" (func $wasi/trace/test)) (func $~lib/rt/stub/__retain (; 2 ;) (param $0 i32) (result i32) local.get $0 ) @@ -3682,7 +3681,17 @@ local.get $0 call $~lib/rt/stub/__release ) - (func $wasi/trace/test (; 20 ;) + (func $start:wasi/trace (; 20 ;) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset i32.const 32 i32.const 0 f64.const 0 @@ -3717,15 +3726,6 @@ i32.const 1 global.set $~started end - global.get $~lib/heap/__heap_base - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - global.set $~lib/rt/stub/startOffset - global.get $~lib/rt/stub/startOffset - global.set $~lib/rt/stub/offset + call $start:wasi/trace ) ) From 0be8f235ce8f9caa53661a9b33e62daa3c8c0179 Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 13 Mar 2020 11:03:27 +0100 Subject: [PATCH 10/13] cleanup --- src/program.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/program.ts b/src/program.ts index ea61be133b..8164e53906 100644 --- a/src/program.ts +++ b/src/program.ts @@ -118,7 +118,10 @@ import { import { Parser } from "./parser"; -import { BuiltinNames } from "./builtins"; + +import { + BuiltinNames +} from "./builtins"; /** Represents a yet unresolved `import`. */ class QueuedImport { From 88e506d51b1fa611a1b4e95d19becad42aec6805 Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 13 Mar 2020 17:22:41 +0100 Subject: [PATCH 11/13] use dedicated indicator, implicit explicitStart if wasi --- src/common.ts | 1 + src/compiler.ts | 2 +- src/program.ts | 13 ++++++++++--- std/assembly/bindings/wasi.ts | 4 ++++ tests/compiler/wasi/abort.json | 3 +-- tests/compiler/wasi/seed.json | 3 +-- tests/compiler/wasi/snapshot_preview1.optimized.wat | 10 +++++++++- tests/compiler/wasi/snapshot_preview1.untouched.wat | 10 +++++++++- tests/compiler/wasi/trace.json | 3 +-- 9 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/common.ts b/src/common.ts index 5d2cf8fbdc..d89b0076f4 100644 --- a/src/common.ts +++ b/src/common.ts @@ -154,6 +154,7 @@ export namespace CommonNames { export const ASC_TABLE_BASE = "ASC_TABLE_BASE"; export const ASC_OPTIMIZE_LEVEL = "ASC_OPTIMIZE_LEVEL"; export const ASC_SHRINK_LEVEL = "ASC_SHRINK_LEVEL"; + export const ASC_WASI = "ASC_WASI"; export const ASC_FEATURE_SIGN_EXTENSION = "ASC_FEATURE_SIGN_EXTENSION"; export const ASC_FEATURE_MUTABLE_GLOBALS = "ASC_FEATURE_MUTABLE_GLOBALS"; export const ASC_FEATURE_NONTRAPPING_F2I = "ASC_FEATURE_NONTRAPPING_F2I"; diff --git a/src/compiler.ts b/src/compiler.ts index 65ef4d541a..d93aa8257d 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -419,7 +419,7 @@ export class Compiler extends DiagnosticEmitter { // compile the start function if not empty or if explicitly requested var startIsEmpty = !startFunctionBody.length; - var explicitStart = options.explicitStart; + var explicitStart = program.isWasi || options.explicitStart; if (!startIsEmpty || explicitStart) { let signature = startFunctionInstance.signature; if (!startIsEmpty && explicitStart) { diff --git a/src/program.ts b/src/program.ts index 83596976af..f04f86a3de 100644 --- a/src/program.ts +++ b/src/program.ts @@ -517,6 +517,12 @@ export class Program extends DiagnosticEmitter { nextSignatureId: i32 = 0; /** An indicator if the program has been initialized. */ initialized: bool = false; + + /** Tests whether this is a WASI program. */ + get isWasi(): bool { + return this.elementsByName.has(CommonNames.ASC_WASI); + } + /** Constructs a new program, optionally inheriting parser diagnostics. */ constructor( /** Compiler options. */ @@ -1005,23 +1011,24 @@ export class Program extends DiagnosticEmitter { { let globalAliases = options.globalAliases; if (!globalAliases) globalAliases = new Map(); + let isWasi = this.isWasi; if (!globalAliases.has(CommonNames.abort)) { globalAliases.set(CommonNames.abort, - this.elementsByName.has(BuiltinNames.wasiAbort) + isWasi ? BuiltinNames.wasiAbort : BuiltinNames.abort ); } if (!globalAliases.has(CommonNames.trace)) { globalAliases.set(CommonNames.trace, - this.elementsByName.has(BuiltinNames.wasiTrace) + isWasi ? BuiltinNames.wasiTrace : BuiltinNames.trace ); } if (!globalAliases.has(CommonNames.seed)) { globalAliases.set(CommonNames.seed, - this.elementsByName.has(BuiltinNames.wasiSeed) + isWasi ? BuiltinNames.wasiSeed : BuiltinNames.seed ); diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index 448114b028..0ad98ac6d7 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -13,6 +13,10 @@ import { export * from "./wasi_snapshot_preview1"; +// @ts-ignore: decorator +@global @inline +const ASC_WASI = true; + /** A WASI-aware abort implementation. */ function abort( message: string | null = null, diff --git a/tests/compiler/wasi/abort.json b/tests/compiler/wasi/abort.json index 3d9e8b70ba..453cb07770 100644 --- a/tests/compiler/wasi/abort.json +++ b/tests/compiler/wasi/abort.json @@ -1,6 +1,5 @@ { "asc_flags": [ - "--runtime none", - "--explicitStart" + "--runtime none" ] } diff --git a/tests/compiler/wasi/seed.json b/tests/compiler/wasi/seed.json index 3d9e8b70ba..453cb07770 100644 --- a/tests/compiler/wasi/seed.json +++ b/tests/compiler/wasi/seed.json @@ -1,6 +1,5 @@ { "asc_flags": [ - "--runtime none", - "--explicitStart" + "--runtime none" ] } diff --git a/tests/compiler/wasi/snapshot_preview1.optimized.wat b/tests/compiler/wasi/snapshot_preview1.optimized.wat index e1ab832a7d..aaacaa0c79 100644 --- a/tests/compiler/wasi/snapshot_preview1.optimized.wat +++ b/tests/compiler/wasi/snapshot_preview1.optimized.wat @@ -2,9 +2,17 @@ (type $none_=>_none (func)) (memory $0 0) (global $wasi/snapshot_preview1/sig (mut i32) (i32.const 1)) + (global $~started (mut i32) (i32.const 0)) + (export "_start" (func $~start)) (export "memory" (memory $0)) - (start $~start) (func $~start (; 0 ;) + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end i32.const 9 global.set $wasi/snapshot_preview1/sig ) diff --git a/tests/compiler/wasi/snapshot_preview1.untouched.wat b/tests/compiler/wasi/snapshot_preview1.untouched.wat index a9494f74b6..9401ef5787 100644 --- a/tests/compiler/wasi/snapshot_preview1.untouched.wat +++ b/tests/compiler/wasi/snapshot_preview1.untouched.wat @@ -7,13 +7,21 @@ (global $~lib/shared/target/Target.JS i32 (i32.const 2)) (global $~lib/ASC_TARGET i32 (i32.const 0)) (global $wasi/snapshot_preview1/sig (mut i32) (i32.const 1)) + (global $~started (mut i32) (i32.const 0)) + (export "_start" (func $~start)) (export "memory" (memory $0)) - (start $~start) (func $start:wasi/snapshot_preview1 (; 0 ;) i32.const 9 global.set $wasi/snapshot_preview1/sig ) (func $~start (; 1 ;) + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end call $start:wasi/snapshot_preview1 ) ) diff --git a/tests/compiler/wasi/trace.json b/tests/compiler/wasi/trace.json index 3d9e8b70ba..453cb07770 100644 --- a/tests/compiler/wasi/trace.json +++ b/tests/compiler/wasi/trace.json @@ -1,6 +1,5 @@ { "asc_flags": [ - "--runtime none", - "--explicitStart" + "--runtime none" ] } From 9894c563ec60a0b275b4ef9470926af0ec38bab7 Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 13 Mar 2020 18:06:47 +0100 Subject: [PATCH 12/13] split bindings and implementation, unsafe --- src/builtins.ts | 6 +- src/compiler.ts | 2 +- std/assembly/bindings/wasi.ts | 123 ------------------ .../bindings/wasi_snapshot_preview1.ts | 90 +++++++++++++ std/assembly/bindings/wasi_unstable.ts | 90 +++++++++++++ std/assembly/wasi/index.ts | 121 +++++++++++++++++ tests/compiler/wasi/abort.optimized.wat | 4 +- tests/compiler/wasi/abort.ts | 2 +- tests/compiler/wasi/abort.untouched.wat | 4 +- tests/compiler/wasi/seed.optimized.wat | 4 +- tests/compiler/wasi/seed.ts | 2 +- tests/compiler/wasi/seed.untouched.wat | 8 +- .../wasi/snapshot_preview1.optimized.wat | 10 +- .../wasi/snapshot_preview1.untouched.wat | 10 +- tests/compiler/wasi/trace.optimized.wat | 14 +- tests/compiler/wasi/trace.ts | 2 +- tests/compiler/wasi/trace.untouched.wat | 14 +- 17 files changed, 334 insertions(+), 172 deletions(-) create mode 100644 std/assembly/wasi/index.ts diff --git a/src/builtins.ts b/src/builtins.ts index e6b3ced895..3ea0512792 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -589,9 +589,9 @@ export namespace BuiltinNames { export const Float64Array = "~lib/typedarray/Float64Array"; // std/bindings/wasi.ts - export const wasiAbort = "~lib/bindings/wasi/abort"; - export const wasiTrace = "~lib/bindings/wasi/trace"; - export const wasiSeed = "~lib/bindings/wasi/seed"; + export const wasiAbort = "~lib/wasi/index/abort"; + export const wasiTrace = "~lib/wasi/index/trace"; + export const wasiSeed = "~lib/wasi/index/seed"; } /** Builtin compilation context. */ diff --git a/src/compiler.ts b/src/compiler.ts index d93aa8257d..f380b84730 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -8825,7 +8825,7 @@ export class Compiler extends DiagnosticEmitter { reportNode: Node ): ExpressionRef { var ctor = this.ensureConstructor(classInstance, reportNode); - if (ctor.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(reportNode); + if (classInstance.type.isUnmanaged || ctor.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(reportNode); var expr = this.compileCallDirect( // no need for another autoreleased local ctor, argumentExpressions, diff --git a/std/assembly/bindings/wasi.ts b/std/assembly/bindings/wasi.ts index 0ad98ac6d7..dfa28ee97c 100644 --- a/std/assembly/bindings/wasi.ts +++ b/std/assembly/bindings/wasi.ts @@ -1,124 +1 @@ -import { - proc_exit, - fd_write, - iovec, - random_get -} from "./wasi_snapshot_preview1"; - -import { - MAX_DOUBLE_LENGTH, - decimalCount32, - dtoa_stream -} from "util/number"; - export * from "./wasi_snapshot_preview1"; - -// @ts-ignore: decorator -@global @inline -const ASC_WASI = true; - -/** A WASI-aware abort implementation. */ -function abort( - message: string | null = null, - fileName: string | null = null, - lineNumber: u32 = 0, - columnNumber: u32 = 0 -): void { - // 0: iov.buf - // 4: iov.buf_len - // 8: len - // 12: buf... - const iovPtr: usize = 0; - const bufPtr: usize = iovPtr + offsetof() + sizeof(); - changetype(iovPtr).buf = bufPtr; - var ptr = bufPtr; - store(ptr, 0x203A74726F6261); ptr += 7; // 'abort: ' - if (message !== null) { - ptr += String.UTF8.encodeUnsafe(changetype(message), message.length, ptr); - } - store(ptr, 0x206E6920); ptr += 4; // ' in ' - if (fileName !== null) { - ptr += String.UTF8.encodeUnsafe(changetype(fileName), fileName.length, ptr); - } - store(ptr++, 0x28); // ( - var len = decimalCount32(lineNumber); ptr += len; - do { - let t = lineNumber / 10; - store(--ptr, 0x30 + lineNumber % 10); - lineNumber = t; - } while (lineNumber); ptr += len; - store(ptr++, 0x3A); // : - len = decimalCount32(columnNumber); ptr += len; - do { - let t = columnNumber / 10; - store(--ptr, 0x30 + columnNumber % 10); - columnNumber = t; - } while (columnNumber); ptr += len; - store(ptr, 0x0A29); ptr += 2; // )\n - changetype(iovPtr).buf_len = ptr - bufPtr; - fd_write(2, iovPtr, 1, offsetof()); - proc_exit(255); -} - -/** A WASI-aware trace implementation. */ -function trace( - message: string, - n: i32 = 0, - a0: f64 = 0, - a1: f64 = 0, - a2: f64 = 0, - a3: f64 = 0, - a4: f64 = 0 -): void { - // 0: iov.buf - // 4: iov.buf_len - // 8: len - // 12: buf... - var iovPtr = __alloc(offsetof() + sizeof() + 1 + (max(String.UTF8.byteLength(message), MAX_DOUBLE_LENGTH << 1)), 0); - var lenPtr = iovPtr + offsetof(); - var bufPtr = lenPtr + sizeof(); - changetype(iovPtr).buf = bufPtr; - store(bufPtr, 0x203A6563617274); // 'trace: ' - changetype(iovPtr).buf_len = 7; - fd_write(1, iovPtr, 1, lenPtr); - changetype(iovPtr).buf_len = String.UTF8.encodeUnsafe(changetype(message), message.length, bufPtr); - fd_write(1, iovPtr, 1, lenPtr); - if (n) { - store(bufPtr++, 0x20); // space - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a0), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); - if (n > 1) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a1), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); - if (n > 2) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a2), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); - if (n > 3) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a3), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); - if (n > 4) { - changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a4), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); - } - } - } - } - --bufPtr; - } - store(bufPtr, 0x0A); // \n - changetype(iovPtr).buf_len = 1; - fd_write(1, iovPtr, 1, lenPtr); - __free(iovPtr); -} - -/** A WASI-aware seed implementation. */ -function seed(): f64 { - var temp = load(0); - var rand: u64; - do { - random_get(0, 8); // to be sure - rand = load(0); - } while (!rand); - store(0, temp); - return reinterpret(rand); -} diff --git a/std/assembly/bindings/wasi_snapshot_preview1.ts b/std/assembly/bindings/wasi_snapshot_preview1.ts index ba691f994d..9bb6a6e6b2 100644 --- a/std/assembly/bindings/wasi_snapshot_preview1.ts +++ b/std/assembly/bindings/wasi_snapshot_preview1.ts @@ -9,6 +9,8 @@ type ptr = usize; // all pointers are usize'd type struct = T; // structs are references already in AS /** Read command-line argument data. */ +// @ts-ignore: decorator +@unsafe export declare function args_get( /** Input: Pointer to a buffer to write the argument pointers. */ argv: ptr>, @@ -17,6 +19,8 @@ export declare function args_get( ): errno; /** Return command-line argument data sizes. */ +// @ts-ignore: decorator +@unsafe export declare function args_sizes_get( /** Output: Number of arguments. */ argc: ptr, @@ -25,6 +29,8 @@ export declare function args_sizes_get( ): errno; /** Return the resolution of a clock. */ +// @ts-ignore: decorator +@unsafe export declare function clock_res_get( /** Input: The clock for which to return the resolution. */ clock: clockid, @@ -33,6 +39,8 @@ export declare function clock_res_get( ): errno; /** Return the time value of a clock. */ +// @ts-ignore: decorator +@unsafe export declare function clock_time_get( /** Input: Cock for which to return the time. */ clock: clockid, @@ -43,6 +51,8 @@ export declare function clock_time_get( ): errno; /** Read environment variable data. */ +// @ts-ignore: decorator +@unsafe export declare function environ_get( /** Input: Pointer to a buffer to write the environment variable pointers. */ environ: ptr, @@ -51,6 +61,8 @@ export declare function environ_get( ): errno; /** Return command-line argument data sizes. */ +// @ts-ignore: decorator +@unsafe export declare function environ_sizes_get( /** Output: The number of environment variables. */ environ_count: ptr, @@ -59,6 +71,8 @@ export declare function environ_sizes_get( ): errno; /** Provide file advisory information on a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_advise( /** Input: The file descriptor for the file for which to provide file advisory information. */ fd: fd, @@ -71,6 +85,8 @@ export declare function fd_advise( ): errno; /** Provide file advisory information on a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_allocate( /** Input: The file descriptor for the file in which to allocate space. */ fd: fd, @@ -81,18 +97,24 @@ export declare function fd_allocate( ): errno; /** Close a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_close( /** Input: The file descriptor to close. */ fd: fd ): errno; /** Synchronize the data of a file to disk. */ +// @ts-ignore: decorator +@unsafe export declare function fd_datasync( /** Input: The file descriptor of the file to synchronize to disk. */ fd: fd ): errno; /** Get the attributes of a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_fdstat_get( /** Input: The file descriptor to inspect. */ fd: fd, @@ -101,6 +123,8 @@ export declare function fd_fdstat_get( ): errno; /** Adjust the flags associated with a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_fdstat_set_flags( /** Input: The file descriptor to operate on. */ fd: fd, @@ -109,6 +133,8 @@ export declare function fd_fdstat_set_flags( ): errno; /** Adjust the rights associated with a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_fdstat_set_rights( /** Input: The file descriptor to operate on. */ fd: fd, @@ -119,6 +145,8 @@ export declare function fd_fdstat_set_rights( ): errno; /** Return the attributes of an open file. */ +// @ts-ignore: decorator +@unsafe export declare function fd_filestat_get( /** Input: The file descriptor to inspect. */ fd: fd, @@ -127,6 +155,8 @@ export declare function fd_filestat_get( ): errno; /** Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros. */ +// @ts-ignore: decorator +@unsafe export declare function fd_filestat_set_size( /** Input: A file descriptor for the file to adjust. */ fd: fd, @@ -135,6 +165,8 @@ export declare function fd_filestat_set_size( ): errno; /** Adjust the timestamps of an open file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function fd_filestat_set_times( /** Input: The file descriptor to operate on. */ fd: fd, @@ -147,6 +179,8 @@ export declare function fd_filestat_set_times( ): errno; /** Read from a file descriptor, without using and updating the file descriptor's offset. */ +// @ts-ignore: decorator +@unsafe export declare function fd_pread( /** Input: The file descriptor from which to read data. */ fd: fd, @@ -161,6 +195,8 @@ export declare function fd_pread( ): errno; /** Return a description of the given preopened file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_prestat_get( /** Input: The file descriptor about which to retrieve information. */ fd: fd, @@ -169,6 +205,8 @@ export declare function fd_prestat_get( ): errno; /** Return a description of the given preopened file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_prestat_dir_name( /** Input: The file descriptor about which to retrieve information. */ fd: fd, @@ -179,6 +217,8 @@ export declare function fd_prestat_dir_name( ): errno; /** Write to a file descriptor, without using and updating the file descriptor's offset. */ +// @ts-ignore: decorator +@unsafe export declare function fd_pwrite( /** Input: The file descriptor to which to write data. */ fd: fd, @@ -193,6 +233,8 @@ export declare function fd_pwrite( ): errno; /** Read from a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_read( /** Input: The file descriptor from which to read data. */ fd: fd, @@ -205,6 +247,8 @@ export declare function fd_read( ): errno; /** Read directory entries from a directory. */ +// @ts-ignore: decorator +@unsafe export declare function fd_readdir( /** Input: Directory from which to read the directory entries. */ fd: fd, @@ -219,6 +263,8 @@ export declare function fd_readdir( ): errno; /** Atomically replace a file descriptor by renumbering another file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_renumber( /** Input: The file descriptor to renumber. */ from: fd, @@ -227,6 +273,8 @@ export declare function fd_renumber( ): errno; /** Move the offset of a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_seek( /** Input: The file descriptor to operate on. */ fd: fd, @@ -239,12 +287,16 @@ export declare function fd_seek( ): errno; /** Synchronize the data and metadata of a file to disk. */ +// @ts-ignore: decorator +@unsafe export declare function fd_sync( /** Input: The file descriptor of the file containing the data and metadata to synchronize to disk. */ fd: fd ): errno; /** Return the current offset of a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_tell( /** Input: The file descriptor to inspect. */ fd: fd, @@ -253,6 +305,8 @@ export declare function fd_tell( ): errno; /** Write to a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_write( /** Input: The file descriptor to which to write data. */ fd: fd, @@ -265,6 +319,8 @@ export declare function fd_write( ): errno; /* Create a directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_create_directory( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -275,6 +331,8 @@ export declare function path_create_directory( ): errno; /** Return the attributes of a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_filestat_get( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -289,6 +347,8 @@ export declare function path_filestat_get( ): errno; /** Adjust the timestamps of a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_filestat_set_times( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -307,6 +367,8 @@ export declare function path_filestat_set_times( ): errno; /** Create a hard link. */ +// @ts-ignore: decorator +@unsafe export declare function path_link( /** Input: The working directory at which the resolution of the old path starts. */ old_fd: fd, @@ -325,6 +387,8 @@ export declare function path_link( ): errno; /** Open a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_open( /** Input: The working directory at which the resolution of the path starts. */ dirfd: fd, @@ -347,6 +411,8 @@ export declare function path_open( ): errno; /** Read the contents of a symbolic link. */ +// @ts-ignore: decorator +@unsafe export declare function path_readlink( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -363,6 +429,8 @@ export declare function path_readlink( ): errno; /** Remove a directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_remove_directory( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -373,6 +441,8 @@ export declare function path_remove_directory( ): errno; /** Rename a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_rename( /** Input: The working directory at which the resolution of the old path starts. */ old_fd: fd, @@ -389,6 +459,8 @@ export declare function path_rename( ): errno; /** Create a symbolic link. */ +// @ts-ignore: decorator +@unsafe export declare function path_symlink( /** Input: The contents of the symbolic link. */ old_path: ptr, @@ -403,6 +475,8 @@ export declare function path_symlink( ): errno; /** Unlink a file. */ +// @ts-ignore: decorator +@unsafe export declare function path_unlink_file( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -413,6 +487,8 @@ export declare function path_unlink_file( ): errno; /** Concurrently poll for the occurrence of a set of events. */ +// @ts-ignore: decorator +@unsafe export declare function poll_oneoff( /** Input: The events to which to subscribe. */ in_: ptr>, @@ -425,18 +501,24 @@ export declare function poll_oneoff( ): errno; /** Terminate the process normally. An exit code of 0 indicates successful termination of the program. The meanings of other values is dependent on the environment. */ +// @ts-ignore: decorator +@unsafe export declare function proc_exit( /** Input: The exit code returned by the process. */ rval: u32 ): void; /** Send a signal to the process of the calling thread. */ +// @ts-ignore: decorator +@unsafe export declare function proc_raise( /** Input: The signal condition to trigger. */ sig: signal ): errno; /** Write high-quality random data into a buffer. */ +// @ts-ignore: decorator +@unsafe export declare function random_get( /** Input: The buffer to fill with random data. */ buf: usize, @@ -445,9 +527,13 @@ export declare function random_get( ): errno; /** Temporarily yield execution of the calling thread. */ +// @ts-ignore: decorator +@unsafe export declare function sched_yield(): errno; /** Receive a message from a socket. */ +// @ts-ignore: decorator +@unsafe export declare function sock_recv( /** Input: The socket on which to receive data. */ sock: fd, @@ -464,6 +550,8 @@ export declare function sock_recv( ): errno; /** Send a message on a socket. */ +// @ts-ignore: decorator +@unsafe export declare function sock_send( /** Input: The socket on which to send data. */ sock: fd, @@ -478,6 +566,8 @@ export declare function sock_send( ): errno; /** Shut down socket send and receive channels. */ +// @ts-ignore: decorator +@unsafe export declare function sock_shutdown( /** Input: The socket on which to shutdown channels. */ sock: fd, diff --git a/std/assembly/bindings/wasi_unstable.ts b/std/assembly/bindings/wasi_unstable.ts index d75695dfa4..565b9532b8 100644 --- a/std/assembly/bindings/wasi_unstable.ts +++ b/std/assembly/bindings/wasi_unstable.ts @@ -9,6 +9,8 @@ type ptr = usize; // all pointers are usize'd type struct = T; // structs are references already in AS /** Read command-line argument data. */ +// @ts-ignore: decorator +@unsafe export declare function args_get( /** Input: Pointer to a buffer to write the argument pointers. */ argv: ptr>, @@ -17,6 +19,8 @@ export declare function args_get( ): errno; /** Return command-line argument data sizes. */ +// @ts-ignore: decorator +@unsafe export declare function args_sizes_get( /** Output: Number of arguments. */ argc: ptr, @@ -25,6 +29,8 @@ export declare function args_sizes_get( ): errno; /** Return the resolution of a clock. */ +// @ts-ignore: decorator +@unsafe export declare function clock_res_get( /** Input: The clock for which to return the resolution. */ clock: clockid, @@ -33,6 +39,8 @@ export declare function clock_res_get( ): errno; /** Return the time value of a clock. */ +// @ts-ignore: decorator +@unsafe export declare function clock_time_get( /** Input: Cock for which to return the time. */ clock: clockid, @@ -43,6 +51,8 @@ export declare function clock_time_get( ): errno; /** Read environment variable data. */ +// @ts-ignore: decorator +@unsafe export declare function environ_get( /** Input: Pointer to a buffer to write the environment variable pointers. */ environ: ptr, @@ -51,6 +61,8 @@ export declare function environ_get( ): errno; /** Return command-line argument data sizes. */ +// @ts-ignore: decorator +@unsafe export declare function environ_sizes_get( /** Output: The number of environment variables. */ environ_count: ptr, @@ -59,6 +71,8 @@ export declare function environ_sizes_get( ): errno; /** Provide file advisory information on a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_advise( /** Input: The file descriptor for the file for which to provide file advisory information. */ fd: fd, @@ -71,6 +85,8 @@ export declare function fd_advise( ): errno; /** Provide file advisory information on a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_allocate( /** Input: The file descriptor for the file in which to allocate space. */ fd: fd, @@ -81,18 +97,24 @@ export declare function fd_allocate( ): errno; /** Close a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_close( /** Input: The file descriptor to close. */ fd: fd ): errno; /** Synchronize the data of a file to disk. */ +// @ts-ignore: decorator +@unsafe export declare function fd_datasync( /** Input: The file descriptor of the file to synchronize to disk. */ fd: fd ): errno; /** Get the attributes of a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_fdstat_get( /** Input: The file descriptor to inspect. */ fd: fd, @@ -101,6 +123,8 @@ export declare function fd_fdstat_get( ): errno; /** Adjust the flags associated with a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_fdstat_set_flags( /** Input: The file descriptor to operate on. */ fd: fd, @@ -109,6 +133,8 @@ export declare function fd_fdstat_set_flags( ): errno; /** Adjust the rights associated with a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_fdstat_set_rights( /** Input: The file descriptor to operate on. */ fd: fd, @@ -119,6 +145,8 @@ export declare function fd_fdstat_set_rights( ): errno; /** Return the attributes of an open file. */ +// @ts-ignore: decorator +@unsafe export declare function fd_filestat_get( /** Input: The file descriptor to inspect. */ fd: fd, @@ -127,6 +155,8 @@ export declare function fd_filestat_get( ): errno; /** Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros. */ +// @ts-ignore: decorator +@unsafe export declare function fd_filestat_set_size( /** Input: A file descriptor for the file to adjust. */ fd: fd, @@ -135,6 +165,8 @@ export declare function fd_filestat_set_size( ): errno; /** Adjust the timestamps of an open file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function fd_filestat_set_times( /** Input: The file descriptor to operate on. */ fd: fd, @@ -147,6 +179,8 @@ export declare function fd_filestat_set_times( ): errno; /** Read from a file descriptor, without using and updating the file descriptor's offset. */ +// @ts-ignore: decorator +@unsafe export declare function fd_pread( /** Input: The file descriptor from which to read data. */ fd: fd, @@ -161,6 +195,8 @@ export declare function fd_pread( ): errno; /** Return a description of the given preopened file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_prestat_get( /** Input: The file descriptor about which to retrieve information. */ fd: fd, @@ -169,6 +205,8 @@ export declare function fd_prestat_get( ): errno; /** Return a description of the given preopened file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_prestat_dir_name( /** Input: The file descriptor about which to retrieve information. */ fd: fd, @@ -179,6 +217,8 @@ export declare function fd_prestat_dir_name( ): errno; /** Write to a file descriptor, without using and updating the file descriptor's offset. */ +// @ts-ignore: decorator +@unsafe export declare function fd_pwrite( /** Input: The file descriptor to which to write data. */ fd: fd, @@ -193,6 +233,8 @@ export declare function fd_pwrite( ): errno; /** Read from a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_read( /** Input: The file descriptor from which to read data. */ fd: fd, @@ -205,6 +247,8 @@ export declare function fd_read( ): errno; /** Read directory entries from a directory. */ +// @ts-ignore: decorator +@unsafe export declare function fd_readdir( /** Input: Directory from which to read the directory entries. */ fd: fd, @@ -219,6 +263,8 @@ export declare function fd_readdir( ): errno; /** Atomically replace a file descriptor by renumbering another file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_renumber( /** Input: The file descriptor to renumber. */ from: fd, @@ -227,6 +273,8 @@ export declare function fd_renumber( ): errno; /** Move the offset of a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_seek( /** Input: The file descriptor to operate on. */ fd: fd, @@ -239,12 +287,16 @@ export declare function fd_seek( ): errno; /** Synchronize the data and metadata of a file to disk. */ +// @ts-ignore: decorator +@unsafe export declare function fd_sync( /** Input: The file descriptor of the file containing the data and metadata to synchronize to disk. */ fd: fd ): errno; /** Return the current offset of a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_tell( /** Input: The file descriptor to inspect. */ fd: fd, @@ -253,6 +305,8 @@ export declare function fd_tell( ): errno; /** Write to a file descriptor. */ +// @ts-ignore: decorator +@unsafe export declare function fd_write( /** Input: The file descriptor to which to write data. */ fd: fd, @@ -265,6 +319,8 @@ export declare function fd_write( ): errno; /* Create a directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_create_directory( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -275,6 +331,8 @@ export declare function path_create_directory( ): errno; /** Return the attributes of a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_filestat_get( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -289,6 +347,8 @@ export declare function path_filestat_get( ): errno; /** Adjust the timestamps of a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_filestat_set_times( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -307,6 +367,8 @@ export declare function path_filestat_set_times( ): errno; /** Create a hard link. */ +// @ts-ignore: decorator +@unsafe export declare function path_link( /** Input: The working directory at which the resolution of the old path starts. */ old_fd: fd, @@ -325,6 +387,8 @@ export declare function path_link( ): errno; /** Open a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_open( /** Input: The working directory at which the resolution of the path starts. */ dirfd: fd, @@ -347,6 +411,8 @@ export declare function path_open( ): errno; /** Read the contents of a symbolic link. */ +// @ts-ignore: decorator +@unsafe export declare function path_readlink( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -363,6 +429,8 @@ export declare function path_readlink( ): errno; /** Remove a directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_remove_directory( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -373,6 +441,8 @@ export declare function path_remove_directory( ): errno; /** Rename a file or directory. */ +// @ts-ignore: decorator +@unsafe export declare function path_rename( /** Input: The working directory at which the resolution of the old path starts. */ old_fd: fd, @@ -389,6 +459,8 @@ export declare function path_rename( ): errno; /** Create a symbolic link. */ +// @ts-ignore: decorator +@unsafe export declare function path_symlink( /** Input: The contents of the symbolic link. */ old_path: ptr, @@ -403,6 +475,8 @@ export declare function path_symlink( ): errno; /** Unlink a file. */ +// @ts-ignore: decorator +@unsafe export declare function path_unlink_file( /** Input: The working directory at which the resolution of the path starts. */ fd: fd, @@ -413,6 +487,8 @@ export declare function path_unlink_file( ): errno; /** Concurrently poll for the occurrence of a set of events. */ +// @ts-ignore: decorator +@unsafe export declare function poll_oneoff( /** Input: The events to which to subscribe. */ in_: ptr>, @@ -425,18 +501,24 @@ export declare function poll_oneoff( ): errno; /** Terminate the process normally. An exit code of 0 indicates successful termination of the program. The meanings of other values is dependent on the environment. */ +// @ts-ignore: decorator +@unsafe export declare function proc_exit( /** Input: The exit code returned by the process. */ rval: u32 ): void; /** Send a signal to the process of the calling thread. */ +// @ts-ignore: decorator +@unsafe export declare function proc_raise( /** Input: The signal condition to trigger. */ sig: signal ): errno; /** Write high-quality random data into a buffer. */ +// @ts-ignore: decorator +@unsafe export declare function random_get( /** Input: The buffer to fill with random data. */ buf: usize, @@ -445,9 +527,13 @@ export declare function random_get( ): errno; /** Temporarily yield execution of the calling thread. */ +// @ts-ignore: decorator +@unsafe export declare function sched_yield(): errno; /** Receive a message from a socket. */ +// @ts-ignore: decorator +@unsafe export declare function sock_recv( /** Input: The socket on which to receive data. */ sock: fd, @@ -464,6 +550,8 @@ export declare function sock_recv( ): errno; /** Send a message on a socket. */ +// @ts-ignore: decorator +@unsafe export declare function sock_send( /** Input: The socket on which to send data. */ sock: fd, @@ -478,6 +566,8 @@ export declare function sock_send( ): errno; /** Shut down socket send and receive channels. */ +// @ts-ignore: decorator +@unsafe export declare function sock_shutdown( /** Input: The socket on which to shutdown channels. */ sock: fd, diff --git a/std/assembly/wasi/index.ts b/std/assembly/wasi/index.ts new file mode 100644 index 0000000000..bebf2bb295 --- /dev/null +++ b/std/assembly/wasi/index.ts @@ -0,0 +1,121 @@ +import { + proc_exit, + fd_write, + iovec, + random_get +} from "bindings/wasi"; + +import { + MAX_DOUBLE_LENGTH, + decimalCount32, + dtoa_stream +} from "util/number"; + +// @ts-ignore: decorator +@global @inline +const ASC_WASI = true; + +function abort( + message: string | null = null, + fileName: string | null = null, + lineNumber: u32 = 0, + columnNumber: u32 = 0 +): void { + // 0: iov.buf + // 4: iov.buf_len + // 8: len + // 12: buf... + const iovPtr: usize = 0; + const bufPtr: usize = iovPtr + offsetof() + sizeof(); + changetype(iovPtr).buf = bufPtr; + var ptr = bufPtr; + store(ptr, 0x203A74726F6261); ptr += 7; // 'abort: ' + if (message !== null) { + ptr += String.UTF8.encodeUnsafe(changetype(message), message.length, ptr); + } + store(ptr, 0x206E6920); ptr += 4; // ' in ' + if (fileName !== null) { + ptr += String.UTF8.encodeUnsafe(changetype(fileName), fileName.length, ptr); + } + store(ptr++, 0x28); // ( + var len = decimalCount32(lineNumber); ptr += len; + do { + let t = lineNumber / 10; + store(--ptr, 0x30 + lineNumber % 10); + lineNumber = t; + } while (lineNumber); ptr += len; + store(ptr++, 0x3A); // : + len = decimalCount32(columnNumber); ptr += len; + do { + let t = columnNumber / 10; + store(--ptr, 0x30 + columnNumber % 10); + columnNumber = t; + } while (columnNumber); ptr += len; + store(ptr, 0x0A29); ptr += 2; // )\n + changetype(iovPtr).buf_len = ptr - bufPtr; + fd_write(2, iovPtr, 1, offsetof()); + proc_exit(255); +} + +function trace( + message: string, + n: i32 = 0, + a0: f64 = 0, + a1: f64 = 0, + a2: f64 = 0, + a3: f64 = 0, + a4: f64 = 0 +): void { + // 0: iov.buf + // 4: iov.buf_len + // 8: len + // 12: buf... + var iovPtr = __alloc(offsetof() + sizeof() + 1 + (max(String.UTF8.byteLength(message), MAX_DOUBLE_LENGTH << 1)), 0); + var lenPtr = iovPtr + offsetof(); + var bufPtr = lenPtr + sizeof(); + changetype(iovPtr).buf = bufPtr; + store(bufPtr, 0x203A6563617274); // 'trace: ' + changetype(iovPtr).buf_len = 7; + fd_write(1, iovPtr, 1, lenPtr); + changetype(iovPtr).buf_len = String.UTF8.encodeUnsafe(changetype(message), message.length, bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n) { + store(bufPtr++, 0x20); // space + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a0), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 1) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a1), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 2) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a2), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 3) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a3), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + if (n > 4) { + changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a4), bufPtr); + fd_write(1, iovPtr, 1, lenPtr); + } + } + } + } + --bufPtr; + } + store(bufPtr, 0x0A); // \n + changetype(iovPtr).buf_len = 1; + fd_write(1, iovPtr, 1, lenPtr); + __free(iovPtr); +} + +function seed(): f64 { + var temp = load(0); + var rand: u64; + do { + random_get(0, 8); // to be sure + rand = load(0); + } while (!rand); + store(0, temp); + return reinterpret(rand); +} + +export * from "bindings/wasi"; diff --git a/tests/compiler/wasi/abort.optimized.wat b/tests/compiler/wasi/abort.optimized.wat index d5f9563f96..402c3f3792 100644 --- a/tests/compiler/wasi/abort.optimized.wat +++ b/tests/compiler/wasi/abort.optimized.wat @@ -234,7 +234,7 @@ i32.lt_u select ) - (func $~lib/bindings/wasi/abort (; 5 ;) + (func $~lib/wasi/index/abort (; 5 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -350,7 +350,7 @@ call $~lib/bindings/wasi_snapshot_preview1/proc_exit ) (func $wasi/abort/test (; 6 ;) - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable ) (func $~start (; 7 ;) diff --git a/tests/compiler/wasi/abort.ts b/tests/compiler/wasi/abort.ts index 45de1f18a9..731925477b 100644 --- a/tests/compiler/wasi/abort.ts +++ b/tests/compiler/wasi/abort.ts @@ -1,4 +1,4 @@ -import "bindings/wasi"; +import "wasi"; export function test(): void { assert(false, "the message"); diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat index cc5649ac9c..2ef0c79d27 100644 --- a/tests/compiler/wasi/abort.untouched.wat +++ b/tests/compiler/wasi/abort.untouched.wat @@ -298,7 +298,7 @@ (func $~lib/rt/stub/__release (; 6 ;) (param $0 i32) nop ) - (func $~lib/bindings/wasi/abort (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/wasi/index/abort (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -472,7 +472,7 @@ i32.const 80 i32.const 4 i32.const 2 - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable end ) diff --git a/tests/compiler/wasi/seed.optimized.wat b/tests/compiler/wasi/seed.optimized.wat index 801b0f16bf..38521677d4 100644 --- a/tests/compiler/wasi/seed.optimized.wat +++ b/tests/compiler/wasi/seed.optimized.wat @@ -289,7 +289,7 @@ i32.lt_u select ) - (func $~lib/bindings/wasi/abort (; 7 ;) + (func $~lib/wasi/index/abort (; 7 ;) (local $0 i32) (local $1 i32) (local $2 i32) @@ -455,7 +455,7 @@ select i32.eqz if - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable end end diff --git a/tests/compiler/wasi/seed.ts b/tests/compiler/wasi/seed.ts index fba2068120..a315eddef3 100644 --- a/tests/compiler/wasi/seed.ts +++ b/tests/compiler/wasi/seed.ts @@ -1,4 +1,4 @@ -import "bindings/wasi"; +import "wasi"; export function test(): f64 { return Math.random(); diff --git a/tests/compiler/wasi/seed.untouched.wat b/tests/compiler/wasi/seed.untouched.wat index 747b39fc13..6152d6aecb 100644 --- a/tests/compiler/wasi/seed.untouched.wat +++ b/tests/compiler/wasi/seed.untouched.wat @@ -22,7 +22,7 @@ (export "_start" (func $~start)) (export "memory" (memory $0)) (export "test" (func $wasi/seed/test)) - (func $~lib/bindings/wasi/seed (; 3 ;) (result f64) + (func $~lib/wasi/index/seed (; 3 ;) (result f64) (local $0 i64) (local $1 i64) (local $2 i32) @@ -400,7 +400,7 @@ (func $~lib/rt/stub/__release (; 10 ;) (param $0 i32) nop ) - (func $~lib/bindings/wasi/abort (; 11 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/wasi/index/abort (; 11 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -614,7 +614,7 @@ i32.const 32 i32.const 1406 i32.const 4 - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable end ) @@ -625,7 +625,7 @@ global.get $~lib/math/random_seeded i32.eqz if - call $~lib/bindings/wasi/seed + call $~lib/wasi/index/seed i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom end diff --git a/tests/compiler/wasi/snapshot_preview1.optimized.wat b/tests/compiler/wasi/snapshot_preview1.optimized.wat index aaacaa0c79..e1ab832a7d 100644 --- a/tests/compiler/wasi/snapshot_preview1.optimized.wat +++ b/tests/compiler/wasi/snapshot_preview1.optimized.wat @@ -2,17 +2,9 @@ (type $none_=>_none (func)) (memory $0 0) (global $wasi/snapshot_preview1/sig (mut i32) (i32.const 1)) - (global $~started (mut i32) (i32.const 0)) - (export "_start" (func $~start)) (export "memory" (memory $0)) + (start $~start) (func $~start (; 0 ;) - global.get $~started - if - return - else - i32.const 1 - global.set $~started - end i32.const 9 global.set $wasi/snapshot_preview1/sig ) diff --git a/tests/compiler/wasi/snapshot_preview1.untouched.wat b/tests/compiler/wasi/snapshot_preview1.untouched.wat index 9401ef5787..a9494f74b6 100644 --- a/tests/compiler/wasi/snapshot_preview1.untouched.wat +++ b/tests/compiler/wasi/snapshot_preview1.untouched.wat @@ -7,21 +7,13 @@ (global $~lib/shared/target/Target.JS i32 (i32.const 2)) (global $~lib/ASC_TARGET i32 (i32.const 0)) (global $wasi/snapshot_preview1/sig (mut i32) (i32.const 1)) - (global $~started (mut i32) (i32.const 0)) - (export "_start" (func $~start)) (export "memory" (memory $0)) + (start $~start) (func $start:wasi/snapshot_preview1 (; 0 ;) i32.const 9 global.set $wasi/snapshot_preview1/sig ) (func $~start (; 1 ;) - global.get $~started - if - return - else - i32.const 1 - global.set $~started - end call $start:wasi/snapshot_preview1 ) ) diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index 36e5e2bc8d..45a326129e 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1614,7 +1614,7 @@ local.get $1 call $~lib/util/number/dtoa_core ) - (func $~lib/bindings/wasi/abort (; 13 ;) (param $0 i32) (param $1 i32) + (func $~lib/wasi/index/abort (; 13 ;) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1713,7 +1713,7 @@ i32.const 255 call $~lib/bindings/wasi_snapshot_preview1/proc_exit ) - (func $~lib/bindings/wasi/trace (; 14 ;) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) + (func $~lib/wasi/index/trace (; 14 ;) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (local $6 i32) (local $7 i32) (local $8 i32) @@ -1898,7 +1898,7 @@ if i32.const 70 i32.const 2 - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable end local.get $6 @@ -1911,7 +1911,7 @@ if i32.const 72 i32.const 13 - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable end global.get $~lib/rt/stub/offset @@ -1943,20 +1943,20 @@ f64.const 0 f64.const 0 f64.const 0 - call $~lib/bindings/wasi/trace + call $~lib/wasi/index/trace i32.const 1 f64.const 1.5 f64.const 0 f64.const 0 f64.const 0 f64.const 0 - call $~lib/bindings/wasi/trace + call $~lib/wasi/index/trace i32.const 5 f64.const -2.00001 f64.const 3 f64.const nan:0x8000000000000 f64.const inf f64.const -inf - call $~lib/bindings/wasi/trace + call $~lib/wasi/index/trace ) ) diff --git a/tests/compiler/wasi/trace.ts b/tests/compiler/wasi/trace.ts index d81af36dfd..82eb28d680 100644 --- a/tests/compiler/wasi/trace.ts +++ b/tests/compiler/wasi/trace.ts @@ -1,4 +1,4 @@ -import "bindings/wasi"; +import "wasi"; trace("the message"); trace("the message", 1, 1.5); diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index 3418d7a3d1..2a27219793 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -3245,7 +3245,7 @@ local.get $2 call $~lib/util/number/dtoa_core ) - (func $~lib/bindings/wasi/abort (; 17 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/wasi/index/abort (; 17 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3430,7 +3430,7 @@ i32.const 1472 i32.const 70 i32.const 2 - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable end local.get $0 @@ -3447,7 +3447,7 @@ i32.const 1472 i32.const 72 i32.const 13 - call $~lib/bindings/wasi/abort + call $~lib/wasi/index/abort unreachable end local.get $0 @@ -3461,7 +3461,7 @@ global.set $~lib/rt/stub/offset end ) - (func $~lib/bindings/wasi/trace (; 19 ;) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) + (func $~lib/wasi/index/trace (; 19 ;) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (local $7 i32) (local $8 i32) (local $9 i32) @@ -3688,7 +3688,7 @@ f64.const 0 f64.const 0 f64.const 0 - call $~lib/bindings/wasi/trace + call $~lib/wasi/index/trace i32.const 32 i32.const 1 f64.const 1.5 @@ -3696,7 +3696,7 @@ f64.const 0 f64.const 0 f64.const 0 - call $~lib/bindings/wasi/trace + call $~lib/wasi/index/trace i32.const 32 i32.const 5 f64.const -2.00001 @@ -3705,7 +3705,7 @@ f64.const inf f64.const inf f64.neg - call $~lib/bindings/wasi/trace + call $~lib/wasi/index/trace ) (func $~start (; 21 ;) global.get $~started From 7226d6c1d94f5f09d2c46d0d1eebf4f4b760ea7e Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 13 Mar 2020 19:53:33 +0100 Subject: [PATCH 13/13] trace to fd 2 to keep stdout intact --- std/assembly/wasi/index.ts | 21 +++++++++++---------- tests/compiler/wasi/trace.optimized.wat | 16 ++++++++-------- tests/compiler/wasi/trace.untouched.wat | 16 ++++++++-------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/std/assembly/wasi/index.ts b/std/assembly/wasi/index.ts index bebf2bb295..a5d472f18a 100644 --- a/std/assembly/wasi/index.ts +++ b/std/assembly/wasi/index.ts @@ -26,7 +26,8 @@ function abort( // 8: len // 12: buf... const iovPtr: usize = 0; - const bufPtr: usize = iovPtr + offsetof() + sizeof(); + const lenPtr: usize = iovPtr + offsetof(); + const bufPtr: usize = lenPtr + sizeof(); changetype(iovPtr).buf = bufPtr; var ptr = bufPtr; store(ptr, 0x203A74726F6261); ptr += 7; // 'abort: ' @@ -53,7 +54,7 @@ function abort( } while (columnNumber); ptr += len; store(ptr, 0x0A29); ptr += 2; // )\n changetype(iovPtr).buf_len = ptr - bufPtr; - fd_write(2, iovPtr, 1, offsetof()); + fd_write(2, iovPtr, 1, lenPtr); proc_exit(255); } @@ -76,25 +77,25 @@ function trace( changetype(iovPtr).buf = bufPtr; store(bufPtr, 0x203A6563617274); // 'trace: ' changetype(iovPtr).buf_len = 7; - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); changetype(iovPtr).buf_len = String.UTF8.encodeUnsafe(changetype(message), message.length, bufPtr); - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); if (n) { store(bufPtr++, 0x20); // space changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a0), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); if (n > 1) { changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a1), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); if (n > 2) { changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a2), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); if (n > 3) { changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a3), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); if (n > 4) { changetype(iovPtr).buf_len = 1 + String.UTF8.encodeUnsafe(bufPtr, dtoa_stream(bufPtr, 0, a4), bufPtr); - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); } } } @@ -103,7 +104,7 @@ function trace( } store(bufPtr, 0x0A); // \n changetype(iovPtr).buf_len = 1; - fd_write(1, iovPtr, 1, lenPtr); + fd_write(2, iovPtr, 1, lenPtr); __free(iovPtr); } diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index 6668808d99..d5130021d4 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1743,7 +1743,7 @@ local.get $6 i32.const 7 i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 @@ -1756,7 +1756,7 @@ local.get $7 call $~lib/string/String.UTF8.encodeUnsafe i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 @@ -1780,7 +1780,7 @@ i32.const 1 i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 @@ -1800,7 +1800,7 @@ i32.const 1 i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 @@ -1820,7 +1820,7 @@ i32.const 1 i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 @@ -1840,7 +1840,7 @@ i32.const 1 i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 @@ -1860,7 +1860,7 @@ i32.const 1 i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 @@ -1881,7 +1881,7 @@ local.get $6 i32.const 1 i32.store offset=4 - i32.const 1 + i32.const 2 local.get $6 i32.const 1 local.get $8 diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index 2a27219793..cb9d76a2eb 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -3508,7 +3508,7 @@ local.get $9 i32.const 7 i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10 @@ -3522,7 +3522,7 @@ i32.const 0 call $~lib/string/String.UTF8.encodeUnsafe i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10 @@ -3550,7 +3550,7 @@ call $~lib/string/String.UTF8.encodeUnsafe i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10 @@ -3572,7 +3572,7 @@ call $~lib/string/String.UTF8.encodeUnsafe i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10 @@ -3594,7 +3594,7 @@ call $~lib/string/String.UTF8.encodeUnsafe i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10 @@ -3616,7 +3616,7 @@ call $~lib/string/String.UTF8.encodeUnsafe i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10 @@ -3638,7 +3638,7 @@ call $~lib/string/String.UTF8.encodeUnsafe i32.add i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10 @@ -3659,7 +3659,7 @@ local.get $9 i32.const 1 i32.store offset=4 - i32.const 1 + i32.const 2 local.get $9 i32.const 1 local.get $10