From c53a32883cd46578b1eac46fc192b9cb0d8df3b3 Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 7 May 2020 16:17:35 +0200 Subject: [PATCH 1/5] GC finalization experiment --- std/assembly/rt/pure.ts | 19 +- tests/compiler/do.optimized.wat | 10 +- tests/compiler/do.untouched.wat | 20 +- .../extends-baseaggregate.optimized.wat | 8 +- .../extends-baseaggregate.untouched.wat | 24 +- tests/compiler/for.optimized.wat | 10 +- tests/compiler/for.untouched.wat | 20 +- .../implicit-getter-setter.optimized.wat | 10 +- .../implicit-getter-setter.untouched.wat | 22 +- tests/compiler/issues/1095.optimized.wat | 10 +- tests/compiler/issues/1095.untouched.wat | 20 +- tests/compiler/managed-cast.optimized.wat | 10 +- tests/compiler/managed-cast.untouched.wat | 20 +- tests/compiler/object-literal.optimized.wat | 10 +- tests/compiler/object-literal.untouched.wat | 20 +- tests/compiler/rc/global-init.untouched.wat | 20 +- tests/compiler/rc/local-init.optimized.wat | 10 +- tests/compiler/rc/local-init.untouched.wat | 20 +- .../rc/logical-and-mismatch.optimized.wat | 10 +- .../rc/logical-and-mismatch.untouched.wat | 20 +- .../rc/logical-or-mismatch.optimized.wat | 10 +- .../rc/logical-or-mismatch.untouched.wat | 20 +- tests/compiler/rc/optimize.optimized.wat | 10 +- tests/compiler/rc/optimize.untouched.wat | 20 +- tests/compiler/rc/rereturn.optimized.wat | 10 +- tests/compiler/rc/rereturn.untouched.wat | 22 +- .../rc/ternary-mismatch.optimized.wat | 10 +- .../rc/ternary-mismatch.untouched.wat | 20 +- tests/compiler/resolve-ternary.optimized.wat | 10 +- tests/compiler/resolve-ternary.untouched.wat | 22 +- .../retain-release-sanity.optimized.wat | 8 +- .../retain-release-sanity.untouched.wat | 24 +- tests/compiler/retain-return.optimized.wat | 10 +- tests/compiler/retain-return.untouched.wat | 20 +- tests/compiler/rt/finalize.json | 6 + tests/compiler/rt/finalize.optimized.wat | 2030 +++++++++ tests/compiler/rt/finalize.ts | 31 + tests/compiler/rt/finalize.untouched.wat | 3986 +++++++++++++++++ tests/compiler/runtime-full.optimized.wat | 10 +- tests/compiler/runtime-full.untouched.wat | 20 +- .../compiler/std/array-literal.optimized.wat | 10 +- .../compiler/std/array-literal.untouched.wat | 20 +- tests/compiler/std/array.optimized.wat | 10 +- tests/compiler/std/array.untouched.wat | 20 +- tests/compiler/std/arraybuffer.optimized.wat | 10 +- tests/compiler/std/arraybuffer.untouched.wat | 20 +- tests/compiler/std/dataview.optimized.wat | 10 +- tests/compiler/std/dataview.untouched.wat | 22 +- tests/compiler/std/map.optimized.wat | 10 +- tests/compiler/std/map.untouched.wat | 20 +- tests/compiler/std/set.optimized.wat | 10 +- tests/compiler/std/set.untouched.wat | 20 +- tests/compiler/std/staticarray.optimized.wat | 10 +- tests/compiler/std/staticarray.untouched.wat | 22 +- .../std/string-casemapping.optimized.wat | 10 +- .../std/string-casemapping.untouched.wat | 22 +- .../std/string-encoding.optimized.wat | 10 +- .../std/string-encoding.untouched.wat | 20 +- tests/compiler/std/string.optimized.wat | 10 +- tests/compiler/std/string.untouched.wat | 20 +- tests/compiler/std/typedarray.optimized.wat | 178 +- tests/compiler/std/typedarray.untouched.wat | 226 +- tests/compiler/while.optimized.wat | 10 +- tests/compiler/while.untouched.wat | 20 +- 64 files changed, 6924 insertions(+), 428 deletions(-) create mode 100644 tests/compiler/rt/finalize.json create mode 100644 tests/compiler/rt/finalize.optimized.wat create mode 100644 tests/compiler/rt/finalize.ts create mode 100644 tests/compiler/rt/finalize.untouched.wat diff --git a/std/assembly/rt/pure.ts b/std/assembly/rt/pure.ts index 0f27bd326e..f87c17ec19 100644 --- a/std/assembly/rt/pure.ts +++ b/std/assembly/rt/pure.ts @@ -103,6 +103,17 @@ function __visit(ref: usize, cookie: i32): void { } } +/** Finalizes the specified block, giving it back to the memory manager. */ +function finalize(s: Block): void { + if (isDefined(__finalize)) { + let info = s.gcInfo | 1; // pretend RC>=1 + s.gcInfo = info; + __finalize(changetype(s) + BLOCK_OVERHEAD); + assert(s.gcInfo == info); + } + freeBlock(ROOT, s); +} + /** Increments the reference count of the specified block by one.*/ function increment(s: Block): void { var info = s.gcInfo; @@ -124,10 +135,10 @@ function decrement(s: Block): void { __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_DECREMENT); if (isDefined(__GC_ALL_ACYCLIC)) { if (DEBUG) assert(!(info & BUFFERED_MASK)); - freeBlock(ROOT, s); + finalize(s); } else { if (!(info & BUFFERED_MASK)) { - freeBlock(ROOT, s); + finalize(s); } else { s.gcInfo = BUFFERED_MASK | COLOR_BLACK | 0; } @@ -205,7 +216,7 @@ export function __collect(): void { cur += sizeof(); } else { if ((info & COLOR_MASK) == COLOR_BLACK && !(info & REFCOUNT_MASK)) { - freeBlock(ROOT, s); + finalize(s); } else { s.gcInfo = info & ~BUFFERED_MASK; } @@ -261,7 +272,7 @@ function collectWhite(s: Block): void { if ((info & COLOR_MASK) == COLOR_WHITE && !(info & BUFFERED_MASK)) { s.gcInfo = (info & ~COLOR_MASK) | COLOR_BLACK; __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_COLLECTWHITE); - freeBlock(ROOT, s); + finalize(s); } } diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index d3ce08b230..edae26e83f 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -1005,7 +1005,7 @@ if i32.const 0 i32.const 1184 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1024,7 +1024,7 @@ if i32.const 0 i32.const 1184 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1416,7 +1416,7 @@ if i32.const 0 i32.const 1184 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1458,7 +1458,7 @@ if i32.const 0 i32.const 1184 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1481,7 +1481,7 @@ if i32.const 0 i32.const 1184 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 418a287303..6fa0fbdbdc 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -1890,7 +1890,7 @@ if i32.const 0 i32.const 176 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1915,7 +1915,7 @@ if i32.const 0 i32.const 176 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -2296,6 +2296,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -2321,7 +2328,7 @@ if i32.const 0 i32.const 176 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -2347,14 +2354,13 @@ if i32.const 0 i32.const 176 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -2365,7 +2371,7 @@ if i32.const 0 i32.const 176 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index e0b0674624..3b13e634b5 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -1071,7 +1071,7 @@ if i32.const 0 i32.const 1248 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1088,7 +1088,7 @@ if i32.const 0 i32.const 1248 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1940,7 +1940,7 @@ if i32.const 0 i32.const 1248 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1973,7 +1973,7 @@ if i32.const 0 i32.const 1248 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index fd84213021..c4627f1d6f 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -1485,7 +1485,7 @@ if i32.const 0 i32.const 240 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1508,7 +1508,7 @@ if i32.const 0 i32.const 240 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3377,6 +3377,13 @@ call $~lib/rt/__visit_members end ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/scanBlack (param $0 i32) local.get $0 local.get $0 @@ -3464,9 +3471,8 @@ i32.add i32.const 5 call $~lib/rt/__visit_members - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize end ) (func $~lib/rt/pure/__collect @@ -3539,9 +3545,8 @@ i32.const 0 end if - global.get $~lib/rt/tlsf/ROOT local.get $5 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else local.get $5 local.get $6 @@ -3740,7 +3745,7 @@ if i32.const 0 i32.const 240 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -3761,9 +3766,8 @@ i32.and i32.eqz if - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else local.get $0 i32.const -2147483648 @@ -3783,7 +3787,7 @@ if i32.const 0 i32.const 240 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 5ffcec178e..ff2ecef440 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -1002,7 +1002,7 @@ if i32.const 0 i32.const 1184 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1021,7 +1021,7 @@ if i32.const 0 i32.const 1184 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1425,7 +1425,7 @@ if i32.const 0 i32.const 1184 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1467,7 +1467,7 @@ if i32.const 0 i32.const 1184 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1490,7 +1490,7 @@ if i32.const 0 i32.const 1184 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 78c447d516..9fd67f9812 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -1903,7 +1903,7 @@ if i32.const 0 i32.const 176 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1928,7 +1928,7 @@ if i32.const 0 i32.const 176 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -2341,6 +2341,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -2366,7 +2373,7 @@ if i32.const 0 i32.const 176 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -2392,14 +2399,13 @@ if i32.const 0 i32.const 176 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -2410,7 +2416,7 @@ if i32.const 0 i32.const 176 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/implicit-getter-setter.optimized.wat b/tests/compiler/implicit-getter-setter.optimized.wat index 454a19e0c9..276560af3e 100644 --- a/tests/compiler/implicit-getter-setter.optimized.wat +++ b/tests/compiler/implicit-getter-setter.optimized.wat @@ -1075,7 +1075,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1094,7 +1094,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1198,7 +1198,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1240,7 +1240,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1263,7 +1263,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/implicit-getter-setter.untouched.wat b/tests/compiler/implicit-getter-setter.untouched.wat index 0bf24f8ead..04fad339ed 100644 --- a/tests/compiler/implicit-getter-setter.untouched.wat +++ b/tests/compiler/implicit-getter-setter.untouched.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -1491,7 +1491,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1516,7 +1516,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1636,6 +1636,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1661,7 +1668,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1687,14 +1694,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1705,7 +1711,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index 555c78f813..d0212f9e55 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -916,7 +916,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -935,7 +935,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1057,7 +1057,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1080,7 +1080,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1095.untouched.wat b/tests/compiler/issues/1095.untouched.wat index ababb570f7..33067580db 100644 --- a/tests/compiler/issues/1095.untouched.wat +++ b/tests/compiler/issues/1095.untouched.wat @@ -1477,7 +1477,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1502,7 +1502,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1620,6 +1620,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1645,7 +1652,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1671,14 +1678,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1689,7 +1695,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 0ed2b2c8b5..07d57d1890 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -924,7 +924,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -943,7 +943,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1133,7 +1133,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1175,7 +1175,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1198,7 +1198,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index 1c3c6de678..ff6b34b0a1 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -1479,7 +1479,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1504,7 +1504,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1884,6 +1884,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1909,7 +1916,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1935,14 +1942,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1953,7 +1959,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index e7c00c0c50..d08e377a79 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -1067,7 +1067,7 @@ if i32.const 0 i32.const 1200 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1086,7 +1086,7 @@ if i32.const 0 i32.const 1200 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -2127,7 +2127,7 @@ if i32.const 0 i32.const 1200 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -2146,7 +2146,7 @@ if i32.const 0 i32.const 1200 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -2161,7 +2161,7 @@ if i32.const 0 i32.const 1200 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat index 98f6656a59..d427d778a5 100644 --- a/tests/compiler/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -1485,7 +1485,7 @@ if i32.const 0 i32.const 192 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1510,7 +1510,7 @@ if i32.const 0 i32.const 192 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3914,6 +3914,13 @@ drop return ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -3939,7 +3946,7 @@ if i32.const 0 i32.const 192 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -3965,14 +3972,13 @@ if i32.const 0 i32.const 192 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -3983,7 +3989,7 @@ if i32.const 0 i32.const 192 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/global-init.untouched.wat b/tests/compiler/rc/global-init.untouched.wat index 5e52828faa..b6a2f91c0b 100644 --- a/tests/compiler/rc/global-init.untouched.wat +++ b/tests/compiler/rc/global-init.untouched.wat @@ -45,7 +45,7 @@ if i32.const 0 i32.const 48 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -70,7 +70,7 @@ if i32.const 0 i32.const 48 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -734,6 +734,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -759,7 +766,7 @@ if i32.const 0 i32.const 48 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -785,14 +792,13 @@ if i32.const 0 i32.const 48 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -803,7 +809,7 @@ if i32.const 0 i32.const 48 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat index c49de915d2..134631395a 100644 --- a/tests/compiler/rc/local-init.optimized.wat +++ b/tests/compiler/rc/local-init.optimized.wat @@ -920,7 +920,7 @@ if i32.const 0 i32.const 1168 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -939,7 +939,7 @@ if i32.const 0 i32.const 1168 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -973,7 +973,7 @@ if i32.const 0 i32.const 1168 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 1168 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1038,7 +1038,7 @@ if i32.const 0 i32.const 1168 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.untouched.wat b/tests/compiler/rc/local-init.untouched.wat index 3f346a5bc7..9b625868ab 100644 --- a/tests/compiler/rc/local-init.untouched.wat +++ b/tests/compiler/rc/local-init.untouched.wat @@ -1490,7 +1490,7 @@ if i32.const 0 i32.const 160 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1515,7 +1515,7 @@ if i32.const 0 i32.const 160 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1582,6 +1582,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1607,7 +1614,7 @@ if i32.const 0 i32.const 160 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1633,14 +1640,13 @@ if i32.const 0 i32.const 160 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1651,7 +1657,7 @@ if i32.const 0 i32.const 160 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat index 6a906a7a83..1d55017c03 100644 --- a/tests/compiler/rc/logical-and-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -915,7 +915,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -934,7 +934,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1057,7 +1057,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1080,7 +1080,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.untouched.wat b/tests/compiler/rc/logical-and-mismatch.untouched.wat index 75a31a6e5d..6719fcbbd2 100644 --- a/tests/compiler/rc/logical-and-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-and-mismatch.untouched.wat @@ -1476,7 +1476,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1501,7 +1501,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1627,6 +1627,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1652,7 +1659,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1678,14 +1685,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1696,7 +1702,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat index 946c55476b..d493664657 100644 --- a/tests/compiler/rc/logical-or-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -915,7 +915,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -934,7 +934,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1017,7 +1017,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1082,7 +1082,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.untouched.wat b/tests/compiler/rc/logical-or-mismatch.untouched.wat index 05b2addd50..79c806abfa 100644 --- a/tests/compiler/rc/logical-or-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-or-mismatch.untouched.wat @@ -1476,7 +1476,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1501,7 +1501,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1627,6 +1627,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1652,7 +1659,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1678,14 +1685,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1696,7 +1702,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index adad34ed33..78d8b84124 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -83,7 +83,7 @@ if i32.const 0 i32.const 1040 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -102,7 +102,7 @@ if i32.const 0 i32.const 1040 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1068,7 +1068,7 @@ if i32.const 0 i32.const 1040 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1110,7 +1110,7 @@ if i32.const 0 i32.const 1040 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1133,7 +1133,7 @@ if i32.const 0 i32.const 1040 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.untouched.wat b/tests/compiler/rc/optimize.untouched.wat index 2504b02101..904bba43ff 100644 --- a/tests/compiler/rc/optimize.untouched.wat +++ b/tests/compiler/rc/optimize.untouched.wat @@ -86,7 +86,7 @@ if i32.const 0 i32.const 32 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -111,7 +111,7 @@ if i32.const 0 i32.const 32 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1879,6 +1879,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1904,7 +1911,7 @@ if i32.const 0 i32.const 32 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1930,14 +1937,13 @@ if i32.const 0 i32.const 32 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1948,7 +1954,7 @@ if i32.const 0 i32.const 32 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat index 160b6e5eb6..245f1ef8e9 100644 --- a/tests/compiler/rc/rereturn.optimized.wat +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1076,7 +1076,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1114,7 +1114,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1156,7 +1156,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1177,7 +1177,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.untouched.wat b/tests/compiler/rc/rereturn.untouched.wat index 86eaab64c7..bfafff6e1f 100644 --- a/tests/compiler/rc/rereturn.untouched.wat +++ b/tests/compiler/rc/rereturn.untouched.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) @@ -1476,7 +1476,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1499,7 +1499,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1575,6 +1575,13 @@ i32.const 0 drop ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1598,7 +1605,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1624,14 +1631,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1642,7 +1648,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat index ae587c4e1a..f9d9be082a 100644 --- a/tests/compiler/rc/ternary-mismatch.optimized.wat +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -917,7 +917,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -936,7 +936,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1016,7 +1016,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1058,7 +1058,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1081,7 +1081,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.untouched.wat b/tests/compiler/rc/ternary-mismatch.untouched.wat index f502716e41..76d51d90f0 100644 --- a/tests/compiler/rc/ternary-mismatch.untouched.wat +++ b/tests/compiler/rc/ternary-mismatch.untouched.wat @@ -1478,7 +1478,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1503,7 +1503,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1611,6 +1611,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1636,7 +1643,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1662,14 +1669,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1680,7 +1686,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index 45b4ecfee3..3f2590ee42 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -1077,7 +1077,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1094,7 +1094,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -2441,7 +2441,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -2483,7 +2483,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -2498,7 +2498,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index 4cc9ba29ab..ccf61ad56a 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -1,7 +1,7 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param 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 $none_=>_none (func)) @@ -1507,7 +1507,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1530,7 +1530,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -4932,6 +4932,13 @@ drop return ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -4955,7 +4962,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -4981,14 +4988,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -4999,7 +5005,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index aaed61f712..4e7bb8343e 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -1237,7 +1237,7 @@ if i32.const 0 i32.const 1248 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1256,7 +1256,7 @@ if i32.const 0 i32.const 1248 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -2365,7 +2365,7 @@ if i32.const 0 i32.const 1248 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -2398,7 +2398,7 @@ if i32.const 0 i32.const 1248 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.untouched.wat b/tests/compiler/retain-release-sanity.untouched.wat index f26dd06d7d..674f363587 100644 --- a/tests/compiler/retain-release-sanity.untouched.wat +++ b/tests/compiler/retain-release-sanity.untouched.wat @@ -1705,7 +1705,7 @@ if i32.const 0 i32.const 240 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1730,7 +1730,7 @@ if i32.const 0 i32.const 240 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3989,6 +3989,13 @@ call $~lib/rt/__visit_members end ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/scanBlack (param $0 i32) local.get $0 local.get $0 @@ -4076,9 +4083,8 @@ i32.add i32.const 5 call $~lib/rt/__visit_members - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize end ) (func $~lib/rt/pure/__collect @@ -4151,9 +4157,8 @@ i32.const 0 end if - global.get $~lib/rt/tlsf/ROOT local.get $5 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else local.get $5 local.get $6 @@ -4362,7 +4367,7 @@ if i32.const 0 i32.const 240 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -4383,9 +4388,8 @@ i32.and i32.eqz if - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else local.get $0 i32.const -2147483648 @@ -4405,7 +4409,7 @@ if i32.const 0 i32.const 240 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.optimized.wat b/tests/compiler/retain-return.optimized.wat index a73cfa0150..ff2b80371f 100644 --- a/tests/compiler/retain-return.optimized.wat +++ b/tests/compiler/retain-return.optimized.wat @@ -911,7 +911,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -928,7 +928,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1013,7 +1013,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1055,7 +1055,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1076,7 +1076,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.untouched.wat b/tests/compiler/retain-return.untouched.wat index b4dcef0dd6..6f9c4e350c 100644 --- a/tests/compiler/retain-return.untouched.wat +++ b/tests/compiler/retain-return.untouched.wat @@ -1480,7 +1480,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1503,7 +1503,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1718,6 +1718,13 @@ i32.const 0 drop ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1741,7 +1748,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1767,14 +1774,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1785,7 +1791,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rt/finalize.json b/tests/compiler/rt/finalize.json new file mode 100644 index 0000000000..93ce9d8b22 --- /dev/null +++ b/tests/compiler/rt/finalize.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--explicitStart" + ] +} \ No newline at end of file diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat new file mode 100644 index 0000000000..438a5deeb6 --- /dev/null +++ b/tests/compiler/rt/finalize.optimized.wat @@ -0,0 +1,2030 @@ +(module + (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (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 $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))) + (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 1024) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e") + (data (i32.const 1072) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 1120) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 1168) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 1216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 1280) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 1328) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c") + (data (i32.const 1376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00_\00_\00f\00i\00n\00a\00l\00i\00z\00e") + (data (i32.const 1424) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 1488) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 1536) "\06\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\"\t") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) + (global $~started (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (export "_start" (func $~start)) + (export "memory" (memory $0)) + (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 277 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 279 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $4 + i32.const 7 + i32.sub + local.set $4 + end + local.get $2 + i32.const 16 + i32.lt_u + i32.const 0 + local.get $4 + i32.const 23 + i32.lt_u + select + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 292 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $3 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $3 + i32.store offset=20 + end + local.get $3 + if + local.get $3 + local.get $5 + i32.store offset=16 + end + local.get $1 + local.get $0 + local.get $2 + local.get $4 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + i32.eq + if + local.get $0 + local.get $2 + local.get $4 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + local.get $3 + i32.store offset=96 + local.get $3 + i32.eqz + if + local.get $0 + local.get $4 + i32.const 2 + i32.shl + i32.add + local.tee $3 + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.set $1 + local.get $3 + local.get $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 205 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 207 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + local.get $3 + i32.const 3 + i32.and + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $7 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 228 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $8 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $8 + local.get $7 + i32.const 3 + i32.and + i32.or + local.tee $3 + i32.store + local.get $2 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 243 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $1 + i32.const 16 + i32.add + i32.add + local.get $4 + i32.ne + if + i32.const 0 + i32.const 1184 + i32.const 244 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + local.set $6 + end + local.get $2 + i32.const 16 + i32.lt_u + i32.const 0 + local.get $6 + i32.const 23 + i32.lt_u + select + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 260 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + local.get $6 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $3 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $3 + i32.store offset=20 + local.get $3 + if + local.get $3 + local.get $1 + i32.store offset=16 + end + local.get $0 + local.get $2 + local.get $6 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $6 + i32.shl + i32.or + i32.store + local.get $0 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.tee $0 + local.get $0 + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 386 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 1184 + i32.const 396 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $1 + i32.const 16 + i32.sub + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 1184 + i32.const 408 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/maybeInitialize (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $0 + i32.eqz + if + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 1600 + local.tee $0 + i32.const 0 + i32.store + i32.const 3168 + i32.const 0 + i32.store + loop $for-loop|0 + local.get $1 + i32.const 23 + i32.lt_u + if + local.get $1 + i32.const 2 + i32.shl + i32.const 1600 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $2 + loop $for-loop|1 + local.get $2 + i32.const 16 + i32.lt_u + if + local.get $1 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + i32.const 1600 + i32.add + i32.const 0 + i32.store offset=96 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $for-loop|1 + end + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $for-loop|0 + end + end + i32.const 1600 + i32.const 3184 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 1600 + global.set $~lib/rt/tlsf/ROOT + end + local.get $0 + ) + (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + local.set $2 + end + local.get $1 + i32.const 16 + i32.lt_u + i32.const 0 + local.get $2 + i32.const 23 + i32.lt_u + select + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 338 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 351 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 1184 + i32.const 365 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $2 + local.get $1 + i32.const 16 + i32.add + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.tee $0 + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $0 + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/tlsf/collectLock + if + i32.const 0 + i32.const 1184 + i32.const 501 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1073741808 + i32.ge_u + if + i32.const 1232 + i32.const 1184 + i32.const 461 + i32.const 30 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $3 + i32.const 16 + local.get $3 + i32.const 16 + i32.gt_u + select + local.tee $4 + call $~lib/rt/tlsf/searchBlock + local.tee $3 + i32.eqz + if + i32.const 1 + global.set $~lib/rt/tlsf/collectLock + call $~lib/rt/pure/__collect + i32.const 0 + global.set $~lib/rt/tlsf/collectLock + local.get $0 + local.get $4 + call $~lib/rt/tlsf/searchBlock + local.tee $3 + i32.eqz + if + i32.const 16 + memory.size + local.tee $3 + i32.const 16 + i32.shl + i32.const 16 + i32.sub + local.get $0 + i32.load offset=1568 + i32.ne + i32.shl + local.get $4 + i32.const 1 + i32.const 27 + local.get $4 + i32.clz + i32.sub + i32.shl + i32.const 1 + i32.sub + i32.add + local.get $4 + local.get $4 + i32.const 536870904 + i32.lt_u + select + i32.add + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.set $5 + local.get $3 + local.get $5 + local.get $3 + local.get $5 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $5 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $3 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + local.get $0 + local.get $4 + call $~lib/rt/tlsf/searchBlock + local.tee $3 + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 513 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + end + end + local.get $3 + i32.load + i32.const -4 + i32.and + local.get $4 + i32.lt_u + if + i32.const 0 + i32.const 1184 + i32.const 521 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $2 + i32.store offset=8 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $4 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) + call $~lib/rt/tlsf/maybeInitialize + local.get $0 + local.get $1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/__retain (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1588 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + i32.load offset=4 + local.tee $2 + i32.const -268435456 + i32.and + local.get $2 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 1296 + i32.const 120 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 1296 + i32.const 123 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + end + local.get $0 + ) + (func $~lib/rt/pure/__release (param $0 i32) + local.get $0 + i32.const 1588 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~start + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end + i32.const 1040 + i32.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + i32.const 0 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $1 + i32.const 16 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $2 + i32.const 0 + i32.store + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + i32.const 0 + i32.store offset=8 + local.get $2 + i32.const 0 + i32.store offset=12 + local.get $1 + local.tee $0 + local.get $2 + i32.load + local.tee $3 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + local.get $0 + i32.store + local.get $2 + local.get $1 + i32.store offset=4 + local.get $2 + i32.const 0 + i32.store offset=8 + local.get $2 + i32.const 0 + i32.store offset=12 + local.get $2 + call $~lib/rt/pure/__release + i32.const 1344 + i32.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + i32.const 4 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $2 + i32.const 0 + i32.store + i32.const 4 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $3 + i32.const 0 + i32.store + local.get $3 + local.tee $0 + local.get $2 + local.tee $1 + i32.load + local.tee $4 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $4 + call $~lib/rt/pure/__release + end + local.get $1 + local.get $0 + i32.store + local.get $1 + local.tee $0 + local.get $3 + i32.load + local.tee $1 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + end + local.get $3 + local.get $0 + i32.store + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + call $~lib/rt/pure/__collect + ) + (func $~lib/rt/pure/markGray (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/pure/finalize (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.or + local.tee $2 + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + local.tee $3 + i32.const 16 + i32.sub + local.set $1 + i32.const 1392 + i32.const 5 + local.get $3 + f64.convert_i32_u + local.get $1 + i32.load + f64.convert_i32_u + local.get $1 + i32.load offset=4 + f64.convert_i32_u + local.get $1 + i32.load offset=8 + f64.convert_i32_u + local.get $1 + i32.load offset=12 + f64.convert_i32_u + call $~lib/builtins/trace + local.get $0 + i32.load offset=4 + local.get $2 + i32.ne + if + i32.const 0 + i32.const 1296 + i32.const 112 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/scanBlack (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + local.get $0 + call $~lib/rt/pure/finalize + end + ) + (func $~lib/rt/pure/__collect + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.tee $0 + local.tee $4 + local.set $3 + global.get $~lib/rt/pure/CUR + local.set $1 + loop $for-loop|0 + local.get $3 + local.get $1 + i32.lt_u + if + local.get $3 + i32.load + local.tee $2 + i32.load offset=4 + local.tee $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $2 + call $~lib/rt/pure/markGray + local.get $4 + local.get $2 + i32.store + local.get $4 + i32.const 4 + i32.add + local.set $4 + else + i32.const 0 + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + local.get $5 + i32.const 1879048192 + i32.and + select + if + local.get $2 + call $~lib/rt/pure/finalize + else + local.get $2 + local.get $5 + i32.const 2147483647 + i32.and + i32.store offset=4 + end + end + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $for-loop|0 + end + end + local.get $4 + global.set $~lib/rt/pure/CUR + local.get $0 + local.set $1 + loop $for-loop|1 + local.get $1 + local.get $4 + i32.lt_u + if + local.get $1 + i32.load + call $~lib/rt/pure/scan + local.get $1 + i32.const 4 + i32.add + local.set $1 + br $for-loop|1 + end + end + local.get $0 + local.set $1 + loop $for-loop|2 + local.get $1 + local.get $4 + i32.lt_u + if + local.get $1 + i32.load + local.tee $5 + local.get $5 + i32.load offset=4 + i32.const 2147483647 + i32.and + i32.store offset=4 + local.get $5 + call $~lib/rt/pure/collectWhite + local.get $1 + i32.const 4 + i32.add + local.set $1 + br $for-loop|2 + end + end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $4 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $4 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $3 + i32.load8_u + i32.store8 + br $while-continue|0 + end + end + loop $while-continue|1 + local.get $4 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $4 + i32.const 8 + i32.sub + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $while-continue|1 + end + end + end + loop $while-continue|2 + local.get $4 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $3 + i32.load8_u + i32.store8 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + br $while-continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|3 + local.get $0 + local.get $4 + i32.add + i32.const 7 + i32.and + if + local.get $4 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i32.load8_u + i32.store8 + br $while-continue|3 + end + end + loop $while-continue|4 + local.get $4 + i32.const 8 + i32.ge_u + if + local.get $4 + i32.const 8 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i64.load + i64.store + br $while-continue|4 + end + end + end + loop $while-continue|5 + local.get $4 + if + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i32.load8_u + i32.store8 + br $while-continue|5 + end + end + end + end + ) + (func $~lib/rt/pure/growRoots + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $0 + i32.sub + local.tee $3 + i32.const 1 + i32.shl + local.tee $1 + i32.const 256 + local.get $1 + i32.const 256 + i32.gt_u + select + local.tee $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $1 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $0 + if + call $~lib/rt/tlsf/maybeInitialize + local.get $0 + i32.const 16 + i32.sub + local.set $2 + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + if (result i32) + local.get $2 + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.load offset=4 + i32.const -268435456 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1184 + i32.const 581 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/tlsf/freeBlock + end + local.get $1 + global.set $~lib/rt/pure/ROOTS + local.get $1 + local.get $3 + i32.add + global.set $~lib/rt/pure/CUR + local.get $1 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/decrement (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 1296 + i32.const 133 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + local.get $0 + call $~lib/rt/pure/finalize + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 1296 + i32.const 147 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + local.tee $3 + i32.const 1536 + i32.load + i32.gt_u + if + i32.const 1440 + i32.const 1504 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.shl + i32.const 1540 + i32.add + i32.load + i32.const 32 + i32.and + i32.eqz + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + end + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) + local.get $0 + i32.const 1588 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 1296 + i32.const 79 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 1296 + i32.const 90 + i32.const 9 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 1296 + i32.const 101 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + return + end + unreachable + ) +) diff --git a/tests/compiler/rt/finalize.ts b/tests/compiler/rt/finalize.ts new file mode 100644 index 0000000000..e4c790266b --- /dev/null +++ b/tests/compiler/rt/finalize.ts @@ -0,0 +1,31 @@ +import { BLOCK, BLOCK_OVERHEAD } from "rt/common"; + +@global function __finalize(ptr: usize): void { + var s = changetype(ptr - BLOCK_OVERHEAD); + trace("__finalize", 5, ptr, s.mmInfo, s.gcInfo, s.rtId, s.rtSize); +} + +function testSimple(): void { + var a = new Array(0); +} + +trace("testSimple"); +testSimple(); + +class Foo { + bar: Bar; +} +class Bar { + foo: Foo; +} + +function testCyclic(): void { + var foo = new Foo(); + var bar = new Bar(); + foo.bar = bar; + bar.foo = foo; +} + +trace("testCyclic"); +testCyclic(); +__collect(); diff --git a/tests/compiler/rt/finalize.untouched.wat b/tests/compiler/rt/finalize.untouched.wat new file mode 100644 index 0000000000..50c8554923 --- /dev/null +++ b/tests/compiler/rt/finalize.untouched.wat @@ -0,0 +1,3986 @@ +(module + (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_=>_none (func (param 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_=>_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 $none_=>_i32 (func (result i32))) + (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 16) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e\00") + (data (i32.const 64) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 112) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 160) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 208) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 272) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00") + (data (i32.const 368) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00_\00_\00f\00i\00n\00a\00l\00i\00z\00e\00") + (data (i32.const 416) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 480) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 528) "\06\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\"\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (table $0 1 funcref) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) + (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) + (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~started (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 528)) + (global $~lib/heap/__heap_base i32 (i32.const 580)) + (export "_start" (func $~start)) + (export "memory" (memory $0)) + (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + i32.const 1 + drop + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 277 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + i32.const 1 + drop + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 279 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + i32.const 1 + drop + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 292 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + i32.eq + if + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + local.get $7 + i32.eqz + if + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.set $9 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + i32.const 1 + drop + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 205 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + i32.const 1 + drop + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 207 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + local.set $6 + local.get $6 + i32.load + local.set $3 + i32.const 1 + drop + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 228 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + i32.const 1 + drop + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 243 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + drop + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 244 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + i32.const 1 + drop + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 260 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (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) + i32.const 1 + drop + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 386 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + i32.const 1 + drop + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 396 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + i32.const 1 + drop + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 408 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 16 + i32.const 16 + i32.add + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 16 + i32.const 1 + i32.shl + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/maybeInitialize (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $0 + local.get $0 + i32.eqz + if + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $1 + memory.size + local.set $2 + local.get $1 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $3 + local.get $2 + i32.gt_s + if (result i32) + local.get $3 + local.get $2 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $1 + local.set $0 + local.get $0 + i32.const 0 + i32.store + local.get $0 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + i32.const 0 + local.set $5 + loop $for-loop|0 + local.get $5 + i32.const 23 + i32.lt_u + local.set $4 + local.get $4 + if + local.get $0 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $8 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=4 + i32.const 0 + local.set $8 + loop $for-loop|1 + local.get $8 + i32.const 16 + i32.lt_u + local.set $7 + local.get $7 + if + local.get $0 + local.set $11 + local.get $5 + local.set $10 + local.get $8 + local.set $9 + i32.const 0 + local.set $6 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + local.get $8 + i32.const 1 + i32.add + local.set $8 + br $for-loop|1 + end + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $for-loop|0 + end + end + local.get $1 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $5 + i32.const 0 + drop + local.get $0 + local.get $5 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $0 + global.set $~lib/rt/tlsf/ROOT + end + local.get $0 + ) + (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 224 + i32.const 176 + i32.const 461 + i32.const 30 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + i32.const 1 + drop + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 338 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.set $6 + i32.const 1 + drop + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 351 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $7 + end + else + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + i32.const 0 + drop + local.get $1 + i32.const 536870904 + i32.lt_u + if + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.const 1 + i32.sub + i32.add + local.set $1 + end + memory.size + local.set $2 + local.get $1 + i32.const 16 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.sub + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + i32.ne + i32.shl + i32.add + local.set $1 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $4 + local.get $2 + local.tee $3 + local.get $4 + local.tee $5 + local.get $3 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + i32.const 1 + drop + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 365 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 16 + i32.const 16 + i32.add + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + i32.const 1 + drop + global.get $~lib/rt/tlsf/collectLock + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 501 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + local.get $4 + i32.eqz + if + global.get $~lib/gc/gc.auto + if + i32.const 1 + drop + i32.const 1 + global.set $~lib/rt/tlsf/collectLock + call $~lib/rt/pure/__collect + i32.const 1 + drop + i32.const 0 + global.set $~lib/rt/tlsf/collectLock + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + local.get $4 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + i32.const 1 + drop + local.get $4 + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 513 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + end + else + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + i32.const 1 + drop + local.get $4 + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 518 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + end + end + i32.const 1 + drop + local.get $4 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 521 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 0 + i32.store offset=4 + local.get $4 + local.get $2 + i32.store offset=8 + local.get $4 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $4 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + i32.const 0 + drop + local.get $4 + ) + (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) + call $~lib/rt/tlsf/maybeInitialize + local.get $0 + local.get $1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i64) + (local $10 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + i32.const 0 + i32.const 1 + i32.gt_s + drop + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.set $6 + local.get $5 + local.get $4 + i32.store8 + local.get $6 + local.get $4 + i32.store8 offset=3 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 offset=1 + local.get $5 + local.get $4 + i32.store8 offset=2 + local.get $6 + local.get $4 + i32.store8 offset=2 + local.get $6 + local.get $4 + i32.store8 offset=1 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 offset=3 + local.get $6 + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $7 + local.get $5 + local.get $7 + i32.add + local.set $5 + local.get $3 + local.get $7 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $8 + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.set $6 + local.get $5 + local.get $8 + i32.store + local.get $6 + local.get $8 + i32.store offset=24 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $8 + i32.store offset=4 + local.get $5 + local.get $8 + i32.store offset=8 + local.get $6 + local.get $8 + i32.store offset=16 + local.get $6 + local.get $8 + i32.store offset=20 + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $8 + i32.store offset=12 + local.get $5 + local.get $8 + i32.store offset=16 + local.get $5 + local.get $8 + i32.store offset=20 + local.get $5 + local.get $8 + i32.store offset=24 + local.get $6 + local.get $8 + i32.store + local.get $6 + local.get $8 + i32.store offset=4 + local.get $6 + local.get $8 + i32.store offset=8 + local.get $6 + local.get $8 + i32.store offset=12 + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $7 + local.get $5 + local.get $7 + i32.add + local.set $5 + local.get $3 + local.get $7 + i32.sub + local.set $3 + local.get $8 + i64.extend_i32_u + local.get $8 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $9 + loop $while-continue|0 + local.get $3 + i32.const 32 + i32.ge_u + local.set $10 + local.get $10 + if + local.get $5 + local.get $9 + i64.store + local.get $5 + local.get $9 + i64.store offset=8 + local.get $5 + local.get $9 + i64.store offset=16 + local.get $5 + local.get $9 + i64.store offset=24 + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $while-continue|0 + end + end + end + ) + (func $~lib/rt/pure/increment (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 120 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + i32.const 0 + drop + i32.const 1 + drop + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 123 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/pure/__release (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $1 + i32.const 1073741808 + i32.const 2 + i32.shr_u + i32.gt_u + if + i32.const 80 + i32.const 128 + i32.const 57 + i32.const 60 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.set $2 + local.get $2 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + i32.const 0 + local.get $2 + call $~lib/memory/memory.fill + local.get $0 + i32.eqz + if + i32.const 16 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + i32.load + local.tee $6 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + local.set $5 + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $2 + i32.store offset=8 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $rt/finalize/testSimple + (local $0 i32) + i32.const 0 + i32.const 0 + call $~lib/array/Array#constructor + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + ) + (func $rt/finalize/Foo#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $rt/finalize/Bar#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $rt/finalize/testCyclic + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 0 + call $rt/finalize/Foo#constructor + local.set $0 + i32.const 0 + call $rt/finalize/Bar#constructor + local.set $1 + local.get $0 + local.tee $2 + local.get $1 + local.tee $3 + local.get $2 + i32.load + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + local.set $3 + local.get $4 + call $~lib/rt/pure/__release + end + local.get $3 + i32.store + local.get $1 + local.tee $4 + local.get $0 + local.tee $3 + local.get $4 + i32.load + local.tee $2 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + end + local.get $3 + i32.store + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $start:rt/finalize + i32.const 32 + i32.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + call $rt/finalize/testSimple + i32.const 336 + i32.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + call $rt/finalize/testCyclic + call $~lib/rt/pure/__collect + ) + (func $~start + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end + call $start:rt/finalize + ) + (func $~lib/rt/pure/markGray (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $rt/finalize/__finalize (param $0 i32) + (local $1 i32) + local.get $0 + i32.const 16 + i32.sub + local.set $1 + i32.const 384 + i32.const 5 + local.get $0 + f64.convert_i32_u + local.get $1 + i32.load + f64.convert_i32_u + local.get $1 + i32.load offset=4 + f64.convert_i32_u + local.get $1 + i32.load offset=8 + f64.convert_i32_u + local.get $1 + i32.load offset=12 + f64.convert_i32_u + call $~lib/builtins/trace + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + i32.const 0 + drop + ) + (func $~lib/rt/pure/finalize (param $0 i32) + (local $1 i32) + i32.const 1 + drop + local.get $0 + i32.load offset=4 + i32.const 1 + i32.or + local.set $1 + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + call $rt/finalize/__finalize + local.get $0 + i32.load offset=4 + local.get $1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 112 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/scanBlack (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + local.get $0 + call $~lib/rt/pure/finalize + end + ) + (func $~lib/rt/pure/__collect + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 0 + drop + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + loop $for-loop|0 + local.get $2 + local.get $3 + i32.lt_u + local.set $4 + local.get $4 + if + local.get $2 + i32.load + local.set $5 + local.get $5 + i32.load offset=4 + local.set $6 + local.get $6 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $6 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $5 + call $~lib/rt/pure/markGray + local.get $1 + local.get $5 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $6 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $6 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $5 + call $~lib/rt/pure/finalize + else + local.get $5 + local.get $6 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $for-loop|0 + end + end + local.get $1 + global.set $~lib/rt/pure/CUR + local.get $0 + local.set $3 + loop $for-loop|1 + local.get $3 + local.get $1 + i32.lt_u + local.set $2 + local.get $2 + if + local.get $3 + i32.load + call $~lib/rt/pure/scan + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $for-loop|1 + end + end + local.get $0 + local.set $3 + loop $for-loop|2 + local.get $3 + local.get $1 + i32.lt_u + local.set $2 + local.get $2 + if + local.get $3 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $for-loop|2 + end + end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/__typeinfo (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 432 + i32.const 496 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + loop $while-continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + local.set $5 + local.get $5 + if + local.get $0 + local.tee $6 + i32.const 1 + i32.add + local.set $0 + local.get $6 + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $while-continue|0 + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + loop $while-continue|1 + local.get $2 + i32.const 16 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|1 + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + local.get $1 + i32.load + local.set $3 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + loop $while-continue|3 + local.get $2 + i32.const 17 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|3 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $3 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + loop $while-continue|4 + local.get $2 + i32.const 18 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|4 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $3 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + loop $while-continue|5 + local.get $2 + i32.const 19 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|5 + end + end + br $break|2 + end + end + local.get $2 + i32.const 16 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + i32.const 0 + i32.const 1 + i32.lt_s + drop + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + i32.const 0 + i32.const 2 + i32.lt_s + drop + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|0 + local.get $5 + i32.const 7 + i32.and + local.set $6 + local.get $6 + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $5 + local.tee $7 + i32.const 1 + i32.add + local.set $5 + local.get $7 + local.get $4 + local.tee $7 + i32.const 1 + i32.add + local.set $4 + local.get $7 + i32.load8_u + i32.store8 + br $while-continue|0 + end + end + loop $while-continue|1 + local.get $3 + i32.const 8 + i32.ge_u + local.set $6 + local.get $6 + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $while-continue|1 + end + end + end + loop $while-continue|2 + local.get $3 + local.set $6 + local.get $6 + if + local.get $5 + local.tee $7 + i32.const 1 + i32.add + local.set $5 + local.get $7 + local.get $4 + local.tee $7 + i32.const 1 + i32.add + local.set $4 + local.get $7 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $while-continue|2 + end + end + else + i32.const 0 + i32.const 2 + i32.lt_s + drop + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + local.set $6 + local.get $6 + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $while-continue|3 + end + end + loop $while-continue|4 + local.get $3 + i32.const 8 + i32.ge_u + local.set $6 + local.get $6 + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $while-continue|4 + end + end + end + loop $while-continue|5 + local.get $3 + local.set $6 + local.get $6 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $while-continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 16 + i32.sub + local.set $1 + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $1 + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $1 + i32.load offset=4 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 176 + i32.const 581 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + ) + (func $~lib/rt/tlsf/__free (param $0 i32) + call $~lib/rt/tlsf/maybeInitialize + local.get $0 + call $~lib/rt/tlsf/checkUsedBlock + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + i32.const 0 + drop + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + i32.const 0 + drop + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + i32.const 0 + drop + i32.const 1 + drop + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 133 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + i32.const 0 + drop + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/finalize + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + i32.const 1 + drop + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 147 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + drop + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 32 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + i32.const 0 + drop + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + end + i32.const 1 + drop + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 79 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 90 + i32.const 9 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 1 + drop + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 101 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/array/Array#__visit_impl (param $0 i32) (param $1 i32) + i32.const 0 + drop + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + (local $2 i32) + block $switch$1$default + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + return + end + unreachable + ) +) diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index fa32ef6903..6df4ed0d91 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1076,7 +1076,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1114,7 +1114,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1156,7 +1156,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1177,7 +1177,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/runtime-full.untouched.wat b/tests/compiler/runtime-full.untouched.wat index d7ab098ac5..850055e702 100644 --- a/tests/compiler/runtime-full.untouched.wat +++ b/tests/compiler/runtime-full.untouched.wat @@ -1475,7 +1475,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1498,7 +1498,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1548,6 +1548,13 @@ i32.const 0 drop ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -1571,7 +1578,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1597,14 +1604,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -1615,7 +1621,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index ddd2247e86..d159810ce1 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1113,7 +1113,7 @@ if i32.const 0 i32.const 1504 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1132,7 +1132,7 @@ if i32.const 0 i32.const 1504 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1562,7 +1562,7 @@ if i32.const 0 i32.const 1504 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1622,7 +1622,7 @@ if i32.const 0 i32.const 1504 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1645,7 +1645,7 @@ if i32.const 0 i32.const 1504 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 86d15dc5a3..0688da0008 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -2835,7 +2835,7 @@ if i32.const 0 i32.const 496 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -2860,7 +2860,7 @@ if i32.const 0 i32.const 496 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3386,6 +3386,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -3411,7 +3418,7 @@ if i32.const 0 i32.const 496 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -3437,14 +3444,13 @@ if i32.const 0 i32.const 496 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -3455,7 +3461,7 @@ if i32.const 0 i32.const 496 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index d1cec40ab1..1cd9fb2962 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -1468,7 +1468,7 @@ if i32.const 0 i32.const 1248 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1487,7 +1487,7 @@ if i32.const 0 i32.const 1248 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -16175,7 +16175,7 @@ if i32.const 0 i32.const 1248 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -16249,7 +16249,7 @@ if i32.const 0 i32.const 1248 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -16264,7 +16264,7 @@ if i32.const 0 i32.const 1248 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 4c07bd984a..3d3fc79a9a 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -1924,7 +1924,7 @@ if i32.const 0 i32.const 240 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1949,7 +1949,7 @@ if i32.const 0 i32.const 240 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -25039,6 +25039,13 @@ drop return ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -25064,7 +25071,7 @@ if i32.const 0 i32.const 240 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -25090,14 +25097,13 @@ if i32.const 0 i32.const 240 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -25108,7 +25114,7 @@ if i32.const 0 i32.const 240 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index ac4432de51..a9a8f983bc 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -1223,7 +1223,7 @@ if i32.const 0 i32.const 1264 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1242,7 +1242,7 @@ if i32.const 0 i32.const 1264 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1922,7 +1922,7 @@ if i32.const 0 i32.const 1264 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1963,7 +1963,7 @@ if i32.const 0 i32.const 1264 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1986,7 +1986,7 @@ if i32.const 0 i32.const 1264 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index c71239ab12..171d92aa66 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -1697,7 +1697,7 @@ if i32.const 0 i32.const 256 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1722,7 +1722,7 @@ if i32.const 0 i32.const 256 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -4085,6 +4085,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -4110,7 +4117,7 @@ if i32.const 0 i32.const 256 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -4136,14 +4143,13 @@ if i32.const 0 i32.const 256 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -4154,7 +4160,7 @@ if i32.const 0 i32.const 256 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index f112291106..e649e72ec7 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -1073,7 +1073,7 @@ if i32.const 0 i32.const 1264 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1092,7 +1092,7 @@ if i32.const 0 i32.const 1264 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3444,7 +3444,7 @@ if i32.const 0 i32.const 1264 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -3486,7 +3486,7 @@ if i32.const 0 i32.const 1264 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -3509,7 +3509,7 @@ if i32.const 0 i32.const 1264 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index e579146b4f..9ce71cef6b 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -1,6 +1,6 @@ (module - (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_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) @@ -1705,7 +1705,7 @@ if i32.const 0 i32.const 256 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1730,7 +1730,7 @@ if i32.const 0 i32.const 256 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -4566,6 +4566,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -4591,7 +4598,7 @@ if i32.const 0 i32.const 256 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -4617,14 +4624,13 @@ if i32.const 0 i32.const 256 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -4635,7 +4641,7 @@ if i32.const 0 i32.const 256 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 45fa556b7b..e5b94fe171 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1086,7 +1086,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1105,7 +1105,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -13055,7 +13055,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -13104,7 +13104,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -13119,7 +13119,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index cb8759d371..2039cb3f6b 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -1500,7 +1500,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1525,7 +1525,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -21046,6 +21046,13 @@ drop return ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -21071,7 +21078,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -21097,14 +21104,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -21115,7 +21121,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index ec63d08717..360d2face2 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1083,7 +1083,7 @@ if i32.const 0 i32.const 1152 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1102,7 +1102,7 @@ if i32.const 0 i32.const 1152 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -9389,7 +9389,7 @@ if i32.const 0 i32.const 1152 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -9438,7 +9438,7 @@ if i32.const 0 i32.const 1152 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -9453,7 +9453,7 @@ if i32.const 0 i32.const 1152 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index d25308241e..8787d0ef01 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -1495,7 +1495,7 @@ if i32.const 0 i32.const 144 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1520,7 +1520,7 @@ if i32.const 0 i32.const 144 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -14585,6 +14585,13 @@ drop return ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -14610,7 +14617,7 @@ if i32.const 0 i32.const 144 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -14636,14 +14643,13 @@ if i32.const 0 i32.const 144 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -14654,7 +14660,7 @@ if i32.const 0 i32.const 144 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index ec97281e2d..1c22ec1af9 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -1300,7 +1300,7 @@ if i32.const 0 i32.const 1440 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1319,7 +1319,7 @@ if i32.const 0 i32.const 1440 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1581,7 +1581,7 @@ if i32.const 0 i32.const 1440 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1649,7 +1649,7 @@ if i32.const 0 i32.const 1440 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1672,7 +1672,7 @@ if i32.const 0 i32.const 1440 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.untouched.wat b/tests/compiler/std/staticarray.untouched.wat index 7698493990..453eadd83f 100644 --- a/tests/compiler/std/staticarray.untouched.wat +++ b/tests/compiler/std/staticarray.untouched.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) @@ -2825,7 +2825,7 @@ if i32.const 0 i32.const 432 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -2850,7 +2850,7 @@ if i32.const 0 i32.const 432 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3165,6 +3165,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -3190,7 +3197,7 @@ if i32.const 0 i32.const 432 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -3216,14 +3223,13 @@ if i32.const 0 i32.const 432 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -3234,7 +3240,7 @@ if i32.const 0 i32.const 432 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index 25640a67c8..d64371ad56 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -337,7 +337,7 @@ if i32.const 0 i32.const 1056 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -356,7 +356,7 @@ if i32.const 0 i32.const 1056 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -4845,7 +4845,7 @@ if i32.const 0 i32.const 1056 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -4887,7 +4887,7 @@ if i32.const 0 i32.const 1056 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -4902,7 +4902,7 @@ if i32.const 0 i32.const 1056 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-casemapping.untouched.wat b/tests/compiler/std/string-casemapping.untouched.wat index 41c7e6ce04..ff335206b4 100644 --- a/tests/compiler/std/string-casemapping.untouched.wat +++ b/tests/compiler/std/string-casemapping.untouched.wat @@ -1,8 +1,8 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $none_=>_none (func)) @@ -234,7 +234,7 @@ if i32.const 0 i32.const 48 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -259,7 +259,7 @@ if i32.const 0 i32.const 48 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -6912,6 +6912,13 @@ drop return ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -6937,7 +6944,7 @@ if i32.const 0 i32.const 48 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -6963,14 +6970,13 @@ if i32.const 0 i32.const 48 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -6981,7 +6987,7 @@ if i32.const 0 i32.const 48 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index 0e16ace529..fea87f522c 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -59,7 +59,7 @@ if i32.const 0 i32.const 1072 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -78,7 +78,7 @@ if i32.const 0 i32.const 1072 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3163,7 +3163,7 @@ if i32.const 0 i32.const 1072 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -3205,7 +3205,7 @@ if i32.const 0 i32.const 1072 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -3220,7 +3220,7 @@ if i32.const 0 i32.const 1072 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index 49ea1dfcdb..96900383c6 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -65,7 +65,7 @@ if i32.const 0 i32.const 64 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -90,7 +90,7 @@ if i32.const 0 i32.const 64 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -5031,6 +5031,13 @@ (func $~start call $start:std/string-encoding ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -5056,7 +5063,7 @@ if i32.const 0 i32.const 64 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -5082,14 +5089,13 @@ if i32.const 0 i32.const 64 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -5100,7 +5106,7 @@ if i32.const 0 i32.const 64 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 0644843b30..dae7c41d72 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -409,7 +409,7 @@ if i32.const 0 i32.const 1168 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -428,7 +428,7 @@ if i32.const 0 i32.const 1168 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -14249,7 +14249,7 @@ if i32.const 0 i32.const 1168 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -14324,7 +14324,7 @@ if i32.const 0 i32.const 1168 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -14339,7 +14339,7 @@ if i32.const 0 i32.const 1168 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index c409be3275..4c88722bcf 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -429,7 +429,7 @@ if i32.const 0 i32.const 160 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -454,7 +454,7 @@ if i32.const 0 i32.const 160 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -18621,6 +18621,13 @@ end call $start:std/string ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -18646,7 +18653,7 @@ if i32.const 0 i32.const 160 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -18672,14 +18679,13 @@ if i32.const 0 i32.const 160 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -18690,7 +18696,7 @@ if i32.const 0 i32.const 160 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 2e7da3d719..012611f6f9 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -1422,7 +1422,7 @@ if i32.const 0 i32.const 1264 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1441,7 +1441,7 @@ if i32.const 0 i32.const 1264 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -3155,7 +3155,19 @@ i32.add i32.load8_s ) - (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 local.get $1 @@ -3165,7 +3177,6 @@ (func $std/typedarray/isInt8ArrayEqual (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) block $folding-inner0 local.get $0 i32.load offset=8 @@ -3184,23 +3195,9 @@ local.get $0 local.get $2 call $~lib/typedarray/Int8Array#__get - local.set $4 - local.get $2 - local.get $1 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get - local.get $4 + call $~lib/array/Array#__get i32.ne br_if $folding-inner0 local.get $2 @@ -3374,15 +3371,6 @@ end local.get $5 ) - (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.load offset=4 - local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load - ) (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 @@ -3397,8 +3385,12 @@ unreachable end local.get $0 + i32.load offset=4 local.get $1 - call $~lib/array/Array#__unchecked_get + i32.const 2 + i32.shl + i32.add + i32.load ) (func $std/typedarray/isInt32ArrayEqual (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -20883,7 +20875,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.tee $5 i32.ne if @@ -21327,7 +21319,19 @@ call $~lib/builtins/abort unreachable ) - (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 local.get $1 @@ -21364,7 +21368,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.tee $5 i32.ne if @@ -21678,7 +21682,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.tee $5 i32.ne if @@ -22309,6 +22313,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $0 i32.load offset=8 i32.const 1 @@ -22334,6 +22340,18 @@ local.get $2 call $~lib/typedarray/Int16Array#__get local.tee $4 + local.get $2 + local.get $1 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $1 i32.load offset=4 local.get $2 @@ -22341,7 +22359,9 @@ i32.shl i32.add i32.load16_s - local.tee $5 + local.tee $6 + local.set $7 + local.get $6 i32.ne if i32.const 5232 @@ -22350,7 +22370,7 @@ f64.convert_i32_s local.get $4 f64.convert_i32_s - local.get $5 + local.get $7 f64.convert_i32_s f64.const 0 f64.const 0 @@ -22832,6 +22852,8 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $0 i32.load offset=8 i32.const 1 @@ -22857,6 +22879,18 @@ local.get $2 call $~lib/typedarray/Uint16Array#__get local.tee $4 + local.get $2 + local.get $1 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $1 i32.load offset=4 local.get $2 @@ -22864,7 +22898,9 @@ i32.shl i32.add i32.load16_u - local.tee $5 + local.tee $6 + local.set $7 + local.get $6 i32.ne if i32.const 5520 @@ -22873,7 +22909,7 @@ f64.convert_i32_s local.get $4 f64.convert_i32_u - local.get $5 + local.get $7 f64.convert_i32_u f64.const 0 f64.const 0 @@ -23211,7 +23247,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.tee $5 i32.ne if @@ -23759,7 +23795,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.tee $5 i32.ne if @@ -24103,7 +24139,19 @@ end end ) - (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i64) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 local.get $1 @@ -24144,7 +24192,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.tee $5 i64.ne if @@ -24663,7 +24711,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.tee $5 i64.ne if @@ -24960,6 +25008,8 @@ (local $3 i32) (local $4 f32) (local $5 f32) + (local $6 f32) + (local $7 f32) local.get $0 i32.load offset=8 i32.const 2 @@ -24985,6 +25035,18 @@ local.get $2 call $~lib/typedarray/Float32Array#__get local.tee $4 + local.get $2 + local.get $1 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $1 i32.load offset=4 local.get $2 @@ -24992,7 +25054,9 @@ i32.shl i32.add f32.load - local.tee $5 + local.tee $6 + local.set $7 + local.get $6 f32.ne if i32.const 7616 @@ -25001,7 +25065,7 @@ f64.convert_i32_s local.get $4 f64.promote_f32 - local.get $5 + local.get $7 f64.promote_f32 f64.const 0 f64.const 0 @@ -25402,6 +25466,8 @@ (local $3 i32) (local $4 f64) (local $5 f64) + (local $6 f64) + (local $7 f64) local.get $0 i32.load offset=8 i32.const 3 @@ -25427,6 +25493,18 @@ local.get $2 call $~lib/typedarray/Float64Array#__get local.tee $4 + local.get $2 + local.get $1 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $1 i32.load offset=4 local.get $2 @@ -25434,7 +25512,9 @@ i32.shl i32.add f64.load - local.tee $5 + local.tee $6 + local.set $7 + local.get $6 f64.ne if i32.const 7952 @@ -25442,7 +25522,7 @@ local.get $2 f64.convert_i32_s local.get $4 - local.get $5 + local.get $7 f64.const 0 f64.const 0 call $~lib/builtins/trace @@ -32162,7 +32242,7 @@ if i32.const 0 i32.const 1264 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -32202,7 +32282,7 @@ if i32.const 0 i32.const 1264 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -32217,7 +32297,7 @@ if i32.const 0 i32.const 1264 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 6100b1c993..6f4ab2bb1b 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -7,29 +7,29 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i64_i32_i32_=>_i32 (func (param i64 i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) (type $f32_i32_i32_=>_i32 (func (param f32 i32 i32) (result i32))) (type $f64_i32_i32_=>_i32 (func (param f64 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) (type $i64_i64_i32_i32_=>_i64 (func (param i64 i64 i32 i32) (result i64))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i64_i32_i32_=>_none (func (param i64 i32 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_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64))) (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32))) (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64))) (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) @@ -1888,7 +1888,7 @@ if i32.const 0 i32.const 256 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1913,7 +1913,7 @@ if i32.const 0 i32.const 256 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -40684,7 +40684,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -41824,6 +41824,28 @@ i32.add i32.load8_u ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint8Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -41867,7 +41889,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -43037,7 +43059,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -44246,6 +44268,28 @@ i32.add i32.load16_s ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Int16Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -44289,7 +44333,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -45474,6 +45518,28 @@ i32.add i32.load16_u ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint16Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -45517,7 +45583,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -46679,7 +46745,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -47864,6 +47930,28 @@ i32.add i32.load ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint32Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -47907,7 +47995,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -49145,6 +49233,28 @@ i32.add i64.load ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) + (local $2 i64) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Int64Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -49188,7 +49298,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -50373,6 +50483,28 @@ i32.add i64.load ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) + (local $2 i64) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint64Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -50416,7 +50548,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -51598,6 +51730,28 @@ i32.add f32.load ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result f32) + (local $2 f32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Float32Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -51641,7 +51795,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -52658,6 +52812,28 @@ i32.add f64.load ) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result f64) + (local $2 f64) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 368 + i32.const 528 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + local.set $2 + i32.const 0 + drop + local.get $2 + ) (func $std/typedarray/valuesEqual<~lib/typedarray/Float64Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -52701,7 +52877,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__unchecked_get + call $~lib/array/Array#__get local.set $6 local.get $5 local.get $6 @@ -56382,6 +56558,13 @@ drop return ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -56407,7 +56590,7 @@ if i32.const 0 i32.const 256 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -56433,14 +56616,13 @@ if i32.const 0 i32.const 256 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -56451,7 +56633,7 @@ if i32.const 0 i32.const 256 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 9a365e4cff..fb0fb242dc 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -1010,7 +1010,7 @@ if i32.const 0 i32.const 1184 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1029,7 +1029,7 @@ if i32.const 0 i32.const 1184 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -1474,7 +1474,7 @@ if i32.const 0 i32.const 1184 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -1516,7 +1516,7 @@ if i32.const 0 i32.const 1184 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable @@ -1539,7 +1539,7 @@ if i32.const 0 i32.const 1184 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 7caedb7a8b..88f8ae0192 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -1932,7 +1932,7 @@ if i32.const 0 i32.const 176 - i32.const 109 + i32.const 120 i32.const 3 call $~lib/builtins/abort unreachable @@ -1957,7 +1957,7 @@ if i32.const 0 i32.const 176 - i32.const 112 + i32.const 123 i32.const 14 call $~lib/builtins/abort unreachable @@ -2430,6 +2430,13 @@ local.get $1 call $~lib/rt/rtrace/onfree ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 0 + drop + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) (local $2 i32) @@ -2455,7 +2462,7 @@ if i32.const 0 i32.const 176 - i32.const 122 + i32.const 133 i32.const 14 call $~lib/builtins/abort unreachable @@ -2481,14 +2488,13 @@ if i32.const 0 i32.const 176 - i32.const 126 + i32.const 137 i32.const 18 call $~lib/builtins/abort unreachable end - global.get $~lib/rt/tlsf/ROOT local.get $0 - call $~lib/rt/tlsf/freeBlock + call $~lib/rt/pure/finalize else i32.const 1 drop @@ -2499,7 +2505,7 @@ if i32.const 0 i32.const 176 - i32.const 136 + i32.const 147 i32.const 16 call $~lib/builtins/abort unreachable From 723eb339f2d641b7ff5c50b273e5b55210045962 Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 7 May 2020 16:34:50 +0200 Subject: [PATCH 2/5] local ts-node cache again --- tests/compiler/std/typedarray.optimized.wat | 168 +++++----------- tests/compiler/std/typedarray.untouched.wat | 204 ++------------------ 2 files changed, 58 insertions(+), 314 deletions(-) diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 012611f6f9..26ee9c84ab 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -3155,19 +3155,7 @@ i32.add i32.load8_s ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end + (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -3177,6 +3165,7 @@ (func $std/typedarray/isInt8ArrayEqual (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) block $folding-inner0 local.get $0 i32.load offset=8 @@ -3195,9 +3184,23 @@ local.get $0 local.get $2 call $~lib/typedarray/Int8Array#__get + local.set $4 + local.get $2 + local.get $1 + i32.load offset=12 + i32.ge_u + if + i32.const 1376 + i32.const 1536 + i32.const 104 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get + local.get $4 i32.ne br_if $folding-inner0 local.get $2 @@ -3371,6 +3374,15 @@ end local.get $5 ) + (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + ) (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 @@ -3385,12 +3397,8 @@ unreachable end local.get $0 - i32.load offset=4 local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load + call $~lib/array/Array#__unchecked_get ) (func $std/typedarray/isInt32ArrayEqual (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -20875,7 +20883,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.tee $5 i32.ne if @@ -21319,19 +21327,7 @@ call $~lib/builtins/abort unreachable ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end + (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -21368,7 +21364,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.tee $5 i32.ne if @@ -21682,7 +21678,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.tee $5 i32.ne if @@ -22313,8 +22309,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) local.get $0 i32.load offset=8 i32.const 1 @@ -22340,18 +22334,6 @@ local.get $2 call $~lib/typedarray/Int16Array#__get local.tee $4 - local.get $2 - local.get $1 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end local.get $1 i32.load offset=4 local.get $2 @@ -22359,9 +22341,7 @@ i32.shl i32.add i32.load16_s - local.tee $6 - local.set $7 - local.get $6 + local.tee $5 i32.ne if i32.const 5232 @@ -22370,7 +22350,7 @@ f64.convert_i32_s local.get $4 f64.convert_i32_s - local.get $7 + local.get $5 f64.convert_i32_s f64.const 0 f64.const 0 @@ -22852,8 +22832,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) local.get $0 i32.load offset=8 i32.const 1 @@ -22879,18 +22857,6 @@ local.get $2 call $~lib/typedarray/Uint16Array#__get local.tee $4 - local.get $2 - local.get $1 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end local.get $1 i32.load offset=4 local.get $2 @@ -22898,9 +22864,7 @@ i32.shl i32.add i32.load16_u - local.tee $6 - local.set $7 - local.get $6 + local.tee $5 i32.ne if i32.const 5520 @@ -22909,7 +22873,7 @@ f64.convert_i32_s local.get $4 f64.convert_i32_u - local.get $7 + local.get $5 f64.convert_i32_u f64.const 0 f64.const 0 @@ -23247,7 +23211,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.tee $5 i32.ne if @@ -23795,7 +23759,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.tee $5 i32.ne if @@ -24139,19 +24103,7 @@ end end ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end + (func $~lib/array/Array#__unchecked_get (param $0 i32) (param $1 i32) (result i64) local.get $0 i32.load offset=4 local.get $1 @@ -24192,7 +24144,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.tee $5 i64.ne if @@ -24711,7 +24663,7 @@ local.tee $4 local.get $1 local.get $2 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.tee $5 i64.ne if @@ -25008,8 +24960,6 @@ (local $3 i32) (local $4 f32) (local $5 f32) - (local $6 f32) - (local $7 f32) local.get $0 i32.load offset=8 i32.const 2 @@ -25035,18 +24985,6 @@ local.get $2 call $~lib/typedarray/Float32Array#__get local.tee $4 - local.get $2 - local.get $1 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end local.get $1 i32.load offset=4 local.get $2 @@ -25054,9 +24992,7 @@ i32.shl i32.add f32.load - local.tee $6 - local.set $7 - local.get $6 + local.tee $5 f32.ne if i32.const 7616 @@ -25065,7 +25001,7 @@ f64.convert_i32_s local.get $4 f64.promote_f32 - local.get $7 + local.get $5 f64.promote_f32 f64.const 0 f64.const 0 @@ -25466,8 +25402,6 @@ (local $3 i32) (local $4 f64) (local $5 f64) - (local $6 f64) - (local $7 f64) local.get $0 i32.load offset=8 i32.const 3 @@ -25493,18 +25427,6 @@ local.get $2 call $~lib/typedarray/Float64Array#__get local.tee $4 - local.get $2 - local.get $1 - i32.load offset=12 - i32.ge_u - if - i32.const 1376 - i32.const 1536 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end local.get $1 i32.load offset=4 local.get $2 @@ -25512,9 +25434,7 @@ i32.shl i32.add f64.load - local.tee $6 - local.set $7 - local.get $6 + local.tee $5 f64.ne if i32.const 7952 @@ -25522,7 +25442,7 @@ local.get $2 f64.convert_i32_s local.get $4 - local.get $7 + local.get $5 f64.const 0 f64.const 0 call $~lib/builtins/trace diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 6f4ab2bb1b..9cf843ec53 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -12,24 +12,24 @@ (type $f64_i32_i32_=>_i32 (func (param f64 i32 i32) (result i32))) (type $i64_i64_i32_i32_=>_i64 (func (param i64 i64 i32 i32) (result i64))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i64_i32_i32_=>_none (func (param i64 i32 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_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64))) (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) (type $i32_i32_i64_=>_i32 (func (param i32 i32 i64) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32))) (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64))) (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) @@ -40684,7 +40684,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -41824,28 +41824,6 @@ i32.add i32.load8_u ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint8Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -41889,7 +41867,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -43059,7 +43037,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -44268,28 +44246,6 @@ i32.add i32.load16_s ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Int16Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -44333,7 +44289,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -45518,28 +45474,6 @@ i32.add i32.load16_u ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint16Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -45583,7 +45517,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -46745,7 +46679,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -47930,28 +47864,6 @@ i32.add i32.load ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint32Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -47995,7 +47907,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -49233,28 +49145,6 @@ i32.add i64.load ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) - (local $2 i64) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Int64Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -49298,7 +49188,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -50483,28 +50373,6 @@ i32.add i64.load ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) - (local $2 i64) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Uint64Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -50548,7 +50416,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -51730,28 +51598,6 @@ i32.add f32.load ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result f32) - (local $2 f32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Float32Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -51795,7 +51641,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 @@ -52812,28 +52658,6 @@ i32.add f64.load ) - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result f64) - (local $2 f64) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 368 - i32.const 528 - i32.const 104 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/array/Array#__unchecked_get - local.set $2 - i32.const 0 - drop - local.get $2 - ) (func $std/typedarray/valuesEqual<~lib/typedarray/Float64Array> (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -52877,7 +52701,7 @@ local.set $5 local.get $1 local.get $3 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get local.set $6 local.get $5 local.get $6 From 70366e580e093a0f12555151a698666c8e5d5c4a Mon Sep 17 00:00:00 2001 From: dcode Date: Thu, 7 May 2020 17:00:10 +0200 Subject: [PATCH 3/5] FinalizationRegistry? --- tests/compiler/rt/finalize.optimized.wat | 1561 ++++++++++---- tests/compiler/rt/finalize.ts | 34 +- tests/compiler/rt/finalize.untouched.wat | 2484 +++++++++++++++------- 3 files changed, 2933 insertions(+), 1146 deletions(-) diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat index 438a5deeb6..10547feb63 100644 --- a/tests/compiler/rt/finalize.optimized.wat +++ b/tests/compiler/rt/finalize.optimized.wat @@ -3,33 +3,43 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) (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 $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 $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))) - (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (memory $0 1) - (data (i32.const 1024) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e") - (data (i32.const 1072) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") - (data (i32.const 1120) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 1168) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") - (data (i32.const 1216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") - (data (i32.const 1280) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") - (data (i32.const 1328) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c") - (data (i32.const 1376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00_\00_\00f\00i\00n\00a\00l\00i\00z\00e") - (data (i32.const 1424) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") - (data (i32.const 1488) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") - (data (i32.const 1536) "\06\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\"\t") + (data (i32.const 1024) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 1072) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 1136) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 1184) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 1232) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 1296) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00f\00i\00n\00a\00l\00i\00z\00e\00:\00 ") + (data (i32.const 1344) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 1380) "\01\00\00\00\01") + (data (i32.const 1392) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 1440) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e\00~\00a") + (data (i32.const 1488) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00f\00o\00o") + (data (i32.const 1536) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00b\00a\00r") + (data (i32.const 1584) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00K\00e\00y\00 \00d\00o\00e\00s\00 \00n\00o\00t\00 \00e\00x\00i\00s\00t") + (data (i32.const 1648) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00~\00l\00i\00b\00/\00m\00a\00p\00.\00t\00s") + (data (i32.const 1696) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 1760) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 1808) "\08\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\000A\02\00\00\00\00\00\"\t") + (table $0 2 funcref) + (elem (i32.const 1) $start:rt/finalize~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) + (global $rt/finalize/registry (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) (global $~lib/rt/pure/END (mut i32) (i32.const 0)) (export "_start" (func $~start)) + (export "__setArgumentsLength" (func $~setArgumentsLength)) (export "memory" (memory $0)) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) @@ -44,7 +54,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 277 i32.const 14 call $~lib/builtins/abort @@ -66,7 +76,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 279 i32.const 14 call $~lib/builtins/abort @@ -109,7 +119,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 292 i32.const 14 call $~lib/builtins/abort @@ -205,7 +215,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 205 i32.const 14 call $~lib/builtins/abort @@ -219,7 +229,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 207 i32.const 14 call $~lib/builtins/abort @@ -292,7 +302,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 228 i32.const 16 call $~lib/builtins/abort @@ -347,7 +357,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 243 i32.const 14 call $~lib/builtins/abort @@ -362,7 +372,7 @@ i32.ne if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 244 i32.const 14 call $~lib/builtins/abort @@ -410,7 +420,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 260 i32.const 14 call $~lib/builtins/abort @@ -493,7 +503,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 386 i32.const 5 call $~lib/builtins/abort @@ -510,7 +520,7 @@ i32.lt_u if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 396 i32.const 16 call $~lib/builtins/abort @@ -538,7 +548,7 @@ i32.lt_u if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 408 i32.const 5 call $~lib/builtins/abort @@ -611,11 +621,11 @@ if unreachable end - i32.const 1600 + i32.const 1888 local.tee $0 i32.const 0 i32.store - i32.const 3168 + i32.const 3456 i32.const 0 i32.store loop $for-loop|0 @@ -626,7 +636,7 @@ local.get $1 i32.const 2 i32.shl - i32.const 1600 + i32.const 1888 i32.add i32.const 0 i32.store offset=4 @@ -644,7 +654,7 @@ i32.add i32.const 2 i32.shl - i32.const 1600 + i32.const 1888 i32.add i32.const 0 i32.store offset=96 @@ -662,13 +672,13 @@ br $for-loop|0 end end - i32.const 1600 - i32.const 3184 + i32.const 1888 + i32.const 3472 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 1600 + i32.const 1888 global.set $~lib/rt/tlsf/ROOT end local.get $0 @@ -728,7 +738,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 338 i32.const 14 call $~lib/builtins/abort @@ -780,7 +790,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 351 i32.const 18 call $~lib/builtins/abort @@ -813,7 +823,7 @@ i32.and if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 365 i32.const 14 call $~lib/builtins/abort @@ -884,7 +894,7 @@ global.get $~lib/rt/tlsf/collectLock if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 501 i32.const 14 call $~lib/builtins/abort @@ -894,8 +904,8 @@ i32.const 1073741808 i32.ge_u if - i32.const 1232 - i32.const 1184 + i32.const 1088 + i32.const 1040 i32.const 461 i32.const 30 call $~lib/builtins/abort @@ -996,7 +1006,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 513 i32.const 20 call $~lib/builtins/abort @@ -1012,7 +1022,7 @@ i32.lt_u if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 521 i32.const 14 call $~lib/builtins/abort @@ -1048,7 +1058,7 @@ (local $1 i32) (local $2 i32) local.get $0 - i32.const 1588 + i32.const 1876 i32.gt_u if local.get $0 @@ -1067,7 +1077,7 @@ i32.ne if i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 120 i32.const 3 call $~lib/builtins/abort @@ -1084,7 +1094,7 @@ i32.and if i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 123 i32.const 14 call $~lib/builtins/abort @@ -1093,154 +1103,966 @@ end local.get $0 ) - (func $~lib/rt/pure/__release (param $0 i32) - local.get $0 - i32.const 1588 - i32.gt_u - if + (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 local.get $0 - i32.const 16 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 i32.sub - call $~lib/rt/pure/decrement + local.tee $2 + i32.const 0 + i32.store8 offset=3 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 offset=1 + local.get $0 + i32.const 0 + i32.store8 offset=2 + local.get $2 + i32.const 0 + i32.store8 offset=2 + local.get $2 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 offset=3 + local.get $2 + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $2 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $0 + local.get $1 + local.get $2 + i32.sub + i32.const -4 + i32.and + local.tee $2 + i32.add + i32.const 28 + i32.sub + local.tee $1 + i32.const 0 + i32.store offset=24 + local.get $2 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $2 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + i32.const 0 + i32.store offset=24 + local.get $1 + i32.const 0 + i32.store + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $0 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $1 + i32.add + local.set $0 + local.get $2 + local.get $1 + i32.sub + local.set $1 + loop $while-continue|0 + local.get $1 + i32.const 32 + i32.ge_u + if + local.get $0 + i64.const 0 + i64.store + local.get $0 + i64.const 0 + i64.store offset=8 + local.get $0 + i64.const 0 + i64.store offset=16 + local.get $0 + i64.const 0 + i64.store offset=24 + local.get $1 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $while-continue|0 + end + end end ) - (func $~start - (local $0 i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - global.get $~started - if - return - else - i32.const 1 - global.set $~started - end - i32.const 1040 - i32.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - call $~lib/builtins/trace - i32.const 0 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.set $1 - i32.const 16 - i32.const 3 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $2 - i32.const 0 - i32.store - local.get $2 - i32.const 0 - i32.store offset=4 - local.get $2 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 0 - i32.store offset=12 - local.get $1 - local.tee $0 - local.get $2 - i32.load - local.tee $3 - i32.ne + local.get $0 + i32.const 1073741808 + i32.gt_u if - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__release + i32.const 1200 + i32.const 1248 + i32.const 49 + i32.const 43 + call $~lib/builtins/abort + unreachable end - local.get $2 local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 0 - i32.store offset=12 - local.get $2 - call $~lib/rt/pure/__release - i32.const 1344 - i32.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - call $~lib/builtins/trace - i32.const 4 - i32.const 4 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $2 i32.const 0 - i32.store - i32.const 4 - i32.const 5 call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $3 - i32.const 0 - i32.store - local.get $3 - local.tee $0 - local.get $2 local.tee $1 - i32.load - local.tee $4 - i32.ne - if - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $1 local.get $0 - i32.store + call $~lib/memory/memory.fill local.get $1 - local.tee $0 - local.get $3 - i32.load - local.tee $1 - i32.ne + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/pure/__release (param $0 i32) + local.get $0 + i32.const 1876 + i32.gt_u if local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $1 - call $~lib/rt/pure/__release + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement end - local.get $3 - local.get $0 - i32.store - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - call $~lib/rt/pure/__collect ) - (func $~lib/rt/pure/markGray (param $0 i32) - (local $1 i32) + (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 - i32.load offset=4 - local.tee $1 - i32.const 1879048192 - i32.and - i32.const 268435456 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $4 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $4 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $3 + i32.load8_u + i32.store8 + br $while-continue|0 + end + end + loop $while-continue|1 + local.get $4 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $4 + i32.const 8 + i32.sub + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $while-continue|1 + end + end + end + loop $while-continue|2 + local.get $4 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $3 + i32.load8_u + i32.store8 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + br $while-continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|3 + local.get $0 + local.get $4 + i32.add + i32.const 7 + i32.and + if + local.get $4 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i32.load8_u + i32.store8 + br $while-continue|3 + end + end + loop $while-continue|4 + local.get $4 + i32.const 8 + i32.ge_u + if + local.get $4 + i32.const 8 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i64.load + i64.store + br $while-continue|4 + end + end + end + loop $while-continue|5 + local.get $4 + if + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i32.load8_u + i32.store8 + br $while-continue|5 + end + end + end + end + ) + (func $start:rt/finalize~anonymous|0 (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 + i32.eqz + if + local.get $1 + i32.const 1360 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__release + end + i32.const 1360 + local.set $1 + end + block $__inlined_func$~lib/string/String#concat + i32.const 1312 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $2 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $3 + i32.add + local.tee $0 + i32.eqz + if + i32.const 1392 + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + br $__inlined_func$~lib/string/String#concat + end + local.get $0 + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 1312 + local.get $2 + call $~lib/memory/memory.copy + local.get $0 + local.get $2 + i32.add + local.get $1 + local.get $3 + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + i32.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + local.get $0 + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.get $0 + i32.const 16 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.get $0 + i32.const 24 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 2 + i32.shl + i32.add + i32.load + local.set $0 + loop $while-continue|0 + local.get $0 + if + local.get $0 + i32.load offset=8 + i32.const 1 + i32.and + if (result i32) + i32.const 0 + else + local.get $1 + local.get $0 + i32.load + i32.eq + end + if + local.get $0 + return + end + local.get $0 + i32.load offset=8 + i32.const -2 + i32.and + local.set $0 + br $while-continue|0 + end + end + i32.const 0 + ) + (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $1 + i32.const 1 + i32.add + local.tee $4 + i32.const 2 + i32.shl + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $6 + local.get $4 + i32.const 3 + i32.shl + i32.const 3 + i32.div_s + local.tee $7 + i32.const 12 + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $4 + local.get $0 + i32.load offset=8 + local.tee $3 + local.get $0 + i32.load offset=16 + i32.const 12 + i32.mul + i32.add + local.set $8 + local.get $4 + local.set $5 + loop $while-continue|0 + local.get $3 + local.get $8 + i32.ne + if + local.get $3 + local.tee $2 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $5 + local.get $2 + i32.load + i32.store + local.get $5 + local.get $2 + i32.load offset=4 + i32.store offset=4 + local.get $5 + local.get $6 + local.get $2 + i32.load + call $~lib/util/hash/hash32 + local.get $1 + i32.and + i32.const 2 + i32.shl + i32.add + local.tee $2 + i32.load + i32.store offset=8 + local.get $2 + local.get $5 + i32.store + local.get $5 + i32.const 12 + i32.add + local.set $5 + end + local.get $3 + i32.const 12 + i32.add + local.set $3 + br $while-continue|0 + end + end + local.get $6 + local.tee $3 + local.get $0 + local.tee $2 + i32.load + local.tee $5 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + local.set $3 + local.get $5 + call $~lib/rt/pure/__release + end + local.get $2 + local.get $3 + i32.store + local.get $2 + local.get $1 + i32.store offset=4 + local.get $2 + local.set $1 + local.get $4 + local.tee $2 + local.get $1 + i32.load offset=8 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 + local.get $3 + call $~lib/rt/pure/__release + end + local.get $1 + local.get $2 + i32.store offset=8 + local.get $1 + local.get $7 + i32.store offset=12 + local.get $1 + local.get $1 + i32.load offset=20 + i32.store offset=16 + local.get $6 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#set (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 + local.get $1 + call $~lib/util/hash/hash32 + local.tee $4 + call $~lib/map/Map#find + local.tee $3 + if + local.get $2 + local.get $3 + i32.load offset=4 + local.tee $1 + i32.ne + if + local.get $3 + local.get $2 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $1 + call $~lib/rt/pure/__release + end + else + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq + if + local.get $0 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + if (result i32) + local.get $0 + i32.load offset=4 + else + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or + end + call $~lib/map/Map#rehash + end + local.get $0 + i32.load offset=8 + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $5 + i32.const 1 + i32.add + i32.store offset=16 + local.get $5 + i32.const 12 + i32.mul + i32.add + local.tee $3 + local.get $1 + i32.store + local.get $3 + local.get $2 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + i32.store offset=20 + local.get $3 + local.get $0 + i32.load + local.get $4 + local.get $0 + i32.load offset=4 + i32.and + i32.const 2 + i32.shl + i32.add + local.tee $1 + i32.load + i32.store offset=8 + local.get $1 + local.get $3 + i32.store + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $rt/finalize/FinalizationRegistry#register<~lib/array/Array> (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + i32.load + local.get $1 + local.get $2 + call $~lib/map/Map#set + call $~lib/rt/pure/__release + ) + (func $start:rt/finalize + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 8 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $2 + i32.const 24 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load + call $~lib/rt/pure/__release + local.get $0 + local.get $1 + i32.store + local.get $0 + i32.const 3 + i32.store offset=4 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $2 + local.get $0 + i32.store + local.get $2 + i32.const 1 + i32.store offset=4 + local.get $2 + global.set $rt/finalize/registry + i32.const 0 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 0 + call $~lib/memory/memory.fill + i32.const 16 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + i32.const 0 + i32.store + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $0 + local.set $2 + local.get $0 + local.get $1 + i32.load + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 + local.get $3 + call $~lib/rt/pure/__release + end + local.get $1 + local.get $2 + i32.store + local.get $1 + local.get $0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=12 + global.get $rt/finalize/registry + local.get $1 + i32.const 1456 + call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> + local.get $1 + call $~lib/rt/pure/__release + i32.const 4 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $2 + i32.const 0 + i32.store + local.get $2 + i32.const 4 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + local.set $1 + local.get $0 + local.get $2 + i32.load + local.tee $4 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $4 + call $~lib/rt/pure/__release + end + local.get $0 + i32.store + local.get $2 + local.tee $0 + local.get $1 + i32.load + local.tee $3 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__release + end + local.get $1 + local.get $0 + i32.store + global.get $rt/finalize/registry + local.get $2 + i32.const 1504 + call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> + global.get $rt/finalize/registry + local.get $1 + i32.const 1552 + call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> + local.get $2 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + call $~lib/rt/pure/__collect + ) + (func $~start + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end + call $start:rt/finalize + ) + (func $~lib/rt/pure/markGray (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 i32.ne if local.get $0 @@ -1257,6 +2079,103 @@ call $~lib/rt/__visit_members end ) + (func $~setArgumentsLength (param $0 i32) + nop + ) + (func $rt/finalize/FinalizationRegistry#finalize (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load + local.tee $2 + local.get $1 + local.get $1 + call $~lib/util/hash/hash32 + call $~lib/map/Map#find + if + local.get $2 + local.get $1 + local.get $1 + call $~lib/util/hash/hash32 + call $~lib/map/Map#find + local.tee $3 + i32.eqz + if + i32.const 1600 + i32.const 1664 + i32.const 111 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.load offset=4 + call $~lib/rt/pure/__retain + local.tee $3 + local.get $0 + i32.load offset=4 + call_indirect (type $i32_=>_none) + local.get $2 + local.get $1 + local.get $1 + call $~lib/util/hash/hash32 + call $~lib/map/Map#find + local.tee $0 + if + local.get $0 + i32.load offset=4 + call $~lib/rt/pure/__release + local.get $0 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.or + i32.store offset=8 + local.get $2 + local.get $2 + i32.load offset=20 + i32.const 1 + i32.sub + i32.store offset=20 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.tee $1 + i32.const 1 + i32.add + i32.const 4 + local.get $2 + i32.load offset=20 + local.tee $0 + i32.const 4 + local.get $0 + i32.gt_u + select + i32.ge_u + if (result i32) + local.get $2 + i32.load offset=20 + local.get $2 + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + else + i32.const 0 + end + if + local.get $2 + local.get $1 + call $~lib/map/Map#rehash + end + end + local.get $3 + call $~lib/rt/pure/__release + end + ) (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) local.get $1 local.get $1 @@ -1270,46 +2189,25 @@ ) (func $~lib/rt/pure/finalize (param $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 local.get $0 i32.load offset=4 i32.const 1 i32.or - local.tee $2 + local.tee $1 i32.store offset=4 + global.get $rt/finalize/registry local.get $0 i32.const 16 i32.add - local.tee $3 - i32.const 16 - i32.sub - local.set $1 - i32.const 1392 - i32.const 5 - local.get $3 - f64.convert_i32_u - local.get $1 - i32.load - f64.convert_i32_u - local.get $1 - i32.load offset=4 - f64.convert_i32_u - local.get $1 - i32.load offset=8 - f64.convert_i32_u - local.get $1 - i32.load offset=12 - f64.convert_i32_u - call $~lib/builtins/trace + call $rt/finalize/FinalizationRegistry#finalize local.get $0 i32.load offset=4 - local.get $2 + local.get $1 i32.ne if i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 112 i32.const 5 call $~lib/builtins/abort @@ -1518,179 +2416,6 @@ local.get $0 global.set $~lib/rt/pure/CUR ) - (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - block $~lib/util/memory/memmove|inlined.0 - local.get $2 - local.set $4 - local.get $0 - local.get $1 - i32.eq - br_if $~lib/util/memory/memmove|inlined.0 - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $while-continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $4 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $0 - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $3 - i32.load8_u - i32.store8 - br $while-continue|0 - end - end - loop $while-continue|1 - local.get $4 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $4 - i32.const 8 - i32.sub - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $while-continue|1 - end - end - end - loop $while-continue|2 - local.get $4 - if - local.get $0 - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $3 - i32.load8_u - i32.store8 - local.get $4 - i32.const 1 - i32.sub - local.set $4 - br $while-continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $while-continue|3 - local.get $0 - local.get $4 - i32.add - i32.const 7 - i32.and - if - local.get $4 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $4 - i32.const 1 - i32.sub - local.tee $4 - local.get $0 - i32.add - local.get $1 - local.get $4 - i32.add - i32.load8_u - i32.store8 - br $while-continue|3 - end - end - loop $while-continue|4 - local.get $4 - i32.const 8 - i32.ge_u - if - local.get $4 - i32.const 8 - i32.sub - local.tee $4 - local.get $0 - i32.add - local.get $1 - local.get $4 - i32.add - i64.load - i64.store - br $while-continue|4 - end - end - end - loop $while-continue|5 - local.get $4 - if - local.get $4 - i32.const 1 - i32.sub - local.tee $4 - local.get $0 - i32.add - local.get $1 - local.get $4 - i32.add - i32.load8_u - i32.store8 - br $while-continue|5 - end - end - end - end - ) (func $~lib/rt/pure/growRoots (local $0 i32) (local $1 i32) @@ -1753,7 +2478,7 @@ i32.eqz if i32.const 0 - i32.const 1184 + i32.const 1040 i32.const 581 i32.const 3 call $~lib/builtins/abort @@ -1789,7 +2514,7 @@ i32.and if i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 133 i32.const 14 call $~lib/builtins/abort @@ -1821,7 +2546,7 @@ i32.le_u if i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 147 i32.const 16 call $~lib/builtins/abort @@ -1830,12 +2555,12 @@ local.get $0 i32.load offset=8 local.tee $3 - i32.const 1536 + i32.const 1808 i32.load i32.gt_u if - i32.const 1440 - i32.const 1504 + i32.const 1712 + i32.const 1776 i32.const 22 i32.const 28 call $~lib/builtins/abort @@ -1844,7 +2569,7 @@ local.get $3 i32.const 3 i32.shl - i32.const 1540 + i32.const 1812 i32.add i32.load i32.const 32 @@ -1895,7 +2620,7 @@ ) (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) local.get $0 - i32.const 1588 + i32.const 1876 i32.lt_u if return @@ -1931,7 +2656,7 @@ i32.le_u if i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 79 i32.const 20 call $~lib/builtins/abort @@ -1964,7 +2689,7 @@ i32.ne if i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 90 i32.const 9 call $~lib/builtins/abort @@ -1989,7 +2714,7 @@ br $break|0 end i32.const 0 - i32.const 1296 + i32.const 1152 i32.const 101 i32.const 27 call $~lib/builtins/abort @@ -1997,26 +2722,72 @@ end ) (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) block $switch$1$default - block $switch$1$case$5 - block $switch$1$case$4 - block $switch$1$case$2 + block $switch$1$case$7 + block $switch$1$case$6 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$4 $switch$1$case$6 $switch$1$case$7 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$4 $switch$1$case$4 $switch$1$default + local.get $1 + call $~lib/rt/pure/__visit end return end local.get $0 i32.load - local.tee $0 - if - local.get $0 + local.get $1 + local.tee $2 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.tee $3 + local.tee $1 + local.get $0 + i32.load offset=16 + i32.const 12 + i32.mul + i32.add + local.set $0 + loop $while-continue|0 local.get $1 - call $~lib/rt/pure/__visit + local.get $0 + i32.lt_u + if + local.get $1 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $1 + i32.load offset=4 + local.get $2 + call $~lib/rt/pure/__visit + end + local.get $1 + i32.const 12 + i32.add + local.set $1 + br $while-continue|0 + end end + local.get $3 + local.get $2 + call $~lib/rt/pure/__visit return end local.get $0 diff --git a/tests/compiler/rt/finalize.ts b/tests/compiler/rt/finalize.ts index e4c790266b..ed18342b87 100644 --- a/tests/compiler/rt/finalize.ts +++ b/tests/compiler/rt/finalize.ts @@ -1,15 +1,38 @@ -import { BLOCK, BLOCK_OVERHEAD } from "rt/common"; +class FinalizationRegistry { + private map: Map = new Map(); + + constructor( + private fn: (value: string) => void + ) {} + + register(target: U, value: string): void { + if (!isReference()) throw new Error("not an object"); + this.map.set(changetype(target), value); + } + + @unsafe finalize(ptr: usize): void { + var map = this.map; + if (map.has(ptr)) { + let value = map.get(ptr); + this.fn(value); + map.delete(ptr); + } + } +} + +var registry = new FinalizationRegistry(value => { + trace("finalize: " + value); +}); @global function __finalize(ptr: usize): void { - var s = changetype(ptr - BLOCK_OVERHEAD); - trace("__finalize", 5, ptr, s.mmInfo, s.gcInfo, s.rtId, s.rtSize); + registry.finalize(ptr); } function testSimple(): void { var a = new Array(0); + registry.register(a, "testSimple~a"); } -trace("testSimple"); testSimple(); class Foo { @@ -24,8 +47,9 @@ function testCyclic(): void { var bar = new Bar(); foo.bar = bar; bar.foo = foo; + registry.register(foo, "testCyclic~foo"); + registry.register(bar, "testCyclic~bar"); } -trace("testCyclic"); testCyclic(); __collect(); diff --git a/tests/compiler/rt/finalize.untouched.wat b/tests/compiler/rt/finalize.untouched.wat index 50c8554923..adc7c9b547 100644 --- a/tests/compiler/rt/finalize.untouched.wat +++ b/tests/compiler/rt/finalize.untouched.wat @@ -1,41 +1,51 @@ (module (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) (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 $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $none_=>_i32 (func (result i32))) - (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (memory $0 1) - (data (i32.const 16) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e\00") - (data (i32.const 64) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") - (data (i32.const 112) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 160) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") - (data (i32.const 208) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") - (data (i32.const 272) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") - (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00") - (data (i32.const 368) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00_\00_\00f\00i\00n\00a\00l\00i\00z\00e\00") - (data (i32.const 416) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") - (data (i32.const 480) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") - (data (i32.const 528) "\06\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\"\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (table $0 1 funcref) + (data (i32.const 16) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 64) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 176) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 224) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 288) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00f\00i\00n\00a\00l\00i\00z\00e\00:\00 \00") + (data (i32.const 336) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 368) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 384) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 432) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e\00~\00a\00") + (data (i32.const 480) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00f\00o\00o\00") + (data (i32.const 528) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00b\00a\00r\00") + (data (i32.const 576) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00K\00e\00y\00 \00d\00o\00e\00s\00 \00n\00o\00t\00 \00e\00x\00i\00s\00t\00") + (data (i32.const 640) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00~\00l\00i\00b\00/\00m\00a\00p\00.\00t\00s\00") + (data (i32.const 688) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 752) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 800) "\08\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\000A\02\00\00\00\00\00\"\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (table $0 2 funcref) + (elem (i32.const 1) $start:rt/finalize~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $rt/finalize/registry (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/pure/END (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 528)) - (global $~lib/heap/__heap_base i32 (i32.const 580)) + (global $~lib/rt/__rtti_base i32 (i32.const 800)) + (global $~lib/heap/__heap_base i32 (i32.const 868)) (export "_start" (func $~start)) + (export "__setArgumentsLength" (func $~setArgumentsLength)) (export "memory" (memory $0)) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) @@ -59,7 +69,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 277 i32.const 14 call $~lib/builtins/abort @@ -86,7 +96,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 279 i32.const 14 call $~lib/builtins/abort @@ -140,7 +150,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 292 i32.const 14 call $~lib/builtins/abort @@ -272,7 +282,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 205 i32.const 14 call $~lib/builtins/abort @@ -289,7 +299,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 207 i32.const 14 call $~lib/builtins/abort @@ -384,7 +394,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 228 i32.const 16 call $~lib/builtins/abort @@ -449,7 +459,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 243 i32.const 14 call $~lib/builtins/abort @@ -467,7 +477,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 244 i32.const 14 call $~lib/builtins/abort @@ -526,7 +536,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 260 i32.const 14 call $~lib/builtins/abort @@ -647,7 +657,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 386 i32.const 5 call $~lib/builtins/abort @@ -672,7 +682,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 396 i32.const 16 call $~lib/builtins/abort @@ -705,7 +715,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 408 i32.const 5 call $~lib/builtins/abort @@ -936,8 +946,8 @@ i32.const 1073741808 i32.ge_u if - i32.const 224 - i32.const 176 + i32.const 80 + i32.const 32 i32.const 461 i32.const 30 call $~lib/builtins/abort @@ -1033,7 +1043,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 338 i32.const 14 call $~lib/builtins/abort @@ -1098,7 +1108,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 351 i32.const 18 call $~lib/builtins/abort @@ -1247,7 +1257,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 365 i32.const 14 call $~lib/builtins/abort @@ -1340,7 +1350,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 501 i32.const 14 call $~lib/builtins/abort @@ -1387,7 +1397,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 513 i32.const 20 call $~lib/builtins/abort @@ -1408,7 +1418,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 518 i32.const 18 call $~lib/builtins/abort @@ -1429,7 +1439,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 521 i32.const 14 call $~lib/builtins/abort @@ -1463,6 +1473,69 @@ i32.const 16 i32.add ) + (func $~lib/rt/pure/increment (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 120 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + i32.const 0 + drop + i32.const 1 + drop + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 123 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) @@ -1676,68 +1749,29 @@ end end ) - (func $~lib/rt/pure/increment (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 268435455 - i32.const -1 - i32.xor - i32.and + (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $1 - i32.const 1 - i32.add - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - i32.eq - i32.eqz + i32.const 1073741808 + i32.gt_u if - i32.const 0 - i32.const 288 - i32.const 120 - i32.const 3 + i32.const 192 + i32.const 240 + i32.const 49 + i32.const 43 call $~lib/builtins/abort unreachable end - local.get $0 local.get $1 - i32.const 1 - i32.add - i32.store offset=4 i32.const 0 - drop - i32.const 1 - drop - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 288 - i32.const 123 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/rt/pure/__retain (param $0 i32) (result i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/increment - end - local.get $0 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + i32.const 0 + local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/pure/__retain ) (func $~lib/rt/pure/__release (param $0 i32) local.get $0 @@ -1750,42 +1784,52 @@ call $~lib/rt/pure/decrement end ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#clear (param $0 i32) + (local $1 i32) (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 1073741808 - i32.const 2 - i32.shr_u - i32.gt_u - if - i32.const 80 - i32.const 128 - i32.const 57 - i32.const 60 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl + local.get $0 + local.tee $1 + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release local.get $2 + i32.store + local.get $0 + i32.const 4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + local.tee $2 i32.const 0 - call $~lib/rt/tlsf/__alloc - local.set $3 - local.get $3 - i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 local.get $2 - call $~lib/memory/memory.fill + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + ) + (func $~lib/map/Map#constructor (param $0 i32) (result i32) local.get $0 i32.eqz if - i32.const 16 - i32.const 3 + i32.const 24 + i32.const 4 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain local.set $0 @@ -1803,647 +1847,177 @@ i32.const 0 i32.store offset=12 local.get $0 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - i32.load - local.tee $6 - i32.ne - if - local.get $5 - call $~lib/rt/pure/__retain - local.set $5 - local.get $6 - call $~lib/rt/pure/__release - end - local.get $5 - i32.store - local.get $0 - local.get $3 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - local.get $1 - i32.store offset=12 - local.get $0 - ) - (func $rt/finalize/testSimple - (local $0 i32) i32.const 0 + i32.store offset=16 + local.get $0 i32.const 0 - call $~lib/array/Array#constructor - local.set $0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear local.get $0 - call $~lib/rt/pure/__release ) - (func $rt/finalize/Foo#constructor (param $0 i32) (result i32) + (func $rt/finalize/FinalizationRegistry#constructor (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.eqz if - i32.const 4 - i32.const 4 + i32.const 8 + i32.const 3 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain local.set $0 end local.get $0 i32.const 0 + call $~lib/map/Map#constructor i32.store local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 ) - (func $rt/finalize/Bar#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 4 - i32.const 5 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - ) - (func $rt/finalize/testCyclic - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 0 - call $rt/finalize/Foo#constructor - local.set $0 - i32.const 0 - call $rt/finalize/Bar#constructor - local.set $1 - local.get $0 - local.tee $2 - local.get $1 - local.tee $3 - local.get $2 - i32.load - local.tee $4 - i32.ne - if - local.get $3 - call $~lib/rt/pure/__retain - local.set $3 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $3 - i32.store - local.get $1 - local.tee $4 - local.get $0 - local.tee $3 - local.get $4 - i32.load - local.tee $2 - i32.ne - if - local.get $3 - call $~lib/rt/pure/__retain - local.set $3 - local.get $2 - call $~lib/rt/pure/__release - end - local.get $3 - i32.store - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $start:rt/finalize - i32.const 32 - i32.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - call $~lib/builtins/trace - call $rt/finalize/testSimple - i32.const 336 - i32.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - call $~lib/builtins/trace - call $rt/finalize/testCyclic - call $~lib/rt/pure/__collect - ) - (func $~start - global.get $~started - if - return - else - i32.const 1 - global.set $~started - end - call $start:rt/finalize - ) - (func $~lib/rt/pure/markGray (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1879048192 - i32.and - i32.const 268435456 - i32.ne - if - local.get $0 - local.get $1 - i32.const 1879048192 - i32.const -1 - i32.xor - i32.and - i32.const 268435456 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 2 - call $~lib/rt/__visit_members - end - ) - (func $rt/finalize/__finalize (param $0 i32) - (local $1 i32) + (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub - local.set $1 - i32.const 384 - i32.const 5 - local.get $0 - f64.convert_i32_u - local.get $1 - i32.load - f64.convert_i32_u - local.get $1 - i32.load offset=4 - f64.convert_i32_u - local.get $1 - i32.load offset=8 - f64.convert_i32_u - local.get $1 i32.load offset=12 - f64.convert_i32_u - call $~lib/builtins/trace - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.load - local.set $2 - local.get $1 - local.get $2 i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - i32.const 0 - drop + i32.shr_u ) - (func $~lib/rt/pure/finalize (param $0 i32) - (local $1 i32) - i32.const 1 - drop - local.get $0 - i32.load offset=4 - i32.const 1 - i32.or - local.set $1 - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - call $rt/finalize/__finalize - local.get $0 - i32.load offset=4 - local.get $1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 288 - i32.const 112 - i32.const 5 - call $~lib/builtins/abort - unreachable + (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + loop $while-continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + local.set $5 + local.get $5 + if + local.get $0 + local.tee $6 + i32.const 1 + i32.add + local.set $0 + local.get $6 + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $while-continue|0 + end end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/freeBlock - ) - (func $~lib/rt/pure/scanBlack (param $0 i32) local.get $0 - local.get $0 - i32.load offset=4 - i32.const 1879048192 - i32.const -1 - i32.xor + i32.const 3 i32.and i32.const 0 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 4 - call $~lib/rt/__visit_members - ) - (func $~lib/rt/pure/scan (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1879048192 - i32.and - i32.const 268435456 i32.eq if - local.get $1 - i32.const 268435455 - i32.and - i32.const 0 - i32.gt_u - if - local.get $0 - call $~lib/rt/pure/scanBlack - else - local.get $0 - local.get $1 - i32.const 1879048192 - i32.const -1 - i32.xor - i32.and - i32.const 536870912 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 3 - call $~lib/rt/__visit_members - end - end - ) - (func $~lib/rt/pure/collectWhite (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1879048192 - i32.and - i32.const 536870912 - i32.eq - if (result i32) - local.get $1 - i32.const -2147483648 - i32.and - i32.eqz - else - i32.const 0 - end - if - local.get $0 - local.get $1 - i32.const 1879048192 - i32.const -1 - i32.xor - i32.and - i32.const 0 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 5 - call $~lib/rt/__visit_members - local.get $0 - call $~lib/rt/pure/finalize - end - ) - (func $~lib/rt/pure/__collect - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - i32.const 0 - drop - global.get $~lib/rt/pure/ROOTS - local.set $0 - local.get $0 - local.set $1 - local.get $1 - local.set $2 - global.get $~lib/rt/pure/CUR - local.set $3 - loop $for-loop|0 - local.get $2 - local.get $3 - i32.lt_u - local.set $4 - local.get $4 - if + loop $while-continue|1 local.get $2 - i32.load + i32.const 16 + i32.ge_u local.set $5 local.get $5 - i32.load offset=4 - local.set $6 - local.get $6 - i32.const 1879048192 - i32.and - i32.const 805306368 - i32.eq - if (result i32) - local.get $6 - i32.const 268435455 - i32.and - i32.const 0 - i32.gt_u - else - i32.const 0 - end if - local.get $5 - call $~lib/rt/pure/markGray + local.get $0 local.get $1 - local.get $5 + i32.load i32.store + local.get $0 + i32.const 4 + i32.add local.get $1 i32.const 4 i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add local.set $1 - else - local.get $6 - i32.const 1879048192 - i32.and - i32.const 0 - i32.eq - if (result i32) - local.get $6 - i32.const 268435455 - i32.and - i32.eqz - else - i32.const 0 - end - if - local.get $5 - call $~lib/rt/pure/finalize - else - local.get $5 - local.get $6 - i32.const -2147483648 - i32.const -1 - i32.xor - i32.and - i32.store offset=4 - end + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|1 end - local.get $2 - i32.const 4 - i32.add - local.set $2 - br $for-loop|0 end - end - local.get $1 - global.set $~lib/rt/pure/CUR - local.get $0 - local.set $3 - loop $for-loop|1 - local.get $3 - local.get $1 - i32.lt_u - local.set $2 local.get $2 + i32.const 8 + i32.and if - local.get $3 + local.get $0 + local.get $1 i32.load - call $~lib/rt/pure/scan - local.get $3 + i32.store + local.get $0 i32.const 4 i32.add - local.set $3 - br $for-loop|1 + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 end - end - local.get $0 - local.set $3 - loop $for-loop|2 - local.get $3 - local.get $1 - i32.lt_u - local.set $2 local.get $2 + i32.const 4 + i32.and if - local.get $3 + local.get $0 + local.get $1 i32.load - local.set $4 - local.get $4 - local.get $4 - i32.load offset=4 - i32.const -2147483648 - i32.const -1 - i32.xor - i32.and - i32.store offset=4 - local.get $4 - call $~lib/rt/pure/collectWhite - local.get $3 + i32.store + local.get $0 i32.const 4 i32.add - local.set $3 - br $for-loop|2 - end - end - local.get $0 - global.set $~lib/rt/pure/CUR - ) - (func $~lib/rt/__typeinfo (param $0 i32) (result i32) - (local $1 i32) - global.get $~lib/rt/__rtti_base - local.set $1 - local.get $0 - local.get $1 - i32.load - i32.gt_u - if - i32.const 432 - i32.const 496 - i32.const 22 - i32.const 28 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 4 - i32.add - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load - ) - (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - loop $while-continue|0 - local.get $2 - if (result i32) - local.get $1 - i32.const 3 - i32.and - else - i32.const 0 - end - local.set $5 - local.get $5 - if - local.get $0 - local.tee $6 - i32.const 1 - i32.add - local.set $0 - local.get $6 - local.get $1 - local.tee $6 - i32.const 1 - i32.add - local.set $1 - local.get $6 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $while-continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.const 0 - i32.eq - if - loop $while-continue|1 - local.get $2 - i32.const 16 - i32.ge_u - local.set $5 - local.get $5 - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $while-continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $1 - i32.const 4 - i32.add - local.set $1 + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 end local.get $2 i32.const 2 @@ -3543,27 +3117,1370 @@ end end end - loop $while-continue|5 - local.get $3 - local.set $6 + loop $while-continue|5 + local.get $3 + local.set $6 + local.get $6 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $while-continue|5 + end + end + end + end + ) + (func $~lib/string/String#concat (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.eq + if + i32.const 352 + local.tee $2 + local.get $1 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + local.set $1 + end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $4 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 + local.get $4 + local.get $5 + i32.add + local.set $6 + local.get $6 + i32.const 0 + i32.eq + if + i32.const 384 + call $~lib/rt/pure/__retain + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $6 + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.get $0 + local.get $4 + call $~lib/memory/memory.copy + local.get $7 + local.get $4 + i32.add + local.get $1 + local.get $5 + call $~lib/memory/memory.copy + local.get $7 + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String.__concat (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.const 352 + local.get $0 + i32.const 0 + i32.ne + select + local.get $1 + call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $start:rt/finalize~anonymous|0 (param $0 i32) + (local $1 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 304 + local.get $0 + call $~lib/string/String.__concat + local.tee $1 + i32.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $1 + i32.const 1073741808 + i32.const 2 + i32.shr_u + i32.gt_u + if + i32.const 192 + i32.const 400 + i32.const 57 + i32.const 60 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.set $2 + local.get $2 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + i32.const 0 + local.get $2 + call $~lib/memory/memory.fill + local.get $0 + i32.eqz + if + i32.const 16 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + i32.load + local.tee $6 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + local.set $5 + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $2 + i32.store offset=8 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (local $1 i32) + i32.const -2128831035 + local.set $1 + local.get $1 + local.get $0 + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $1 + local.get $0 + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $1 + local.get $0 + i32.const 16 + i32.shr_u + i32.const 255 + i32.and + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $1 + local.get $0 + i32.const 24 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $1 + ) + (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + loop $while-continue|0 + local.get $3 + local.set $4 + local.get $4 + if + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 + br $while-continue|0 + end + end + i32.const 0 + ) + (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.const 1 + i32.add + local.set $2 + i32.const 0 + local.get $2 + i32.const 4 + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $3 + local.get $2 + i32.const 8 + i32.mul + i32.const 3 + i32.div_s + local.set $4 + i32.const 0 + local.get $4 + i32.const 12 + i32.mul + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $5 + local.get $0 + i32.load offset=8 + local.set $6 + local.get $6 + local.get $0 + i32.load offset=16 + i32.const 12 + i32.mul + i32.add + local.set $7 + local.get $5 + local.set $8 + loop $while-continue|0 + local.get $6 + local.get $7 + i32.ne + local.set $9 + local.get $9 + if + local.get $6 + local.set $10 + local.get $10 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $11 + local.get $11 + local.get $10 + i32.load + i32.store + local.get $11 + local.get $10 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $10 + i32.load + local.set $12 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 1 + i32.eq + drop + i32.const 4 + i32.const 2 + i32.eq + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $12 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $11 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + i32.const 12 + i32.add + local.set $8 + end + local.get $6 + i32.const 12 + i32.add + local.set $6 + br $while-continue|0 + end + end + local.get $0 + local.tee $11 + local.get $3 + local.tee $12 + local.get $11 + i32.load + local.tee $9 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + local.set $12 + local.get $9 + call $~lib/rt/pure/__release + end + local.get $12 + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.tee $13 + local.get $5 + local.tee $9 + local.get $13 + i32.load offset=8 + local.tee $11 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + local.set $9 + local.get $11 + call $~lib/rt/pure/__release + end + local.get $9 + i32.store offset=8 + local.get $0 + local.get $4 + i32.store offset=12 + local.get $0 + local.get $0 + i32.load offset=20 + i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $3 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 1 + i32.eq + drop + i32.const 4 + i32.const 2 + i32.eq + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end + local.set $4 + local.get $0 + local.get $1 + local.get $4 + call $~lib/map/Map#find + local.set $5 + local.get $5 + if + i32.const 1 + drop + local.get $5 + i32.load offset=4 + local.set $3 + local.get $2 + local.get $3 + i32.ne + if + local.get $5 + local.get $2 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $3 + call $~lib/rt/pure/__release + end + else + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq + if + local.get $0 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + if (result i32) + local.get $0 + i32.load offset=4 + else + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or + end + call $~lib/map/Map#rehash + end + local.get $0 + i32.load offset=8 + call $~lib/rt/pure/__retain + local.set $3 + local.get $3 + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $6 + i32.const 1 + i32.add + i32.store offset=16 + local.get $6 + i32.const 12 + i32.mul + i32.add + local.set $5 + local.get $5 + local.get $1 + i32.store + local.get $5 + local.get $2 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + i32.store offset=20 + local.get $0 + i32.load + local.get $4 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.load + i32.store offset=8 + local.get $6 + local.get $5 + i32.store + local.get $3 + call $~lib/rt/pure/__release + end + local.get $0 + call $~lib/rt/pure/__retain + local.set $6 + local.get $2 + call $~lib/rt/pure/__release + local.get $6 + ) + (func $rt/finalize/FinalizationRegistry#register<~lib/array/Array> (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 1 + i32.eqz + drop + local.get $0 + i32.load + local.get $1 + local.get $2 + call $~lib/map/Map#set + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + ) + (func $rt/finalize/testSimple + (local $0 i32) + i32.const 0 + i32.const 0 + call $~lib/array/Array#constructor + local.set $0 + global.get $rt/finalize/registry + local.get $0 + i32.const 448 + call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> + local.get $0 + call $~lib/rt/pure/__release + ) + (func $rt/finalize/Foo#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $rt/finalize/Bar#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $rt/finalize/FinalizationRegistry#register (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 1 + i32.eqz + drop + local.get $0 + i32.load + local.get $1 + local.get $2 + call $~lib/map/Map#set + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + ) + (func $rt/finalize/FinalizationRegistry#register (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 1 + i32.eqz + drop + local.get $0 + i32.load + local.get $1 + local.get $2 + call $~lib/map/Map#set + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + ) + (func $rt/finalize/testCyclic + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 0 + call $rt/finalize/Foo#constructor + local.set $0 + i32.const 0 + call $rt/finalize/Bar#constructor + local.set $1 + local.get $0 + local.tee $2 + local.get $1 + local.tee $3 + local.get $2 + i32.load + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + local.set $3 + local.get $4 + call $~lib/rt/pure/__release + end + local.get $3 + i32.store + local.get $1 + local.tee $4 + local.get $0 + local.tee $3 + local.get $4 + i32.load + local.tee $2 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + end + local.get $3 + i32.store + global.get $rt/finalize/registry + local.get $0 + i32.const 496 + call $rt/finalize/FinalizationRegistry#register + global.get $rt/finalize/registry + local.get $1 + i32.const 544 + call $rt/finalize/FinalizationRegistry#register + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $start:rt/finalize + i32.const 0 + i32.const 1 + call $rt/finalize/FinalizationRegistry#constructor + global.set $rt/finalize/registry + call $rt/finalize/testSimple + call $rt/finalize/testCyclic + call $~lib/rt/pure/__collect + ) + (func $~start + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end + call $start:rt/finalize + ) + (func $~lib/rt/pure/markGray (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $1 + local.set $2 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 1 + i32.eq + drop + i32.const 4 + i32.const 2 + i32.eq + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 + end + call $~lib/map/Map#find + i32.const 0 + i32.ne + ) + (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.3 (result i32) + local.get $1 + local.set $2 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 1 + i32.eq + drop + i32.const 4 + i32.const 2 + i32.eq + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 + i32.eqz + if + i32.const 592 + i32.const 656 + i32.const 111 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.load offset=4 + call $~lib/rt/pure/__retain + ) + (func $~setArgumentsLength (param $0 i32) + local.get $0 + global.set $~argumentsLength + ) + (func $~lib/map/Map#delete (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + local.get $1 + block $~lib/util/hash/HASH|inlined.4 (result i32) + local.get $1 + local.set $2 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 1 + i32.eq + drop + i32.const 4 + i32.const 2 + i32.eq + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 + end + call $~lib/map/Map#find + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + return + end + i32.const 0 + drop + i32.const 1 + drop + local.get $3 + i32.load offset=4 + call $~lib/rt/pure/__release + local.get $3 + local.get $3 + i32.load offset=8 + i32.const 1 + i32.or + i32.store offset=8 + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.sub + i32.store offset=20 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $4 + local.get $4 + i32.const 1 + i32.add + i32.const 4 + local.tee $2 + local.get $0 + i32.load offset=20 + local.tee $5 + local.get $2 + local.get $5 + i32.gt_u + select + i32.ge_u + if (result i32) + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + else + i32.const 0 + end + if + local.get $0 + local.get $4 + call $~lib/map/Map#rehash + end + i32.const 1 + ) + (func $rt/finalize/FinalizationRegistry#finalize (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load + call $~lib/rt/pure/__retain + local.set $2 + local.get $2 + local.get $1 + call $~lib/map/Map#has + if + local.get $2 + local.get $1 + call $~lib/map/Map#get + local.set $3 + local.get $3 + i32.const 1 + global.set $~argumentsLength + local.get $0 + i32.load offset=4 + call_indirect (type $i32_=>_none) + local.get $2 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + call $~lib/rt/pure/__release + ) + (func $rt/finalize/__finalize (param $0 i32) + global.get $rt/finalize/registry + local.get $0 + call $rt/finalize/FinalizationRegistry#finalize + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + i32.const 0 + drop + ) + (func $~lib/rt/pure/finalize (param $0 i32) + (local $1 i32) + i32.const 1 + drop + local.get $0 + i32.load offset=4 + i32.const 1 + i32.or + local.set $1 + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + call $rt/finalize/__finalize + local.get $0 + i32.load offset=4 + local.get $1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 144 + i32.const 112 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/scanBlack (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + local.get $0 + call $~lib/rt/pure/finalize + end + ) + (func $~lib/rt/pure/__collect + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 0 + drop + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + loop $for-loop|0 + local.get $2 + local.get $3 + i32.lt_u + local.set $4 + local.get $4 + if + local.get $2 + i32.load + local.set $5 + local.get $5 + i32.load offset=4 + local.set $6 + local.get $6 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $6 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $5 + call $~lib/rt/pure/markGray + local.get $1 + local.get $5 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else local.get $6 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $6 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end if local.get $5 - local.get $3 - i32.const 1 - i32.sub - local.tee $3 - i32.add - local.get $4 - local.get $3 - i32.add - i32.load8_u - i32.store8 - br $while-continue|5 + call $~lib/rt/pure/finalize + else + local.get $5 + local.get $6 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 end end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $for-loop|0 + end + end + local.get $1 + global.set $~lib/rt/pure/CUR + local.get $0 + local.set $3 + loop $for-loop|1 + local.get $3 + local.get $1 + i32.lt_u + local.set $2 + local.get $2 + if + local.get $3 + i32.load + call $~lib/rt/pure/scan + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $for-loop|1 + end + end + local.get $0 + local.set $3 + loop $for-loop|2 + local.get $3 + local.get $1 + i32.lt_u + local.set $2 + local.get $2 + if + local.get $3 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $for-loop|2 end end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/__typeinfo (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 704 + i32.const 768 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load ) (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) (local $1 i32) @@ -3605,7 +4522,7 @@ i32.eqz if i32.const 0 - i32.const 176 + i32.const 32 i32.const 581 i32.const 3 call $~lib/builtins/abort @@ -3715,7 +4632,7 @@ i32.eqz if i32.const 0 - i32.const 288 + i32.const 144 i32.const 133 i32.const 14 call $~lib/builtins/abort @@ -3757,7 +4674,7 @@ i32.eqz if i32.const 0 - i32.const 288 + i32.const 144 i32.const 147 i32.const 16 call $~lib/builtins/abort @@ -3865,7 +4782,7 @@ i32.eqz if i32.const 0 - i32.const 288 + i32.const 144 i32.const 79 i32.const 20 call $~lib/builtins/abort @@ -3904,7 +4821,7 @@ i32.eqz if i32.const 0 - i32.const 288 + i32.const 144 i32.const 90 i32.const 9 call $~lib/builtins/abort @@ -3936,7 +4853,7 @@ i32.eqz if i32.const 0 - i32.const 288 + i32.const 144 i32.const 101 i32.const 27 call $~lib/builtins/abort @@ -3944,6 +4861,75 @@ end end ) + (func $~lib/map/Map#__visit_impl (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + i32.const 0 + if (result i32) + i32.const 1 + else + i32.const 1 + end + drop + local.get $2 + local.set $3 + local.get $3 + local.get $0 + i32.load offset=16 + i32.const 12 + i32.mul + i32.add + local.set $4 + loop $while-continue|0 + local.get $3 + local.get $4 + i32.lt_u + local.set $5 + local.get $5 + if + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + drop + i32.const 1 + drop + local.get $6 + i32.load offset=4 + local.set $7 + i32.const 0 + drop + local.get $7 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $3 + i32.const 12 + i32.add + local.set $3 + br $while-continue|0 + end + end + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) (func $~lib/array/Array#__visit_impl (param $0 i32) (param $1 i32) i32.const 0 drop @@ -3955,25 +4941,31 @@ (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) (local $2 i32) block $switch$1$default - block $switch$1$case$5 - block $switch$1$case$4 - block $switch$1$case$2 - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$4 $switch$1$case$4 $switch$1$default + block $switch$1$case$7 + block $switch$1$case$6 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$4 $switch$1$case$6 $switch$1$case$7 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit end return end local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/pure/__visit - end + local.get $1 + call $~lib/map/Map#__visit_impl return end local.get $0 From de7ee5e56b4950fa42f1a047c986b756c6f11395 Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 16 May 2020 19:38:57 +0200 Subject: [PATCH 4/5] cleanup --- std/assembly/rt/index.d.ts | 1 + std/assembly/rt/pure.ts | 19 +- tests/compiler/rt/finalize.optimized.wat | 1756 +++++--------- tests/compiler/rt/finalize.ts | 60 +- tests/compiler/rt/finalize.untouched.wat | 2761 ++++++++-------------- 5 files changed, 1658 insertions(+), 2939 deletions(-) diff --git a/std/assembly/rt/index.d.ts b/std/assembly/rt/index.d.ts index b8d1c74f3c..a911e2627c 100644 --- a/std/assembly/rt/index.d.ts +++ b/std/assembly/rt/index.d.ts @@ -12,5 +12,6 @@ declare function __visit_globals(cookie: u32): void; declare function __visit_members(ref: usize, cookie: u32): void; declare function __allocBuffer(size: usize, id: u32, data?: usize): usize; declare function __allocArray(length: i32, alignLog2: usize, id: u32, data?: usize): usize; +declare function __finalize(ref: usize): void; declare const ASC_RTRACE: bool; declare const __GC_ALL_ACYCLIC: bool; diff --git a/std/assembly/rt/pure.ts b/std/assembly/rt/pure.ts index f87c17ec19..863fc141a2 100644 --- a/std/assembly/rt/pure.ts +++ b/std/assembly/rt/pure.ts @@ -103,17 +103,6 @@ function __visit(ref: usize, cookie: i32): void { } } -/** Finalizes the specified block, giving it back to the memory manager. */ -function finalize(s: Block): void { - if (isDefined(__finalize)) { - let info = s.gcInfo | 1; // pretend RC>=1 - s.gcInfo = info; - __finalize(changetype(s) + BLOCK_OVERHEAD); - assert(s.gcInfo == info); - } - freeBlock(ROOT, s); -} - /** Increments the reference count of the specified block by one.*/ function increment(s: Block): void { var info = s.gcInfo; @@ -160,6 +149,14 @@ function decrement(s: Block): void { } } +/** Finalizes the specified block, giving it back to the memory manager. */ +function finalize(s: Block): void { + if (isDefined(__finalize)) { + __finalize(changetype(s) + BLOCK_OVERHEAD); + } + freeBlock(ROOT, s); +} + /** Buffer of possible roots. */ // @ts-ignore: decorator @lazy var ROOTS: usize; diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat index 993b31d47d..390f9872fd 100644 --- a/tests/compiler/rt/finalize.optimized.wat +++ b/tests/compiler/rt/finalize.optimized.wat @@ -4,42 +4,47 @@ (type $none_=>_none (func)) (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 $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 $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (memory $0 1) - (data (i32.const 1024) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") - (data (i32.const 1072) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") - (data (i32.const 1136) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") - (data (i32.const 1184) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") - (data (i32.const 1232) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 1296) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00f\00i\00n\00a\00l\00i\00z\00e\00:\00 ") - (data (i32.const 1344) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") - (data (i32.const 1380) "\01\00\00\00\01") - (data (i32.const 1392) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 1440) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e\00~\00a") - (data (i32.const 1488) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00f\00o\00o") - (data (i32.const 1536) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00b\00a\00r") - (data (i32.const 1584) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00K\00e\00y\00 \00d\00o\00e\00s\00 \00n\00o\00t\00 \00e\00x\00i\00s\00t") - (data (i32.const 1648) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00~\00l\00i\00b\00/\00m\00a\00p\00.\00t\00s") - (data (i32.const 1696) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") - (data (i32.const 1760) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") - (data (i32.const 1808) "\08\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\000A\02\00\00\00\00\00\"\t") - (table $0 2 funcref) - (elem (i32.const 1) $start:rt/finalize~anonymous|0) + (data (i32.const 1024) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 1072) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00s\00t\00a\00t\00i\00c\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 1136) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 1184) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 1248) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 1296) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 1344) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00r\00t\00/\00f\00i\00n\00a\00l\00i\00z\00e\00.\00t\00s") + (data (i32.const 1392) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 1456) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00n\00a\00l\00i\00z\00e") + (data (i32.const 1488) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 1536) "\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00$\01\00\00\00\00\00\00\"\t") (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) - (global $rt/finalize/registry (mut i32) (i32.const 0)) + (global $rt/finalize/expected (mut i32) (i32.const 0)) + (global $rt/finalize/expectedWriteIndex (mut i32) (i32.const 0)) + (global $rt/finalize/expectedReadIndex (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) - (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (export "_start" (func $~start)) (export "memory" (memory $0)) + (func $~lib/rt/pure/__release (param $0 i32) + local.get $0 + i32.const 1596 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -53,7 +58,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 277 i32.const 14 call $~lib/builtins/abort @@ -75,7 +80,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 279 i32.const 14 call $~lib/builtins/abort @@ -118,7 +123,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 292 i32.const 14 call $~lib/builtins/abort @@ -214,7 +219,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 205 i32.const 14 call $~lib/builtins/abort @@ -228,7 +233,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 207 i32.const 14 call $~lib/builtins/abort @@ -301,7 +306,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 228 i32.const 16 call $~lib/builtins/abort @@ -356,7 +361,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 243 i32.const 14 call $~lib/builtins/abort @@ -371,7 +376,7 @@ i32.ne if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 244 i32.const 14 call $~lib/builtins/abort @@ -419,7 +424,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 260 i32.const 14 call $~lib/builtins/abort @@ -502,7 +507,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 386 i32.const 5 call $~lib/builtins/abort @@ -519,7 +524,7 @@ i32.lt_u if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 396 i32.const 16 call $~lib/builtins/abort @@ -547,7 +552,7 @@ i32.lt_u if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 408 i32.const 5 call $~lib/builtins/abort @@ -620,11 +625,11 @@ if unreachable end - i32.const 1888 + i32.const 1600 local.tee $0 i32.const 0 i32.store - i32.const 3456 + i32.const 3168 i32.const 0 i32.store loop $for-loop|0 @@ -635,7 +640,7 @@ local.get $1 i32.const 2 i32.shl - i32.const 1888 + i32.const 1600 i32.add i32.const 0 i32.store offset=4 @@ -653,7 +658,7 @@ i32.add i32.const 2 i32.shl - i32.const 1888 + i32.const 1600 i32.add i32.const 0 i32.store offset=96 @@ -671,13 +676,13 @@ br $for-loop|0 end end - i32.const 1888 - i32.const 3472 + i32.const 1600 + i32.const 3184 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 1888 + i32.const 1600 global.set $~lib/rt/tlsf/ROOT end local.get $0 @@ -737,7 +742,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 338 i32.const 14 call $~lib/builtins/abort @@ -789,7 +794,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 351 i32.const 18 call $~lib/builtins/abort @@ -822,7 +827,7 @@ i32.and if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 365 i32.const 14 call $~lib/builtins/abort @@ -893,7 +898,7 @@ global.get $~lib/rt/tlsf/collectLock if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 501 i32.const 14 call $~lib/builtins/abort @@ -903,8 +908,8 @@ i32.const 1073741808 i32.ge_u if - i32.const 1088 - i32.const 1040 + i32.const 1200 + i32.const 1152 i32.const 461 i32.const 30 call $~lib/builtins/abort @@ -1005,7 +1010,7 @@ i32.eqz if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 513 i32.const 20 call $~lib/builtins/abort @@ -1021,7 +1026,7 @@ i32.lt_u if i32.const 0 - i32.const 1040 + i32.const 1152 i32.const 521 i32.const 14 call $~lib/builtins/abort @@ -1053,66 +1058,6 @@ i32.const 16 i32.add ) - (func $~lib/rt/pure/__retain (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1876 - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - local.tee $1 - i32.load offset=4 - local.tee $2 - i32.const -268435456 - i32.and - local.get $2 - i32.const 1 - i32.add - i32.const -268435456 - i32.and - i32.ne - if - i32.const 0 - i32.const 1152 - i32.const 120 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $2 - i32.const 1 - i32.add - i32.store offset=4 - local.get $1 - i32.load - i32.const 1 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 123 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - end - local.get $0 - ) - (func $~lib/rt/pure/__release (param $0 i32) - local.get $0 - i32.const 1876 - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - end - ) (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) (local $2 i32) block $~lib/util/memory/memset|inlined.0 @@ -1271,84 +1216,415 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) + (func $~lib/rt/pure/__retain (param $0 i32) (result i32) (local $1 i32) + (local $2 i32) local.get $0 - i32.const 1073741808 + i32.const 1596 i32.gt_u if - i32.const 1200 - i32.const 1248 - i32.const 49 - i32.const 43 - call $~lib/builtins/abort - unreachable + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + i32.load offset=4 + local.tee $2 + i32.const -268435456 + i32.and + local.get $2 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 1264 + i32.const 109 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 1264 + i32.const 112 + i32.const 14 + call $~lib/builtins/abort + unreachable + end end local.get $0 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 - call $~lib/rt/pure/__retain - local.tee $0 ) - (func $~lib/string/String#get:length (param $0 i32) (result i32) + (func $~lib/staticarray/StaticArray#get:length (param $0 i32) (result i32) local.get $0 i32.const 16 i32.sub i32.load offset=12 - i32.const 1 + i32.const 2 i32.shr_u ) - (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) + (func $rt/finalize/expect (param $0 i32) + (local $1 i32) + (local $2 i32) + global.get $rt/finalize/expectedWriteIndex + global.get $rt/finalize/expected + call $~lib/staticarray/StaticArray#get:length + i32.ge_s + if + i32.const 0 + i32.const 1360 + i32.const 8 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expectedWriteIndex + local.tee $2 + i32.const 1 + i32.add + global.set $rt/finalize/expectedWriteIndex + local.get $2 + local.tee $1 + global.get $rt/finalize/expected + local.tee $2 + call $~lib/staticarray/StaticArray#get:length + i32.ge_u + if + i32.const 1408 + i32.const 1088 + i32.const 110 + i32.const 41 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $0 + i32.store + ) + (func $start:rt/finalize + (local $0 i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - block $~lib/util/memory/memmove|inlined.0 - local.get $2 - local.set $4 - local.get $0 - local.get $1 - i32.eq - br_if $~lib/util/memory/memmove|inlined.0 + i32.const 40 + i32.const 3 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 40 + call $~lib/memory/memory.fill + local.get $0 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $rt/finalize/expected + i32.const 16 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $3 + i32.const 0 + i32.store + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 0 + i32.store offset=12 + i32.const 0 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $2 + i32.const 0 + call $~lib/memory/memory.fill + local.get $2 + local.tee $0 + local.get $3 + i32.load + local.tee $1 + i32.ne + if local.get $0 + call $~lib/rt/pure/__retain + local.set $0 local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $while-continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $4 - i32.eqz - br_if $~lib/util/memory/memmove|inlined.0 - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $0 - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $3 - i32.load8_u + call $~lib/rt/pure/__release + end + local.get $3 + local.get $0 + i32.store + local.get $3 + local.get $2 + i32.store offset=4 + local.get $3 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 0 + i32.store offset=12 + local.get $3 + i32.load + call $rt/finalize/expect + local.get $3 + call $rt/finalize/expect + local.get $3 + call $~lib/rt/pure/__release + global.get $rt/finalize/expectedWriteIndex + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 1360 + i32.const 28 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expectedReadIndex + global.get $rt/finalize/expectedWriteIndex + i32.ne + if + i32.const 0 + i32.const 1360 + i32.const 29 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $2 + i32.const 0 + i32.store + i32.const 4 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + local.tee $1 + local.get $2 + i32.load + local.tee $3 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + local.tee $3 + local.get $1 + i32.store + local.get $3 + local.tee $1 + local.get $0 + i32.load + local.tee $3 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $3 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $1 + i32.store + local.get $0 + call $rt/finalize/expect + local.get $2 + call $rt/finalize/expect + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + call $~lib/rt/pure/__collect + global.get $rt/finalize/expectedWriteIndex + i32.const 4 + i32.ne + if + i32.const 0 + i32.const 1360 + i32.const 51 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expectedReadIndex + global.get $rt/finalize/expectedWriteIndex + i32.ne + if + i32.const 0 + i32.const 1360 + i32.const 52 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expected + call $rt/finalize/expect + global.get $rt/finalize/expected + local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__release + end + i32.const 0 + global.set $rt/finalize/expected + global.get $rt/finalize/expectedWriteIndex + i32.const 5 + i32.ne + if + i32.const 0 + i32.const 1360 + i32.const 58 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expectedReadIndex + global.get $rt/finalize/expectedWriteIndex + i32.ne + if + i32.const 0 + i32.const 1360 + i32.const 59 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + ) + (func $~start + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end + call $start:rt/finalize + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/pure/finalize (param $0 i32) + (local $1 i32) + (local $2 i32) + i32.const 1472 + i32.const 1 + local.get $0 + i32.const 16 + i32.add + local.tee $1 + f64.convert_i32_u + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + global.get $rt/finalize/expectedReadIndex + local.tee $2 + i32.const 1 + i32.add + global.set $rt/finalize/expectedReadIndex + local.get $1 + global.get $rt/finalize/expected + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + i32.ne + if + i32.const 0 + i32.const 1360 + i32.const 17 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $4 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $4 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $3 + i32.load8_u i32.store8 br $while-continue|0 end @@ -1475,744 +1751,231 @@ end end ) - (func $start:rt/finalize~anonymous|0 (param $0 i32) + (func $~lib/rt/pure/growRoots + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - call $~lib/rt/pure/__retain + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $0 + i32.sub + local.tee $3 + i32.const 1 + i32.shl local.tee $1 - i32.eqz - if - local.get $1 - i32.const 1360 - i32.ne - if - local.get $1 - call $~lib/rt/pure/__release - end - i32.const 1360 - local.set $1 - end - block $__inlined_func$~lib/string/String#concat - i32.const 1312 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.tee $2 - local.get $1 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.tee $3 - i32.add - local.tee $0 - i32.eqz - if - i32.const 1392 - local.set $0 - local.get $1 - call $~lib/rt/pure/__release - br $__inlined_func$~lib/string/String#concat - end - local.get $0 - i32.const 1 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 1312 - local.get $2 - call $~lib/memory/memory.copy - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $3 - call $~lib/memory/memory.copy - local.get $1 - call $~lib/rt/pure/__release - end - local.get $0 - i32.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - call $~lib/builtins/trace - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $while-continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $1 - local.get $0 - i32.load - i32.eq - end - if - local.get $0 - return - end - local.get $0 - i32.load offset=8 - i32.const -2 - i32.and - local.set $0 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $7 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $0 - i32.load offset=8 - local.tee $3 - local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $8 - local.get $4 - local.set $5 - loop $while-continue|0 - local.get $3 - local.get $8 - i32.ne - if - local.get $3 - local.tee $2 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $5 - local.get $2 - i32.load - i32.store - local.get $5 - local.get $2 - i32.load offset=4 - i32.store offset=4 - local.get $5 - local.get $6 - local.get $2 - i32.load - call $~lib/util/hash/hash32 - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $2 - i32.load - i32.store offset=8 - local.get $2 - local.get $5 - i32.store - local.get $5 - i32.const 12 - i32.add - local.set $5 - end - local.get $3 - i32.const 12 - i32.add - local.set $3 - br $while-continue|0 - end - end - local.get $6 - local.tee $3 - local.get $0 - local.tee $2 - i32.load - local.tee $5 - i32.ne - if - local.get $3 - call $~lib/rt/pure/__retain - local.set $3 - local.get $5 - call $~lib/rt/pure/__release - end - local.get $2 - local.get $3 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - local.set $1 - local.get $4 - local.tee $2 - local.get $1 - i32.load offset=8 - local.tee $3 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $3 - call $~lib/rt/pure/__release - end - local.get $1 - local.get $2 - i32.store offset=8 - local.get $1 - local.get $7 - i32.store offset=12 - local.get $1 - local.get $1 - i32.load offset=20 - i32.store offset=16 - local.get $6 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (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 - local.get $1 - call $~lib/util/hash/hash32 - local.tee $4 - call $~lib/map/Map#find - local.tee $3 - if - local.get $2 - local.get $3 - i32.load offset=4 - local.tee $1 - i32.ne - if - local.get $3 - local.get $2 - call $~lib/rt/pure/__retain - i32.store offset=4 - local.get $1 - call $~lib/rt/pure/__release - end - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/map/Map#rehash - end - local.get $0 - i32.load offset=8 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $5 - i32.const 1 - i32.add - i32.store offset=16 - local.get $5 - i32.const 12 - i32.mul - i32.add - local.tee $3 - local.get $1 - i32.store - local.get $3 - local.get $2 - call $~lib/rt/pure/__retain - i32.store offset=4 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $3 - local.get $0 - i32.load - local.get $4 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $1 - i32.load - i32.store offset=8 - local.get $1 - local.get $3 - i32.store - end - local.get $0 - call $~lib/rt/pure/__retain - ) - (func $rt/finalize/FinalizationRegistry#register<~lib/array/Array> (param $0 i32) (param $1 i32) (param $2 i32) - local.get $0 - i32.load - local.get $1 - local.get $2 - call $~lib/map/Map#set - call $~lib/rt/pure/__release - ) - (func $start:rt/finalize - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 8 - i32.const 3 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $2 - i32.const 24 - i32.const 4 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $1 - local.get $0 - i32.load - call $~lib/rt/pure/__release - local.get $0 - local.get $1 - i32.store - local.get $0 - i32.const 3 - i32.store offset=4 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $1 - local.get $0 - i32.load offset=8 - call $~lib/rt/pure/__release - local.get $0 - local.get $1 - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $2 - local.get $0 - i32.store - local.get $2 - i32.const 1 - i32.store offset=4 - local.get $2 - global.set $rt/finalize/registry - i32.const 16 - i32.const 5 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $1 - i32.const 0 - i32.store - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - i32.const 0 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.tee $0 - i32.const 0 - call $~lib/memory/memory.fill - local.get $0 - local.set $2 - local.get $0 - local.get $1 - i32.load - local.tee $3 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $3 - call $~lib/rt/pure/__release - end - local.get $1 - local.get $2 - i32.store - local.get $1 - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 0 - i32.store offset=12 - global.get $rt/finalize/registry - local.get $1 - i32.const 1456 - call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> - local.get $1 - call $~lib/rt/pure/__release - i32.const 4 - i32.const 6 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $2 - i32.const 0 - i32.store - local.get $2 - i32.const 4 - i32.const 7 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.store - local.get $0 - local.set $1 - local.get $0 - local.get $2 - i32.load - local.tee $4 - i32.ne - if - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - i32.store - local.get $2 - local.tee $0 + i32.const 256 local.get $1 - i32.load - local.tee $3 - i32.ne + i32.const 256 + i32.gt_u + select + local.tee $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $1 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $0 if + call $~lib/rt/tlsf/maybeInitialize local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__release + i32.const 16 + i32.sub + local.set $2 + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + if (result i32) + local.get $2 + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.load offset=4 + i32.const -268435456 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1152 + i32.const 581 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/tlsf/freeBlock end local.get $1 - local.get $0 - i32.store - global.get $rt/finalize/registry - local.get $2 - i32.const 1504 - call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> - global.get $rt/finalize/registry + global.set $~lib/rt/pure/ROOTS local.get $1 - i32.const 1552 - call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> - local.get $2 - call $~lib/rt/pure/__release + local.get $3 + i32.add + global.set $~lib/rt/pure/CUR local.get $1 - call $~lib/rt/pure/__release - call $~lib/rt/pure/__collect - ) - (func $~start - global.get $~started - if - return - else - i32.const 1 - global.set $~started - end - call $start:rt/finalize + local.get $4 + i32.add + global.set $~lib/rt/pure/END ) - (func $~lib/rt/pure/markGray (param $0 i32) + (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) + (local $2 i32) + (local $3 i32) local.get $0 i32.load offset=4 - local.tee $1 - i32.const 1879048192 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + i32.load + i32.const 1 i32.and - i32.const 268435456 - i32.ne if - local.get $0 - local.get $1 - i32.const -1879048193 - i32.and - i32.const 268435456 - i32.or - i32.store offset=4 + i32.const 0 + i32.const 1264 + i32.const 122 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if local.get $0 i32.const 16 i32.add - i32.const 2 + i32.const 1 call $~lib/rt/__visit_members - end - ) - (func $rt/finalize/FinalizationRegistry#finalize (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.load - local.tee $2 - local.get $1 - local.get $1 - call $~lib/util/hash/hash32 - call $~lib/map/Map#find - if local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + local.get $0 + call $~lib/rt/pure/finalize + end + else local.get $1 - local.get $1 - call $~lib/util/hash/hash32 - call $~lib/map/Map#find + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 1264 + i32.const 136 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 local.tee $3 - i32.eqz + i32.const 1536 + i32.load + i32.gt_u if - i32.const 1600 - i32.const 1664 - i32.const 111 - i32.const 17 + i32.const 1408 + i32.const 1504 + i32.const 22 + i32.const 28 call $~lib/builtins/abort unreachable end local.get $3 - i32.load offset=4 - call $~lib/rt/pure/__retain - local.tee $3 - local.get $0 - i32.load offset=4 - call_indirect (type $i32_=>_none) - local.get $2 - local.get $1 - local.get $1 - call $~lib/util/hash/hash32 - call $~lib/map/Map#find - local.tee $0 + i32.const 3 + i32.shl + i32.const 1540 + i32.add + i32.load + i32.const 32 + i32.and + i32.eqz if local.get $0 - i32.load offset=4 - call $~lib/rt/pure/__release - local.get $0 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.or - i32.store offset=8 - local.get $2 - local.get $2 - i32.load offset=20 + local.get $1 i32.const 1 i32.sub - i32.store offset=20 - local.get $2 - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $1 - i32.const 1 - i32.add - i32.const 4 + i32.const -1342177280 + i32.or + i32.store offset=4 local.get $2 - i32.load offset=20 - local.tee $0 - i32.const 4 - local.get $0 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $2 - i32.load offset=20 - local.get $2 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end + i32.const -2147483648 + i32.and + i32.eqz if - local.get $2 + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store local.get $1 - call $~lib/map/Map#rehash + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR end - end - local.get $3 - call $~lib/rt/pure/__release - end - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - local.get $1 - local.get $1 - i32.load - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/pure/finalize (param $0 i32) - (local $1 i32) - local.get $0 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.or - local.tee $1 - i32.store offset=4 - global.get $rt/finalize/registry - local.get $0 - i32.const 16 - i32.add - call $rt/finalize/FinalizationRegistry#finalize + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/markGray (param $0 i32) + (local $1 i32) local.get $0 i32.load offset=4 - local.get $1 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 i32.ne if - i32.const 0 - i32.const 1152 - i32.const 112 - i32.const 5 - call $~lib/builtins/abort - unreachable + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/freeBlock ) (func $~lib/rt/pure/scanBlack (param $0 i32) local.get $0 @@ -2413,211 +2176,9 @@ local.get $0 global.set $~lib/rt/pure/CUR ) - (func $~lib/rt/pure/growRoots - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/rt/pure/CUR - global.get $~lib/rt/pure/ROOTS - local.tee $0 - i32.sub - local.tee $3 - i32.const 1 - i32.shl - local.tee $1 - i32.const 256 - local.get $1 - i32.const 256 - i32.gt_u - select - local.tee $4 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.tee $1 - local.get $0 - local.get $3 - call $~lib/memory/memory.copy - local.get $0 - if - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - i32.const 16 - i32.sub - local.set $2 - local.get $0 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $0 - select - if (result i32) - local.get $2 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $2 - i32.load offset=4 - i32.const -268435456 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 581 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $2 - call $~lib/rt/tlsf/freeBlock - end - local.get $1 - global.set $~lib/rt/pure/ROOTS - local.get $1 - local.get $3 - i32.add - global.set $~lib/rt/pure/CUR - local.get $1 - local.get $4 - i32.add - global.set $~lib/rt/pure/END - ) - (func $~lib/rt/pure/decrement (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.load offset=4 - local.tee $2 - i32.const 268435455 - i32.and - local.set $1 - local.get $0 - i32.load - i32.const 1 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 133 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 1 - i32.eq - if - local.get $0 - i32.const 16 - i32.add - i32.const 1 - call $~lib/rt/__visit_members - local.get $2 - i32.const -2147483648 - i32.and - if - local.get $0 - i32.const -2147483648 - i32.store offset=4 - else - local.get $0 - call $~lib/rt/pure/finalize - end - else - local.get $1 - i32.const 0 - i32.le_u - if - i32.const 0 - i32.const 1152 - i32.const 147 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=8 - local.tee $3 - i32.const 1808 - i32.load - i32.gt_u - if - i32.const 1712 - i32.const 1776 - i32.const 22 - i32.const 28 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.shl - i32.const 1812 - i32.add - i32.load - i32.const 32 - i32.and - i32.eqz - if - local.get $0 - local.get $1 - i32.const 1 - i32.sub - i32.const -1342177280 - i32.or - i32.store offset=4 - local.get $2 - i32.const -2147483648 - i32.and - i32.eqz - if - global.get $~lib/rt/pure/CUR - local.tee $1 - global.get $~lib/rt/pure/END - i32.ge_u - if - call $~lib/rt/pure/growRoots - global.get $~lib/rt/pure/CUR - local.set $1 - end - local.get $1 - local.get $0 - i32.store - local.get $1 - i32.const 4 - i32.add - global.set $~lib/rt/pure/CUR - end - else - local.get $0 - local.get $1 - i32.const 1 - i32.sub - local.get $2 - i32.const -268435456 - i32.and - i32.or - i32.store offset=4 - end - end - ) (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) local.get $0 - i32.const 1876 + i32.const 1596 i32.lt_u if return @@ -2653,7 +2214,7 @@ i32.le_u if i32.const 0 - i32.const 1152 + i32.const 1264 i32.const 79 i32.const 20 call $~lib/builtins/abort @@ -2686,7 +2247,7 @@ i32.ne if i32.const 0 - i32.const 1152 + i32.const 1264 i32.const 90 i32.const 9 call $~lib/builtins/abort @@ -2711,7 +2272,7 @@ br $break|0 end i32.const 0 - i32.const 1152 + i32.const 1264 i32.const 101 i32.const 27 call $~lib/builtins/abort @@ -2719,18 +2280,16 @@ end ) (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) block $switch$1$default - block $switch$1$case$7 - block $switch$1$case$6 + block $switch$1$case$6 + block $switch$1$case$5 block $switch$1$case$4 block $switch$1$case$2 local.get $0 i32.const 8 i32.sub i32.load - br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$4 $switch$1$case$6 $switch$1$case$7 $switch$1$case$4 $switch$1$case$4 $switch$1$default + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$6 $switch$1$case$4 $switch$1$case$4 $switch$1$default end return end @@ -2744,47 +2303,6 @@ end return end - local.get $0 - i32.load - local.get $1 - local.tee $2 - call $~lib/rt/pure/__visit - local.get $0 - i32.load offset=8 - local.tee $3 - local.tee $1 - local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $0 - loop $while-continue|0 - local.get $1 - local.get $0 - i32.lt_u - if - local.get $1 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $1 - i32.load offset=4 - local.get $2 - call $~lib/rt/pure/__visit - end - local.get $1 - i32.const 12 - i32.add - local.set $1 - br $while-continue|0 - end - end - local.get $3 - local.get $2 - call $~lib/rt/pure/__visit return end local.get $0 diff --git a/tests/compiler/rt/finalize.ts b/tests/compiler/rt/finalize.ts index ed18342b87..d9a0ada7a2 100644 --- a/tests/compiler/rt/finalize.ts +++ b/tests/compiler/rt/finalize.ts @@ -1,39 +1,34 @@ -class FinalizationRegistry { - private map: Map = new Map(); - - constructor( - private fn: (value: string) => void - ) {} - - register(target: U, value: string): void { - if (!isReference()) throw new Error("not an object"); - this.map.set(changetype(target), value); - } - - @unsafe finalize(ptr: usize): void { - var map = this.map; - if (map.has(ptr)) { - let value = map.get(ptr); - this.fn(value); - map.delete(ptr); - } - } +// Add bookkeeping + +var expected = new StaticArray(10); +var expectedWriteIndex = 0; +var expectedReadIndex = 0; + +function expect(ptr: usize): void { + assert(expectedWriteIndex < expected.length); + expected[expectedWriteIndex++] = ptr; } -var registry = new FinalizationRegistry(value => { - trace("finalize: " + value); -}); +// Implement finalization hook +// @ts-ignore @global function __finalize(ptr: usize): void { - registry.finalize(ptr); + trace("finalize", 1, ptr); + assert(ptr == unchecked(expected[expectedReadIndex++])); } +// Simple test with locals becoming finalized immediately + function testSimple(): void { var a = new Array(0); - registry.register(a, "testSimple~a"); + expect(changetype(a.buffer)); + expect(changetype(a)); } - testSimple(); +assert(expectedWriteIndex == 2); +assert(expectedReadIndex == expectedWriteIndex); + +// Cyclic test with locals becoming deferred until collected class Foo { bar: Bar; @@ -47,9 +42,18 @@ function testCyclic(): void { var bar = new Bar(); foo.bar = bar; bar.foo = foo; - registry.register(foo, "testCyclic~foo"); - registry.register(bar, "testCyclic~bar"); + expect(changetype(bar)); + expect(changetype(foo)); } testCyclic(); __collect(); +assert(expectedWriteIndex == 4); +assert(expectedReadIndex == expectedWriteIndex); + +// Unleak bookkeeping, expecting it to become finalized as well + +expect(changetype(expected)); +expected = changetype>(0); +assert(expectedWriteIndex == 5); +assert(expectedReadIndex == expectedWriteIndex); diff --git a/tests/compiler/rt/finalize.untouched.wat b/tests/compiler/rt/finalize.untouched.wat index f6e66fd8fc..c96a353ee5 100644 --- a/tests/compiler/rt/finalize.untouched.wat +++ b/tests/compiler/rt/finalize.untouched.wat @@ -1,10 +1,10 @@ (module (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param 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_=>_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))) @@ -12,40 +12,45 @@ (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (memory $0 1) - (data (i32.const 16) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") - (data (i32.const 64) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") - (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") - (data (i32.const 176) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") - (data (i32.const 224) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 288) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00f\00i\00n\00a\00l\00i\00z\00e\00:\00 \00") - (data (i32.const 336) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") - (data (i32.const 368) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 384) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 432) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00t\00e\00s\00t\00S\00i\00m\00p\00l\00e\00~\00a\00") - (data (i32.const 480) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00f\00o\00o\00") - (data (i32.const 528) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00t\00e\00s\00t\00C\00y\00c\00l\00i\00c\00~\00b\00a\00r\00") - (data (i32.const 576) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00K\00e\00y\00 \00d\00o\00e\00s\00 \00n\00o\00t\00 \00e\00x\00i\00s\00t\00") - (data (i32.const 640) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00~\00l\00i\00b\00/\00m\00a\00p\00.\00t\00s\00") - (data (i32.const 688) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") - (data (i32.const 752) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") - (data (i32.const 800) "\08\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\000A\02\00\00\00\00\00\"\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (table $0 2 funcref) - (elem (i32.const 1) $start:rt/finalize~anonymous|0) + (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") + (data (i32.const 64) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00s\00t\00a\00t\00i\00c\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 176) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 240) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 288) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 336) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00r\00t\00/\00f\00i\00n\00a\00l\00i\00z\00e\00.\00t\00s\00") + (data (i32.const 384) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 448) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00n\00a\00l\00i\00z\00e\00") + (data (i32.const 480) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 528) "\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00$\01\00\00\00\00\00\00\"\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $rt/finalize/registry (mut i32) (i32.const 0)) + (global $rt/finalize/expected (mut i32) (i32.const 0)) + (global $rt/finalize/expectedWriteIndex (mut i32) (i32.const 0)) + (global $rt/finalize/expectedReadIndex (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) - (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) - (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/pure/END (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 800)) - (global $~lib/heap/__heap_base i32 (i32.const 868)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 528)) + (global $~lib/heap/__heap_base i32 (i32.const 588)) (export "_start" (func $~start)) (export "memory" (memory $0)) + (func $~lib/rt/pure/__release (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -68,7 +73,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 277 i32.const 14 call $~lib/builtins/abort @@ -95,7 +100,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 279 i32.const 14 call $~lib/builtins/abort @@ -149,7 +154,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 292 i32.const 14 call $~lib/builtins/abort @@ -281,7 +286,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 205 i32.const 14 call $~lib/builtins/abort @@ -298,7 +303,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 207 i32.const 14 call $~lib/builtins/abort @@ -393,7 +398,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 228 i32.const 16 call $~lib/builtins/abort @@ -458,7 +463,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 243 i32.const 14 call $~lib/builtins/abort @@ -476,7 +481,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 244 i32.const 14 call $~lib/builtins/abort @@ -535,7 +540,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 260 i32.const 14 call $~lib/builtins/abort @@ -656,7 +661,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 386 i32.const 5 call $~lib/builtins/abort @@ -681,7 +686,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 396 i32.const 16 call $~lib/builtins/abort @@ -714,7 +719,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 408 i32.const 5 call $~lib/builtins/abort @@ -945,8 +950,8 @@ i32.const 1073741808 i32.ge_u if - i32.const 80 - i32.const 32 + i32.const 192 + i32.const 144 i32.const 461 i32.const 30 call $~lib/builtins/abort @@ -1042,7 +1047,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 338 i32.const 14 call $~lib/builtins/abort @@ -1107,7 +1112,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 351 i32.const 18 call $~lib/builtins/abort @@ -1256,7 +1261,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 365 i32.const 14 call $~lib/builtins/abort @@ -1349,7 +1354,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 501 i32.const 14 call $~lib/builtins/abort @@ -1396,7 +1401,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 513 i32.const 20 call $~lib/builtins/abort @@ -1417,7 +1422,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 518 i32.const 18 call $~lib/builtins/abort @@ -1438,7 +1443,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 521 i32.const 14 call $~lib/builtins/abort @@ -1472,80 +1477,6 @@ i32.const 16 i32.add ) - (func $~lib/rt/pure/increment (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - local.get $1 - i32.const 1 - i32.add - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 120 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - i32.const 0 - drop - i32.const 1 - drop - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 123 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/rt/pure/__retain (param $0 i32) (result i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/increment - end - local.get $0 - ) - (func $~lib/rt/pure/__release (param $0 i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - end - ) (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) @@ -1759,80 +1690,115 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/increment (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 256 + i32.const 109 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + i32.const 0 + drop + i32.const 1 + drop + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 256 + i32.const 112 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/staticarray/StaticArray#constructor (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) local.get $1 i32.const 1073741808 + i32.const 2 + i32.shr_u i32.gt_u if - i32.const 192 - i32.const 240 - i32.const 49 - i32.const 43 + i32.const 32 + i32.const 80 + i32.const 83 + i32.const 60 call $~lib/builtins/abort unreachable end local.get $1 - i32.const 0 - call $~lib/rt/tlsf/__alloc + i32.const 2 + i32.shl local.set $2 local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill - local.get $2 - call $~lib/rt/pure/__retain + i32.const 3 + call $~lib/rt/tlsf/__alloc local.set $3 - local.get $0 - call $~lib/rt/pure/__release local.get $3 - ) - (func $~lib/map/Map#clear (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - local.tee $1 i32.const 0 - i32.const 16 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $2 - local.get $1 - i32.load - call $~lib/rt/pure/__release local.get $2 - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 + call $~lib/memory/memory.fill + local.get $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 - local.tee $2 - i32.const 0 - i32.const 48 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $1 - local.get $2 - i32.load offset=8 call $~lib/rt/pure/__release - local.get $1 - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 + local.get $4 ) - (func $~lib/map/Map#constructor (param $0 i32) (result i32) + (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 i32.eqz if - i32.const 24 + i32.const 16 i32.const 4 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain @@ -1850,123 +1816,500 @@ local.get $0 i32.const 0 i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 + local.get $1 + i32.const 1073741808 + i32.const 2 + i32.shr_u + i32.gt_u + if + i32.const 32 + i32.const 304 + i32.const 57 + i32.const 60 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.set $2 + local.get $2 i32.const 0 - i32.store offset=20 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + i32.const 0 + local.get $2 + call $~lib/memory/memory.fill + local.get $0 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + i32.load + local.tee $6 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + local.set $5 + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $2 + i32.store offset=8 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/staticarray/StaticArray#get:length (param $0 i32) (result i32) local.get $0 - call $~lib/map/Map#clear + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 2 + i32.shr_u + ) + (func $~lib/staticarray/StaticArray#__uset (param $0 i32) (param $1 i32) (param $2 i32) + i32.const 0 + drop local.get $0 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store ) - (func $rt/finalize/FinalizationRegistry#constructor (param $0 i32) (param $1 i32) (result i32) + (func $~lib/staticarray/StaticArray#__set (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + call $~lib/staticarray/StaticArray#get:length + i32.ge_u + if + i32.const 400 + i32.const 80 + i32.const 110 + i32.const 41 + call $~lib/builtins/abort + unreachable + end local.get $0 + local.get $1 + local.get $2 + call $~lib/staticarray/StaticArray#__uset + ) + (func $rt/finalize/expect (param $0 i32) + (local $1 i32) + global.get $rt/finalize/expectedWriteIndex + global.get $rt/finalize/expected + call $~lib/staticarray/StaticArray#get:length + i32.lt_s i32.eqz if + i32.const 0 + i32.const 352 i32.const 8 i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expected + global.get $rt/finalize/expectedWriteIndex + local.tee $1 + i32.const 1 + i32.add + global.set $rt/finalize/expectedWriteIndex + local.get $1 + local.get $0 + call $~lib/staticarray/StaticArray#__set + ) + (func $rt/finalize/testSimple + (local $0 i32) + i32.const 0 + i32.const 0 + call $~lib/array/Array#constructor + local.set $0 + local.get $0 + i32.load + call $rt/finalize/expect + local.get $0 + call $rt/finalize/expect + local.get $0 + call $~lib/rt/pure/__release + ) + (func $rt/finalize/Foo#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 5 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain local.set $0 end local.get $0 i32.const 0 - call $~lib/map/Map#constructor i32.store local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 ) - (func $~lib/string/String#get:length (param $0 i32) (result i32) + (func $rt/finalize/Bar#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u ) - (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) + (func $rt/finalize/testCyclic + (local $0 i32) + (local $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - loop $while-continue|0 + i32.const 0 + call $rt/finalize/Foo#constructor + local.set $0 + i32.const 0 + call $rt/finalize/Bar#constructor + local.set $1 + local.get $0 + local.tee $2 + local.get $1 + local.tee $3 + local.get $2 + i32.load + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + local.set $3 + local.get $4 + call $~lib/rt/pure/__release + end + local.get $3 + i32.store + local.get $1 + local.tee $4 + local.get $0 + local.tee $3 + local.get $4 + i32.load + local.tee $2 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + local.set $3 local.get $2 - if (result i32) - local.get $1 - i32.const 3 - i32.and - else - i32.const 0 - end - local.set $5 - local.get $5 - if - local.get $0 - local.tee $6 - i32.const 1 - i32.add - local.set $0 - local.get $6 - local.get $1 - local.tee $6 - i32.const 1 - i32.add - local.set $1 - local.get $6 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $while-continue|0 - end + call $~lib/rt/pure/__release end + local.get $3 + i32.store + local.get $1 + call $rt/finalize/expect local.get $0 - i32.const 3 - i32.and + call $rt/finalize/expect + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $start:rt/finalize + (local $0 i32) + (local $1 i32) i32.const 0 + i32.const 10 + call $~lib/staticarray/StaticArray#constructor + global.set $rt/finalize/expected + call $rt/finalize/testSimple + global.get $rt/finalize/expectedWriteIndex + i32.const 2 i32.eq + i32.eqz if - loop $while-continue|1 - local.get $2 - i32.const 16 - i32.ge_u - local.set $5 - local.get $5 - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 + i32.const 0 + i32.const 352 + i32.const 28 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expectedReadIndex + global.get $rt/finalize/expectedWriteIndex + i32.eq + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 29 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + call $rt/finalize/testCyclic + call $~lib/rt/pure/__collect + global.get $rt/finalize/expectedWriteIndex + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 51 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expectedReadIndex + global.get $rt/finalize/expectedWriteIndex + i32.eq + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 52 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expected + call $rt/finalize/expect + i32.const 0 + local.tee $0 + global.get $rt/finalize/expected + local.tee $1 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + global.set $rt/finalize/expected + global.get $rt/finalize/expectedWriteIndex + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 58 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $rt/finalize/expectedReadIndex + global.get $rt/finalize/expectedWriteIndex + i32.eq + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 59 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + ) + (func $~start + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end + call $start:rt/finalize + ) + (func $~lib/staticarray/StaticArray#__uget (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + ) + (func $rt/finalize/__finalize (param $0 i32) + (local $1 i32) + i32.const 464 + i32.const 1 + local.get $0 + f64.convert_i32_u + f64.const 0 + f64.const 0 + f64.const 0 + f64.const 0 + call $~lib/builtins/trace + local.get $0 + global.get $rt/finalize/expected + global.get $rt/finalize/expectedReadIndex + local.tee $1 + i32.const 1 + i32.add + global.set $rt/finalize/expectedReadIndex + local.get $1 + call $~lib/staticarray/StaticArray#__uget + i32.eq + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 17 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + i32.const 0 + drop + ) + (func $~lib/rt/pure/finalize (param $0 i32) + i32.const 1 + drop + local.get $0 + i32.const 16 + i32.add + call $rt/finalize/__finalize + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/__typeinfo (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 400 + i32.const 496 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + loop $while-continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + local.set $5 + local.get $5 + if + local.get $0 + local.tee $6 + i32.const 1 + i32.add + local.set $0 + local.get $6 + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $while-continue|0 + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + loop $while-continue|1 + local.get $2 + i32.const 16 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 i32.const 16 i32.add local.set $1 @@ -3097,1390 +3440,51 @@ i32.store8 br $while-continue|3 end - end - loop $while-continue|4 - local.get $3 - i32.const 8 - i32.ge_u - local.set $6 - local.get $6 - if - local.get $3 - i32.const 8 - i32.sub - local.set $3 - local.get $5 - local.get $3 - i32.add - local.get $4 - local.get $3 - i32.add - i64.load - i64.store - br $while-continue|4 - end - end - end - loop $while-continue|5 - local.get $3 - local.set $6 - local.get $6 - if - local.get $5 - local.get $3 - i32.const 1 - i32.sub - local.tee $3 - i32.add - local.get $4 - local.get $3 - i32.add - i32.load8_u - i32.store8 - br $while-continue|5 - end - end - end - end - ) - (func $~lib/string/String#concat (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $1 - i32.const 0 - i32.eq - if - i32.const 352 - local.tee $2 - local.get $1 - local.tee $3 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $3 - call $~lib/rt/pure/__release - end - local.get $2 - local.set $1 - end - local.get $0 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $4 - local.get $1 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $5 - local.get $4 - local.get $5 - i32.add - local.set $6 - local.get $6 - i32.const 0 - i32.eq - if - i32.const 384 - call $~lib/rt/pure/__retain - local.set $2 - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - return - end - local.get $6 - i32.const 1 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $7 - local.get $7 - local.get $0 - local.get $4 - call $~lib/memory/memory.copy - local.get $7 - local.get $4 - i32.add - local.get $1 - local.get $5 - call $~lib/memory/memory.copy - local.get $7 - local.set $2 - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - ) - (func $~lib/string/String.__concat (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.const 352 - local.get $0 - i32.const 0 - i32.ne - select - local.get $1 - call $~lib/string/String#concat - local.set $2 - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - ) - (func $start:rt/finalize~anonymous|0 (param $0 i32) - (local $1 i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - i32.const 304 - local.get $0 - call $~lib/string/String.__concat - local.tee $1 - i32.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - f64.const 0 - call $~lib/builtins/trace - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.eqz - if - i32.const 16 - i32.const 5 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 1073741808 - i32.const 2 - i32.shr_u - i32.gt_u - if - i32.const 192 - i32.const 400 - i32.const 57 - i32.const 60 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.set $3 - local.get $3 - i32.const 0 - local.get $2 - call $~lib/memory/memory.fill - local.get $0 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - i32.load - local.tee $6 - i32.ne - if - local.get $5 - call $~lib/rt/pure/__retain - local.set $5 - local.get $6 - call $~lib/rt/pure/__release - end - local.get $5 - i32.store - local.get $0 - local.get $3 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - local.get $1 - i32.store offset=12 - local.get $0 - ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) - (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 - local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 - i32.const 0 - local.get $4 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 - local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $11 - local.get $10 - i32.load - i32.store - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $10 - i32.load - local.set $12 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $12 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $11 - local.get $13 - i32.load - i32.store offset=8 - local.get $13 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 - end - local.get $6 - i32.const 12 - i32.add - local.set $6 - br $while-continue|0 - end - end - local.get $0 - local.tee $11 - local.get $3 - local.tee $12 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $12 - call $~lib/rt/pure/__retain - local.set $12 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $12 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - local.tee $13 - local.get $5 - local.tee $9 - local.get $13 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $9 - i32.store offset=8 - local.get $0 - local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - local.set $4 - local.get $0 - local.get $1 - local.get $4 - call $~lib/map/Map#find - local.set $5 - local.get $5 - if - i32.const 1 - drop - local.get $5 - i32.load offset=4 - local.set $3 - local.get $2 - local.get $3 - i32.ne - if - local.get $5 - local.get $2 - call $~lib/rt/pure/__retain - i32.store offset=4 - local.get $3 - call $~lib/rt/pure/__release - end - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/map/Map#rehash - end - local.get $0 - i32.load offset=8 - call $~lib/rt/pure/__retain - local.set $3 - local.get $3 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 12 - i32.mul - i32.add - local.set $5 - local.get $5 - local.get $1 - i32.store - local.get $5 - local.get $2 - call $~lib/rt/pure/__retain - i32.store offset=4 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $4 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $6 - local.get $5 - local.get $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $5 - i32.store - local.get $3 - call $~lib/rt/pure/__release - end - local.get $0 - call $~lib/rt/pure/__retain - local.set $6 - local.get $2 - call $~lib/rt/pure/__release - local.get $6 - ) - (func $rt/finalize/FinalizationRegistry#register<~lib/array/Array> (param $0 i32) (param $1 i32) (param $2 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 1 - i32.eqz - drop - local.get $0 - i32.load - local.get $1 - local.get $2 - call $~lib/map/Map#set - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - ) - (func $rt/finalize/testSimple - (local $0 i32) - i32.const 0 - i32.const 0 - call $~lib/array/Array#constructor - local.set $0 - global.get $rt/finalize/registry - local.get $0 - i32.const 448 - call $rt/finalize/FinalizationRegistry#register<~lib/array/Array> - local.get $0 - call $~lib/rt/pure/__release - ) - (func $rt/finalize/Foo#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 4 - i32.const 6 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - ) - (func $rt/finalize/Bar#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 4 - i32.const 7 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - ) - (func $rt/finalize/FinalizationRegistry#register (param $0 i32) (param $1 i32) (param $2 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 1 - i32.eqz - drop - local.get $0 - i32.load - local.get $1 - local.get $2 - call $~lib/map/Map#set - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - ) - (func $rt/finalize/FinalizationRegistry#register (param $0 i32) (param $1 i32) (param $2 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 1 - i32.eqz - drop - local.get $0 - i32.load - local.get $1 - local.get $2 - call $~lib/map/Map#set - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - ) - (func $rt/finalize/testCyclic - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 0 - call $rt/finalize/Foo#constructor - local.set $0 - i32.const 0 - call $rt/finalize/Bar#constructor - local.set $1 - local.get $0 - local.tee $2 - local.get $1 - local.tee $3 - local.get $2 - i32.load - local.tee $4 - i32.ne - if - local.get $3 - call $~lib/rt/pure/__retain - local.set $3 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $3 - i32.store - local.get $1 - local.tee $4 - local.get $0 - local.tee $3 - local.get $4 - i32.load - local.tee $2 - i32.ne - if - local.get $3 - call $~lib/rt/pure/__retain - local.set $3 - local.get $2 - call $~lib/rt/pure/__release - end - local.get $3 - i32.store - global.get $rt/finalize/registry - local.get $0 - i32.const 496 - call $rt/finalize/FinalizationRegistry#register - global.get $rt/finalize/registry - local.get $1 - i32.const 544 - call $rt/finalize/FinalizationRegistry#register - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $start:rt/finalize - i32.const 0 - i32.const 1 - call $rt/finalize/FinalizationRegistry#constructor - global.set $rt/finalize/registry - call $rt/finalize/testSimple - call $rt/finalize/testCyclic - call $~lib/rt/pure/__collect - ) - (func $~start - global.get $~started - if - return - else - i32.const 1 - global.set $~started - end - call $start:rt/finalize - ) - (func $~lib/rt/pure/markGray (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1879048192 - i32.and - i32.const 268435456 - i32.ne - if - local.get $0 - local.get $1 - i32.const 1879048192 - i32.const -1 - i32.xor - i32.and - i32.const 268435456 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 2 - call $~lib/rt/__visit_members - end - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - local.get $1 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/map/Map#find - local.set $3 - local.get $3 - i32.eqz - if - i32.const 592 - i32.const 656 - i32.const 111 - i32.const 17 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.load offset=4 - call $~lib/rt/pure/__retain - ) - (func $~lib/map/Map#delete (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - local.get $1 - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - call $~lib/map/Map#find - local.set $3 - local.get $3 - i32.eqz - if - i32.const 0 - return - end - i32.const 0 - drop - i32.const 1 - drop - local.get $3 - i32.load offset=4 - call $~lib/rt/pure/__release - local.get $3 - local.get $3 - i32.load offset=8 - i32.const 1 - i32.or - i32.store offset=8 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.sub - i32.store offset=20 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $4 - local.get $4 - i32.const 1 - i32.add - i32.const 4 - local.tee $2 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $2 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end - if - local.get $0 - local.get $4 - call $~lib/map/Map#rehash - end - i32.const 1 - ) - (func $rt/finalize/FinalizationRegistry#finalize (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.load - call $~lib/rt/pure/__retain - local.set $2 - local.get $2 - local.get $1 - call $~lib/map/Map#has - if - local.get $2 - local.get $1 - call $~lib/map/Map#get - local.set $3 - local.get $3 - i32.const 1 - global.set $~argumentsLength - local.get $0 - i32.load offset=4 - call_indirect (type $i32_=>_none) - local.get $2 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $3 - call $~lib/rt/pure/__release - end - local.get $2 - call $~lib/rt/pure/__release - ) - (func $rt/finalize/__finalize (param $0 i32) - global.get $rt/finalize/registry - local.get $0 - call $rt/finalize/FinalizationRegistry#finalize - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - i32.const 0 - drop - ) - (func $~lib/rt/pure/finalize (param $0 i32) - (local $1 i32) - i32.const 1 - drop - local.get $0 - i32.load offset=4 - i32.const 1 - i32.or - local.set $1 - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - call $rt/finalize/__finalize - local.get $0 - i32.load offset=4 - local.get $1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 112 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/freeBlock - ) - (func $~lib/rt/pure/scanBlack (param $0 i32) - local.get $0 - local.get $0 - i32.load offset=4 - i32.const 1879048192 - i32.const -1 - i32.xor - i32.and - i32.const 0 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 4 - call $~lib/rt/__visit_members - ) - (func $~lib/rt/pure/scan (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1879048192 - i32.and - i32.const 268435456 - i32.eq - if - local.get $1 - i32.const 268435455 - i32.and - i32.const 0 - i32.gt_u - if - local.get $0 - call $~lib/rt/pure/scanBlack - else - local.get $0 - local.get $1 - i32.const 1879048192 - i32.const -1 - i32.xor - i32.and - i32.const 536870912 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 3 - call $~lib/rt/__visit_members - end - end - ) - (func $~lib/rt/pure/collectWhite (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1879048192 - i32.and - i32.const 536870912 - i32.eq - if (result i32) - local.get $1 - i32.const -2147483648 - i32.and - i32.eqz - else - i32.const 0 - end - if - local.get $0 - local.get $1 - i32.const 1879048192 - i32.const -1 - i32.xor - i32.and - i32.const 0 - i32.or - i32.store offset=4 - local.get $0 - i32.const 16 - i32.add - i32.const 5 - call $~lib/rt/__visit_members - local.get $0 - call $~lib/rt/pure/finalize - end - ) - (func $~lib/rt/pure/__collect - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - i32.const 0 - drop - global.get $~lib/rt/pure/ROOTS - local.set $0 - local.get $0 - local.set $1 - local.get $1 - local.set $2 - global.get $~lib/rt/pure/CUR - local.set $3 - loop $for-loop|0 - local.get $2 - local.get $3 - i32.lt_u - local.set $4 - local.get $4 - if - local.get $2 - i32.load - local.set $5 - local.get $5 - i32.load offset=4 - local.set $6 - local.get $6 - i32.const 1879048192 - i32.and - i32.const 805306368 - i32.eq - if (result i32) - local.get $6 - i32.const 268435455 - i32.and - i32.const 0 - i32.gt_u - else - i32.const 0 - end - if - local.get $5 - call $~lib/rt/pure/markGray - local.get $1 - local.get $5 - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - else - local.get $6 - i32.const 1879048192 - i32.and - i32.const 0 - i32.eq - if (result i32) - local.get $6 - i32.const 268435455 - i32.and - i32.eqz - else - i32.const 0 - end - if - local.get $5 - call $~lib/rt/pure/finalize - else - local.get $5 - local.get $6 - i32.const -2147483648 - i32.const -1 - i32.xor - i32.and - i32.store offset=4 - end - end - local.get $2 - i32.const 4 - i32.add - local.set $2 - br $for-loop|0 - end - end - local.get $1 - global.set $~lib/rt/pure/CUR - local.get $0 - local.set $3 - loop $for-loop|1 - local.get $3 - local.get $1 - i32.lt_u - local.set $2 - local.get $2 - if - local.get $3 - i32.load - call $~lib/rt/pure/scan - local.get $3 - i32.const 4 - i32.add - local.set $3 - br $for-loop|1 - end - end - local.get $0 - local.set $3 - loop $for-loop|2 - local.get $3 - local.get $1 - i32.lt_u - local.set $2 - local.get $2 - if - local.get $3 - i32.load - local.set $4 - local.get $4 - local.get $4 - i32.load offset=4 - i32.const -2147483648 - i32.const -1 - i32.xor - i32.and - i32.store offset=4 - local.get $4 - call $~lib/rt/pure/collectWhite - local.get $3 - i32.const 4 - i32.add - local.set $3 - br $for-loop|2 + end + loop $while-continue|4 + local.get $3 + i32.const 8 + i32.ge_u + local.set $6 + local.get $6 + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $while-continue|4 + end + end + end + loop $while-continue|5 + local.get $3 + local.set $6 + local.get $6 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $while-continue|5 + end + end end end - local.get $0 - global.set $~lib/rt/pure/CUR - ) - (func $~lib/rt/__typeinfo (param $0 i32) (result i32) - (local $1 i32) - global.get $~lib/rt/__rtti_base - local.set $1 - local.get $0 - local.get $1 - i32.load - i32.gt_u - if - i32.const 704 - i32.const 768 - i32.const 22 - i32.const 28 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 4 - i32.add - local.get $0 - i32.const 8 - i32.mul - i32.add - i32.load ) (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) (local $1 i32) @@ -4522,7 +3526,7 @@ i32.eqz if i32.const 0 - i32.const 32 + i32.const 144 i32.const 581 i32.const 3 call $~lib/builtins/abort @@ -4632,8 +3636,8 @@ i32.eqz if i32.const 0 - i32.const 144 - i32.const 133 + i32.const 256 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -4645,81 +3649,341 @@ local.get $0 i32.const 16 i32.add - i32.const 1 + i32.const 1 + call $~lib/rt/__visit_members + i32.const 0 + drop + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/finalize + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + i32.const 1 + drop + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 256 + i32.const 136 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + drop + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 32 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/markGray (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 call $~lib/rt/__visit_members - i32.const 0 - drop - local.get $1 - i32.const -2147483648 - i32.and - i32.eqz + local.get $0 + call $~lib/rt/pure/finalize + end + ) + (func $~lib/rt/pure/__collect + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 0 + drop + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + loop $for-loop|0 + local.get $2 + local.get $3 + i32.lt_u + local.set $4 + local.get $4 if - local.get $0 - call $~lib/rt/pure/finalize - else - local.get $0 - i32.const -2147483648 - i32.const 0 - i32.or - i32.const 0 - i32.or - i32.store offset=4 + local.get $2 + i32.load + local.set $5 + local.get $5 + i32.load offset=4 + local.set $6 + local.get $6 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $6 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $5 + call $~lib/rt/pure/markGray + local.get $1 + local.get $5 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $6 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $6 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $5 + call $~lib/rt/pure/finalize + else + local.get $5 + local.get $6 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $for-loop|0 end - else - i32.const 1 - drop + end + local.get $1 + global.set $~lib/rt/pure/CUR + local.get $0 + local.set $3 + loop $for-loop|1 + local.get $3 + local.get $1 + i32.lt_u + local.set $2 local.get $2 - i32.const 0 - i32.gt_u - i32.eqz if - i32.const 0 - i32.const 144 - i32.const 147 - i32.const 16 - call $~lib/builtins/abort - unreachable + local.get $3 + i32.load + call $~lib/rt/pure/scan + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $for-loop|1 end - i32.const 0 - drop - local.get $0 - i32.load offset=8 - call $~lib/rt/__typeinfo - i32.const 32 - i32.and - i32.eqz + end + local.get $0 + local.set $3 + loop $for-loop|2 + local.get $3 + local.get $1 + i32.lt_u + local.set $2 + local.get $2 if - local.get $0 - i32.const -2147483648 - i32.const 805306368 - i32.or - local.get $2 - i32.const 1 - i32.sub - i32.or - i32.store offset=4 - local.get $1 + local.get $3 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 i32.const -2147483648 - i32.and - i32.eqz - if - local.get $0 - call $~lib/rt/pure/appendRoot - end - else - local.get $0 - local.get $1 - i32.const 268435455 i32.const -1 i32.xor i32.and - local.get $2 - i32.const 1 - i32.sub - i32.or i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $for-loop|2 end end + local.get $0 + global.set $~lib/rt/pure/CUR ) (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) (local $2 i32) @@ -4782,7 +4046,7 @@ i32.eqz if i32.const 0 - i32.const 144 + i32.const 256 i32.const 79 i32.const 20 call $~lib/builtins/abort @@ -4821,7 +4085,7 @@ i32.eqz if i32.const 0 - i32.const 144 + i32.const 256 i32.const 90 i32.const 9 call $~lib/builtins/abort @@ -4853,7 +4117,7 @@ i32.eqz if i32.const 0 - i32.const 144 + i32.const 256 i32.const 101 i32.const 27 call $~lib/builtins/abort @@ -4861,74 +4125,9 @@ end end ) - (func $~lib/map/Map#__visit_impl (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $0 - i32.load - local.get $1 - call $~lib/rt/pure/__visit - local.get $0 - i32.load offset=8 - local.set $2 + (func $~lib/staticarray/StaticArray#__visit_impl (param $0 i32) (param $1 i32) i32.const 0 - if (result i32) - i32.const 1 - else - i32.const 1 - end drop - local.get $2 - local.set $3 - local.get $3 - local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $4 - loop $while-continue|0 - local.get $3 - local.get $4 - i32.lt_u - local.set $5 - local.get $5 - if - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - drop - i32.const 1 - drop - local.get $6 - i32.load offset=4 - local.set $7 - i32.const 0 - drop - local.get $7 - local.get $1 - call $~lib/rt/pure/__visit - end - local.get $3 - i32.const 12 - i32.add - local.set $3 - br $while-continue|0 - end - end - local.get $2 - local.get $1 - call $~lib/rt/pure/__visit ) (func $~lib/array/Array#__visit_impl (param $0 i32) (param $1 i32) i32.const 0 @@ -4941,15 +4140,15 @@ (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) (local $2 i32) block $switch$1$default - block $switch$1$case$7 - block $switch$1$case$6 + block $switch$1$case$6 + block $switch$1$case$5 block $switch$1$case$4 block $switch$1$case$2 local.get $0 i32.const 8 i32.sub i32.load - br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$4 $switch$1$case$6 $switch$1$case$7 $switch$1$case$4 $switch$1$case$4 $switch$1$default + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$6 $switch$1$case$4 $switch$1$case$4 $switch$1$default end return end @@ -4965,7 +4164,7 @@ end local.get $0 local.get $1 - call $~lib/map/Map#__visit_impl + call $~lib/staticarray/StaticArray#__visit_impl return end local.get $0 From c60a9502955e2980a13608a2c0ca64561001fe03 Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 16 May 2020 19:43:15 +0200 Subject: [PATCH 5/5] update fixtures --- tests/compiler/do.optimized.wat | 10 +++++----- tests/compiler/do.untouched.wat | 10 +++++----- tests/compiler/extends-baseaggregate.optimized.wat | 8 ++++---- tests/compiler/extends-baseaggregate.untouched.wat | 8 ++++---- tests/compiler/for.optimized.wat | 10 +++++----- tests/compiler/for.untouched.wat | 10 +++++----- tests/compiler/implicit-getter-setter.optimized.wat | 10 +++++----- tests/compiler/implicit-getter-setter.untouched.wat | 10 +++++----- tests/compiler/issues/1095.optimized.wat | 10 +++++----- tests/compiler/issues/1095.untouched.wat | 10 +++++----- tests/compiler/issues/1225.optimized.wat | 10 +++++----- tests/compiler/issues/1225.untouched.wat | 10 +++++----- tests/compiler/logical.optimized.wat | 10 +++++----- tests/compiler/logical.untouched.wat | 10 +++++----- tests/compiler/managed-cast.optimized.wat | 10 +++++----- tests/compiler/managed-cast.untouched.wat | 10 +++++----- tests/compiler/object-literal.optimized.wat | 10 +++++----- tests/compiler/object-literal.untouched.wat | 10 +++++----- tests/compiler/rc/global-init.untouched.wat | 10 +++++----- tests/compiler/rc/local-init.optimized.wat | 10 +++++----- tests/compiler/rc/local-init.untouched.wat | 10 +++++----- tests/compiler/rc/logical-and-mismatch.optimized.wat | 10 +++++----- tests/compiler/rc/logical-and-mismatch.untouched.wat | 10 +++++----- tests/compiler/rc/logical-or-mismatch.optimized.wat | 10 +++++----- tests/compiler/rc/logical-or-mismatch.untouched.wat | 10 +++++----- tests/compiler/rc/optimize.optimized.wat | 10 +++++----- tests/compiler/rc/optimize.untouched.wat | 10 +++++----- tests/compiler/rc/rereturn.optimized.wat | 10 +++++----- tests/compiler/rc/rereturn.untouched.wat | 10 +++++----- tests/compiler/rc/ternary-mismatch.optimized.wat | 10 +++++----- tests/compiler/rc/ternary-mismatch.untouched.wat | 10 +++++----- tests/compiler/resolve-ternary.optimized.wat | 10 +++++----- tests/compiler/resolve-ternary.untouched.wat | 10 +++++----- tests/compiler/retain-release-sanity.optimized.wat | 8 ++++---- tests/compiler/retain-release-sanity.untouched.wat | 8 ++++---- tests/compiler/retain-return.optimized.wat | 10 +++++----- tests/compiler/retain-return.untouched.wat | 10 +++++----- tests/compiler/runtime-full.optimized.wat | 10 +++++----- tests/compiler/runtime-full.untouched.wat | 10 +++++----- tests/compiler/std/array-literal.optimized.wat | 10 +++++----- tests/compiler/std/array-literal.untouched.wat | 10 +++++----- tests/compiler/std/array.optimized.wat | 10 +++++----- tests/compiler/std/array.untouched.wat | 10 +++++----- tests/compiler/std/arraybuffer.optimized.wat | 10 +++++----- tests/compiler/std/arraybuffer.untouched.wat | 10 +++++----- tests/compiler/std/dataview.optimized.wat | 10 +++++----- tests/compiler/std/dataview.untouched.wat | 10 +++++----- tests/compiler/std/map.optimized.wat | 10 +++++----- tests/compiler/std/map.untouched.wat | 10 +++++----- tests/compiler/std/set.optimized.wat | 10 +++++----- tests/compiler/std/set.untouched.wat | 10 +++++----- tests/compiler/std/staticarray.optimized.wat | 10 +++++----- tests/compiler/std/staticarray.untouched.wat | 10 +++++----- tests/compiler/std/string-casemapping.optimized.wat | 10 +++++----- tests/compiler/std/string-casemapping.untouched.wat | 10 +++++----- tests/compiler/std/string-encoding.optimized.wat | 10 +++++----- tests/compiler/std/string-encoding.untouched.wat | 10 +++++----- tests/compiler/std/string.optimized.wat | 10 +++++----- tests/compiler/std/string.untouched.wat | 10 +++++----- tests/compiler/std/typedarray.optimized.wat | 10 +++++----- tests/compiler/std/typedarray.untouched.wat | 10 +++++----- tests/compiler/throw.untouched.wat | 6 +++--- tests/compiler/while.optimized.wat | 10 +++++----- tests/compiler/while.untouched.wat | 10 +++++----- 64 files changed, 314 insertions(+), 314 deletions(-) diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index edae26e83f..d3ce08b230 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -1005,7 +1005,7 @@ if i32.const 0 i32.const 1184 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1024,7 +1024,7 @@ if i32.const 0 i32.const 1184 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1416,7 +1416,7 @@ if i32.const 0 i32.const 1184 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1458,7 +1458,7 @@ if i32.const 0 i32.const 1184 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1481,7 +1481,7 @@ if i32.const 0 i32.const 1184 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 6fa0fbdbdc..4ba3692148 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -1890,7 +1890,7 @@ if i32.const 0 i32.const 176 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1915,7 +1915,7 @@ if i32.const 0 i32.const 176 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -2328,7 +2328,7 @@ if i32.const 0 i32.const 176 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -2354,7 +2354,7 @@ if i32.const 0 i32.const 176 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -2371,7 +2371,7 @@ if i32.const 0 i32.const 176 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index 3b13e634b5..e0b0674624 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -1071,7 +1071,7 @@ if i32.const 0 i32.const 1248 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1088,7 +1088,7 @@ if i32.const 0 i32.const 1248 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1940,7 +1940,7 @@ if i32.const 0 i32.const 1248 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1973,7 +1973,7 @@ if i32.const 0 i32.const 1248 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index c4627f1d6f..38f5b817f3 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -1485,7 +1485,7 @@ if i32.const 0 i32.const 240 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1508,7 +1508,7 @@ if i32.const 0 i32.const 240 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -3745,7 +3745,7 @@ if i32.const 0 i32.const 240 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -3787,7 +3787,7 @@ if i32.const 0 i32.const 240 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index ff2ecef440..5ffcec178e 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -1002,7 +1002,7 @@ if i32.const 0 i32.const 1184 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1021,7 +1021,7 @@ if i32.const 0 i32.const 1184 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1425,7 +1425,7 @@ if i32.const 0 i32.const 1184 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1467,7 +1467,7 @@ if i32.const 0 i32.const 1184 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1490,7 +1490,7 @@ if i32.const 0 i32.const 1184 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 9fd67f9812..70b18169ff 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -1903,7 +1903,7 @@ if i32.const 0 i32.const 176 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1928,7 +1928,7 @@ if i32.const 0 i32.const 176 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -2373,7 +2373,7 @@ if i32.const 0 i32.const 176 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -2399,7 +2399,7 @@ if i32.const 0 i32.const 176 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -2416,7 +2416,7 @@ if i32.const 0 i32.const 176 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/implicit-getter-setter.optimized.wat b/tests/compiler/implicit-getter-setter.optimized.wat index 276560af3e..454a19e0c9 100644 --- a/tests/compiler/implicit-getter-setter.optimized.wat +++ b/tests/compiler/implicit-getter-setter.optimized.wat @@ -1075,7 +1075,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1094,7 +1094,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1198,7 +1198,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1240,7 +1240,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1263,7 +1263,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/implicit-getter-setter.untouched.wat b/tests/compiler/implicit-getter-setter.untouched.wat index 351ac3f0f5..8074e7f460 100644 --- a/tests/compiler/implicit-getter-setter.untouched.wat +++ b/tests/compiler/implicit-getter-setter.untouched.wat @@ -1491,7 +1491,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1516,7 +1516,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1668,7 +1668,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1694,7 +1694,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1711,7 +1711,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index d0212f9e55..555c78f813 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -916,7 +916,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -935,7 +935,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1057,7 +1057,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1080,7 +1080,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1095.untouched.wat b/tests/compiler/issues/1095.untouched.wat index 33067580db..69356e6ffa 100644 --- a/tests/compiler/issues/1095.untouched.wat +++ b/tests/compiler/issues/1095.untouched.wat @@ -1477,7 +1477,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1502,7 +1502,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1652,7 +1652,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1678,7 +1678,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1695,7 +1695,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1225.optimized.wat b/tests/compiler/issues/1225.optimized.wat index 3d25bb4c77..271e518e90 100644 --- a/tests/compiler/issues/1225.optimized.wat +++ b/tests/compiler/issues/1225.optimized.wat @@ -931,7 +931,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -950,7 +950,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1032,7 +1032,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1074,7 +1074,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1097,7 +1097,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1225.untouched.wat b/tests/compiler/issues/1225.untouched.wat index ac697d9cb1..52e7dc1158 100644 --- a/tests/compiler/issues/1225.untouched.wat +++ b/tests/compiler/issues/1225.untouched.wat @@ -1479,7 +1479,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1504,7 +1504,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1673,7 +1673,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1699,7 +1699,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1716,7 +1716,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index fcae5223a0..dfcf05fc2e 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -920,7 +920,7 @@ if i32.const 0 i32.const 1200 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -939,7 +939,7 @@ if i32.const 0 i32.const 1200 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1016,7 +1016,7 @@ if i32.const 0 i32.const 1200 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1058,7 +1058,7 @@ if i32.const 0 i32.const 1200 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1081,7 +1081,7 @@ if i32.const 0 i32.const 1200 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/logical.untouched.wat b/tests/compiler/logical.untouched.wat index 30b134da7f..dd56298c72 100644 --- a/tests/compiler/logical.untouched.wat +++ b/tests/compiler/logical.untouched.wat @@ -1501,7 +1501,7 @@ if i32.const 0 i32.const 192 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1526,7 +1526,7 @@ if i32.const 0 i32.const 192 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -2203,7 +2203,7 @@ if i32.const 0 i32.const 192 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -2229,7 +2229,7 @@ if i32.const 0 i32.const 192 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -2246,7 +2246,7 @@ if i32.const 0 i32.const 192 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 07d57d1890..0ed2b2c8b5 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -924,7 +924,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -943,7 +943,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1133,7 +1133,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1175,7 +1175,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1198,7 +1198,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index ff6b34b0a1..819a059fba 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -1479,7 +1479,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1504,7 +1504,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1916,7 +1916,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1942,7 +1942,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1959,7 +1959,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index d08e377a79..e7c00c0c50 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -1067,7 +1067,7 @@ if i32.const 0 i32.const 1200 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1086,7 +1086,7 @@ if i32.const 0 i32.const 1200 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -2127,7 +2127,7 @@ if i32.const 0 i32.const 1200 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -2146,7 +2146,7 @@ if i32.const 0 i32.const 1200 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -2161,7 +2161,7 @@ if i32.const 0 i32.const 1200 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat index d427d778a5..a8a39b0dda 100644 --- a/tests/compiler/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -1485,7 +1485,7 @@ if i32.const 0 i32.const 192 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1510,7 +1510,7 @@ if i32.const 0 i32.const 192 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -3946,7 +3946,7 @@ if i32.const 0 i32.const 192 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -3972,7 +3972,7 @@ if i32.const 0 i32.const 192 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -3989,7 +3989,7 @@ if i32.const 0 i32.const 192 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/global-init.untouched.wat b/tests/compiler/rc/global-init.untouched.wat index b6a2f91c0b..bcb9c93bde 100644 --- a/tests/compiler/rc/global-init.untouched.wat +++ b/tests/compiler/rc/global-init.untouched.wat @@ -45,7 +45,7 @@ if i32.const 0 i32.const 48 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -70,7 +70,7 @@ if i32.const 0 i32.const 48 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -766,7 +766,7 @@ if i32.const 0 i32.const 48 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -792,7 +792,7 @@ if i32.const 0 i32.const 48 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -809,7 +809,7 @@ if i32.const 0 i32.const 48 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat index 134631395a..c49de915d2 100644 --- a/tests/compiler/rc/local-init.optimized.wat +++ b/tests/compiler/rc/local-init.optimized.wat @@ -920,7 +920,7 @@ if i32.const 0 i32.const 1168 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -939,7 +939,7 @@ if i32.const 0 i32.const 1168 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -973,7 +973,7 @@ if i32.const 0 i32.const 1168 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 1168 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1038,7 +1038,7 @@ if i32.const 0 i32.const 1168 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.untouched.wat b/tests/compiler/rc/local-init.untouched.wat index 9b625868ab..4c5c5cecdd 100644 --- a/tests/compiler/rc/local-init.untouched.wat +++ b/tests/compiler/rc/local-init.untouched.wat @@ -1490,7 +1490,7 @@ if i32.const 0 i32.const 160 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1515,7 +1515,7 @@ if i32.const 0 i32.const 160 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1614,7 +1614,7 @@ if i32.const 0 i32.const 160 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1640,7 +1640,7 @@ if i32.const 0 i32.const 160 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1657,7 +1657,7 @@ if i32.const 0 i32.const 160 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat index 1d55017c03..6a906a7a83 100644 --- a/tests/compiler/rc/logical-and-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -915,7 +915,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -934,7 +934,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1057,7 +1057,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1080,7 +1080,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.untouched.wat b/tests/compiler/rc/logical-and-mismatch.untouched.wat index 6719fcbbd2..9047c17834 100644 --- a/tests/compiler/rc/logical-and-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-and-mismatch.untouched.wat @@ -1476,7 +1476,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1501,7 +1501,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1659,7 +1659,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1685,7 +1685,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1702,7 +1702,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat index d493664657..946c55476b 100644 --- a/tests/compiler/rc/logical-or-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -915,7 +915,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -934,7 +934,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1017,7 +1017,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1082,7 +1082,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.untouched.wat b/tests/compiler/rc/logical-or-mismatch.untouched.wat index 79c806abfa..1992299e68 100644 --- a/tests/compiler/rc/logical-or-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-or-mismatch.untouched.wat @@ -1476,7 +1476,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1501,7 +1501,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1659,7 +1659,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1685,7 +1685,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1702,7 +1702,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index 78d8b84124..adad34ed33 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -83,7 +83,7 @@ if i32.const 0 i32.const 1040 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -102,7 +102,7 @@ if i32.const 0 i32.const 1040 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1068,7 +1068,7 @@ if i32.const 0 i32.const 1040 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1110,7 +1110,7 @@ if i32.const 0 i32.const 1040 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1133,7 +1133,7 @@ if i32.const 0 i32.const 1040 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.untouched.wat b/tests/compiler/rc/optimize.untouched.wat index 904bba43ff..adac094c22 100644 --- a/tests/compiler/rc/optimize.untouched.wat +++ b/tests/compiler/rc/optimize.untouched.wat @@ -86,7 +86,7 @@ if i32.const 0 i32.const 32 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -111,7 +111,7 @@ if i32.const 0 i32.const 32 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1911,7 +1911,7 @@ if i32.const 0 i32.const 32 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1937,7 +1937,7 @@ if i32.const 0 i32.const 32 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1954,7 +1954,7 @@ if i32.const 0 i32.const 32 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat index 245f1ef8e9..160b6e5eb6 100644 --- a/tests/compiler/rc/rereturn.optimized.wat +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1076,7 +1076,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1114,7 +1114,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1156,7 +1156,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1177,7 +1177,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.untouched.wat b/tests/compiler/rc/rereturn.untouched.wat index bfafff6e1f..6e8fcd49cc 100644 --- a/tests/compiler/rc/rereturn.untouched.wat +++ b/tests/compiler/rc/rereturn.untouched.wat @@ -1476,7 +1476,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1499,7 +1499,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1605,7 +1605,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1631,7 +1631,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1648,7 +1648,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat index f9d9be082a..ae587c4e1a 100644 --- a/tests/compiler/rc/ternary-mismatch.optimized.wat +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -917,7 +917,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -936,7 +936,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1016,7 +1016,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1058,7 +1058,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1081,7 +1081,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.untouched.wat b/tests/compiler/rc/ternary-mismatch.untouched.wat index 76d51d90f0..a0a89202e2 100644 --- a/tests/compiler/rc/ternary-mismatch.untouched.wat +++ b/tests/compiler/rc/ternary-mismatch.untouched.wat @@ -1478,7 +1478,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1503,7 +1503,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1643,7 +1643,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1669,7 +1669,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1686,7 +1686,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index 85c47143b4..5c12ab7b25 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -1076,7 +1076,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1093,7 +1093,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -2437,7 +2437,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -2479,7 +2479,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -2494,7 +2494,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index ab9faa7e7a..865361be0d 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -1506,7 +1506,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1529,7 +1529,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -4956,7 +4956,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -4982,7 +4982,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -4999,7 +4999,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 44790b3fc6..e3b306b5ff 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -1248,7 +1248,7 @@ if i32.const 0 i32.const 1248 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1267,7 +1267,7 @@ if i32.const 0 i32.const 1248 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -2140,7 +2140,7 @@ if i32.const 0 i32.const 1248 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -2173,7 +2173,7 @@ if i32.const 0 i32.const 1248 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.untouched.wat b/tests/compiler/retain-release-sanity.untouched.wat index f5902c738e..a2f9ce9a3e 100644 --- a/tests/compiler/retain-release-sanity.untouched.wat +++ b/tests/compiler/retain-release-sanity.untouched.wat @@ -1716,7 +1716,7 @@ if i32.const 0 i32.const 240 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1741,7 +1741,7 @@ if i32.const 0 i32.const 240 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -4107,7 +4107,7 @@ if i32.const 0 i32.const 240 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -4149,7 +4149,7 @@ if i32.const 0 i32.const 240 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.optimized.wat b/tests/compiler/retain-return.optimized.wat index d1b233a99a..b19a070365 100644 --- a/tests/compiler/retain-return.optimized.wat +++ b/tests/compiler/retain-return.optimized.wat @@ -910,7 +910,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -927,7 +927,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1009,7 +1009,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1051,7 +1051,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1072,7 +1072,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.untouched.wat b/tests/compiler/retain-return.untouched.wat index 5a6309530c..072fb06768 100644 --- a/tests/compiler/retain-return.untouched.wat +++ b/tests/compiler/retain-return.untouched.wat @@ -1479,7 +1479,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1502,7 +1502,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1743,7 +1743,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1769,7 +1769,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1786,7 +1786,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index 6df4ed0d91..fa32ef6903 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 1152 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1076,7 +1076,7 @@ if i32.const 0 i32.const 1152 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1114,7 +1114,7 @@ if i32.const 0 i32.const 1152 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1156,7 +1156,7 @@ if i32.const 0 i32.const 1152 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1177,7 +1177,7 @@ if i32.const 0 i32.const 1152 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/runtime-full.untouched.wat b/tests/compiler/runtime-full.untouched.wat index 850055e702..23b59efce8 100644 --- a/tests/compiler/runtime-full.untouched.wat +++ b/tests/compiler/runtime-full.untouched.wat @@ -1475,7 +1475,7 @@ if i32.const 0 i32.const 144 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1498,7 +1498,7 @@ if i32.const 0 i32.const 144 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1578,7 +1578,7 @@ if i32.const 0 i32.const 144 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1604,7 +1604,7 @@ if i32.const 0 i32.const 144 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1621,7 +1621,7 @@ if i32.const 0 i32.const 144 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index d159810ce1..ddd2247e86 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1113,7 +1113,7 @@ if i32.const 0 i32.const 1504 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1132,7 +1132,7 @@ if i32.const 0 i32.const 1504 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1562,7 +1562,7 @@ if i32.const 0 i32.const 1504 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1622,7 +1622,7 @@ if i32.const 0 i32.const 1504 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1645,7 +1645,7 @@ if i32.const 0 i32.const 1504 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 98e91c6015..8249707688 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -2835,7 +2835,7 @@ if i32.const 0 i32.const 496 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -2860,7 +2860,7 @@ if i32.const 0 i32.const 496 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -3418,7 +3418,7 @@ if i32.const 0 i32.const 496 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -3444,7 +3444,7 @@ if i32.const 0 i32.const 496 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -3461,7 +3461,7 @@ if i32.const 0 i32.const 496 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 935b2eae97..8cfc0be17b 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -1478,7 +1478,7 @@ if i32.const 0 i32.const 1248 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1497,7 +1497,7 @@ if i32.const 0 i32.const 1248 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -16168,7 +16168,7 @@ if i32.const 0 i32.const 1248 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -16242,7 +16242,7 @@ if i32.const 0 i32.const 1248 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -16257,7 +16257,7 @@ if i32.const 0 i32.const 1248 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 502e0d0605..676ecf4438 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -1934,7 +1934,7 @@ if i32.const 0 i32.const 240 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1959,7 +1959,7 @@ if i32.const 0 i32.const 240 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -25046,7 +25046,7 @@ if i32.const 0 i32.const 240 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -25072,7 +25072,7 @@ if i32.const 0 i32.const 240 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -25089,7 +25089,7 @@ if i32.const 0 i32.const 240 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 42f5c1f778..7b293d62ad 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -1233,7 +1233,7 @@ if i32.const 0 i32.const 1264 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1252,7 +1252,7 @@ if i32.const 0 i32.const 1264 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1919,7 +1919,7 @@ if i32.const 0 i32.const 1264 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1960,7 +1960,7 @@ if i32.const 0 i32.const 1264 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1983,7 +1983,7 @@ if i32.const 0 i32.const 1264 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 5b6aebd3ce..18d1314edc 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -1707,7 +1707,7 @@ if i32.const 0 i32.const 256 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1732,7 +1732,7 @@ if i32.const 0 i32.const 256 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -4112,7 +4112,7 @@ if i32.const 0 i32.const 256 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -4138,7 +4138,7 @@ if i32.const 0 i32.const 256 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -4155,7 +4155,7 @@ if i32.const 0 i32.const 256 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 43433f0662..0dc4eb871c 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -1083,7 +1083,7 @@ if i32.const 0 i32.const 1264 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1102,7 +1102,7 @@ if i32.const 0 i32.const 1264 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -3440,7 +3440,7 @@ if i32.const 0 i32.const 1264 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -3482,7 +3482,7 @@ if i32.const 0 i32.const 1264 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -3505,7 +3505,7 @@ if i32.const 0 i32.const 1264 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index c02090efa6..8581adb76a 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -1715,7 +1715,7 @@ if i32.const 0 i32.const 256 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1740,7 +1740,7 @@ if i32.const 0 i32.const 256 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -4587,7 +4587,7 @@ if i32.const 0 i32.const 256 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -4613,7 +4613,7 @@ if i32.const 0 i32.const 256 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -4630,7 +4630,7 @@ if i32.const 0 i32.const 256 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 4caf36abdc..fb5b50733e 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1255,7 +1255,7 @@ if i32.const 0 i32.const 1264 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1274,7 +1274,7 @@ if i32.const 0 i32.const 1264 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -13058,7 +13058,7 @@ if i32.const 0 i32.const 1264 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -13107,7 +13107,7 @@ if i32.const 0 i32.const 1264 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -13122,7 +13122,7 @@ if i32.const 0 i32.const 1264 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 633d863a49..8a09e76627 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -1724,7 +1724,7 @@ if i32.const 0 i32.const 256 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1749,7 +1749,7 @@ if i32.const 0 i32.const 256 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -21078,7 +21078,7 @@ if i32.const 0 i32.const 256 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -21104,7 +21104,7 @@ if i32.const 0 i32.const 256 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -21121,7 +21121,7 @@ if i32.const 0 i32.const 256 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index e49fe3cc49..d466d43d4e 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1252,7 +1252,7 @@ if i32.const 0 i32.const 1264 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1271,7 +1271,7 @@ if i32.const 0 i32.const 1264 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -9392,7 +9392,7 @@ if i32.const 0 i32.const 1264 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -9441,7 +9441,7 @@ if i32.const 0 i32.const 1264 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -9456,7 +9456,7 @@ if i32.const 0 i32.const 1264 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 720a163c22..1a14648c53 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -1719,7 +1719,7 @@ if i32.const 0 i32.const 256 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1744,7 +1744,7 @@ if i32.const 0 i32.const 256 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -14617,7 +14617,7 @@ if i32.const 0 i32.const 256 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -14643,7 +14643,7 @@ if i32.const 0 i32.const 256 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -14660,7 +14660,7 @@ if i32.const 0 i32.const 256 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index 1c22ec1af9..ec97281e2d 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -1300,7 +1300,7 @@ if i32.const 0 i32.const 1440 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1319,7 +1319,7 @@ if i32.const 0 i32.const 1440 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1581,7 +1581,7 @@ if i32.const 0 i32.const 1440 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1649,7 +1649,7 @@ if i32.const 0 i32.const 1440 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1672,7 +1672,7 @@ if i32.const 0 i32.const 1440 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.untouched.wat b/tests/compiler/std/staticarray.untouched.wat index f1dc9b9467..c975b65418 100644 --- a/tests/compiler/std/staticarray.untouched.wat +++ b/tests/compiler/std/staticarray.untouched.wat @@ -2825,7 +2825,7 @@ if i32.const 0 i32.const 432 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -2850,7 +2850,7 @@ if i32.const 0 i32.const 432 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -3197,7 +3197,7 @@ if i32.const 0 i32.const 432 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -3223,7 +3223,7 @@ if i32.const 0 i32.const 432 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -3240,7 +3240,7 @@ if i32.const 0 i32.const 432 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index d64371ad56..25640a67c8 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -337,7 +337,7 @@ if i32.const 0 i32.const 1056 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -356,7 +356,7 @@ if i32.const 0 i32.const 1056 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -4845,7 +4845,7 @@ if i32.const 0 i32.const 1056 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -4887,7 +4887,7 @@ if i32.const 0 i32.const 1056 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -4902,7 +4902,7 @@ if i32.const 0 i32.const 1056 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-casemapping.untouched.wat b/tests/compiler/std/string-casemapping.untouched.wat index ff335206b4..84265d9f4f 100644 --- a/tests/compiler/std/string-casemapping.untouched.wat +++ b/tests/compiler/std/string-casemapping.untouched.wat @@ -234,7 +234,7 @@ if i32.const 0 i32.const 48 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -259,7 +259,7 @@ if i32.const 0 i32.const 48 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -6944,7 +6944,7 @@ if i32.const 0 i32.const 48 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -6970,7 +6970,7 @@ if i32.const 0 i32.const 48 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -6987,7 +6987,7 @@ if i32.const 0 i32.const 48 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index fea87f522c..0e16ace529 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -59,7 +59,7 @@ if i32.const 0 i32.const 1072 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -78,7 +78,7 @@ if i32.const 0 i32.const 1072 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -3163,7 +3163,7 @@ if i32.const 0 i32.const 1072 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -3205,7 +3205,7 @@ if i32.const 0 i32.const 1072 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -3220,7 +3220,7 @@ if i32.const 0 i32.const 1072 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index 96900383c6..9ebfbcd5af 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -65,7 +65,7 @@ if i32.const 0 i32.const 64 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -90,7 +90,7 @@ if i32.const 0 i32.const 64 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -5063,7 +5063,7 @@ if i32.const 0 i32.const 64 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -5089,7 +5089,7 @@ if i32.const 0 i32.const 64 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -5106,7 +5106,7 @@ if i32.const 0 i32.const 64 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 1cda6900c3..05421d9639 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -408,7 +408,7 @@ if i32.const 0 i32.const 1168 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -427,7 +427,7 @@ if i32.const 0 i32.const 1168 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -14242,7 +14242,7 @@ if i32.const 0 i32.const 1168 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -14317,7 +14317,7 @@ if i32.const 0 i32.const 1168 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -14332,7 +14332,7 @@ if i32.const 0 i32.const 1168 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 0695c238d2..b927c901ab 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -428,7 +428,7 @@ if i32.const 0 i32.const 160 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -453,7 +453,7 @@ if i32.const 0 i32.const 160 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -18646,7 +18646,7 @@ if i32.const 0 i32.const 160 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -18672,7 +18672,7 @@ if i32.const 0 i32.const 160 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -18689,7 +18689,7 @@ if i32.const 0 i32.const 160 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index b1f37fe25e..4ec3ad891f 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -1432,7 +1432,7 @@ if i32.const 0 i32.const 1264 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1451,7 +1451,7 @@ if i32.const 0 i32.const 1264 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -32187,7 +32187,7 @@ if i32.const 0 i32.const 1264 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -32227,7 +32227,7 @@ if i32.const 0 i32.const 1264 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -32242,7 +32242,7 @@ if i32.const 0 i32.const 1264 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index b28a0a2483..32b0132fa2 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -1898,7 +1898,7 @@ if i32.const 0 i32.const 256 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1923,7 +1923,7 @@ if i32.const 0 i32.const 256 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -55801,7 +55801,7 @@ if i32.const 0 i32.const 256 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -55827,7 +55827,7 @@ if i32.const 0 i32.const 256 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -55844,7 +55844,7 @@ if i32.const 0 i32.const 256 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/throw.untouched.wat b/tests/compiler/throw.untouched.wat index cc0d165d71..383394d55d 100644 --- a/tests/compiler/throw.untouched.wat +++ b/tests/compiler/throw.untouched.wat @@ -759,7 +759,7 @@ if i32.const 0 i32.const 352 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -785,7 +785,7 @@ if i32.const 0 i32.const 352 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -802,7 +802,7 @@ if i32.const 0 i32.const 352 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index fb0fb242dc..9a365e4cff 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -1010,7 +1010,7 @@ if i32.const 0 i32.const 1184 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1029,7 +1029,7 @@ if i32.const 0 i32.const 1184 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -1474,7 +1474,7 @@ if i32.const 0 i32.const 1184 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -1516,7 +1516,7 @@ if i32.const 0 i32.const 1184 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -1539,7 +1539,7 @@ if i32.const 0 i32.const 1184 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 88f8ae0192..9601138127 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -1932,7 +1932,7 @@ if i32.const 0 i32.const 176 - i32.const 120 + i32.const 109 i32.const 3 call $~lib/builtins/abort unreachable @@ -1957,7 +1957,7 @@ if i32.const 0 i32.const 176 - i32.const 123 + i32.const 112 i32.const 14 call $~lib/builtins/abort unreachable @@ -2462,7 +2462,7 @@ if i32.const 0 i32.const 176 - i32.const 133 + i32.const 122 i32.const 14 call $~lib/builtins/abort unreachable @@ -2488,7 +2488,7 @@ if i32.const 0 i32.const 176 - i32.const 137 + i32.const 126 i32.const 18 call $~lib/builtins/abort unreachable @@ -2505,7 +2505,7 @@ if i32.const 0 i32.const 176 - i32.const 147 + i32.const 136 i32.const 16 call $~lib/builtins/abort unreachable