diff --git a/cli/asc.js b/cli/asc.js index 6796f10866..2fbec18afd 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -426,9 +426,15 @@ exports.main = function main(argv, options, callback) { } // Set up options - var program; + var program, runtime; const compilerOptions = __pin(assemblyscript.newOptions()); + switch (opts.runtime) { + case "stub": runtime = 0; break; + case "minimal": runtime = 1; break; + default: runtime = 2; break; + } assemblyscript.setTarget(compilerOptions, 0); + assemblyscript.setRuntime(compilerOptions, runtime); assemblyscript.setNoAssert(compilerOptions, opts.noAssert); assemblyscript.setExportMemory(compilerOptions, !opts.noExportMemory); assemblyscript.setImportMemory(compilerOptions, opts.importMemory); diff --git a/src/common.ts b/src/common.ts index 54ccd742b2..10ef6265de 100644 --- a/src/common.ts +++ b/src/common.ts @@ -158,7 +158,7 @@ export namespace CommonNames { export const constructor = "constructor"; // constants export const ASC_TARGET = "ASC_TARGET"; - export const ASC_NO_TREESHAKING = "ASC_NO_TREESHAKING"; + export const ASC_RUNTIME = "ASC_RUNTIME"; export const ASC_NO_ASSERT = "ASC_NO_ASSERT"; export const ASC_MEMORY_BASE = "ASC_MEMORY_BASE"; export const ASC_TABLE_BASE = "ASC_TABLE_BASE"; @@ -256,4 +256,5 @@ export namespace CommonNames { // shared export { Feature, featureToString } from "../std/assembly/shared/feature"; export { Target } from "../std/assembly/shared/target"; +export { Runtime } from "../std/assembly/shared/runtime"; export { Typeinfo, TypeinfoFlags } from "../std/assembly/shared/typeinfo"; diff --git a/src/compiler.ts b/src/compiler.ts index 9ad5925ab3..a4c10db782 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -64,6 +64,7 @@ import { CommonNames, Feature, Target, + Runtime, featureToString } from "./common"; @@ -212,6 +213,8 @@ export class Options { /** WebAssembly target. Defaults to {@link Target.WASM32}. */ target: Target = Target.WASM32; + /** Runtime type. Defaults to Incremental GC. */ + runtime: Runtime = Runtime.Incremental; /** If true, replaces assertions with nops. */ noAssert: bool = false; /** It true, exports the memory to the embedder. */ diff --git a/src/index.ts b/src/index.ts index 526444eade..560ca8fd5c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,7 +33,7 @@ * When compiling to WebAssembly `glue/wasm/index.ts` must be included. */ -import { Target, Feature } from "./common"; +import { Target, Runtime, Feature } from "./common"; import { Compiler, Options } from "./compiler"; import { IDLBuilder, TSDBuilder } from "./definitions"; import { DiagnosticMessage, DiagnosticCategory, formatDiagnosticMessage } from "./diagnostics"; @@ -52,6 +52,10 @@ export function setTarget(options: Options, target: Target): void { options.target = target; } +export function setRuntime(options: Options, runtime: Runtime): void { + options.runtime = runtime; +} + /** Sets the `noAssert` option. */ export function setNoAssert(options: Options, noAssert: bool): void { options.noAssert = noAssert; diff --git a/src/program.ts b/src/program.ts index 7fa8f417d0..8df389b4b4 100644 --- a/src/program.ts +++ b/src/program.ts @@ -1013,6 +1013,8 @@ export class Program extends DiagnosticEmitter { // register compiler hints this.registerConstantInteger(CommonNames.ASC_TARGET, Type.i32, i64_new(options.isWasm64 ? Target.WASM64 : Target.WASM32)); + this.registerConstantInteger(CommonNames.ASC_RUNTIME, Type.i32, + i64_new(options.runtime)); this.registerConstantInteger(CommonNames.ASC_NO_ASSERT, Type.bool, i64_new(options.noAssert ? 1 : 0, 0)); this.registerConstantInteger(CommonNames.ASC_MEMORY_BASE, Type.i32, diff --git a/std/assembly/array.ts b/std/assembly/array.ts index b373436a61..9bcdacdf12 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -1,6 +1,7 @@ /// import { BLOCK_MAXSIZE } from "./rt/common"; +import { Runtime } from "shared/runtime"; import { COMPARATOR, SORT } from "./util/sort"; import { REVERSE } from "./util/bytes"; import { joinBooleanArray, joinIntegerArray, joinFloatArray, joinStringArray, joinReferenceArray } from "./util/string"; @@ -22,7 +23,11 @@ function ensureCapacity(array: usize, newSize: usize, alignLog2: u32, canGrow: b let newCapacity = max(newSize, MIN_SIZE) << alignLog2; if (canGrow) newCapacity = max(min(oldCapacity << 1, BLOCK_MAXSIZE), newCapacity); let newData = __renew(oldData, newCapacity); - memory.fill(newData + oldCapacity, 0, newCapacity - oldCapacity); + // __new / __renew already init memory range as zeros in Incremental runtime. + // So try to avoid this. + if (ASC_RUNTIME != Runtime.Incremental) { + memory.fill(newData + oldCapacity, 0, newCapacity - oldCapacity); + } if (newData !== oldData) { // oldData has been free'd store(array, newData, offsetof("buffer")); store(array, newData, offsetof("dataStart")); @@ -66,7 +71,9 @@ export class Array { // reserve capacity for at least MIN_SIZE elements var bufferSize = max(length, MIN_SIZE) << alignof(); var buffer = changetype(__new(bufferSize, idof())); - memory.fill(changetype(buffer), 0, bufferSize); + if (ASC_RUNTIME != Runtime.Incremental) { + memory.fill(changetype(buffer), 0, bufferSize); + } this.buffer = buffer; // links this.dataStart = changetype(buffer); this.byteLength = bufferSize; diff --git a/std/assembly/arraybuffer.ts b/std/assembly/arraybuffer.ts index d1173c9799..18479ade6c 100644 --- a/std/assembly/arraybuffer.ts +++ b/std/assembly/arraybuffer.ts @@ -1,6 +1,7 @@ /// import { OBJECT, BLOCK_MAXSIZE, TOTAL_OVERHEAD } from "./rt/common"; +import { Runtime } from "shared/runtime"; import { idof } from "./builtins"; import { E_INVALIDLENGTH } from "./util/error"; @@ -17,7 +18,9 @@ export abstract class ArrayBufferView { protected constructor(length: i32, alignLog2: i32) { if (length > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH); var buffer = changetype(__new(length = length << alignLog2, idof())); - memory.fill(changetype(buffer), 0, length); + if (ASC_RUNTIME != Runtime.Incremental) { + memory.fill(changetype(buffer), 0, length); + } this.buffer = buffer; // links this.dataStart = changetype(buffer); this.byteLength = length; @@ -48,7 +51,9 @@ export abstract class ArrayBufferView { constructor(length: i32) { if (length > BLOCK_MAXSIZE) throw new RangeError(E_INVALIDLENGTH); var buffer = changetype(__new(length, idof())); - memory.fill(changetype(buffer), 0, length); + if (ASC_RUNTIME != Runtime.Incremental) { + memory.fill(changetype(buffer), 0, length); + } return buffer; } diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 1f093996e7..14a808bea5 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -52,6 +52,8 @@ declare type dataref = object | null; /** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */ declare const ASC_TARGET: i32; +/** Runtime type. 0 = Stub, 1 = Minimal, 2 = Incremental. */ +declare const ASC_RUNTIME: i32; /** Provided noAssert option. */ declare const ASC_NO_ASSERT: bool; /** Provided memoryBase option. */ diff --git a/std/assembly/shared/runtime.ts b/std/assembly/shared/runtime.ts new file mode 100644 index 0000000000..4092e20961 --- /dev/null +++ b/std/assembly/shared/runtime.ts @@ -0,0 +1,11 @@ +// This file is shared with the compiler and must remain portable + +/** Runtime types. */ +export enum Runtime { + /** Simple bump allocator without GC. */ + Stub = 0, + /** Stop the world semi-automatic GC. */ + Minimal = 1, + /** incremental GC. */ + Incremental = 2, +} diff --git a/std/assembly/staticarray.ts b/std/assembly/staticarray.ts index e08009ee3c..f242c7147f 100644 --- a/std/assembly/staticarray.ts +++ b/std/assembly/staticarray.ts @@ -1,6 +1,7 @@ /// import { OBJECT, BLOCK_MAXSIZE, TOTAL_OVERHEAD } from "./rt/common"; +import { Runtime } from "shared/runtime"; import { COMPARATOR, SORT } from "./util/sort"; import { REVERSE } from "./util/bytes"; import { idof } from "./builtins"; @@ -90,7 +91,9 @@ export class StaticArray { if (length > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH); var outSize = length << alignof(); var out = changetype>(__new(outSize, idof>())); - memory.fill(changetype(out), 0, outSize); + if (ASC_RUNTIME != Runtime.Incremental) { + memory.fill(changetype(out), 0, outSize); + } return out; } diff --git a/std/portable/index.d.ts b/std/portable/index.d.ts index d7114e9140..6b09b77cee 100644 --- a/std/portable/index.d.ts +++ b/std/portable/index.d.ts @@ -35,6 +35,8 @@ declare type valueof = T[0]; /** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */ declare const ASC_TARGET: i32; +/** Runtime type. 0 = Stub, 1 = Minimal, 2 = Incremental. */ +declare const ASC_RUNTIME: i32; /** Provided noAssert option. */ declare const ASC_NO_ASSERT: bool; /** Provided memoryBase option. */ diff --git a/std/portable/index.js b/std/portable/index.js index 2400d61746..01165dd358 100644 --- a/std/portable/index.js +++ b/std/portable/index.js @@ -4,6 +4,7 @@ var globalScope = typeof window !== "undefined" && window || typeof global !== " if (typeof globalScope.ASC_TARGET === "undefined") { globalScope.ASC_TARGET = 0; // Target.JS + globalScope.ASC_RUNTIME = 0; // Runtime.Stub globalScope.ASC_NO_ASSERT = false; globalScope.ASC_MEMORY_BASE = 0; globalScope.ASC_OPTIMIZE_LEVEL = 3; diff --git a/tests/compiler/NonNullable.untouched.wat b/tests/compiler/NonNullable.untouched.wat index ddf742b16d..5678a98ff6 100644 --- a/tests/compiler/NonNullable.untouched.wat +++ b/tests/compiler/NonNullable.untouched.wat @@ -6,6 +6,9 @@ (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $NonNullable/z (mut i32) (i32.const 224)) (global $~lib/memory/__data_end i32 (i32.const 300)) diff --git a/tests/compiler/asc-constants.ts b/tests/compiler/asc-constants.ts index 0614110be0..34716332ba 100644 --- a/tests/compiler/asc-constants.ts +++ b/tests/compiler/asc-constants.ts @@ -1,4 +1,5 @@ ASC_TARGET; +ASC_RUNTIME; ASC_NO_ASSERT; ASC_MEMORY_BASE; ASC_OPTIMIZE_LEVEL; diff --git a/tests/compiler/asc-constants.untouched.wat b/tests/compiler/asc-constants.untouched.wat index 0fc4903e56..be45b662f8 100644 --- a/tests/compiler/asc-constants.untouched.wat +++ b/tests/compiler/asc-constants.untouched.wat @@ -1,6 +1,7 @@ (module (type $none_=>_none (func)) (global $~lib/ASC_TARGET i32 (i32.const 1)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) (global $~lib/ASC_MEMORY_BASE i32 (i32.const 0)) (global $~lib/ASC_OPTIMIZE_LEVEL i32 (i32.const 0)) @@ -28,6 +29,8 @@ (func $start:asc-constants i32.const 1 drop + i32.const 2 + drop i32.const 0 drop i32.const 0 diff --git a/tests/compiler/assert-nonnull.optimized.wat b/tests/compiler/assert-nonnull.optimized.wat index a40dd66179..ded72ad821 100644 --- a/tests/compiler/assert-nonnull.optimized.wat +++ b/tests/compiler/assert-nonnull.optimized.wat @@ -55,7 +55,7 @@ if i32.const 1184 i32.const 1248 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -261,7 +261,7 @@ if i32.const 1184 i32.const 1248 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -277,7 +277,7 @@ if i32.const 1296 i32.const 1248 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/assert-nonnull.untouched.wat b/tests/compiler/assert-nonnull.untouched.wat index 54d53ba3f5..62c0a38401 100644 --- a/tests/compiler/assert-nonnull.untouched.wat +++ b/tests/compiler/assert-nonnull.untouched.wat @@ -5,6 +5,9 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 380)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16764)) @@ -310,7 +313,7 @@ if i32.const 160 i32.const 224 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -335,7 +338,7 @@ if i32.const 272 i32.const 224 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -366,7 +369,7 @@ if i32.const 160 i32.const 224 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/builtins.untouched.wat b/tests/compiler/builtins.untouched.wat index d999b82b85..ff642e6620 100644 --- a/tests/compiler/builtins.untouched.wat +++ b/tests/compiler/builtins.untouched.wat @@ -21,6 +21,9 @@ (global $builtins/s (mut i32) (i32.const 0)) (global $builtins/fn (mut i32) (i32.const 144)) (global $~argumentsLength (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128)) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) diff --git a/tests/compiler/call-super.untouched.wat b/tests/compiler/call-super.untouched.wat index c5905141bf..446526b584 100644 --- a/tests/compiler/call-super.untouched.wat +++ b/tests/compiler/call-super.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/class-implements.untouched.wat b/tests/compiler/class-implements.untouched.wat index 20b4df005b..104af54d85 100644 --- a/tests/compiler/class-implements.untouched.wat +++ b/tests/compiler/class-implements.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/class-overloading-cast.untouched.wat b/tests/compiler/class-overloading-cast.untouched.wat index 19a34533b6..c3df550ffc 100644 --- a/tests/compiler/class-overloading-cast.untouched.wat +++ b/tests/compiler/class-overloading-cast.untouched.wat @@ -19,6 +19,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/class-overloading.untouched.wat b/tests/compiler/class-overloading.untouched.wat index 2facadbbcd..73b3ed7326 100644 --- a/tests/compiler/class-overloading.untouched.wat +++ b/tests/compiler/class-overloading.untouched.wat @@ -19,6 +19,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index 0439ea3151..c395b16052 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (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 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) @@ -1201,182 +1201,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1445,7 +1269,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1460,7 +1284,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1473,7 +1297,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1481,7 +1305,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1492,16 +1316,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1512,16 +1336,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1529,7 +1353,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1537,8 +1361,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1555,7 +1379,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1565,13 +1389,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1584,40 +1408,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1677,10 +1501,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $class/testGenericInitializer (local $0 i32) @@ -1741,9 +1737,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store offset=4 - local.get $0 - i32.const 32 - call $~lib/memory/memory.fill local.get $2 local.get $0 i32.store diff --git a/tests/compiler/class.untouched.wat b/tests/compiler/class.untouched.wat index ddea6b07eb..6fda41c809 100644 --- a/tests/compiler/class.untouched.wat +++ b/tests/compiler/class.untouched.wat @@ -20,10 +20,14 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 512)) (global $~lib/memory/__data_end i32 (i32.const 564)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16948)) @@ -2721,7 +2725,7 @@ if i32.const 432 i32.const 480 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -2743,10 +2747,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer diff --git a/tests/compiler/constructor.untouched.wat b/tests/compiler/constructor.untouched.wat index 89a0c648ba..2a90aead9b 100644 --- a/tests/compiler/constructor.untouched.wat +++ b/tests/compiler/constructor.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 7320a8c2e2..5780fd01a8 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -18,6 +18,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/empty-exportruntime.untouched.wat b/tests/compiler/empty-exportruntime.untouched.wat index 1d8dc9fe14..6cfe1e0434 100644 --- a/tests/compiler/empty-exportruntime.untouched.wat +++ b/tests/compiler/empty-exportruntime.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/empty-new.untouched.wat b/tests/compiler/empty-new.untouched.wat index 0cbc855010..7d67affc28 100644 --- a/tests/compiler/empty-new.untouched.wat +++ b/tests/compiler/empty-new.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index e7b3081595..6e2f615cd1 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -27,6 +27,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/exportstar-rereexport.untouched.wat b/tests/compiler/exportstar-rereexport.untouched.wat index 3e97865cd4..b1e2bafc65 100644 --- a/tests/compiler/exportstar-rereexport.untouched.wat +++ b/tests/compiler/exportstar-rereexport.untouched.wat @@ -23,6 +23,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index 19933ed0f0..b33d051df5 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -1,7 +1,7 @@ (module (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_=>_none (func (param i32 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_=>_none (func (param i32 i32 i32 i32))) @@ -1207,182 +1207,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1451,7 +1275,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1466,7 +1290,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1479,7 +1303,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1487,7 +1311,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1498,16 +1322,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1518,16 +1342,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1535,7 +1359,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1543,8 +1367,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1561,7 +1385,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1571,13 +1395,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1590,40 +1414,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1683,10 +1507,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -2381,16 +2377,15 @@ (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) i32.const 1180 i32.load - local.tee $10 + local.tee $7 i32.const 1 i32.add local.tee $8 i32.const 1176 i32.load - local.tee $9 + local.tee $1 i32.const 2 i32.shr_u i32.gt_u @@ -2401,13 +2396,13 @@ if i32.const 1616 i32.const 1664 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable end block $__inlined_func$~lib/rt/itcms/__renew - local.get $9 + local.get $1 i32.const 1 i32.shl local.tee $1 @@ -2430,10 +2425,10 @@ local.get $2 i32.gt_u select - local.tee $7 + local.tee $9 i32.const 1168 i32.load - local.tee $11 + local.tee $6 local.tee $1 i32.const 20 i32.sub @@ -2446,25 +2441,25 @@ i32.le_u if local.get $3 - local.get $7 + local.get $9 i32.store offset=16 br $__inlined_func$~lib/rt/itcms/__renew end - local.get $7 + local.get $9 local.get $3 i32.load offset=12 call $~lib/rt/itcms/__new local.tee $5 local.set $2 - local.get $7 + local.get $9 local.get $3 i32.load offset=16 local.tee $3 local.get $3 - local.get $7 + local.get $9 i32.gt_u select - local.set $6 + local.set $10 block $~lib/util/memory/memmove|inlined.0 local.get $1 local.get $2 @@ -2473,10 +2468,10 @@ local.get $1 local.get $2 i32.sub - local.get $6 + local.get $10 i32.sub i32.const 0 - local.get $6 + local.get $10 i32.const 1 i32.shl i32.sub @@ -2484,7 +2479,7 @@ if local.get $2 local.get $1 - local.get $6 + local.get $10 call $~lib/util/memory/memcpy br $~lib/util/memory/memmove|inlined.0 end @@ -2505,13 +2500,13 @@ i32.const 7 i32.and if - local.get $6 + local.get $10 i32.eqz br_if $~lib/util/memory/memmove|inlined.0 - local.get $6 + local.get $10 i32.const 1 i32.sub - local.set $6 + local.set $10 local.get $2 local.tee $3 i32.const 1 @@ -2530,7 +2525,7 @@ end end loop $while-continue|1 - local.get $6 + local.get $10 i32.const 8 i32.ge_u if @@ -2538,10 +2533,10 @@ local.get $1 i64.load i64.store - local.get $6 + local.get $10 i32.const 8 i32.sub - local.set $6 + local.set $10 local.get $2 i32.const 8 i32.add @@ -2555,7 +2550,7 @@ end end loop $while-continue|2 - local.get $6 + local.get $10 if local.get $2 local.tee $3 @@ -2571,10 +2566,10 @@ local.get $4 i32.load8_u i32.store8 - local.get $6 + local.get $10 i32.const 1 i32.sub - local.set $6 + local.set $10 br $while-continue|2 end end @@ -2589,22 +2584,22 @@ if loop $while-continue|3 local.get $2 - local.get $6 + local.get $10 i32.add i32.const 7 i32.and if - local.get $6 + local.get $10 i32.eqz br_if $~lib/util/memory/memmove|inlined.0 - local.get $6 + local.get $10 i32.const 1 i32.sub - local.tee $6 + local.tee $10 local.get $2 i32.add local.get $1 - local.get $6 + local.get $10 i32.add i32.load8_u i32.store8 @@ -2612,18 +2607,18 @@ end end loop $while-continue|4 - local.get $6 + local.get $10 i32.const 8 i32.ge_u if - local.get $6 + local.get $10 i32.const 8 i32.sub - local.tee $6 + local.tee $10 local.get $2 i32.add local.get $1 - local.get $6 + local.get $10 i32.add i64.load i64.store @@ -2632,16 +2627,16 @@ end end loop $while-continue|5 - local.get $6 + local.get $10 if - local.get $6 + local.get $10 i32.const 1 i32.sub - local.tee $6 + local.tee $10 local.get $2 i32.add local.get $1 - local.get $6 + local.get $10 i32.add i32.load8_u i32.store8 @@ -2654,14 +2649,7 @@ local.set $1 end local.get $1 - local.get $9 - i32.add - local.get $7 - local.get $9 - i32.sub - call $~lib/memory/memory.fill - local.get $1 - local.get $11 + local.get $6 i32.ne if i32.const 1168 @@ -2678,12 +2666,12 @@ end end i32.const 1176 - local.get $7 + local.get $9 i32.store end i32.const 1172 i32.load - local.get $10 + local.get $7 i32.const 2 i32.shl i32.add diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index 09f205cc84..ee79fbfd3c 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -20,10 +20,14 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 672)) (global $~lib/memory/__data_end i32 (i32.const 748)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17132)) @@ -3758,7 +3762,7 @@ if i32.const 592 i32.const 640 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -3802,14 +3806,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne diff --git a/tests/compiler/extends-recursive.untouched.wat b/tests/compiler/extends-recursive.untouched.wat index f66a3affff..886d35c1f8 100644 --- a/tests/compiler/extends-recursive.untouched.wat +++ b/tests/compiler/extends-recursive.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/field-initialization.optimized.wat b/tests/compiler/field-initialization.optimized.wat index 32d67a3f0b..964b83e93f 100644 --- a/tests/compiler/field-initialization.optimized.wat +++ b/tests/compiler/field-initialization.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) @@ -1214,182 +1214,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1458,7 +1282,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1473,7 +1297,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1486,7 +1310,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1494,7 +1318,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1505,16 +1329,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1525,16 +1349,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1542,7 +1366,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1550,8 +1374,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1568,7 +1392,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1578,13 +1402,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1597,40 +1421,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1690,10 +1514,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3145,9 +3141,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store - local.get $0 - i32.const 0 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add diff --git a/tests/compiler/field-initialization.untouched.wat b/tests/compiler/field-initialization.untouched.wat index 061989af79..90140e0342 100644 --- a/tests/compiler/field-initialization.untouched.wat +++ b/tests/compiler/field-initialization.untouched.wat @@ -18,10 +18,14 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 768)) (global $~lib/memory/__data_end i32 (i32.const 972)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17356)) @@ -3953,7 +3957,7 @@ if i32.const 512 i32.const 560 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -3964,10 +3968,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer diff --git a/tests/compiler/field.untouched.wat b/tests/compiler/field.untouched.wat index 3c9951bf50..652bf1f8b0 100644 --- a/tests/compiler/field.untouched.wat +++ b/tests/compiler/field.untouched.wat @@ -18,6 +18,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index a533f2a6cd..274cf8f80a 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -18,6 +18,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/function-call.untouched.wat b/tests/compiler/function-call.untouched.wat index b82907c3b2..27b2cc8679 100644 --- a/tests/compiler/function-call.untouched.wat +++ b/tests/compiler/function-call.untouched.wat @@ -23,6 +23,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/function-expression.untouched.wat b/tests/compiler/function-expression.untouched.wat index e42698f3cb..b190999976 100644 --- a/tests/compiler/function-expression.untouched.wat +++ b/tests/compiler/function-expression.untouched.wat @@ -24,6 +24,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/getter-call.untouched.wat b/tests/compiler/getter-call.untouched.wat index 691f91bf28..3fa9b41b61 100644 --- a/tests/compiler/getter-call.untouched.wat +++ b/tests/compiler/getter-call.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/implicit-getter-setter.untouched.wat b/tests/compiler/implicit-getter-setter.untouched.wat index 846ece1d20..4bdc62a2b0 100644 --- a/tests/compiler/implicit-getter-setter.untouched.wat +++ b/tests/compiler/implicit-getter-setter.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/infer-array.optimized.wat b/tests/compiler/infer-array.optimized.wat index 2159ac4362..8ee55c5d7f 100644 --- a/tests/compiler/infer-array.optimized.wat +++ b/tests/compiler/infer-array.optimized.wat @@ -2691,7 +2691,7 @@ end i32.const 1280 i32.const 1488 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/infer-array.untouched.wat b/tests/compiler/infer-array.untouched.wat index a7a74136c7..a39653b6f5 100644 --- a/tests/compiler/infer-array.untouched.wat +++ b/tests/compiler/infer-array.untouched.wat @@ -12,6 +12,9 @@ (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -3705,7 +3708,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3731,7 +3734,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3757,7 +3760,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3783,7 +3786,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3825,7 +3828,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4601,7 +4604,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4647,7 +4650,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4693,7 +4696,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4718,7 +4721,7 @@ if i32.const 976 i32.const 464 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/infer-generic.untouched.wat b/tests/compiler/infer-generic.untouched.wat index b7cf289aa2..9363d0ea8b 100644 --- a/tests/compiler/infer-generic.untouched.wat +++ b/tests/compiler/infer-generic.untouched.wat @@ -13,6 +13,9 @@ (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $infer-generic/arr i32 (i32.const 128)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) diff --git a/tests/compiler/inlining.untouched.wat b/tests/compiler/inlining.untouched.wat index 19773dbe73..591305f56b 100644 --- a/tests/compiler/inlining.untouched.wat +++ b/tests/compiler/inlining.untouched.wat @@ -19,6 +19,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/instanceof-class.untouched.wat b/tests/compiler/instanceof-class.untouched.wat index 26f3db7e58..5bfcc1c5e8 100644 --- a/tests/compiler/instanceof-class.untouched.wat +++ b/tests/compiler/instanceof-class.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/issues/1095.untouched.wat b/tests/compiler/issues/1095.untouched.wat index 758618249b..0d031c6765 100644 --- a/tests/compiler/issues/1095.untouched.wat +++ b/tests/compiler/issues/1095.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/issues/1225.untouched.wat b/tests/compiler/issues/1225.untouched.wat index 95d7aa20ca..c422ca0438 100644 --- a/tests/compiler/issues/1225.untouched.wat +++ b/tests/compiler/issues/1225.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/issues/1699.optimized.wat b/tests/compiler/issues/1699.optimized.wat index efa79642c3..3049127451 100644 --- a/tests/compiler/issues/1699.optimized.wat +++ b/tests/compiler/issues/1699.optimized.wat @@ -2,8 +2,8 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (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_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1203,182 +1203,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1447,7 +1271,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1462,7 +1286,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1475,7 +1299,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1483,7 +1307,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1494,16 +1318,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1514,16 +1338,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1531,7 +1355,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1539,8 +1363,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1557,7 +1381,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1567,13 +1391,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1586,40 +1410,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1679,10 +1503,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -2375,7 +2371,6 @@ (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) local.get $0 i32.load offset=12 local.get $1 @@ -2387,7 +2382,7 @@ if i32.const 1344 i32.const 1104 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -2398,7 +2393,7 @@ local.tee $3 local.get $0 i32.load offset=8 - local.tee $9 + local.tee $4 i32.const 2 i32.shr_u i32.gt_u @@ -2409,13 +2404,13 @@ if i32.const 1056 i32.const 1104 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable end block $__inlined_func$~lib/rt/itcms/__renew - local.get $9 + local.get $4 i32.const 1 i32.shl local.tee $4 @@ -2438,10 +2433,10 @@ local.get $4 i32.lt_u select - local.tee $11 + local.tee $10 local.get $0 i32.load - local.tee $10 + local.tee $9 local.tee $3 i32.const 20 i32.sub @@ -2454,21 +2449,21 @@ i32.le_u if local.get $4 - local.get $11 + local.get $10 i32.store offset=16 br $__inlined_func$~lib/rt/itcms/__renew end - local.get $11 + local.get $10 local.get $4 i32.load offset=12 call $~lib/rt/itcms/__new local.set $5 - local.get $11 + local.get $10 local.get $4 i32.load offset=16 local.tee $4 local.get $4 - local.get $11 + local.get $10 i32.gt_u select local.set $8 @@ -2663,13 +2658,6 @@ end local.get $3 local.get $9 - i32.add - local.get $11 - local.get $9 - i32.sub - call $~lib/memory/memory.fill - local.get $3 - local.get $10 i32.ne if local.get $0 @@ -2687,7 +2675,7 @@ end end local.get $0 - local.get $11 + local.get $10 i32.store offset=8 end local.get $0 @@ -2830,13 +2818,13 @@ i32.lt_s br_if $folding-inner0 global.get $~lib/memory/__stack_pointer - local.tee $0 + local.tee $1 i64.const 0 i64.store - local.get $0 + local.get $1 i64.const 0 i64.store offset=8 - local.get $0 + local.get $1 i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer @@ -2872,9 +2860,6 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 32 - call $~lib/memory/memory.fill local.get $2 local.get $3 i32.store @@ -2898,52 +2883,52 @@ i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $0 + local.get $1 local.get $2 i32.store call $issues/1699/MultiAssignmentTest#constructor - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store offset=8 local.get $2 i32.const 1 - local.get $0 + local.get $1 call $~lib/array/Array#__set local.get $2 i32.const 1 call $~lib/array/Array#__get - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store offset=4 local.get $2 i32.const 0 - local.get $0 + local.get $1 call $~lib/array/Array#__set loop $for-loop|0 local.get $2 i32.load offset=12 - local.get $1 + local.get $0 i32.gt_s if global.get $~lib/memory/__stack_pointer call $issues/1699/MultiAssignmentTest#constructor - local.tee $0 + local.tee $1 i32.store offset=12 - local.get $1 + local.get $0 i32.const 1 i32.gt_s if local.get $2 - local.get $1 local.get $0 + local.get $1 call $~lib/array/Array#__set end - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|0 end end @@ -3053,7 +3038,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3073,7 +3058,7 @@ if i32.const 1552 i32.const 1104 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/issues/1699.untouched.wat b/tests/compiler/issues/1699.untouched.wat index cc83e450b9..24e10aaea1 100644 --- a/tests/compiler/issues/1699.untouched.wat +++ b/tests/compiler/issues/1699.untouched.wat @@ -9,6 +9,9 @@ (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -21,6 +24,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 688)) (global $~lib/memory/__data_end i32 (i32.const 732)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17116)) @@ -3763,7 +3767,7 @@ if i32.const 32 i32.const 80 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -3807,14 +3811,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -3863,7 +3863,7 @@ if i32.const 320 i32.const 80 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -4191,7 +4191,7 @@ if i32.const 32 i32.const 80 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -4213,10 +4213,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -4286,7 +4286,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4311,7 +4311,7 @@ if i32.const 528 i32.const 80 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/logical.untouched.wat b/tests/compiler/logical.untouched.wat index f5d48e94c7..344c415077 100644 --- a/tests/compiler/logical.untouched.wat +++ b/tests/compiler/logical.untouched.wat @@ -22,6 +22,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index b68dcba200..40b0f68c6f 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/new.untouched.wat b/tests/compiler/new.untouched.wat index 3a46f640eb..2531a2b11b 100644 --- a/tests/compiler/new.untouched.wat +++ b/tests/compiler/new.untouched.wat @@ -18,6 +18,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index a44c71d806..6549064b26 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -27,6 +27,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat index 4c1f6cb3db..588fdabe2c 100644 --- a/tests/compiler/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -16,6 +16,9 @@ (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat index e08253e6a4..05136ca9de 100644 --- a/tests/compiler/optional-typeparameters.untouched.wat +++ b/tests/compiler/optional-typeparameters.untouched.wat @@ -18,6 +18,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/reexport.untouched.wat b/tests/compiler/reexport.untouched.wat index 27af8da6f0..5ed6191586 100644 --- a/tests/compiler/reexport.untouched.wat +++ b/tests/compiler/reexport.untouched.wat @@ -27,6 +27,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/rereexport.untouched.wat b/tests/compiler/rereexport.untouched.wat index a893c1756c..30c35df4bc 100644 --- a/tests/compiler/rereexport.untouched.wat +++ b/tests/compiler/rereexport.untouched.wat @@ -23,6 +23,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/resolve-access.optimized.wat b/tests/compiler/resolve-access.optimized.wat index 7274d46239..9618845565 100644 --- a/tests/compiler/resolve-access.optimized.wat +++ b/tests/compiler/resolve-access.optimized.wat @@ -3100,7 +3100,7 @@ if i32.const 1280 i32.const 1488 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-access.untouched.wat b/tests/compiler/resolve-access.untouched.wat index fcf2f3dc68..53636d9820 100644 --- a/tests/compiler/resolve-access.untouched.wat +++ b/tests/compiler/resolve-access.untouched.wat @@ -16,6 +16,9 @@ (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -3705,7 +3708,7 @@ if i32.const 256 i32.const 464 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-binary.untouched.wat b/tests/compiler/resolve-binary.untouched.wat index d434e75855..e6b550cff1 100644 --- a/tests/compiler/resolve-binary.untouched.wat +++ b/tests/compiler/resolve-binary.untouched.wat @@ -18,6 +18,9 @@ (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $resolve-binary/a (mut i32) (i32.const 0)) (global $resolve-binary/f (mut f64) (f64.const 0)) diff --git a/tests/compiler/resolve-elementaccess.optimized.wat b/tests/compiler/resolve-elementaccess.optimized.wat index dbe6daa73a..21542a973f 100644 --- a/tests/compiler/resolve-elementaccess.optimized.wat +++ b/tests/compiler/resolve-elementaccess.optimized.wat @@ -1266,182 +1266,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1510,7 +1334,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1525,7 +1349,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1538,7 +1362,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1546,7 +1370,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1557,16 +1381,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1577,16 +1401,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1594,7 +1418,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1602,8 +1426,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1620,7 +1444,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1630,13 +1454,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1649,40 +1473,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1742,10 +1566,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/typedarray/Float32Array#__set (param $0 i32) (param $1 i32) (param $2 f32) local.get $0 @@ -4673,7 +4669,7 @@ if i32.const 1056 i32.const 1104 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -4682,14 +4678,11 @@ i32.const 2 local.get $1 i32.shl - local.tee $4 + local.tee $1 i32.const 0 call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - local.get $4 - call $~lib/memory/memory.fill local.get $0 local.get $3 i32.store @@ -4709,7 +4702,7 @@ local.get $3 i32.const 20 i32.sub - local.tee $1 + local.tee $4 i32.load offset=4 i32.const 3 i32.and @@ -4726,7 +4719,7 @@ i32.eqz i32.eq if - local.get $1 + local.get $4 call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state @@ -4737,7 +4730,7 @@ i32.eq i32.and if - local.get $1 + local.get $4 call $~lib/rt/itcms/Object#makeGray end end @@ -4747,7 +4740,7 @@ local.get $3 i32.store offset=4 local.get $0 - local.get $4 + local.get $1 i32.store offset=8 global.get $~lib/memory/__stack_pointer i32.const 8 diff --git a/tests/compiler/resolve-elementaccess.untouched.wat b/tests/compiler/resolve-elementaccess.untouched.wat index 0a67fc5010..981941dc8a 100644 --- a/tests/compiler/resolve-elementaccess.untouched.wat +++ b/tests/compiler/resolve-elementaccess.untouched.wat @@ -19,6 +19,9 @@ (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -31,6 +34,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $resolve-elementaccess/arr (mut i32) (i32.const 0)) (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) @@ -6158,7 +6162,7 @@ if i32.const 32 i32.const 80 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -6172,10 +6176,10 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $3 call $~lib/arraybuffer/ArrayBufferView#set:buffer diff --git a/tests/compiler/resolve-function-expression.untouched.wat b/tests/compiler/resolve-function-expression.untouched.wat index fa7aaca340..d2d5582ab5 100644 --- a/tests/compiler/resolve-function-expression.untouched.wat +++ b/tests/compiler/resolve-function-expression.untouched.wat @@ -22,6 +22,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/resolve-nested.untouched.wat b/tests/compiler/resolve-nested.untouched.wat index fe5299cb7b..2b9a974028 100644 --- a/tests/compiler/resolve-nested.untouched.wat +++ b/tests/compiler/resolve-nested.untouched.wat @@ -33,6 +33,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/resolve-new.untouched.wat b/tests/compiler/resolve-new.untouched.wat index 3ec3effe0f..c8804fbdba 100644 --- a/tests/compiler/resolve-new.untouched.wat +++ b/tests/compiler/resolve-new.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/resolve-propertyaccess.untouched.wat b/tests/compiler/resolve-propertyaccess.untouched.wat index ca9881fdd1..1204319f7b 100644 --- a/tests/compiler/resolve-propertyaccess.untouched.wat +++ b/tests/compiler/resolve-propertyaccess.untouched.wat @@ -22,6 +22,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index 922eca36b6..32b79fd5ae 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -26,6 +26,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/resolve-unary.untouched.wat b/tests/compiler/resolve-unary.untouched.wat index 921930f130..0d48fb1030 100644 --- a/tests/compiler/resolve-unary.untouched.wat +++ b/tests/compiler/resolve-unary.untouched.wat @@ -21,6 +21,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/rt/finalize.untouched.wat b/tests/compiler/rt/finalize.untouched.wat index fe37c5c7c1..9f65c5f3fd 100644 --- a/tests/compiler/rt/finalize.untouched.wat +++ b/tests/compiler/rt/finalize.untouched.wat @@ -19,6 +19,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/rt/flags.untouched.wat b/tests/compiler/rt/flags.untouched.wat index e832460e28..dfbcb4e8d8 100644 --- a/tests/compiler/rt/flags.untouched.wat +++ b/tests/compiler/rt/flags.untouched.wat @@ -4,6 +4,9 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $rt/flags/VALUE_ALIGN_REF i32 (i32.const 256)) (global $rt/flags/KEY_ALIGN_REF i32 (i32.const 131072)) (global $~lib/rt/__rtti_base i32 (i32.const 176)) diff --git a/tests/compiler/rt/ids.untouched.wat b/tests/compiler/rt/ids.untouched.wat index e0aa4ac445..776c7e5789 100644 --- a/tests/compiler/rt/ids.untouched.wat +++ b/tests/compiler/rt/ids.untouched.wat @@ -1,5 +1,8 @@ (module (type $none_=>_none (func)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/memory/__data_end i32 (i32.const 8)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16392)) (global $~lib/memory/__heap_base i32 (i32.const 16392)) diff --git a/tests/compiler/rt/instanceof.untouched.wat b/tests/compiler/rt/instanceof.untouched.wat index d6ceab0b6b..04e2819d55 100644 --- a/tests/compiler/rt/instanceof.untouched.wat +++ b/tests/compiler/rt/instanceof.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/rt/runtime-incremental-export.untouched.wat b/tests/compiler/rt/runtime-incremental-export.untouched.wat index 1d8dc9fe14..6cfe1e0434 100644 --- a/tests/compiler/rt/runtime-incremental-export.untouched.wat +++ b/tests/compiler/rt/runtime-incremental-export.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/std-wasi/console.optimized.wat b/tests/compiler/std-wasi/console.optimized.wat index ef10ca6f24..8e81148436 100644 --- a/tests/compiler/std-wasi/console.optimized.wat +++ b/tests/compiler/std-wasi/console.optimized.wat @@ -2594,296 +2594,292 @@ end i32.const 0 ) - (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) + (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 1073741804 + i32.ge_u + if + i32.const 4400 + i32.const 4992 + i32.const 260 + i32.const 31 + call $~lib/wasi/index/abort + unreachable + end + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + block $__inlined_func$~lib/rt/itcms/interrupt + i32.const 2048 + local.set $2 + loop $do-loop|0 + local.get $2 + call $~lib/rt/itcms/step + i32.sub + local.set $2 + global.get $~lib/rt/itcms/state + i32.eqz + if + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i64.const 200 + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + br $__inlined_func$~lib/rt/itcms/interrupt + end + local.get $2 + i32.const 0 + i32.gt_s + br_if $do-loop|0 + end + global.get $~lib/rt/itcms/total + local.tee $2 + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.const 10 + i32.shl + local.get $2 + i32.add + global.set $~lib/rt/itcms/threshold + end + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.add + call $~lib/rt/tlsf/allocateBlock + local.tee $2 + local.get $1 + i32.store offset=12 + local.get $2 + local.get $0 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $1 + i32.load offset=8 + local.set $3 + local.get $2 + global.get $~lib/rt/itcms/white + local.get $1 + i32.or + i32.store offset=4 + local.get $2 + local.get $3 + i32.store offset=8 + local.get $3 + local.get $3 + i32.load offset=4 + i32.const 3 + i32.and + local.get $2 + i32.or + i32.store offset=4 + local.get $1 + local.get $2 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $2 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.tee $2 + local.set $1 block $~lib/util/memory/memset|inlined.0 - local.get $1 + local.get $0 i32.eqz br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 local.get $0 local.get $1 i32.add - local.tee $2 + local.tee $3 i32.const 1 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 2 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=1 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=2 - local.get $2 + local.get $3 i32.const 2 i32.sub i32.const 0 i32.store8 - local.get $2 + local.get $3 i32.const 3 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 6 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=3 - local.get $2 + local.get $3 i32.const 4 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 - local.get $0 + local.get $1 i32.sub i32.const 3 i32.and - local.tee $2 + local.tee $3 i32.add - local.tee $0 + local.tee $1 i32.const 0 i32.store - local.get $0 local.get $1 - local.get $2 + local.get $0 + local.get $3 i32.sub i32.const -4 i32.and - local.tee $1 + local.tee $0 i32.add - local.tee $2 + local.tee $3 i32.const 4 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=4 - local.get $0 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $3 i32.const 12 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 8 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 24 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=12 - local.get $0 + local.get $1 i32.const 0 i32.store offset=16 - local.get $0 + local.get $1 i32.const 0 i32.store offset=20 - local.get $0 + local.get $1 i32.const 0 i32.store offset=24 - local.get $2 + local.get $3 i32.const 28 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 24 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 20 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 16 i32.sub i32.const 0 i32.store - local.get $0 - local.get $0 + local.get $1 + local.get $1 i32.const 4 i32.and i32.const 24 i32.add - local.tee $2 + local.tee $3 i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 loop $while-continue|0 - local.get $1 + local.get $0 i32.const 32 i32.ge_u if - local.get $0 + local.get $1 i64.const 0 i64.store - local.get $0 + local.get $1 i64.const 0 i64.store offset=8 - local.get $0 + local.get $1 i64.const 0 i64.store offset=16 - local.get $0 + local.get $1 i64.const 0 i64.store offset=24 - local.get $1 + local.get $0 i32.const 32 i32.sub - local.set $1 - local.get $0 + local.set $0 + local.get $1 i32.const 32 i32.add - local.set $0 + local.set $1 br $while-continue|0 end end end - ) - (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741804 - i32.ge_u - if - i32.const 4400 - i32.const 4992 - i32.const 260 - i32.const 31 - call $~lib/wasi/index/abort - unreachable - end - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.ge_u - if - block $__inlined_func$~lib/rt/itcms/interrupt - i32.const 2048 - local.set $2 - loop $do-loop|0 - local.get $2 - call $~lib/rt/itcms/step - i32.sub - local.set $2 - global.get $~lib/rt/itcms/state - i32.eqz - if - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i64.const 200 - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - br $__inlined_func$~lib/rt/itcms/interrupt - end - local.get $2 - i32.const 0 - i32.gt_s - br_if $do-loop|0 - end - global.get $~lib/rt/itcms/total - local.tee $2 - global.get $~lib/rt/itcms/threshold - i32.sub - i32.const 1024 - i32.lt_u - i32.const 10 - i32.shl - local.get $2 - i32.add - global.set $~lib/rt/itcms/threshold - end - end - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - i32.const 16 - i32.add - call $~lib/rt/tlsf/allocateBlock - local.tee $2 - local.get $1 - i32.store offset=12 - local.get $2 - local.get $0 - i32.store offset=16 - global.get $~lib/rt/itcms/fromSpace - local.tee $1 - i32.load offset=8 - local.set $3 - local.get $2 - global.get $~lib/rt/itcms/white - local.get $1 - i32.or - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $3 - local.get $3 - i32.load offset=4 - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - global.get $~lib/rt/itcms/total local.get $2 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.add - global.set $~lib/rt/itcms/total - local.get $2 - i32.const 20 - i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 ) (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) (local $1 i32) @@ -4715,7 +4711,6 @@ global.set $~lib/memory/__stack_pointer ) (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) - (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -4740,7 +4735,7 @@ if i32.const 5264 i32.const 5312 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/wasi/index/abort unreachable @@ -4749,16 +4744,13 @@ local.get $0 i32.const 0 call $~lib/rt/itcms/__new - local.tee $1 + local.tee $0 i32.store - local.get $1 - local.get $0 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $1 + local.get $0 ) (func $byn-split-outlined-A$~lib/rt/itcms/__visit (param $0 i32) global.get $~lib/rt/itcms/white diff --git a/tests/compiler/std-wasi/console.untouched.wat b/tests/compiler/std-wasi/console.untouched.wat index 55d8738139..03dfa64e06 100644 --- a/tests/compiler/std-wasi/console.untouched.wat +++ b/tests/compiler/std-wasi/console.untouched.wat @@ -23,6 +23,9 @@ (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (import "wasi_snapshot_preview1" "clock_time_get" (func $~lib/bindings/wasi_snapshot_preview1/clock_time_get (param i32 i64 i32) (result i32))) (global $~lib/process/process.stderr i32 (i32.const 2)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/bindings/wasi/tempbuf i32 (i32.const 112)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -38,6 +41,7 @@ (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/console/timers (mut i32) (i32.const 0)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/rt/__rtti_base i32 (i32.const 6912)) @@ -6124,7 +6128,7 @@ if i32.const 4240 i32.const 4288 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/wasi/index/abort unreachable @@ -6135,10 +6139,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer diff --git a/tests/compiler/std-wasi/crypto.optimized.wat b/tests/compiler/std-wasi/crypto.optimized.wat index 4c09233d1f..37ff5828c0 100644 --- a/tests/compiler/std-wasi/crypto.optimized.wat +++ b/tests/compiler/std-wasi/crypto.optimized.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) @@ -2029,296 +2029,292 @@ end local.get $1 ) - (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) + (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 1073741804 + i32.ge_u + if + i32.const 1280 + i32.const 1344 + i32.const 260 + i32.const 31 + call $~lib/wasi/index/abort + unreachable + end + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + block $__inlined_func$~lib/rt/itcms/interrupt + i32.const 2048 + local.set $2 + loop $do-loop|0 + local.get $2 + call $~lib/rt/itcms/step + i32.sub + local.set $2 + global.get $~lib/rt/itcms/state + i32.eqz + if + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i64.const 200 + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + br $__inlined_func$~lib/rt/itcms/interrupt + end + local.get $2 + i32.const 0 + i32.gt_s + br_if $do-loop|0 + end + global.get $~lib/rt/itcms/total + local.tee $2 + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.const 10 + i32.shl + local.get $2 + i32.add + global.set $~lib/rt/itcms/threshold + end + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.add + call $~lib/rt/tlsf/allocateBlock + local.tee $2 + local.get $1 + i32.store offset=12 + local.get $2 + local.get $0 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $1 + i32.load offset=8 + local.set $3 + local.get $2 + global.get $~lib/rt/itcms/white + local.get $1 + i32.or + i32.store offset=4 + local.get $2 + local.get $3 + i32.store offset=8 + local.get $3 + local.get $3 + i32.load offset=4 + i32.const 3 + i32.and + local.get $2 + i32.or + i32.store offset=4 + local.get $1 + local.get $2 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $2 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.tee $2 + local.set $1 block $~lib/util/memory/memset|inlined.0 - local.get $1 + local.get $0 i32.eqz br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 local.get $0 local.get $1 i32.add - local.tee $2 + local.tee $3 i32.const 1 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 2 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=1 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=2 - local.get $2 + local.get $3 i32.const 2 i32.sub i32.const 0 i32.store8 - local.get $2 + local.get $3 i32.const 3 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 6 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=3 - local.get $2 + local.get $3 i32.const 4 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 - local.get $0 + local.get $1 i32.sub i32.const 3 i32.and - local.tee $2 + local.tee $3 i32.add - local.tee $0 + local.tee $1 i32.const 0 i32.store - local.get $0 local.get $1 - local.get $2 + local.get $0 + local.get $3 i32.sub i32.const -4 i32.and - local.tee $1 + local.tee $0 i32.add - local.tee $2 + local.tee $3 i32.const 4 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=4 - local.get $0 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $3 i32.const 12 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 8 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 24 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=12 - local.get $0 + local.get $1 i32.const 0 i32.store offset=16 - local.get $0 + local.get $1 i32.const 0 i32.store offset=20 - local.get $0 + local.get $1 i32.const 0 i32.store offset=24 - local.get $2 + local.get $3 i32.const 28 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 24 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 20 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 16 i32.sub i32.const 0 i32.store - local.get $0 - local.get $0 + local.get $1 + local.get $1 i32.const 4 i32.and i32.const 24 i32.add - local.tee $2 + local.tee $3 i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 loop $while-continue|0 - local.get $1 + local.get $0 i32.const 32 i32.ge_u if - local.get $0 + local.get $1 i64.const 0 i64.store - local.get $0 + local.get $1 i64.const 0 i64.store offset=8 - local.get $0 + local.get $1 i64.const 0 i64.store offset=16 - local.get $0 + local.get $1 i64.const 0 i64.store offset=24 - local.get $1 + local.get $0 i32.const 32 i32.sub - local.set $1 - local.get $0 + local.set $0 + local.get $1 i32.const 32 i32.add - local.set $0 + local.set $1 br $while-continue|0 end end end - ) - (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741804 - i32.ge_u - if - i32.const 1280 - i32.const 1344 - i32.const 260 - i32.const 31 - call $~lib/wasi/index/abort - unreachable - end - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.ge_u - if - block $__inlined_func$~lib/rt/itcms/interrupt - i32.const 2048 - local.set $2 - loop $do-loop|0 - local.get $2 - call $~lib/rt/itcms/step - i32.sub - local.set $2 - global.get $~lib/rt/itcms/state - i32.eqz - if - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i64.const 200 - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - br $__inlined_func$~lib/rt/itcms/interrupt - end - local.get $2 - i32.const 0 - i32.gt_s - br_if $do-loop|0 - end - global.get $~lib/rt/itcms/total - local.tee $2 - global.get $~lib/rt/itcms/threshold - i32.sub - i32.const 1024 - i32.lt_u - i32.const 10 - i32.shl - local.get $2 - i32.add - global.set $~lib/rt/itcms/threshold - end - end - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - i32.const 16 - i32.add - call $~lib/rt/tlsf/allocateBlock - local.tee $2 - local.get $1 - i32.store offset=12 - local.get $2 - local.get $0 - i32.store offset=16 - global.get $~lib/rt/itcms/fromSpace - local.tee $1 - i32.load offset=8 - local.set $3 local.get $2 - global.get $~lib/rt/itcms/white - local.get $1 - i32.or - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $3 - local.get $3 - i32.load offset=4 - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - global.get $~lib/rt/itcms/total - local.get $2 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.add - global.set $~lib/rt/itcms/total - local.get $2 - i32.const 20 - i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 ) (func $~lib/bindings/wasi_snapshot_preview1/errnoToString (param $0 i32) (result i32) block $break|0 @@ -4526,9 +4522,6 @@ call $~lib/rt/itcms/__new local.tee $1 i32.store - local.get $1 - i32.const 8 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add @@ -4921,7 +4914,7 @@ if i32.const 1168 i32.const 1216 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/wasi/index/abort unreachable @@ -4932,9 +4925,6 @@ call $~lib/rt/itcms/__new local.tee $6 i32.store offset=4 - local.get $6 - local.get $5 - call $~lib/memory/memory.fill local.get $1 local.get $6 i32.store diff --git a/tests/compiler/std-wasi/crypto.untouched.wat b/tests/compiler/std-wasi/crypto.untouched.wat index e475f22c07..fdf616ac4a 100644 --- a/tests/compiler/std-wasi/crypto.untouched.wat +++ b/tests/compiler/std-wasi/crypto.untouched.wat @@ -16,6 +16,9 @@ (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -29,6 +32,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $std-wasi/crypto/ab (mut i32) (i32.const 0)) (global $std-wasi/crypto/buf (mut i32) (i32.const 0)) (global $~lib/process/process.stdout i32 (i32.const 1)) @@ -6166,7 +6170,7 @@ if i32.const 144 i32.const 192 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/wasi/index/abort unreachable @@ -6177,10 +6181,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer @@ -6855,7 +6859,7 @@ if i32.const 144 i32.const 192 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/wasi/index/abort unreachable @@ -6869,10 +6873,10 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $3 call $~lib/arraybuffer/ArrayBufferView#set:buffer diff --git a/tests/compiler/std-wasi/process.optimized.wat b/tests/compiler/std-wasi/process.optimized.wat index dba70f0262..7177cdaa28 100644 --- a/tests/compiler/std-wasi/process.optimized.wat +++ b/tests/compiler/std-wasi/process.optimized.wat @@ -2610,296 +2610,292 @@ end i32.const 0 ) - (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) + (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 1073741804 + i32.ge_u + if + i32.const 4352 + i32.const 4656 + i32.const 260 + i32.const 31 + call $~lib/wasi/index/abort + unreachable + end + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + block $__inlined_func$~lib/rt/itcms/interrupt + i32.const 2048 + local.set $2 + loop $do-loop|0 + local.get $2 + call $~lib/rt/itcms/step + i32.sub + local.set $2 + global.get $~lib/rt/itcms/state + i32.eqz + if + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i64.const 200 + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + br $__inlined_func$~lib/rt/itcms/interrupt + end + local.get $2 + i32.const 0 + i32.gt_s + br_if $do-loop|0 + end + global.get $~lib/rt/itcms/total + local.tee $2 + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.const 10 + i32.shl + local.get $2 + i32.add + global.set $~lib/rt/itcms/threshold + end + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.add + call $~lib/rt/tlsf/allocateBlock + local.tee $2 + local.get $1 + i32.store offset=12 + local.get $2 + local.get $0 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $1 + i32.load offset=8 + local.set $3 + local.get $2 + global.get $~lib/rt/itcms/white + local.get $1 + i32.or + i32.store offset=4 + local.get $2 + local.get $3 + i32.store offset=8 + local.get $3 + local.get $3 + i32.load offset=4 + i32.const 3 + i32.and + local.get $2 + i32.or + i32.store offset=4 + local.get $1 + local.get $2 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $2 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.tee $2 + local.set $1 block $~lib/util/memory/memset|inlined.0 - local.get $1 + local.get $0 i32.eqz br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 local.get $0 local.get $1 i32.add - local.tee $2 + local.tee $3 i32.const 1 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 2 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=1 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=2 - local.get $2 + local.get $3 i32.const 2 i32.sub i32.const 0 i32.store8 - local.get $2 + local.get $3 i32.const 3 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 6 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=3 - local.get $2 + local.get $3 i32.const 4 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 - local.get $0 + local.get $1 i32.sub i32.const 3 i32.and - local.tee $2 + local.tee $3 i32.add - local.tee $0 + local.tee $1 i32.const 0 i32.store - local.get $0 local.get $1 - local.get $2 + local.get $0 + local.get $3 i32.sub i32.const -4 i32.and - local.tee $1 + local.tee $0 i32.add - local.tee $2 + local.tee $3 i32.const 4 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=4 - local.get $0 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $3 i32.const 12 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 8 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 24 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=12 - local.get $0 + local.get $1 i32.const 0 i32.store offset=16 - local.get $0 + local.get $1 i32.const 0 i32.store offset=20 - local.get $0 + local.get $1 i32.const 0 i32.store offset=24 - local.get $2 + local.get $3 i32.const 28 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 24 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 20 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 16 i32.sub i32.const 0 i32.store - local.get $0 - local.get $0 + local.get $1 + local.get $1 i32.const 4 i32.and i32.const 24 i32.add - local.tee $2 + local.tee $3 i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 loop $while-continue|0 - local.get $1 + local.get $0 i32.const 32 i32.ge_u if - local.get $0 + local.get $1 i64.const 0 i64.store - local.get $0 + local.get $1 i64.const 0 i64.store offset=8 - local.get $0 + local.get $1 i64.const 0 i64.store offset=16 - local.get $0 + local.get $1 i64.const 0 i64.store offset=24 - local.get $1 + local.get $0 i32.const 32 i32.sub - local.set $1 - local.get $0 + local.set $0 + local.get $1 i32.const 32 i32.add - local.set $0 + local.set $1 br $while-continue|0 end end end - ) - (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741804 - i32.ge_u - if - i32.const 4352 - i32.const 4656 - i32.const 260 - i32.const 31 - call $~lib/wasi/index/abort - unreachable - end - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.ge_u - if - block $__inlined_func$~lib/rt/itcms/interrupt - i32.const 2048 - local.set $2 - loop $do-loop|0 - local.get $2 - call $~lib/rt/itcms/step - i32.sub - local.set $2 - global.get $~lib/rt/itcms/state - i32.eqz - if - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i64.const 200 - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - br $__inlined_func$~lib/rt/itcms/interrupt - end - local.get $2 - i32.const 0 - i32.gt_s - br_if $do-loop|0 - end - global.get $~lib/rt/itcms/total - local.tee $2 - global.get $~lib/rt/itcms/threshold - i32.sub - i32.const 1024 - i32.lt_u - i32.const 10 - i32.shl - local.get $2 - i32.add - global.set $~lib/rt/itcms/threshold - end - end - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - i32.const 16 - i32.add - call $~lib/rt/tlsf/allocateBlock - local.tee $2 - local.get $1 - i32.store offset=12 local.get $2 - local.get $0 - i32.store offset=16 - global.get $~lib/rt/itcms/fromSpace - local.tee $1 - i32.load offset=8 - local.set $3 - local.get $2 - global.get $~lib/rt/itcms/white - local.get $1 - i32.or - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $3 - local.get $3 - i32.load offset=4 - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - global.get $~lib/rt/itcms/total - local.get $2 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.add - global.set $~lib/rt/itcms/total - local.get $2 - i32.const 20 - i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 ) (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -3829,7 +3825,7 @@ if i32.const 4560 i32.const 4608 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/wasi/index/abort unreachable @@ -3868,13 +3864,6 @@ local.get $1 call $~lib/rt/itcms/__renew local.tee $2 - local.get $3 - i32.add - local.get $1 - local.get $3 - i32.sub - call $~lib/memory/memory.fill - local.get $2 local.get $4 i32.ne if @@ -3910,7 +3899,7 @@ if i32.const 4784 i32.const 4608 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/wasi/index/abort unreachable @@ -5842,7 +5831,7 @@ if i32.const 4560 i32.const 4608 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/wasi/index/abort unreachable @@ -5861,9 +5850,6 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - local.get $2 - call $~lib/memory/memory.fill local.get $1 local.get $3 i32.store @@ -6127,7 +6113,7 @@ if i32.const 4784 i32.const 4608 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/wasi/index/abort unreachable @@ -6147,7 +6133,7 @@ if i32.const 4976 i32.const 4608 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/wasi/index/abort unreachable @@ -6159,7 +6145,6 @@ local.get $0 ) (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) - (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -6184,7 +6169,7 @@ if i32.const 4560 i32.const 5104 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/wasi/index/abort unreachable @@ -6193,16 +6178,13 @@ local.get $0 i32.const 0 call $~lib/rt/itcms/__new - local.tee $1 + local.tee $0 i32.store - local.get $1 - local.get $0 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $1 + local.get $0 ) (func $~lib/string/String#substring (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) diff --git a/tests/compiler/std-wasi/process.untouched.wat b/tests/compiler/std-wasi/process.untouched.wat index 4ea7f0c17f..6d800d22f5 100644 --- a/tests/compiler/std-wasi/process.untouched.wat +++ b/tests/compiler/std-wasi/process.untouched.wat @@ -25,6 +25,9 @@ (import "wasi_snapshot_preview1" "clock_time_get" (func $~lib/bindings/wasi_snapshot_preview1/clock_time_get (param i32 i64 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_read" (func $~lib/bindings/wasi_snapshot_preview1/fd_read (param i32 i32 i32 i32) (result i32))) (global $~lib/process/process.stdout i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/bindings/wasi/tempbuf i32 (i32.const 64)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -41,6 +44,7 @@ (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/process/process.argv (mut i32) (i32.const 0)) (global $std-wasi/process/argv (mut i32) (i32.const 0)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) @@ -5318,7 +5322,7 @@ if i32.const 3536 i32.const 3584 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/wasi/index/abort unreachable @@ -5362,14 +5366,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -5418,7 +5418,7 @@ if i32.const 3760 i32.const 3584 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/wasi/index/abort unreachable @@ -7745,7 +7745,7 @@ if i32.const 3536 i32.const 3584 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/wasi/index/abort unreachable @@ -7767,10 +7767,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array<~lib/string/String>#set:buffer @@ -8172,7 +8172,7 @@ if i32.const 3760 i32.const 3584 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/wasi/index/abort unreachable @@ -8197,7 +8197,7 @@ if i32.const 3952 i32.const 3584 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/wasi/index/abort unreachable @@ -8227,7 +8227,7 @@ if i32.const 3536 i32.const 4080 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/wasi/index/abort unreachable @@ -8238,10 +8238,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index c4daf0c5b8..5b528c7bc8 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -143,7 +143,7 @@ if i32.const 1056 i32.const 1120 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -163,7 +163,7 @@ if i32.const 1168 i32.const 1120 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -214,7 +214,7 @@ if i32.const 1056 i32.const 1120 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index 39bd1eda85..7b8ca0eb92 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -6,6 +6,9 @@ (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 284)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16668)) @@ -32,7 +35,7 @@ if i32.const 32 i32.const 96 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -400,7 +403,7 @@ if i32.const 32 i32.const 96 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -425,7 +428,7 @@ if i32.const 144 i32.const 96 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -456,7 +459,7 @@ if i32.const 32 i32.const 96 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -481,7 +484,7 @@ if i32.const 144 i32.const 96 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -512,7 +515,7 @@ if i32.const 32 i32.const 96 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -537,7 +540,7 @@ if i32.const 144 i32.const 96 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index bf651869e7..5318c29a7e 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -63,7 +63,7 @@ if i32.const 1200 i32.const 1264 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -82,7 +82,7 @@ if i32.const 1200 i32.const 1264 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 29d006913b..613b5d27e7 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -11,6 +11,9 @@ (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/array-literal/staticArrayI8 i32 (i32.const 64)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $std/array-literal/staticArrayI32 i32 (i32.const 320)) (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 400)) (global $std/array-literal/i (mut i32) (i32.const 0)) @@ -69,7 +72,7 @@ if i32.const 176 i32.const 240 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -99,7 +102,7 @@ if i32.const 176 i32.const 240 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 4830d40836..b4442e9acb 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -3353,7 +3353,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3417,7 +3417,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3478,7 +3478,6 @@ (func $~lib/array/ensureCapacity (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 i32.load offset=8 local.tee $5 @@ -3495,7 +3494,7 @@ if i32.const 1056 i32.const 1104 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -3538,7 +3537,7 @@ local.tee $1 i32.const 20 i32.sub - local.tee $6 + local.tee $5 i32.load i32.const -4 i32.and @@ -3546,19 +3545,19 @@ i32.sub i32.le_u if - local.get $6 + local.get $5 local.get $2 i32.store offset=16 br $__inlined_func$~lib/rt/itcms/__renew end local.get $2 - local.get $6 + local.get $5 i32.load offset=12 call $~lib/rt/itcms/__new local.tee $3 local.get $1 local.get $2 - local.get $6 + local.get $5 i32.load offset=16 local.tee $1 local.get $1 @@ -3570,14 +3569,6 @@ local.set $1 end local.get $1 - local.get $5 - i32.add - i32.const 0 - local.get $2 - local.get $5 - i32.sub - call $~lib/memory/memory.fill - local.get $1 local.get $4 i32.ne if @@ -3634,7 +3625,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3658,7 +3649,7 @@ if i32.const 2176 i32.const 1104 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -3712,7 +3703,7 @@ if i32.const 1344 i32.const 1104 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -4156,7 +4147,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4182,7 +4173,7 @@ if i32.const 1344 i32.const 1104 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -4434,7 +4425,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -6299,7 +6290,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -8814,7 +8805,7 @@ if i32.const 1344 i32.const 1104 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -14465,70 +14456,70 @@ i32.lt_s br_if $folding-inner1 global.get $~lib/memory/__stack_pointer - local.tee $1 + local.tee $0 i64.const 0 i64.store - local.get $1 + local.get $0 i64.const 0 i64.store offset=8 - local.get $1 + local.get $0 i64.const 0 i64.store offset=16 - local.get $1 + local.get $0 i64.const 0 i64.store offset=24 - local.get $1 + local.get $0 i64.const 0 i64.store offset=32 - local.get $1 + local.get $0 i64.const 0 i64.store offset=40 - local.get $1 + local.get $0 i64.const 0 i64.store offset=48 - local.get $1 + local.get $0 i64.const 0 i64.store offset=56 - local.get $1 + local.get $0 i64.const 0 i64.store offset=64 - local.get $1 + local.get $0 i64.const 0 i64.store offset=72 - local.get $1 + local.get $0 i64.const 0 i64.store offset=80 - local.get $1 + local.get $0 i64.const 0 i64.store offset=88 - local.get $1 + local.get $0 i64.const 0 i64.store offset=96 - local.get $1 + local.get $0 i64.const 0 i64.store offset=104 - local.get $1 + local.get $0 i64.const 0 i64.store offset=112 - local.get $1 + local.get $0 i64.const 0 i64.store offset=120 - local.get $1 + local.get $0 i64.const 0 i64.store offset=128 - local.get $1 + local.get $0 i64.const 0 i64.store offset=136 - local.get $1 + local.get $0 i64.const 0 i64.store offset=144 - local.get $1 + local.get $0 i64.const 0 i64.store offset=152 - local.get $1 + local.get $0 i64.const 0 i64.store offset=160 - local.get $1 + local.get $0 i32.const 0 i32.store offset=168 memory.size @@ -14568,9 +14559,9 @@ global.set $std/array/arr i32.const 0 call $std/array/Ref#constructor - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store global.get $~lib/memory/__stack_pointer i32.const 4 @@ -14581,10 +14572,10 @@ i32.lt_s br_if $folding-inner1 global.get $~lib/memory/__stack_pointer - local.tee $1 + local.tee $0 i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 12 i32.const 5 call $~lib/rt/itcms/__new @@ -14627,10 +14618,6 @@ call $~lib/rt/itcms/__new local.tee $65 i32.store offset=4 - local.get $65 - i32.const 0 - i32.const 1 - call $~lib/memory/memory.fill local.get $2 local.get $65 i32.store @@ -14665,9 +14652,9 @@ i32.store global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.eqz if i32.const 0 @@ -14683,9 +14670,9 @@ i32.const 6 i32.const 1696 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=4 - local.get $1 + local.get $0 i32.const 1 i32.const 1 i32.const 3 @@ -14700,7 +14687,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 call $std/array/isArraysEqual i32.eqz @@ -14712,7 +14699,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 0 i32.const 0 i32.const 2147483647 @@ -14727,7 +14714,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 call $std/array/isArraysEqual i32.eqz @@ -14739,7 +14726,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 1 i32.const 0 i32.const -3 @@ -14754,7 +14741,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 call $std/array/isArraysEqual i32.eqz @@ -14766,7 +14753,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 2 i32.const -2 i32.const 2147483647 @@ -14781,7 +14768,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 call $std/array/isArraysEqual i32.eqz @@ -14793,7 +14780,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 0 i32.const 1 i32.const 0 @@ -14808,7 +14795,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 call $std/array/isArraysEqual i32.eqz @@ -14826,13 +14813,13 @@ i32.const 7 i32.const 1888 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=12 - local.get $1 + local.get $0 i32.load offset=4 local.set $65 i32.const 1 - local.get $1 + local.get $0 i32.load offset=12 local.tee $66 local.get $66 @@ -14875,7 +14862,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 call $std/array/isArraysEqual i32.eqz @@ -14887,7 +14874,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 local.tee $2 i32.load offset=4 local.set $65 @@ -14899,23 +14886,23 @@ i32.const 0 i32.gt_s select - local.set $1 + local.set $0 loop $for-loop|01 - local.get $1 + local.get $0 local.get $66 i32.lt_s if - local.get $1 + local.get $0 i32.const 2 i32.shl local.get $65 i32.add i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|01 end end @@ -14924,12 +14911,12 @@ i32.const 7 i32.const 1984 call $~lib/rt/__newArray - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store offset=8 local.get $2 - local.get $1 + local.get $0 call $std/array/isArraysEqual i32.eqz if @@ -14951,7 +14938,7 @@ i32.const 0 i32.gt_s select - local.set $1 + local.set $0 local.get $66 i32.const 3 i32.sub @@ -14963,21 +14950,21 @@ select local.set $66 loop $for-loop|03 - local.get $1 + local.get $0 local.get $66 i32.lt_s if - local.get $1 + local.get $0 i32.const 2 i32.shl local.get $65 i32.add i32.const 1 i32.store - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|03 end end @@ -14986,12 +14973,12 @@ i32.const 7 i32.const 2032 call $~lib/rt/__newArray - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store offset=8 local.get $2 - local.get $1 + local.get $0 call $std/array/isArraysEqual i32.eqz if @@ -15010,29 +14997,29 @@ local.tee $66 i32.const 2 i32.sub - local.tee $1 + local.tee $0 i32.const 0 - local.get $1 + local.get $0 i32.const 0 i32.gt_s select - local.set $1 + local.set $0 loop $for-loop|05 - local.get $1 + local.get $0 local.get $66 i32.lt_s if - local.get $1 + local.get $0 i32.const 2 i32.shl local.get $65 i32.add i32.const 2 i32.store - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|05 end end @@ -15041,12 +15028,12 @@ i32.const 7 i32.const 2080 call $~lib/rt/__newArray - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store offset=8 local.get $2 - local.get $1 + local.get $0 call $std/array/isArraysEqual i32.eqz if @@ -15068,7 +15055,7 @@ i32.const 1 i32.gt_s select - local.set $1 + local.set $0 i32.const 0 local.get $66 local.get $66 @@ -15077,21 +15064,21 @@ select local.set $66 loop $for-loop|07 - local.get $1 + local.get $0 local.get $66 i32.lt_s if - local.get $1 + local.get $0 i32.const 2 i32.shl local.get $65 i32.add i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|07 end end @@ -15100,12 +15087,12 @@ i32.const 7 i32.const 2128 call $~lib/rt/__newArray - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store offset=8 local.get $2 - local.get $1 + local.get $0 call $std/array/isArraysEqual i32.eqz if @@ -15118,9 +15105,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 if i32.const 0 @@ -15132,9 +15119,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -15148,17 +15135,17 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 42 call $~lib/array/Array#push drop global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -15173,9 +15160,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 1 i32.ne @@ -15189,9 +15176,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -15205,9 +15192,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $~lib/array/Array#pop i32.const 42 i32.ne @@ -15221,9 +15208,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 if i32.const 0 @@ -15235,9 +15222,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -15251,17 +15238,17 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 43 call $~lib/array/Array#push drop global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 1 i32.ne @@ -15275,9 +15262,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -15291,9 +15278,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -15308,17 +15295,17 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 44 call $~lib/array/Array#push drop global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 2 i32.ne @@ -15332,9 +15319,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -15348,9 +15335,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -15365,9 +15352,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 1 call $~lib/array/Array#__get i32.const 44 @@ -15382,17 +15369,17 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 45 call $~lib/array/Array#push drop global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 3 i32.ne @@ -15406,9 +15393,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -15422,9 +15409,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 43 @@ -15439,9 +15426,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 1 call $~lib/array/Array#__get i32.const 44 @@ -15456,9 +15443,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 2 call $~lib/array/Array#__get i32.const 45 @@ -15472,7 +15459,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.tee $1 + local.tee $0 i32.const 2 i32.const 2 i32.const 8 @@ -15494,7 +15481,7 @@ i32.const 0 call $std/array/Ref#constructor call $~lib/array/Array#__uset - local.get $1 + local.get $0 local.get $2 i32.store offset=16 local.get $2 @@ -15521,9 +15508,9 @@ i32.const 3 i32.const 2224 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=12 - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#at i32.const 1 @@ -15536,7 +15523,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 3 call $~lib/array/Array#at i32.const 4 @@ -15549,7 +15536,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const -1 call $~lib/array/Array#at i32.const 4 @@ -15562,7 +15549,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const -4 call $~lib/array/Array#at i32.const 1 @@ -15578,7 +15565,7 @@ global.get $~lib/memory/__stack_pointer i32.const 0 call $~lib/array/Array#constructor - local.tee $1 + local.tee $0 i32.store offset=12 global.get $~lib/memory/__stack_pointer global.get $std/array/arr @@ -15586,7 +15573,7 @@ i32.store global.get $~lib/memory/__stack_pointer local.get $2 - local.get $1 + local.get $0 call $~lib/array/Array#concat local.tee $2 i32.store offset=16 @@ -15702,11 +15689,11 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 46 call $~lib/array/Array#push drop - local.get $1 + local.get $0 i32.const 47 call $~lib/array/Array#push drop @@ -15717,7 +15704,7 @@ i32.store local.get $2 local.get $65 - local.get $1 + local.get $0 call $~lib/array/Array#concat local.tee $2 i32.store offset=16 @@ -15737,7 +15724,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.load offset=12 i32.const 2 i32.ne @@ -15847,9 +15834,9 @@ i32.const 3 i32.const 2304 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=4 - local.get $1 + local.get $0 i32.load offset=12 if i32.const 0 @@ -15865,7 +15852,7 @@ local.tee $65 i32.store offset=8 local.get $2 - local.get $1 + local.get $0 local.get $65 call $~lib/array/Array#concat local.tee $2 @@ -15882,7 +15869,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.load offset=12 if i32.const 0 @@ -15898,16 +15885,16 @@ i32.const 3 i32.const 2336 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 0 i32.const 3 i32.const 2147483647 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -15918,7 +15905,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -15937,16 +15924,16 @@ i32.const 3 i32.const 2432 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 1 i32.const 3 i32.const 2147483647 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -15957,7 +15944,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -15976,16 +15963,16 @@ i32.const 3 i32.const 2528 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 1 i32.const 2 i32.const 2147483647 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -15996,7 +15983,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16015,16 +16002,16 @@ i32.const 3 i32.const 2624 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 2 i32.const 2 i32.const 2147483647 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16035,7 +16022,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16054,16 +16041,16 @@ i32.const 3 i32.const 2720 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 0 i32.const 3 i32.const 4 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16074,7 +16061,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16093,16 +16080,16 @@ i32.const 3 i32.const 2816 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 1 i32.const 3 i32.const 4 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16113,7 +16100,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16132,16 +16119,16 @@ i32.const 3 i32.const 2912 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 1 i32.const 2 i32.const 4 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16152,7 +16139,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16171,16 +16158,16 @@ i32.const 3 i32.const 3008 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 0 i32.const -2 i32.const 2147483647 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16191,7 +16178,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16210,16 +16197,16 @@ i32.const 3 i32.const 3104 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const 0 i32.const -2 i32.const -1 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16230,7 +16217,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16249,16 +16236,16 @@ i32.const 3 i32.const 3200 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const -4 i32.const -3 i32.const -2 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16269,7 +16256,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16288,16 +16275,16 @@ i32.const 3 i32.const 3296 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const -4 i32.const -3 i32.const -1 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16308,7 +16295,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16327,16 +16314,16 @@ i32.const 3 i32.const 3392 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=16 - local.get $1 + local.get $0 i32.const -4 i32.const -3 i32.const 2147483647 call $~lib/array/Array#copyWithin - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store i32.const 5 i32.const 2 @@ -16347,7 +16334,7 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.store offset=8 - local.get $1 + local.get $0 local.get $2 i32.const 0 call $std/array/isArraysEqual @@ -16362,17 +16349,17 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 42 call $~lib/array/Array#unshift drop global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 4 i32.ne @@ -16386,9 +16373,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -16402,9 +16389,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -16419,9 +16406,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 1 call $~lib/array/Array#__get i32.const 43 @@ -16436,9 +16423,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 2 call $~lib/array/Array#__get i32.const 44 @@ -16453,9 +16440,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 3 call $~lib/array/Array#__get i32.const 45 @@ -16470,17 +16457,17 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 41 call $~lib/array/Array#unshift drop global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 5 i32.ne @@ -16494,9 +16481,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -16510,9 +16497,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 41 @@ -16527,9 +16514,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 1 call $~lib/array/Array#__get i32.const 42 @@ -16544,9 +16531,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 2 call $~lib/array/Array#__get i32.const 43 @@ -16561,9 +16548,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 3 call $~lib/array/Array#__get i32.const 44 @@ -16578,9 +16565,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 4 call $~lib/array/Array#__get i32.const 45 @@ -16595,9 +16582,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 local.tee $2 i32.const 0 @@ -16605,12 +16592,12 @@ if i32.const 2176 i32.const 1104 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.load offset=4 local.tee $65 i32.load @@ -16631,7 +16618,7 @@ i32.add i32.const 0 i32.store - local.get $1 + local.get $0 local.get $2 i32.store offset=12 global.set $std/array/i @@ -16648,9 +16635,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 4 i32.ne @@ -16664,9 +16651,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -16680,9 +16667,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -16697,9 +16684,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 1 call $~lib/array/Array#__get i32.const 43 @@ -16714,9 +16701,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 2 call $~lib/array/Array#__get i32.const 44 @@ -16731,9 +16718,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 3 call $~lib/array/Array#__get i32.const 45 @@ -16748,9 +16735,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $~lib/array/Array#pop global.set $std/array/i global.get $std/array/i @@ -16766,9 +16753,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 i32.const 3 i32.ne @@ -16782,9 +16769,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 call $std/array/internalCapacity i32.const 8 i32.ne @@ -16798,9 +16785,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 0 call $~lib/array/Array#__get i32.const 42 @@ -16815,9 +16802,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 1 call $~lib/array/Array#__get i32.const 43 @@ -16832,9 +16819,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.const 2 call $~lib/array/Array#__get i32.const 44 @@ -16853,10 +16840,10 @@ i32.const 3 i32.const 3488 call $~lib/rt/__newArray - local.tee $1 + local.tee $0 i32.store offset=4 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.const 2 i32.const 2147483647 call $~lib/array/Array#slice @@ -16885,7 +16872,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.const 2 i32.const 4 call $~lib/array/Array#slice @@ -16914,7 +16901,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.const 1 i32.const 5 call $~lib/array/Array#slice @@ -16943,14 +16930,14 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.const 0 i32.const 2147483647 call $~lib/array/Array#slice local.tee $2 i32.store offset=16 local.get $2 - local.get $1 + local.get $0 i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16963,7 +16950,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.const -2 i32.const 2147483647 call $~lib/array/Array#slice @@ -16992,7 +16979,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.const 2 i32.const -1 call $~lib/array/Array#slice @@ -17021,7 +17008,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.const -3 i32.const -1 call $~lib/array/Array#slice @@ -17049,7 +17036,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const -1 i32.const -3 call $~lib/array/Array#slice @@ -17067,15 +17054,15 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 10 i32.const 2147483647 call $~lib/array/Array#slice - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store - local.get $1 + local.get $0 i32.load offset=12 if i32.const 0 @@ -17087,31 +17074,31 @@ end global.get $~lib/memory/__stack_pointer global.get $std/array/arr - local.tee $1 + local.tee $0 i32.store - local.get $1 + local.get $0 i32.load offset=4 local.set $2 - local.get $1 + local.get $0 i32.load offset=12 - local.tee $1 + local.tee $0 i32.const 1 i32.gt_u if - local.get $1 + local.get $0 i32.const 1 i32.shr_u local.set $65 - local.get $1 + local.get $0 i32.const 1 i32.sub - local.set $1 + local.set $0 loop $while-continue|0 - local.get $0 + local.get $1 local.get $65 i32.lt_u if - local.get $0 + local.get $1 i32.const 2 i32.shl local.get $2 @@ -17120,8 +17107,8 @@ i32.load local.set $67 local.get $66 - local.get $1 local.get $0 + local.get $1 i32.sub i32.const 2 i32.shl @@ -17133,10 +17120,10 @@ local.get $66 local.get $67 i32.store - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $while-continue|0 end end @@ -17564,10 +17551,10 @@ local.set $1 loop $while-continue|013 local.get $2 - local.get $9 + local.get $3 i32.gt_s if - local.get $9 + local.get $3 local.tee $0 i32.const 2 i32.shl @@ -17580,7 +17567,7 @@ local.get $0 i32.const 1 i32.add - local.set $9 + local.set $3 br $while-continue|013 end end @@ -17619,10 +17606,10 @@ local.set $1 loop $while-continue|041 local.get $2 - local.get $8 + local.get $9 i32.gt_s if - local.get $8 + local.get $9 local.tee $0 i32.const 2 i32.shl @@ -17635,7 +17622,7 @@ local.get $0 i32.const 1 i32.add - local.set $8 + local.set $9 br $while-continue|041 end end @@ -17676,10 +17663,10 @@ local.set $1 loop $while-continue|044 local.get $2 - local.get $7 + local.get $8 i32.gt_s if - local.get $7 + local.get $8 local.tee $0 i32.const 2 i32.shl @@ -17692,7 +17679,7 @@ local.get $0 i32.const 1 i32.add - local.set $7 + local.set $8 br $while-continue|044 end end @@ -17723,11 +17710,11 @@ block $__inlined_func$~lib/array/Array#indexOf45 local.get $0 i32.load offset=12 - local.tee $7 + local.tee $3 i32.const 100 i32.le_s i32.const 1 - local.get $7 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf45 local.get $0 @@ -17735,7 +17722,7 @@ local.set $0 loop $while-continue|047 local.get $2 - local.get $7 + local.get $3 i32.lt_s if local.get $2 @@ -17990,10 +17977,10 @@ local.set $1 loop $while-continue|059 local.get $2 - local.get $6 + local.get $7 i32.gt_s if - local.get $6 + local.get $7 local.tee $0 i32.const 2 i32.shl @@ -18006,7 +17993,7 @@ local.get $0 i32.const 1 i32.add - local.set $6 + local.set $7 br $while-continue|059 end end @@ -18037,11 +18024,11 @@ block $__inlined_func$~lib/array/Array#indexOf60 local.get $0 i32.load offset=12 - local.tee $6 + local.tee $3 i32.const 1 i32.le_s i32.const 1 - local.get $6 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf60 local.get $0 @@ -18049,7 +18036,7 @@ local.set $0 loop $while-continue|062 local.get $2 - local.get $6 + local.get $3 i32.lt_s if local.get $2 @@ -18096,11 +18083,11 @@ block $__inlined_func$~lib/array/Array#indexOf63 local.get $0 i32.load offset=12 - local.tee $6 + local.tee $3 i32.const 2 i32.le_s i32.const 1 - local.get $6 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf63 local.get $0 @@ -18108,7 +18095,7 @@ local.set $0 loop $while-continue|065 local.get $2 - local.get $6 + local.get $3 i32.lt_s if local.get $2 @@ -18170,10 +18157,10 @@ local.set $0 loop $while-continue|067 local.get $2 - local.get $5 + local.get $6 i32.gt_s if - local.get $5 + local.get $6 local.tee $1 i32.const 2 i32.shl @@ -18186,7 +18173,7 @@ local.get $1 i32.const 1 i32.add - local.set $5 + local.set $6 br $while-continue|067 end end @@ -18230,10 +18217,10 @@ local.set $0 loop $while-continue|069 local.get $2 - local.get $4 + local.get $5 i32.gt_s if - local.get $4 + local.get $5 local.tee $1 i32.const 3 i32.shl @@ -18246,7 +18233,7 @@ local.get $1 i32.const 1 i32.add - local.set $4 + local.set $5 br $while-continue|069 end end @@ -18276,26 +18263,26 @@ global.set $~argumentsLength local.get $2 i32.load offset=12 - local.tee $1 - local.set $4 + local.tee $0 + local.set $1 i32.const -1 - local.set $0 + local.set $3 block $__inlined_func$~lib/array/Array#lastIndexOf - local.get $1 + local.get $0 i32.eqz br_if $__inlined_func$~lib/array/Array#lastIndexOf + local.get $0 local.get $1 - local.get $4 i32.add - local.get $1 + local.get $0 i32.const 1 i32.sub - local.get $4 local.get $1 - local.get $4 + local.get $0 + local.get $1 i32.le_s select - local.get $4 + local.get $1 i32.const 0 i32.lt_s select @@ -18309,6 +18296,7 @@ i32.ge_s if local.get $0 + local.tee $3 i32.const 2 i32.shl local.get $1 @@ -18317,7 +18305,7 @@ i32.const 2 i32.eq br_if $__inlined_func$~lib/array/Array#lastIndexOf - local.get $0 + local.get $3 i32.const 1 i32.sub local.set $0 @@ -18325,9 +18313,9 @@ end end i32.const -1 - local.set $0 + local.set $3 end - local.get $0 + local.get $3 i32.const 3 i32.ne if @@ -18342,26 +18330,26 @@ global.set $~argumentsLength local.get $2 i32.load offset=12 - local.tee $1 - local.set $4 + local.tee $0 + local.set $1 i32.const -1 - local.set $0 + local.set $3 block $__inlined_func$~lib/array/Array#lastIndexOf6 - local.get $1 + local.get $0 i32.eqz br_if $__inlined_func$~lib/array/Array#lastIndexOf6 + local.get $0 local.get $1 - local.get $4 i32.add - local.get $1 + local.get $0 i32.const 1 i32.sub - local.get $4 local.get $1 - local.get $4 + local.get $0 + local.get $1 i32.le_s select - local.get $4 + local.get $1 i32.const 0 i32.lt_s select @@ -18375,6 +18363,7 @@ i32.ge_s if local.get $0 + local.tee $3 i32.const 2 i32.shl local.get $1 @@ -18383,7 +18372,7 @@ i32.const 7 i32.eq br_if $__inlined_func$~lib/array/Array#lastIndexOf6 - local.get $0 + local.get $3 i32.const 1 i32.sub local.set $0 @@ -18391,9 +18380,9 @@ end end i32.const -1 - local.set $0 + local.set $3 end - local.get $0 + local.get $3 i32.const -1 i32.ne if @@ -18623,11 +18612,11 @@ block $__inlined_func$~lib/array/Array#indexOf9 local.get $2 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const 0 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf9 local.get $2 @@ -18635,7 +18624,7 @@ local.set $2 loop $while-continue|010 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $1 @@ -18680,11 +18669,11 @@ block $__inlined_func$~lib/array/Array#indexOf12 local.get $2 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const 0 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf12 local.get $2 @@ -18692,7 +18681,7 @@ local.set $2 loop $while-continue|014 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $1 @@ -18737,11 +18726,11 @@ block $__inlined_func$~lib/array/Array#indexOf16 local.get $2 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const 0 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf16 local.get $2 @@ -18749,7 +18738,7 @@ local.set $2 loop $while-continue|017 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $1 @@ -18794,11 +18783,11 @@ block $__inlined_func$~lib/array/Array#indexOf19 local.get $2 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const 100 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf19 local.get $2 @@ -18806,7 +18795,7 @@ local.set $2 loop $while-continue|020 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $1 @@ -18849,14 +18838,14 @@ block $__inlined_func$~lib/array/Array#indexOf22 local.get $1 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const -100 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf22 - local.get $4 + local.get $3 i32.const 100 i32.sub local.tee $0 @@ -18871,7 +18860,7 @@ local.set $1 loop $while-continue|023 local.get $2 - local.get $4 + local.get $3 i32.lt_s if local.get $2 @@ -18914,14 +18903,14 @@ block $__inlined_func$~lib/array/Array#indexOf25 local.get $1 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const -2 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf25 - local.get $4 + local.get $3 i32.const 2 i32.sub local.tee $0 @@ -18936,7 +18925,7 @@ local.set $1 loop $while-continue|026 local.get $2 - local.get $4 + local.get $3 i32.lt_s if local.get $2 @@ -18979,14 +18968,14 @@ block $__inlined_func$~lib/array/Array#indexOf28 local.get $1 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const -4 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf28 - local.get $4 + local.get $3 i32.const 4 i32.sub local.tee $0 @@ -19001,7 +18990,7 @@ local.set $1 loop $while-continue|029 local.get $2 - local.get $4 + local.get $3 i32.lt_s if local.get $2 @@ -19046,11 +19035,11 @@ block $__inlined_func$~lib/array/Array#indexOf31 local.get $2 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const 0 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf31 local.get $2 @@ -19058,7 +19047,7 @@ local.set $2 loop $while-continue|032 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $1 @@ -19103,11 +19092,11 @@ block $__inlined_func$~lib/array/Array#indexOf34 local.get $2 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const 1 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf34 local.get $2 @@ -19115,7 +19104,7 @@ local.set $2 loop $while-continue|035 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $1 @@ -19160,11 +19149,11 @@ block $__inlined_func$~lib/array/Array#indexOf37 local.get $2 i32.load offset=12 - local.tee $4 + local.tee $3 i32.const 2 i32.le_s i32.const 1 - local.get $4 + local.get $3 select br_if $__inlined_func$~lib/array/Array#indexOf37 local.get $2 @@ -19172,7 +19161,7 @@ local.set $2 loop $while-continue|038 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $1 @@ -20468,15 +20457,15 @@ i32.const 0 local.get $1 i32.load offset=12 - local.tee $4 - local.get $4 + local.tee $3 + local.get $3 i32.const 0 i32.gt_s select local.set $5 local.get $2 i32.const 1 - local.get $4 + local.get $3 local.get $5 i32.sub local.tee $2 @@ -20511,7 +20500,7 @@ i32.const 2 i32.shl call $~lib/memory/memory.copy - local.get $4 + local.get $3 local.get $2 local.get $5 i32.add @@ -20524,7 +20513,7 @@ i32.shl local.get $7 i32.add - local.get $4 + local.get $3 local.get $5 i32.sub i32.const 2 @@ -20532,7 +20521,7 @@ call $~lib/memory/memory.copy end local.get $1 - local.get $4 + local.get $3 local.get $2 i32.sub i32.store offset=12 @@ -22524,9 +22513,9 @@ i32.const 10 i32.const 0 call $~lib/rt/__newArray - local.tee $4 + local.tee $3 i32.store - local.get $4 + local.get $3 i32.load offset=4 local.set $5 loop $for-loop|0197 @@ -22573,9 +22562,9 @@ i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store offset=12 - local.get $4 + local.get $3 i32.load offset=12 i32.const 4 i32.ne @@ -22587,7 +22576,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 i32.const 0 call $~lib/array/Array#__get local.set $12 @@ -23008,9 +22997,9 @@ local.get $2 local.get $1 i32.load offset=12 - local.tee $4 + local.tee $3 local.get $2 - local.get $4 + local.get $3 i32.lt_s select local.get $37 @@ -23023,11 +23012,11 @@ i32.shl i32.add i32.load - local.set $4 + local.set $3 i32.const 4 global.set $~argumentsLength local.get $0 - local.get $4 + local.get $3 local.get $37 local.get $1 i32.const 7280 @@ -23485,14 +23474,14 @@ global.get $~lib/memory/__stack_pointer local.tee $0 global.get $std/array/arr - local.tee $4 + local.tee $3 i32.store local.get $0 i32.const 7504 i32.store offset=8 i32.const 4 local.set $1 - local.get $4 + local.get $3 i32.load offset=12 i32.const 1 i32.sub @@ -23502,7 +23491,7 @@ i32.const 0 i32.ge_s if - local.get $4 + local.get $3 i32.load offset=4 local.get $2 i32.const 2 @@ -23515,7 +23504,7 @@ local.get $1 local.get $0 local.get $2 - local.get $4 + local.get $3 i32.const 7504 i32.load call_indirect $0 (type $i32_i32_i32_i32_=>_i32) @@ -24642,7 +24631,7 @@ i32.const 3 i32.const 8688 call $~lib/rt/__newArray - local.tee $4 + local.tee $3 i32.store offset=136 global.get $~lib/memory/__stack_pointer i32.const 4 @@ -24727,9 +24716,9 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 call $std/array/assertSortedDefault - local.get $4 + local.get $3 local.get $5 i32.const 0 call $std/array/isArraysEqual @@ -24843,14 +24832,14 @@ i32.const 0 local.get $2 i32.load offset=12 - local.tee $4 - local.get $4 + local.tee $3 + local.get $3 i32.const 0 i32.gt_s select local.set $5 local.get $0 - local.get $4 + local.get $3 local.get $5 i32.sub local.tee $0 @@ -24859,7 +24848,7 @@ i32.const 0 i32.gt_s select - local.tee $4 + local.tee $3 i32.const 2 i32.const 20 i32.const 0 @@ -24876,12 +24865,12 @@ i32.shl i32.add local.set $2 - local.get $4 + local.get $3 i32.const 2 i32.shl - local.set $4 + local.set $3 loop $while-continue|00 - local.get $4 + local.get $3 local.get $64 i32.gt_u if @@ -25089,24 +25078,20 @@ i32.const 32 i32.const 0 call $~lib/rt/itcms/__new - local.tee $4 + local.tee $3 i32.store offset=4 - local.get $4 - i32.const 0 - i32.const 32 - call $~lib/memory/memory.fill local.get $2 - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 if local.get $2 - local.get $4 + local.get $3 i32.const 0 call $byn-split-outlined-A$~lib/rt/itcms/__link end local.get $2 - local.get $4 + local.get $3 i32.store offset=4 local.get $2 i32.const 32 @@ -25209,24 +25194,20 @@ i32.const 2048 i32.const 0 call $~lib/rt/itcms/__new - local.tee $4 + local.tee $3 i32.store offset=4 - local.get $4 - i32.const 0 - i32.const 2048 - call $~lib/memory/memory.fill local.get $2 - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 if local.get $2 - local.get $4 + local.get $3 i32.const 0 call $byn-split-outlined-A$~lib/rt/itcms/__link end local.get $2 - local.get $4 + local.get $3 i32.store offset=4 local.get $2 i32.const 2048 @@ -25382,10 +25363,10 @@ local.set $1 local.get $0 i32.load offset=12 - local.set $4 + local.set $3 loop $for-loop|048 local.get $1 - local.get $4 + local.get $3 i32.lt_s if local.get $0 @@ -25496,9 +25477,9 @@ local.get $0 local.get $30 call $~lib/array/Array#__get - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store local.get $2 local.get $30 @@ -25507,7 +25488,7 @@ global.get $~lib/memory/__stack_pointer local.get $5 i32.store offset=4 - local.get $4 + local.get $3 local.get $5 call $~lib/string/String.__eq i32.eqz @@ -25542,7 +25523,7 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.tee $4 + local.tee $3 i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer @@ -25700,7 +25681,7 @@ i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 local.get $5 i32.store offset=156 i32.const 1 @@ -25759,7 +25740,7 @@ local.set $61 local.get $1 i32.load offset=4 - local.set $4 + local.set $3 local.get $1 i32.load offset=12 local.set $1 @@ -25795,7 +25776,7 @@ if i32.const 9456 i32.const 9488 - local.get $4 + local.get $3 i32.load8_u select local.set $2 @@ -25829,7 +25810,7 @@ local.get $61 i32.gt_s if - local.get $4 + local.get $3 local.get $61 i32.add i32.load8_u @@ -25880,14 +25861,14 @@ end end local.get $1 - local.get $4 + local.get $3 i32.add i32.load8_u local.tee $1 i32.eqz i32.const 4 i32.add - local.set $4 + local.set $3 local.get $0 i32.const 1 i32.shl @@ -25897,13 +25878,13 @@ i32.const 9488 local.get $1 select - local.get $4 + local.get $3 i32.const 1 i32.shl call $~lib/memory/memory.copy local.get $6 local.get $0 - local.get $4 + local.get $3 i32.add local.tee $0 i32.gt_s @@ -26253,7 +26234,7 @@ i32.const 3 i32.const 13424 call $~lib/rt/__newArray - local.tee $4 + local.tee $3 i32.store offset=144 local.get $0 call $~lib/array/Array#toString @@ -26320,7 +26301,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 call $~lib/array/Array#toString local.set $0 global.get $~lib/memory/__stack_pointer @@ -26373,7 +26354,7 @@ local.set $62 local.get $1 i32.load offset=4 - local.set $4 + local.set $3 local.get $1 i32.load offset=12 local.set $1 @@ -26407,7 +26388,7 @@ local.get $1 i32.eqz if - local.get $4 + local.get $3 i32.load8_s call $~lib/util/number/itoa32 local.set $2 @@ -26446,7 +26427,7 @@ i32.shl local.get $2 i32.add - local.get $4 + local.get $3 local.get $62 i32.add i32.load8_s @@ -26485,7 +26466,7 @@ local.get $2 i32.add local.get $1 - local.get $4 + local.get $3 i32.add i32.load8_s call $~lib/util/number/itoa_buffered @@ -26562,7 +26543,7 @@ local.set $62 local.get $1 i32.load offset=4 - local.set $4 + local.set $3 local.get $1 i32.load offset=12 local.set $1 @@ -26596,7 +26577,7 @@ local.get $1 i32.eqz if - local.get $4 + local.get $3 i32.load16_u call $~lib/util/number/utoa32 local.set $2 @@ -26638,7 +26619,7 @@ local.get $62 i32.const 1 i32.shl - local.get $4 + local.get $3 i32.add i32.load16_u call $~lib/util/number/itoa_buffered @@ -26678,7 +26659,7 @@ local.get $1 i32.const 1 i32.shl - local.get $4 + local.get $3 i32.add i32.load16_u call $~lib/util/number/itoa_buffered @@ -26934,7 +26915,7 @@ local.set $62 local.get $1 i32.load offset=4 - local.set $4 + local.set $3 local.get $1 i32.load offset=12 local.set $1 @@ -26973,7 +26954,7 @@ i32.eqz if global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.load local.tee $0 i32.store @@ -27010,7 +26991,7 @@ local.get $62 i32.const 2 i32.shl - local.get $4 + local.get $3 i32.add i32.load local.tee $5 @@ -27050,7 +27031,7 @@ local.get $0 i32.const 2 i32.shl - local.get $4 + local.get $3 i32.add i32.load local.tee $0 @@ -27148,7 +27129,7 @@ local.set $62 local.get $1 i32.load offset=4 - local.set $4 + local.set $3 local.get $1 i32.load offset=12 local.set $1 @@ -27187,7 +27168,7 @@ i32.eqz if global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.load local.tee $0 i32.store @@ -27224,7 +27205,7 @@ local.get $62 i32.const 2 i32.shl - local.get $4 + local.get $3 i32.add i32.load local.tee $5 @@ -27264,7 +27245,7 @@ local.get $0 i32.const 2 i32.shl - local.get $4 + local.get $3 i32.add i32.load local.tee $0 @@ -27370,7 +27351,7 @@ local.set $62 local.get $1 i32.load offset=4 - local.set $4 + local.set $3 local.get $1 i32.load offset=12 local.set $1 @@ -27409,7 +27390,7 @@ i32.eqz if global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.load local.tee $0 i32.store @@ -27446,7 +27427,7 @@ local.get $62 i32.const 2 i32.shl - local.get $4 + local.get $3 i32.add i32.load local.tee $5 @@ -27486,7 +27467,7 @@ local.get $0 i32.const 2 i32.shl - local.get $4 + local.get $3 i32.add i32.load local.tee $0 @@ -27702,9 +27683,9 @@ local.get $2 i32.add i32.load - local.tee $4 + local.tee $3 if (result i32) - local.get $4 + local.get $3 i32.load offset=12 else i32.const 0 @@ -27723,7 +27704,7 @@ local.get $29 i32.const 2 i32.shl - local.tee $4 + local.tee $3 i32.const 0 call $~lib/rt/itcms/__new local.tee $5 @@ -27738,7 +27719,7 @@ local.get $29 i32.store offset=12 local.get $6 - local.get $4 + local.get $3 i32.store offset=8 local.get $6 local.get $5 @@ -27766,23 +27747,23 @@ local.get $2 i32.add i32.load - local.tee $4 + local.tee $3 if - local.get $3 + local.get $4 local.get $5 i32.add - local.get $4 + local.get $3 i32.load offset=4 - local.get $4 + local.get $3 i32.load offset=12 i32.const 2 i32.shl - local.tee $4 + local.tee $3 call $~lib/memory/memory.copy local.get $3 local.get $4 i32.add - local.set $3 + local.set $4 end local.get $60 i32.const 1 @@ -28320,7 +28301,7 @@ if i32.const 1056 i32.const 1104 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -28339,10 +28320,6 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 0 - local.get $2 - call $~lib/memory/memory.fill local.get $1 local.get $3 i32.store @@ -28547,7 +28524,7 @@ if i32.const 1056 i32.const 1104 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -28942,7 +28919,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -28962,7 +28939,7 @@ if i32.const 5952 i32.const 1104 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -29000,7 +28977,7 @@ if i32.const 1344 i32.const 1104 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -29471,7 +29448,7 @@ if i32.const 1056 i32.const 1104 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -29490,10 +29467,6 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store offset=4 - local.get $2 - i32.const 0 - local.get $3 - call $~lib/memory/memory.fill local.get $0 local.get $2 i32.store @@ -30255,7 +30228,7 @@ i32.store end global.get $~lib/memory/__stack_pointer - local.tee $4 + local.tee $3 i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer @@ -30294,7 +30267,7 @@ if i32.const 1056 i32.const 1104 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -30308,15 +30281,11 @@ select i32.const 2 i32.shl - local.tee $3 + local.tee $4 i32.const 0 call $~lib/rt/itcms/__new local.tee $2 i32.store offset=4 - local.get $2 - i32.const 0 - local.get $3 - call $~lib/memory/memory.fill local.get $0 local.get $2 i32.store @@ -30331,7 +30300,7 @@ local.get $2 i32.store offset=4 local.get $0 - local.get $3 + local.get $4 i32.store offset=8 local.get $0 local.get $1 @@ -30340,7 +30309,7 @@ i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 local.get $0 i32.store global.get $~lib/memory/__stack_pointer @@ -30681,7 +30650,7 @@ if i32.const 1344 i32.const 1104 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -31167,7 +31136,7 @@ if i32.const 1056 i32.const 1104 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -31288,7 +31257,7 @@ if i32.const 2176 i32.const 1104 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -31512,7 +31481,7 @@ if i32.const 2176 i32.const 1104 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable @@ -32124,7 +32093,7 @@ i32.store i32.const 15152 i32.const 1104 - i32.const 462 + i32.const 469 i32.const 7 call $~lib/builtins/abort unreachable @@ -32206,7 +32175,7 @@ i32.store end global.get $~lib/memory/__stack_pointer - local.tee $4 + local.tee $3 i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer @@ -32245,7 +32214,7 @@ if i32.const 1056 i32.const 1104 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -32257,15 +32226,11 @@ i32.const 8 i32.gt_u select - local.tee $3 + local.tee $4 i32.const 0 call $~lib/rt/itcms/__new local.tee $2 i32.store offset=4 - local.get $2 - i32.const 0 - local.get $3 - call $~lib/memory/memory.fill local.get $0 local.get $2 i32.store @@ -32280,7 +32245,7 @@ local.get $2 i32.store offset=4 local.get $0 - local.get $3 + local.get $4 i32.store offset=8 local.get $0 local.get $1 @@ -32289,7 +32254,7 @@ i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 local.get $0 i32.store global.get $~lib/memory/__stack_pointer @@ -32596,7 +32561,7 @@ if i32.const 1344 i32.const 1104 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -33011,7 +32976,7 @@ if i32.const 1056 i32.const 1104 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -33220,7 +33185,7 @@ if i32.const 2176 i32.const 1104 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -33437,7 +33402,7 @@ if i32.const 2176 i32.const 1104 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable @@ -34447,7 +34412,7 @@ if i32.const 1344 i32.const 1104 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -34467,7 +34432,7 @@ if i32.const 5952 i32.const 1104 - i32.const 144 + i32.const 151 i32.const 40 call $~lib/builtins/abort unreachable @@ -34916,7 +34881,7 @@ if i32.const 1056 i32.const 1104 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -35062,7 +35027,7 @@ if i32.const 2176 i32.const 1104 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -35332,7 +35297,7 @@ if i32.const 2176 i32.const 1104 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index c2c0f7c8d6..5604a6719a 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -33,6 +33,9 @@ (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (import "env" "seed" (func $~lib/builtins/seed (result f64))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -45,6 +48,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $std/array/arr (mut i32) (i32.const 0)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) (global $std/array/i (mut i32) (i32.const 0)) @@ -4258,7 +4262,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4434,7 +4438,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4585,7 +4589,7 @@ if i32.const 32 i32.const 80 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -4629,14 +4633,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -4696,7 +4696,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4725,7 +4725,7 @@ if i32.const 1152 i32.const 80 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -4802,7 +4802,7 @@ if i32.const 320 i32.const 80 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -5053,7 +5053,7 @@ if i32.const 1152 i32.const 80 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable @@ -5502,7 +5502,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -6040,7 +6040,7 @@ if i32.const 320 i32.const 80 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -6589,7 +6589,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -9116,7 +9116,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -12053,7 +12053,7 @@ if i32.const 320 i32.const 80 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -12970,7 +12970,7 @@ if i32.const 320 i32.const 80 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -14990,7 +14990,7 @@ if i32.const 320 i32.const 80 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -19166,7 +19166,7 @@ if i32.const 320 i32.const 80 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -19210,7 +19210,7 @@ if i32.const 320 i32.const 80 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -19541,7 +19541,7 @@ if i32.const 1152 i32.const 80 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -19623,7 +19623,7 @@ if i32.const 1152 i32.const 80 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable @@ -19836,7 +19836,7 @@ drop i32.const 14128 i32.const 80 - i32.const 462 + i32.const 469 i32.const 7 call $~lib/builtins/abort unreachable @@ -20079,7 +20079,7 @@ if i32.const 320 i32.const 80 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -20123,7 +20123,7 @@ if i32.const 320 i32.const 80 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -20458,7 +20458,7 @@ if i32.const 1152 i32.const 80 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -20540,7 +20540,7 @@ if i32.const 1152 i32.const 80 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable @@ -21581,7 +21581,7 @@ drop i32.const 14128 i32.const 80 - i32.const 462 + i32.const 469 i32.const 7 call $~lib/builtins/abort unreachable @@ -22061,7 +22061,7 @@ drop i32.const 14128 i32.const 80 - i32.const 462 + i32.const 469 i32.const 7 call $~lib/builtins/abort unreachable @@ -36972,7 +36972,7 @@ if i32.const 32 i32.const 80 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -36994,10 +36994,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -37087,7 +37087,7 @@ if i32.const 32 i32.const 576 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -37101,10 +37101,10 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $3 call $~lib/arraybuffer/ArrayBufferView#set:buffer @@ -37275,7 +37275,7 @@ if i32.const 32 i32.const 80 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -37699,7 +37699,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -37724,7 +37724,7 @@ if i32.const 4928 i32.const 80 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -37879,7 +37879,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -38628,7 +38628,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -38653,7 +38653,7 @@ if i32.const 4928 i32.const 80 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -38710,7 +38710,7 @@ if i32.const 32 i32.const 80 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -38732,10 +38732,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array<~lib/array/Array>#set:buffer @@ -38836,7 +38836,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -38861,7 +38861,7 @@ if i32.const 4928 i32.const 80 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -38918,7 +38918,7 @@ if i32.const 32 i32.const 80 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -38940,10 +38940,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array>#set:buffer @@ -39013,7 +39013,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -39038,7 +39038,7 @@ if i32.const 4928 i32.const 80 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -39069,7 +39069,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -39141,7 +39141,7 @@ if i32.const 32 i32.const 80 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -39163,10 +39163,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array<~lib/string/String>#set:buffer @@ -39317,7 +39317,7 @@ if i32.const 320 i32.const 80 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -39342,7 +39342,7 @@ if i32.const 4928 i32.const 80 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable @@ -42401,7 +42401,7 @@ if i32.const 32 i32.const 80 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -42423,10 +42423,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -42520,7 +42520,7 @@ if i32.const 32 i32.const 80 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -42926,7 +42926,7 @@ if i32.const 32 i32.const 80 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -42948,10 +42948,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -43045,7 +43045,7 @@ if i32.const 32 i32.const 80 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -43471,7 +43471,7 @@ if i32.const 320 i32.const 80 - i32.const 140 + i32.const 147 i32.const 33 call $~lib/builtins/abort unreachable @@ -43496,7 +43496,7 @@ if i32.const 4928 i32.const 80 - i32.const 144 + i32.const 151 i32.const 40 call $~lib/builtins/abort unreachable @@ -43554,7 +43554,7 @@ if i32.const 32 i32.const 80 - i32.const 237 + i32.const 244 i32.const 60 call $~lib/builtins/abort unreachable @@ -43679,7 +43679,7 @@ if i32.const 1152 i32.const 80 - i32.const 284 + i32.const 291 i32.const 18 call $~lib/builtins/abort unreachable @@ -43813,7 +43813,7 @@ if i32.const 1152 i32.const 80 - i32.const 343 + i32.const 350 i32.const 18 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 8659d57eda..65e99ff7d4 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (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 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) @@ -1204,182 +1204,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1448,7 +1272,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1463,7 +1287,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1476,7 +1300,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1484,7 +1308,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1495,16 +1319,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1515,16 +1339,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1532,7 +1356,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1540,8 +1364,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1558,7 +1382,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1568,13 +1392,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1587,40 +1411,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1680,10 +1504,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -2679,9 +2675,6 @@ call $~lib/rt/itcms/__new local.tee $1 i32.store - local.get $1 - i32.const 8 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add @@ -3268,7 +3261,7 @@ if i32.const 1056 i32.const 1104 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -3282,9 +3275,6 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store offset=4 - local.get $2 - local.get $1 - call $~lib/memory/memory.fill local.get $0 local.get $2 i32.store diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 7ecfbcb398..b76e1b5d56 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -10,6 +10,9 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -22,6 +25,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/__rtti_base i32 (i32.const 688)) (global $~lib/memory/__data_end i32 (i32.const 820)) @@ -4674,7 +4678,7 @@ if i32.const 32 i32.const 80 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -4685,10 +4689,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer @@ -4834,7 +4838,7 @@ if i32.const 32 i32.const 80 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -4848,10 +4852,10 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $3 call $~lib/arraybuffer/ArrayBufferView#set:buffer diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index cf6693f344..41d48e4299 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -2,9 +2,9 @@ (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)) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) @@ -1210,182 +1210,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1454,7 +1278,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1469,7 +1293,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1482,7 +1306,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1490,7 +1314,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1501,16 +1325,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1521,16 +1345,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1538,7 +1362,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1546,8 +1370,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1564,7 +1388,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1574,13 +1398,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1593,40 +1417,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1686,10 +1510,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/typedarray/Uint8Array#__set (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 @@ -2539,9 +2535,6 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 8 - call $~lib/memory/memory.fill local.get $0 local.get $3 i32.store diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index c7a83d2dd4..63b8b01b7e 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -17,6 +17,9 @@ (type $i32_i32_f32_i32_=>_none (func (param i32 i32 f32 i32))) (type $i32_i32_f64_i32_=>_none (func (param i32 i32 f64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -29,6 +32,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/__rtti_base i32 (i32.const 720)) (global $~lib/memory/__data_end i32 (i32.const 764)) @@ -5160,7 +5164,7 @@ if i32.const 32 i32.const 80 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -5174,10 +5178,10 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $3 call $~lib/arraybuffer/ArrayBufferView#set:buffer diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index fc0abbc385..44fa1b416f 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -1570,182 +1570,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1814,7 +1638,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1829,7 +1653,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1842,7 +1666,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1850,7 +1674,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1861,16 +1685,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1881,16 +1705,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1898,7 +1722,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1906,8 +1730,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1924,7 +1748,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1934,13 +1758,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1953,40 +1777,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -2046,10 +1870,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/date/Date#setTime (param $0 i32) (param $1 i64) local.get $1 @@ -3830,20 +3826,19 @@ (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - local.get $0 - i32.load offset=12 - local.tee $6 - i32.const 1 - i32.add - local.tee $4 local.get $0 local.tee $2 i32.load offset=8 - local.tee $8 + local.tee $0 i32.const 2 i32.shr_u - i32.gt_u + local.get $2 + i32.load offset=12 + local.tee $5 + i32.const 1 + i32.add + local.tee $4 + i32.lt_u if local.get $4 i32.const 268435455 @@ -3851,13 +3846,13 @@ if i32.const 6448 i32.const 6496 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable end block $__inlined_func$~lib/rt/itcms/__renew - local.get $8 + local.get $0 i32.const 1 i32.shl local.tee $0 @@ -3880,14 +3875,14 @@ local.get $3 i32.gt_u select - local.tee $9 + local.tee $7 local.get $2 i32.load - local.tee $7 + local.tee $6 local.tee $0 i32.const 20 i32.sub - local.tee $5 + local.tee $8 i32.load i32.const -4 i32.and @@ -3895,23 +3890,23 @@ i32.sub i32.le_u if - local.get $5 - local.get $9 + local.get $8 + local.get $7 i32.store offset=16 br $__inlined_func$~lib/rt/itcms/__renew end - local.get $9 - local.get $5 + local.get $7 + local.get $8 i32.load offset=12 call $~lib/rt/itcms/__new local.tee $3 local.get $0 - local.get $9 - local.get $5 + local.get $7 + local.get $8 i32.load offset=16 local.tee $0 local.get $0 - local.get $9 + local.get $7 i32.gt_u select call $~lib/memory/memory.copy @@ -3919,14 +3914,7 @@ local.set $0 end local.get $0 - local.get $8 - i32.add - local.get $9 - local.get $8 - i32.sub - call $~lib/memory/memory.fill - local.get $0 - local.get $7 + local.get $6 i32.ne if local.get $2 @@ -3944,12 +3932,12 @@ end end local.get $2 - local.get $9 + local.get $7 i32.store offset=8 end local.get $2 i32.load offset=4 - local.get $6 + local.get $5 i32.const 2 i32.shl i32.add @@ -9696,7 +9684,7 @@ if i32.const 1392 i32.const 6496 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -9716,7 +9704,7 @@ if i32.const 6544 i32.const 6496 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 8125ecd31f..fcee4fcf69 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -29,11 +29,15 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 6480)) (global $~lib/memory/__data_end i32 (i32.const 6540)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 22924)) @@ -5270,7 +5274,7 @@ if i32.const 5424 i32.const 5472 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -5314,14 +5318,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -11335,7 +11335,7 @@ if i32.const 368 i32.const 5472 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -11360,7 +11360,7 @@ if i32.const 5520 i32.const 5472 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 0f361c1678..3fab4f4dbf 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -5,6 +5,9 @@ (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/memory/__data_end i32 (i32.const 380)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16764)) (global $~lib/memory/__heap_base i32 (i32.const 16764)) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 981f077769..5eabd47e1c 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1218,182 +1218,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1462,7 +1286,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1477,7 +1301,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1490,7 +1314,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1498,7 +1322,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1509,16 +1333,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1529,16 +1353,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1546,7 +1370,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1554,8 +1378,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1572,7 +1396,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1582,13 +1406,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1601,40 +1425,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1648,56 +1472,228 @@ i32.add local.tee $3 local.get $3 - i32.load - i32.const -3 - i32.and - i32.store + i32.load + i32.const -3 + i32.and + i32.store + end + local.get $2 + local.get $1 + i32.store offset=12 + local.get $2 + local.get $0 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $1 + i32.load offset=8 + local.set $3 + local.get $2 + global.get $~lib/rt/itcms/white + local.get $1 + i32.or + i32.store offset=4 + local.get $2 + local.get $3 + i32.store offset=8 + local.get $3 + local.get $3 + i32.load offset=4 + i32.const 3 + i32.and + local.get $2 + i32.or + i32.store offset=4 + local.get $1 + local.get $2 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $2 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end end local.get $2 - local.get $1 - i32.store offset=12 - local.get $2 - local.get $0 - i32.store offset=16 - global.get $~lib/rt/itcms/fromSpace - local.tee $1 - i32.load offset=8 - local.set $3 - local.get $2 - global.get $~lib/rt/itcms/white - local.get $1 - i32.or - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $3 - local.get $3 - i32.load offset=4 - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - global.get $~lib/rt/itcms/total - local.get $2 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.add - global.set $~lib/rt/itcms/total - local.get $2 - i32.const 20 - i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 ) (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) (local $2 i32) @@ -2640,10 +2636,9 @@ (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $2 i32.shr_u local.get $1 @@ -2657,7 +2652,7 @@ if i32.const 1456 i32.const 1728 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -2677,7 +2672,7 @@ block $__inlined_func$~lib/rt/itcms/__renew local.get $3 if - local.get $8 + local.get $4 i32.const 1 i32.shl local.tee $1 @@ -2725,7 +2720,7 @@ local.get $6 i32.gt_u select - local.set $9 + local.set $8 block $~lib/util/memory/memmove|inlined.0 local.get $3 local.tee $2 @@ -2735,10 +2730,10 @@ local.get $1 local.get $2 i32.sub - local.get $9 + local.get $8 i32.sub i32.const 0 - local.get $9 + local.get $8 i32.const 1 i32.shl i32.sub @@ -2746,7 +2741,7 @@ if local.get $2 local.get $1 - local.get $9 + local.get $8 call $~lib/util/memory/memcpy br $~lib/util/memory/memmove|inlined.0 end @@ -2767,13 +2762,13 @@ i32.const 7 i32.and if - local.get $9 + local.get $8 i32.eqz br_if $~lib/util/memory/memmove|inlined.0 - local.get $9 + local.get $8 i32.const 1 i32.sub - local.set $9 + local.set $8 local.get $2 local.tee $5 i32.const 1 @@ -2792,7 +2787,7 @@ end end loop $while-continue|1 - local.get $9 + local.get $8 i32.const 8 i32.ge_u if @@ -2800,10 +2795,10 @@ local.get $1 i64.load i64.store - local.get $9 + local.get $8 i32.const 8 i32.sub - local.set $9 + local.set $8 local.get $2 i32.const 8 i32.add @@ -2817,7 +2812,7 @@ end end loop $while-continue|2 - local.get $9 + local.get $8 if local.get $2 local.tee $5 @@ -2833,10 +2828,10 @@ local.get $4 i32.load8_u i32.store8 - local.get $9 + local.get $8 i32.const 1 i32.sub - local.set $9 + local.set $8 br $while-continue|2 end end @@ -2851,22 +2846,22 @@ if loop $while-continue|3 local.get $2 - local.get $9 + local.get $8 i32.add i32.const 7 i32.and if - local.get $9 + local.get $8 i32.eqz br_if $~lib/util/memory/memmove|inlined.0 - local.get $9 + local.get $8 i32.const 1 i32.sub - local.tee $9 + local.tee $8 local.get $2 i32.add local.get $1 - local.get $9 + local.get $8 i32.add i32.load8_u i32.store8 @@ -2874,18 +2869,18 @@ end end loop $while-continue|4 - local.get $9 + local.get $8 i32.const 8 i32.ge_u if - local.get $9 + local.get $8 i32.const 8 i32.sub - local.tee $9 + local.tee $8 local.get $2 i32.add local.get $1 - local.get $9 + local.get $8 i32.add i64.load i64.store @@ -2894,16 +2889,16 @@ end end loop $while-continue|5 - local.get $9 + local.get $8 if - local.get $9 + local.get $8 i32.const 1 i32.sub - local.tee $9 + local.tee $8 local.get $2 i32.add local.get $1 - local.get $9 + local.get $8 i32.add i32.load8_u i32.store8 @@ -2916,13 +2911,6 @@ local.set $1 end local.get $1 - local.get $8 - i32.add - local.get $6 - local.get $8 - i32.sub - call $~lib/memory/memory.fill - local.get $1 local.get $7 i32.ne if @@ -2957,7 +2945,7 @@ if i32.const 1248 i32.const 1728 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -2994,7 +2982,7 @@ if i32.const 1248 i32.const 1728 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -3028,7 +3016,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3966,7 +3954,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -3983,9 +3971,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store offset=4 - local.get $0 - local.get $2 - call $~lib/memory/memory.fill local.get $8 local.get $0 i32.store @@ -4142,7 +4127,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -6178,7 +6163,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -6195,9 +6180,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store offset=4 - local.get $0 - local.get $2 - call $~lib/memory/memory.fill local.get $8 local.get $0 i32.store @@ -6354,7 +6336,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -7680,7 +7662,7 @@ if i32.const 1248 i32.const 1728 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -8428,7 +8410,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -8447,9 +8429,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store offset=4 - local.get $0 - local.get $2 - call $~lib/memory/memory.fill local.get $8 local.get $0 i32.store @@ -8606,7 +8585,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -10644,7 +10623,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -10663,9 +10642,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store offset=4 - local.get $0 - local.get $2 - call $~lib/memory/memory.fill local.get $8 local.get $0 i32.store @@ -10822,7 +10798,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -14245,7 +14221,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -14264,9 +14240,6 @@ call $~lib/rt/itcms/__new local.tee $9 i32.store offset=4 - local.get $9 - local.get $8 - call $~lib/memory/memory.fill local.get $2 local.get $9 i32.store @@ -14423,7 +14396,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -15796,7 +15769,7 @@ if i32.const 1248 i32.const 1728 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -16303,7 +16276,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -16322,9 +16295,6 @@ call $~lib/rt/itcms/__new local.tee $11 i32.store offset=4 - local.get $11 - local.get $9 - call $~lib/memory/memory.fill local.get $10 local.get $11 i32.store @@ -16366,11 +16336,11 @@ i32.and i32.eqz if - local.get $1 + local.get $0 local.tee $2 i32.const 1 i32.add - local.set $1 + local.set $0 local.get $10 local.get $2 local.get $9 @@ -16385,12 +16355,12 @@ end end local.get $10 - local.get $1 + local.get $0 i32.const 3 i32.const 0 call $~lib/array/ensureCapacity local.get $10 - local.get $1 + local.get $0 i32.store offset=12 global.get $~lib/memory/__stack_pointer i32.const 4 @@ -16470,10 +16440,10 @@ loop $for-loop|2 local.get $10 i32.load offset=12 - local.get $0 + local.get $1 i32.gt_s if - local.get $0 + local.get $1 local.tee $2 local.get $10 i32.load offset=12 @@ -16481,7 +16451,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -16586,38 +16556,38 @@ i32.shl i32.add i32.load - local.set $0 + local.set $1 block $__inlined_func$~lib/map/Map#find loop $while-continue|0 - local.get $0 + local.get $1 if - local.get $0 + local.get $1 i32.load offset=16 - local.tee $1 + local.tee $0 i32.const 1 i32.and if (result i32) i32.const 0 else local.get $4 - local.get $0 + local.get $1 i64.load i64.eq end br_if $__inlined_func$~lib/map/Map#find - local.get $1 + local.get $0 i32.const -2 i32.and - local.set $0 + local.set $1 br $while-continue|0 end end i32.const 0 - local.set $0 + local.set $1 end - local.get $0 + local.get $1 if - local.get $0 + local.get $1 local.get $4 i64.store offset=8 else @@ -16680,37 +16650,37 @@ i32.const 24 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 + local.tee $1 i32.store offset=4 local.get $12 i32.load offset=8 - local.tee $1 + local.tee $3 local.get $12 i32.load offset=16 i32.const 24 i32.mul i32.add local.set $15 - local.get $3 + local.get $1 local.set $0 loop $while-continue|00 - local.get $1 + local.get $3 local.get $15 i32.ne if - local.get $1 + local.get $3 i32.load offset=16 i32.const 1 i32.and i32.eqz if local.get $0 - local.get $1 + local.get $3 i64.load local.tee $16 i64.store local.get $0 - local.get $1 + local.get $3 i64.load offset=8 i64.store offset=8 local.get $0 @@ -16771,10 +16741,10 @@ i32.add local.set $0 end - local.get $1 + local.get $3 i32.const 24 i32.add - local.set $1 + local.set $3 br $while-continue|00 end end @@ -16791,12 +16761,12 @@ local.get $8 i32.store offset=4 local.get $12 - local.get $3 + local.get $1 i32.store offset=8 - local.get $3 + local.get $1 if local.get $12 - local.get $3 + local.get $1 call $byn-split-outlined-A$~lib/rt/itcms/__link end local.get $12 @@ -16871,7 +16841,7 @@ local.get $2 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|2 end end @@ -17862,7 +17832,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -17881,9 +17851,6 @@ call $~lib/rt/itcms/__new local.tee $11 i32.store offset=4 - local.get $11 - local.get $9 - call $~lib/memory/memory.fill local.get $10 local.get $11 i32.store @@ -17925,11 +17892,11 @@ i32.and i32.eqz if - local.get $1 + local.get $0 local.tee $2 i32.const 1 i32.add - local.set $1 + local.set $0 local.get $10 local.get $2 local.get $9 @@ -17944,12 +17911,12 @@ end end local.get $10 - local.get $1 + local.get $0 i32.const 3 i32.const 0 call $~lib/array/ensureCapacity local.get $10 - local.get $1 + local.get $0 i32.store offset=12 global.get $~lib/memory/__stack_pointer i32.const 4 @@ -18029,10 +17996,10 @@ loop $for-loop|2 local.get $10 i32.load offset=12 - local.get $0 + local.get $1 i32.gt_s if - local.get $0 + local.get $1 local.tee $2 local.get $10 i32.load offset=12 @@ -18040,7 +18007,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -18145,38 +18112,38 @@ i32.shl i32.add i32.load - local.set $0 + local.set $1 block $__inlined_func$~lib/map/Map#find loop $while-continue|0 - local.get $0 + local.get $1 if - local.get $0 + local.get $1 i32.load offset=16 - local.tee $1 + local.tee $0 i32.const 1 i32.and if (result i32) i32.const 0 else local.get $4 - local.get $0 + local.get $1 i64.load i64.eq end br_if $__inlined_func$~lib/map/Map#find - local.get $1 + local.get $0 i32.const -2 i32.and - local.set $0 + local.set $1 br $while-continue|0 end end i32.const 0 - local.set $0 + local.set $1 end - local.get $0 + local.get $1 if - local.get $0 + local.get $1 local.get $4 i64.store offset=8 else @@ -18239,37 +18206,37 @@ i32.const 24 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor - local.tee $3 + local.tee $1 i32.store offset=4 local.get $12 i32.load offset=8 - local.tee $1 + local.tee $3 local.get $12 i32.load offset=16 i32.const 24 i32.mul i32.add local.set $15 - local.get $3 + local.get $1 local.set $0 loop $while-continue|00 - local.get $1 + local.get $3 local.get $15 i32.ne if - local.get $1 + local.get $3 i32.load offset=16 i32.const 1 i32.and i32.eqz if local.get $0 - local.get $1 + local.get $3 i64.load local.tee $16 i64.store local.get $0 - local.get $1 + local.get $3 i64.load offset=8 i64.store offset=8 local.get $0 @@ -18330,10 +18297,10 @@ i32.add local.set $0 end - local.get $1 + local.get $3 i32.const 24 i32.add - local.set $1 + local.set $3 br $while-continue|00 end end @@ -18350,12 +18317,12 @@ local.get $8 i32.store offset=4 local.get $12 - local.get $3 + local.get $1 i32.store offset=8 - local.get $3 + local.get $1 if local.get $12 - local.get $3 + local.get $1 call $byn-split-outlined-A$~lib/rt/itcms/__link end local.get $12 @@ -18430,7 +18397,7 @@ local.get $2 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|2 end end @@ -19564,7 +19531,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -19583,9 +19550,6 @@ call $~lib/rt/itcms/__new local.tee $1 i32.store offset=4 - local.get $1 - local.get $2 - call $~lib/memory/memory.fill local.get $4 local.get $1 i32.store @@ -19646,7 +19610,7 @@ if i32.const 1248 i32.const 1728 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -19776,7 +19740,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -21604,7 +21568,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -21623,9 +21587,6 @@ call $~lib/rt/itcms/__new local.tee $12 i32.store offset=4 - local.get $12 - local.get $10 - call $~lib/memory/memory.fill local.get $11 local.get $12 i32.store @@ -21686,7 +21647,7 @@ if i32.const 1248 i32.const 1728 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -21816,7 +21777,7 @@ if i32.const 1248 i32.const 1728 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -22532,7 +22493,6 @@ global.set $~lib/rt/itcms/threshold ) (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) - (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -22557,7 +22517,7 @@ if i32.const 1456 i32.const 1504 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -22566,16 +22526,13 @@ local.get $0 i32.const 0 call $~lib/rt/itcms/__new - local.tee $1 + local.tee $0 i32.store - local.get $1 - local.get $0 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $1 + local.get $0 ) (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -22803,7 +22760,7 @@ if i32.const 1456 i32.const 1728 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -22822,9 +22779,6 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - local.get $2 - call $~lib/memory/memory.fill local.get $1 local.get $3 i32.store diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 2a7dc6da68..397e0e6b2e 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -38,10 +38,14 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 736)) (global $~lib/memory/__data_end i32 (i32.const 996)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17380)) @@ -4123,7 +4127,7 @@ if i32.const 432 i32.const 704 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -4167,14 +4171,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -4219,7 +4219,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -4300,7 +4300,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -4422,7 +4422,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4448,7 +4448,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -5928,7 +5928,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -6012,7 +6012,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -7230,7 +7230,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -7314,7 +7314,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -8522,7 +8522,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -8606,7 +8606,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -10434,7 +10434,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -10518,7 +10518,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -11725,7 +11725,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -11809,7 +11809,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -13024,7 +13024,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -13108,7 +13108,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -14307,7 +14307,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -14391,7 +14391,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -15607,7 +15607,7 @@ if i32.const 224 i32.const 704 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -15691,7 +15691,7 @@ if i32.const 224 i32.const 704 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -17346,7 +17346,7 @@ if i32.const 432 i32.const 480 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -17357,10 +17357,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer @@ -17588,7 +17588,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -17610,10 +17610,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -17760,7 +17760,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -17782,10 +17782,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -18457,7 +18457,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -18479,10 +18479,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -19061,7 +19061,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -19083,10 +19083,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -19665,7 +19665,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -19687,10 +19687,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -20433,7 +20433,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -20455,10 +20455,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -21037,7 +21037,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -21059,10 +21059,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -21641,7 +21641,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -21663,10 +21663,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -22245,7 +22245,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -22267,10 +22267,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -22849,7 +22849,7 @@ if i32.const 432 i32.const 704 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -22871,10 +22871,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 6d70ba6747..d4999fd5a6 100644 --- a/tests/compiler/std/new.untouched.wat +++ b/tests/compiler/std/new.untouched.wat @@ -20,6 +20,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/std/object.untouched.wat b/tests/compiler/std/object.untouched.wat index ea3d7177e7..f36d38346e 100644 --- a/tests/compiler/std/object.untouched.wat +++ b/tests/compiler/std/object.untouched.wat @@ -7,6 +7,9 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 188)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16572)) diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 332ef7d2e2..7d0d132f14 100644 --- a/tests/compiler/std/operator-overloading.untouched.wat +++ b/tests/compiler/std/operator-overloading.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 445ebedfe3..8015b7a575 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1211,182 +1211,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1455,7 +1279,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1470,7 +1294,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1483,7 +1307,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1491,7 +1315,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1502,16 +1326,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1522,16 +1346,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1539,7 +1363,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1547,8 +1371,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1565,7 +1389,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1575,13 +1399,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1594,103 +1418,275 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 + i32.or + i32.store + local.get $3 + local.get $2 + i32.const 4 + i32.add + i32.add + local.tee $3 + local.get $4 + i32.const 4 + i32.sub + i32.const 1 i32.or i32.store - local.get $5 - local.get $2 - i32.const 4 - i32.add - i32.add - local.tee $3 - local.get $6 - i32.const 4 + local.get $5 + local.get $3 + call $~lib/rt/tlsf/insertBlock + else + local.get $2 + local.get $6 + i32.const -2 + i32.and + i32.store + local.get $2 + i32.const 4 + i32.add + local.get $2 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $3 + local.get $3 + i32.load + i32.const -3 + i32.and + i32.store + end + local.get $2 + local.get $1 + i32.store offset=12 + local.get $2 + local.get $0 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $1 + i32.load offset=8 + local.set $3 + local.get $2 + global.get $~lib/rt/itcms/white + local.get $1 + i32.or + i32.store offset=4 + local.get $2 + local.get $3 + i32.store offset=8 + local.get $3 + local.get $3 + i32.load offset=4 + i32.const 3 + i32.and + local.get $2 + i32.or + i32.store offset=4 + local.get $1 + local.get $2 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $2 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 i32.sub - i32.const 1 - i32.or + i32.const 0 i32.store - local.get $4 local.get $3 - call $~lib/rt/tlsf/insertBlock - else - local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store local.get $3 - i32.const -2 - i32.and + i32.const 16 + i32.sub + i32.const 0 i32.store - local.get $2 + local.get $1 + local.get $1 i32.const 4 - i32.add - local.get $2 - i32.load - i32.const -4 i32.and + i32.const 24 i32.add local.tee $3 + i32.add + local.set $1 + local.get $0 local.get $3 - i32.load - i32.const -3 - i32.and - i32.store + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end end local.get $2 - local.get $1 - i32.store offset=12 - local.get $2 - local.get $0 - i32.store offset=16 - global.get $~lib/rt/itcms/fromSpace - local.tee $1 - i32.load offset=8 - local.set $3 - local.get $2 - global.get $~lib/rt/itcms/white - local.get $1 - i32.or - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $3 - local.get $3 - i32.load offset=4 - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - global.get $~lib/rt/itcms/total - local.get $2 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.add - global.set $~lib/rt/itcms/total - local.get $2 - i32.const 20 - i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 ) (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) (local $2 i32) @@ -2692,10 +2688,9 @@ (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $2 i32.shr_u local.get $1 @@ -2709,7 +2704,7 @@ if i32.const 1456 i32.const 1616 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -2729,7 +2724,7 @@ block $__inlined_func$~lib/rt/itcms/__renew local.get $3 if - local.get $8 + local.get $4 i32.const 1 i32.shl local.tee $1 @@ -2777,7 +2772,7 @@ local.get $6 i32.gt_u select - local.set $9 + local.set $8 block $~lib/util/memory/memmove|inlined.0 local.get $3 local.tee $2 @@ -2787,10 +2782,10 @@ local.get $1 local.get $2 i32.sub - local.get $9 + local.get $8 i32.sub i32.const 0 - local.get $9 + local.get $8 i32.const 1 i32.shl i32.sub @@ -2798,7 +2793,7 @@ if local.get $2 local.get $1 - local.get $9 + local.get $8 call $~lib/util/memory/memcpy br $~lib/util/memory/memmove|inlined.0 end @@ -2819,13 +2814,13 @@ i32.const 7 i32.and if - local.get $9 + local.get $8 i32.eqz br_if $~lib/util/memory/memmove|inlined.0 - local.get $9 + local.get $8 i32.const 1 i32.sub - local.set $9 + local.set $8 local.get $2 local.tee $5 i32.const 1 @@ -2844,7 +2839,7 @@ end end loop $while-continue|1 - local.get $9 + local.get $8 i32.const 8 i32.ge_u if @@ -2852,10 +2847,10 @@ local.get $1 i64.load i64.store - local.get $9 + local.get $8 i32.const 8 i32.sub - local.set $9 + local.set $8 local.get $2 i32.const 8 i32.add @@ -2869,7 +2864,7 @@ end end loop $while-continue|2 - local.get $9 + local.get $8 if local.get $2 local.tee $5 @@ -2885,10 +2880,10 @@ local.get $4 i32.load8_u i32.store8 - local.get $9 + local.get $8 i32.const 1 i32.sub - local.set $9 + local.set $8 br $while-continue|2 end end @@ -2903,22 +2898,22 @@ if loop $while-continue|3 local.get $2 - local.get $9 + local.get $8 i32.add i32.const 7 i32.and if - local.get $9 + local.get $8 i32.eqz br_if $~lib/util/memory/memmove|inlined.0 - local.get $9 + local.get $8 i32.const 1 i32.sub - local.tee $9 + local.tee $8 local.get $2 i32.add local.get $1 - local.get $9 + local.get $8 i32.add i32.load8_u i32.store8 @@ -2926,18 +2921,18 @@ end end loop $while-continue|4 - local.get $9 + local.get $8 i32.const 8 i32.ge_u if - local.get $9 + local.get $8 i32.const 8 i32.sub - local.tee $9 + local.tee $8 local.get $2 i32.add local.get $1 - local.get $9 + local.get $8 i32.add i64.load i64.store @@ -2946,16 +2941,16 @@ end end loop $while-continue|5 - local.get $9 + local.get $8 if - local.get $9 + local.get $8 i32.const 1 i32.sub - local.tee $9 + local.tee $8 local.get $2 i32.add local.get $1 - local.get $9 + local.get $8 i32.add i32.load8_u i32.store8 @@ -2968,13 +2963,6 @@ local.set $1 end local.get $1 - local.get $8 - i32.add - local.get $6 - local.get $8 - i32.sub - call $~lib/memory/memory.fill - local.get $1 local.get $7 i32.ne if @@ -3009,7 +2997,7 @@ if i32.const 1248 i32.const 1616 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -3041,7 +3029,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3686,7 +3674,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -3703,9 +3691,6 @@ call $~lib/rt/itcms/__new local.tee $11 i32.store offset=4 - local.get $11 - local.get $1 - call $~lib/memory/memory.fill local.get $10 local.get $11 i32.store @@ -4711,7 +4696,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -5326,7 +5311,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -5343,9 +5328,6 @@ call $~lib/rt/itcms/__new local.tee $11 i32.store offset=4 - local.get $11 - local.get $1 - call $~lib/memory/memory.fill local.get $10 local.get $11 i32.store @@ -6362,7 +6344,7 @@ if i32.const 1248 i32.const 1616 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -6396,7 +6378,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -7006,7 +6988,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -7025,9 +7007,6 @@ call $~lib/rt/itcms/__new local.tee $11 i32.store offset=4 - local.get $11 - local.get $1 - call $~lib/memory/memory.fill local.get $10 local.get $11 i32.store @@ -8033,7 +8012,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -8650,7 +8629,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -8669,9 +8648,6 @@ call $~lib/rt/itcms/__new local.tee $11 i32.store offset=4 - local.get $11 - local.get $1 - call $~lib/memory/memory.fill local.get $10 local.get $11 i32.store @@ -9684,7 +9660,7 @@ if i32.const 1248 i32.const 1616 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -9718,7 +9694,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -10261,10 +10237,10 @@ i32.store local.get $4 i32.load offset=8 - local.set $3 + local.set $9 local.get $4 i32.load offset=16 - local.set $9 + local.set $3 local.get $8 i32.const 8 i32.sub @@ -10295,21 +10271,21 @@ local.get $6 i32.const 0 i32.store offset=12 - local.get $9 + local.get $3 i32.const 268435455 i32.gt_u if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - local.get $9 + local.get $3 i32.const 8 - local.get $9 + local.get $3 i32.const 8 i32.gt_u select @@ -10320,9 +10296,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store offset=4 - local.get $0 - local.get $10 - call $~lib/memory/memory.fill local.get $6 local.get $0 i32.store @@ -10339,7 +10312,7 @@ local.get $10 i32.store offset=8 local.get $6 - local.get $9 + local.get $3 i32.store offset=12 global.get $~lib/memory/__stack_pointer i32.const 8 @@ -10349,14 +10322,14 @@ local.get $6 i32.store loop $for-loop|02 + local.get $3 local.get $5 - local.get $9 - i32.lt_s + i32.gt_s if local.get $5 i32.const 3 i32.shl - local.get $3 + local.get $9 i32.add local.tee $8 i32.load offset=4 @@ -10410,7 +10383,7 @@ local.get $6 local.get $1 call $~lib/array/Array#__get - local.tee $2 + local.tee $3 i32.const -1028477379 i32.mul i32.const 374761397 @@ -10419,27 +10392,27 @@ i32.rotl i32.const 668265263 i32.mul - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 i32.const 15 i32.shr_u i32.xor i32.const -2048144777 i32.mul - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 i32.const 13 i32.shr_u i32.xor i32.const -1028477379 i32.mul - local.set $3 + local.set $2 local.get $4 i32.load local.get $4 i32.load offset=4 - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor @@ -10448,12 +10421,12 @@ i32.shl i32.add i32.load - local.set $3 + local.set $2 block $__inlined_func$~lib/set/Set#find10 loop $while-continue|011 - local.get $3 + local.get $2 if - local.get $3 + local.get $2 i32.load offset=4 local.tee $5 i32.const 1 @@ -10461,8 +10434,8 @@ if (result i32) i32.const 0 else - local.get $2 local.get $3 + local.get $2 i32.load i32.eq end @@ -10470,14 +10443,14 @@ local.get $5 i32.const -2 i32.and - local.set $3 + local.set $2 br $while-continue|011 end end i32.const 0 - local.set $3 + local.set $2 end - local.get $3 + local.get $2 i32.eqz if i32.const 0 @@ -11293,7 +11266,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -11836,10 +11809,10 @@ i32.store local.get $4 i32.load offset=8 - local.set $3 + local.set $9 local.get $4 i32.load offset=16 - local.set $9 + local.set $3 local.get $8 i32.const 8 i32.sub @@ -11870,21 +11843,21 @@ local.get $6 i32.const 0 i32.store offset=12 - local.get $9 + local.get $3 i32.const 268435455 i32.gt_u if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable end global.get $~lib/memory/__stack_pointer - local.get $9 + local.get $3 i32.const 8 - local.get $9 + local.get $3 i32.const 8 i32.gt_u select @@ -11895,9 +11868,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store offset=4 - local.get $0 - local.get $10 - call $~lib/memory/memory.fill local.get $6 local.get $0 i32.store @@ -11914,7 +11884,7 @@ local.get $10 i32.store offset=8 local.get $6 - local.get $9 + local.get $3 i32.store offset=12 global.get $~lib/memory/__stack_pointer i32.const 8 @@ -11924,14 +11894,14 @@ local.get $6 i32.store loop $for-loop|02 + local.get $3 local.get $5 - local.get $9 - i32.lt_s + i32.gt_s if local.get $5 i32.const 3 i32.shl - local.get $3 + local.get $9 i32.add local.tee $8 i32.load offset=4 @@ -11985,7 +11955,7 @@ local.get $6 local.get $1 call $~lib/array/Array#__get - local.tee $2 + local.tee $3 i32.const -1028477379 i32.mul i32.const 374761397 @@ -11994,27 +11964,27 @@ i32.rotl i32.const 668265263 i32.mul - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 i32.const 15 i32.shr_u i32.xor i32.const -2048144777 i32.mul - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 i32.const 13 i32.shr_u i32.xor i32.const -1028477379 i32.mul - local.set $3 + local.set $2 local.get $4 i32.load local.get $4 i32.load offset=4 - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor @@ -12023,12 +11993,12 @@ i32.shl i32.add i32.load - local.set $3 + local.set $2 block $__inlined_func$~lib/set/Set#find10 loop $while-continue|011 - local.get $3 + local.get $2 if - local.get $3 + local.get $2 i32.load offset=4 local.tee $5 i32.const 1 @@ -12036,8 +12006,8 @@ if (result i32) i32.const 0 else - local.get $2 local.get $3 + local.get $2 i32.load i32.eq end @@ -12045,14 +12015,14 @@ local.get $5 i32.const -2 i32.and - local.set $3 + local.set $2 br $while-continue|011 end end i32.const 0 - local.set $3 + local.set $2 end - local.get $3 + local.get $2 i32.eqz if i32.const 0 @@ -12981,7 +12951,7 @@ if i32.const 1248 i32.const 1616 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -13015,7 +12985,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -13391,7 +13361,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -13410,9 +13380,6 @@ call $~lib/rt/itcms/__new local.tee $12 i32.store offset=4 - local.get $12 - local.get $1 - call $~lib/memory/memory.fill local.get $11 local.get $12 i32.store @@ -14103,7 +14070,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -14442,7 +14409,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -14461,9 +14428,6 @@ call $~lib/rt/itcms/__new local.tee $12 i32.store offset=4 - local.get $12 - local.get $1 - call $~lib/memory/memory.fill local.get $11 local.get $12 i32.store @@ -15048,7 +15012,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -15634,7 +15598,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -15653,9 +15617,6 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - local.get $0 - call $~lib/memory/memory.fill local.get $6 local.get $5 i32.store @@ -15716,7 +15677,7 @@ if i32.const 1248 i32.const 1616 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -16781,7 +16742,7 @@ if i32.const 1248 i32.const 1616 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -17123,7 +17084,7 @@ if i32.const 1456 i32.const 1616 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -17142,9 +17103,6 @@ call $~lib/rt/itcms/__new local.tee $12 i32.store offset=4 - local.get $12 - local.get $1 - call $~lib/memory/memory.fill local.get $2 local.get $12 i32.store @@ -17205,7 +17163,7 @@ if i32.const 1248 i32.const 1616 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -17576,7 +17534,6 @@ global.set $~lib/rt/itcms/threshold ) (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) - (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -17601,7 +17558,7 @@ if i32.const 1456 i32.const 1504 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -17610,16 +17567,13 @@ local.get $0 i32.const 0 call $~lib/rt/itcms/__new - local.tee $1 + local.tee $0 i32.store - local.get $1 - local.get $0 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $1 + local.get $0 ) (func $~lib/set/Set#constructor (result i32) (local $0 i32) diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 6fb03112b3..ea82e01e9f 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -35,10 +35,14 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 624)) (global $~lib/memory/__data_end i32 (i32.const 812)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17196)) @@ -4177,7 +4181,7 @@ if i32.const 432 i32.const 592 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -4221,14 +4225,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -4273,7 +4273,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -4319,7 +4319,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -5243,7 +5243,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -5289,7 +5289,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -6215,7 +6215,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -6261,7 +6261,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -7185,7 +7185,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -7231,7 +7231,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -8155,7 +8155,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -8201,7 +8201,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -9113,7 +9113,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -9159,7 +9159,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -10088,7 +10088,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -10134,7 +10134,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -11064,7 +11064,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -11110,7 +11110,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -12024,7 +12024,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -12070,7 +12070,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -13001,7 +13001,7 @@ if i32.const 224 i32.const 592 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -13047,7 +13047,7 @@ if i32.const 224 i32.const 592 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -14121,7 +14121,7 @@ if i32.const 432 i32.const 480 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -14132,10 +14132,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer @@ -14244,7 +14244,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -14266,10 +14266,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -14472,7 +14472,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -14494,10 +14494,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -14700,7 +14700,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -14722,10 +14722,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -14928,7 +14928,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -14950,10 +14950,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -15156,7 +15156,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -15178,10 +15178,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -15384,7 +15384,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -15406,10 +15406,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -15612,7 +15612,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -15634,10 +15634,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -15840,7 +15840,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -15862,10 +15862,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -16068,7 +16068,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -16090,10 +16090,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer @@ -16296,7 +16296,7 @@ if i32.const 432 i32.const 592 - i32.const 65 + i32.const 70 i32.const 60 call $~lib/builtins/abort unreachable @@ -16318,10 +16318,10 @@ call $~lib/rt/itcms/__new local.tee $5 i32.store offset=4 - local.get $5 - i32.const 0 - local.get $4 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $5 call $~lib/array/Array#set:buffer diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 55a6d361fc..e821382cba 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (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 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) @@ -68,7 +68,7 @@ if i32.const 1472 i32.const 1536 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -1249,182 +1249,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) @@ -2135,7 +1959,7 @@ end local.get $5 i32.load offset=12 - local.set $6 + local.set $4 local.get $1 i32.const 1073741804 i32.ge_u @@ -2198,7 +2022,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $3 + local.set $6 local.get $1 i32.const 16 i32.add @@ -2213,7 +2037,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const 12 local.get $2 i32.const 19 @@ -2234,7 +2058,7 @@ memory.size local.tee $2 i32.const 4 - local.get $3 + local.get $6 i32.load offset=1568 local.get $2 i32.const 16 @@ -2265,16 +2089,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $4 + local.tee $3 local.get $2 - local.get $4 + local.get $3 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $4 + local.get $3 memory.grow i32.const 0 i32.lt_s @@ -2282,7 +2106,7 @@ unreachable end end - local.get $3 + local.get $6 local.get $2 i32.const 16 i32.shl @@ -2290,7 +2114,7 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $3 + local.get $6 local.get $7 call $~lib/rt/tlsf/searchBlock local.tee $2 @@ -2318,12 +2142,12 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $4 + local.set $3 local.get $7 i32.const 4 i32.add @@ -2337,7 +2161,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 i32.const -4 i32.and local.get $7 @@ -2347,7 +2171,7 @@ i32.ge_u if local.get $2 - local.get $4 + local.get $3 i32.const 2 i32.and local.get $7 @@ -2358,19 +2182,19 @@ i32.const 4 i32.add i32.add - local.tee $4 + local.tee $3 local.get $8 i32.const 4 i32.sub i32.const 1 i32.or i32.store + local.get $6 local.get $3 - local.get $4 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $4 + local.get $3 i32.const -2 i32.and i32.store @@ -2390,7 +2214,7 @@ i32.store end local.get $2 - local.get $6 + local.get $4 i32.store offset=12 local.get $2 local.get $1 @@ -2431,8 +2255,180 @@ i32.const 20 i32.add local.tee $4 - local.get $1 - call $~lib/memory/memory.fill + local.set $2 + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 + i32.store8 + local.get $1 + local.get $2 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 + i32.store8 offset=1 + local.get $2 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 + local.get $2 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $2 + i32.const 0 + i32.store + local.get $2 + local.get $1 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $3 + i32.add + local.tee $6 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + i32.const 0 + i32.store offset=8 + local.get $6 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $6 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 + i32.store offset=12 + local.get $2 + i32.const 0 + i32.store offset=16 + local.get $2 + i32.const 0 + i32.store offset=20 + local.get $2 + i32.const 0 + i32.store offset=24 + local.get $6 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $6 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $6 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $6 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $2 + local.get $2 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $6 + i32.add + local.set $2 + local.get $3 + local.get $6 + i32.sub + local.set $3 + loop $while-continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $2 + i64.const 0 + i64.store + local.get $2 + i64.const 0 + i64.store offset=8 + local.get $2 + i64.const 0 + i64.store offset=16 + local.get $2 + i64.const 0 + i64.store offset=24 + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $2 + i32.const 32 + i32.add + local.set $2 + br $while-continue|0 + end + end + end local.get $1 local.get $5 i32.load offset=16 @@ -2478,7 +2474,7 @@ i32.and i32.eq if - loop $while-continue|0 + loop $while-continue|00 local.get $1 i32.const 7 i32.and @@ -2504,7 +2500,7 @@ local.get $3 i32.load8_u i32.store8 - br $while-continue|0 + br $while-continue|00 end end loop $while-continue|1 @@ -2633,7 +2629,6 @@ (func $~lib/array/ensureCapacity (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load offset=8 local.tee $2 @@ -2648,7 +2643,7 @@ if i32.const 1584 i32.const 1536 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -2659,41 +2654,34 @@ local.get $2 i32.const 1 i32.shl - local.tee $4 + local.tee $2 i32.const 1073741820 - local.get $4 + local.get $2 i32.const 1073741820 i32.lt_u select - local.tee $4 + local.tee $2 i32.const 8 local.get $1 i32.shl local.tee $1 local.get $1 - local.get $4 + local.get $2 i32.lt_u select local.tee $1 call $~lib/rt/itcms/__renew - local.tee $4 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.sub - call $~lib/memory/memory.fill + local.tee $2 local.get $3 - local.get $4 i32.ne if local.get $0 - local.get $4 + local.get $2 i32.store local.get $0 - local.get $4 + local.get $2 i32.store offset=4 - local.get $4 + local.get $2 if local.get $0 i32.eqz @@ -2706,7 +2694,7 @@ unreachable end global.get $~lib/rt/itcms/white - local.get $4 + local.get $2 i32.const 20 i32.sub local.tee $2 @@ -2757,7 +2745,7 @@ if i32.const 1472 i32.const 1536 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -2778,7 +2766,7 @@ if i32.const 1472 i32.const 1536 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -2799,7 +2787,7 @@ if i32.const 1472 i32.const 1536 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index 627fe6d822..e3d3535279 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -19,6 +19,9 @@ (global $std/static-array/I i32 (i32.const 160)) (global $std/static-array/f i32 (i32.const 240)) (global $std/static-array/F i32 (i32.const 336)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -31,6 +34,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/rt/__rtti_base i32 (i32.const 928)) (global $~lib/memory/__data_end i32 (i32.const 988)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17372)) @@ -73,7 +77,7 @@ if i32.const 448 i32.const 512 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3781,7 +3785,7 @@ if i32.const 560 i32.const 512 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -3825,14 +3829,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -3882,7 +3882,7 @@ if i32.const 448 i32.const 512 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -3918,7 +3918,7 @@ if i32.const 448 i32.const 512 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3964,7 +3964,7 @@ if i32.const 448 i32.const 512 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -4000,7 +4000,7 @@ if i32.const 448 i32.const 512 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4046,7 +4046,7 @@ if i32.const 448 i32.const 512 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable @@ -4082,7 +4082,7 @@ if i32.const 448 i32.const 512 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4128,7 +4128,7 @@ if i32.const 448 i32.const 512 - i32.const 123 + i32.const 130 i32.const 22 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index c0f49c33a3..f98edcb496 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -3,9 +3,9 @@ (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) @@ -173,7 +173,7 @@ if i32.const 1088 i32.const 1152 - i32.const 115 + i32.const 118 i32.const 41 call $~lib/builtins/abort unreachable @@ -197,7 +197,7 @@ if i32.const 1088 i32.const 1152 - i32.const 130 + i32.const 133 i32.const 41 call $~lib/builtins/abort unreachable @@ -1583,334 +1583,330 @@ end local.get $1 ) - (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) + (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 1073741804 + i32.ge_u + if + i32.const 1344 + i32.const 1408 + i32.const 260 + i32.const 31 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + block $__inlined_func$~lib/rt/itcms/interrupt + i32.const 2048 + local.set $2 + loop $do-loop|0 + local.get $2 + call $~lib/rt/itcms/step + i32.sub + local.set $2 + global.get $~lib/rt/itcms/state + i32.eqz + if + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i64.const 200 + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + br $__inlined_func$~lib/rt/itcms/interrupt + end + local.get $2 + i32.const 0 + i32.gt_s + br_if $do-loop|0 + end + global.get $~lib/rt/itcms/total + local.tee $2 + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.const 10 + i32.shl + local.get $2 + i32.add + global.set $~lib/rt/itcms/threshold + end + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.add + call $~lib/rt/tlsf/allocateBlock + local.tee $2 + local.get $1 + i32.store offset=12 + local.get $2 + local.get $0 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $1 + i32.load offset=8 + local.set $3 + local.get $2 + global.get $~lib/rt/itcms/white + local.get $1 + i32.or + i32.store offset=4 + local.get $2 + local.get $3 + i32.store offset=8 + local.get $3 + local.get $3 + i32.load offset=4 + i32.const 3 + i32.and + local.get $2 + i32.or + i32.store offset=4 + local.get $1 + local.get $2 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $2 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.tee $2 + local.set $1 block $~lib/util/memory/memset|inlined.0 - local.get $1 + local.get $0 i32.eqz br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 local.get $0 local.get $1 i32.add - local.tee $2 + local.tee $3 i32.const 1 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 2 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=1 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=2 - local.get $2 + local.get $3 i32.const 2 i32.sub i32.const 0 i32.store8 - local.get $2 + local.get $3 i32.const 3 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 6 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store8 offset=3 - local.get $2 + local.get $3 i32.const 4 i32.sub i32.const 0 i32.store8 - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 - local.get $0 + local.get $1 i32.sub i32.const 3 i32.and - local.tee $2 + local.tee $3 i32.add - local.tee $0 + local.tee $1 i32.const 0 i32.store - local.get $0 local.get $1 - local.get $2 + local.get $0 + local.get $3 i32.sub i32.const -4 i32.and - local.tee $1 + local.tee $0 i32.add - local.tee $2 + local.tee $3 i32.const 4 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 8 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=4 - local.get $0 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $3 i32.const 12 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 8 i32.sub i32.const 0 i32.store - local.get $1 + local.get $0 i32.const 24 i32.le_u br_if $~lib/util/memory/memset|inlined.0 - local.get $0 + local.get $1 i32.const 0 i32.store offset=12 - local.get $0 + local.get $1 i32.const 0 i32.store offset=16 - local.get $0 + local.get $1 i32.const 0 i32.store offset=20 - local.get $0 + local.get $1 i32.const 0 i32.store offset=24 - local.get $2 + local.get $3 i32.const 28 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 24 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 20 i32.sub i32.const 0 i32.store - local.get $2 + local.get $3 i32.const 16 i32.sub i32.const 0 i32.store - local.get $0 - local.get $0 + local.get $1 + local.get $1 i32.const 4 i32.and i32.const 24 i32.add - local.tee $2 + local.tee $3 i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 loop $while-continue|0 - local.get $1 + local.get $0 i32.const 32 i32.ge_u if - local.get $0 + local.get $1 i64.const 0 i64.store - local.get $0 + local.get $1 i64.const 0 i64.store offset=8 - local.get $0 + local.get $1 i64.const 0 i64.store offset=16 - local.get $0 + local.get $1 i64.const 0 i64.store offset=24 - local.get $1 + local.get $0 i32.const 32 i32.sub - local.set $1 - local.get $0 + local.set $0 + local.get $1 i32.const 32 i32.add - local.set $0 + local.set $1 br $while-continue|0 end end end + local.get $2 ) - (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + loop $while-continue|0 + local.get $1 + i32.const 3 + i32.and + i32.const 0 + local.get $2 + select + if + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $while-continue|0 + end + end local.get $0 - i32.const 1073741804 - i32.ge_u - if - i32.const 1344 - i32.const 1408 - i32.const 260 - i32.const 31 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.ge_u - if - block $__inlined_func$~lib/rt/itcms/interrupt - i32.const 2048 - local.set $2 - loop $do-loop|0 - local.get $2 - call $~lib/rt/itcms/step - i32.sub - local.set $2 - global.get $~lib/rt/itcms/state - i32.eqz - if - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i64.const 200 - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - br $__inlined_func$~lib/rt/itcms/interrupt - end - local.get $2 - i32.const 0 - i32.gt_s - br_if $do-loop|0 - end - global.get $~lib/rt/itcms/total - local.tee $2 - global.get $~lib/rt/itcms/threshold - i32.sub - i32.const 1024 - i32.lt_u - i32.const 10 - i32.shl - local.get $2 - i32.add - global.set $~lib/rt/itcms/threshold - end - end - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - i32.const 16 - i32.add - call $~lib/rt/tlsf/allocateBlock - local.tee $2 - local.get $1 - i32.store offset=12 - local.get $2 - local.get $0 - i32.store offset=16 - global.get $~lib/rt/itcms/fromSpace - local.tee $1 - i32.load offset=8 - local.set $3 - local.get $2 - global.get $~lib/rt/itcms/white - local.get $1 - i32.or - i32.store offset=4 - local.get $2 - local.get $3 - i32.store offset=8 - local.get $3 - local.get $3 - i32.load offset=4 - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - global.get $~lib/rt/itcms/total - local.get $2 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.add - global.set $~lib/rt/itcms/total - local.get $2 - i32.const 20 - i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 - ) - (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - loop $while-continue|0 - local.get $1 - i32.const 3 - i32.and - i32.const 0 - local.get $2 - select - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $while-continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz + i32.const 3 + i32.and + i32.eqz if loop $while-continue|1 local.get $2 @@ -2771,7 +2767,7 @@ if i32.const 1088 i32.const 1776 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -3999,13 +3995,13 @@ (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) - (local $12 i32) + (local $11 f32) + (local $12 f64) (local $13 i32) (local $14 i32) (local $15 i32) - (local $16 f32) - (local $17 f64) + (local $16 i32) + (local $17 i32) (local $18 i32) (local $19 i32) (local $20 i32) @@ -4013,7 +4009,6 @@ (local $22 i32) (local $23 i32) (local $24 i32) - (local $25 i32) global.get $~lib/memory/__stack_pointer i32.const 32 i32.sub @@ -4024,19 +4019,19 @@ i32.lt_s br_if $folding-inner0 global.get $~lib/memory/__stack_pointer - local.tee $3 + local.tee $21 i64.const 0 i64.store - local.get $3 + local.get $21 i64.const 0 i64.store offset=8 - local.get $3 + local.get $21 i64.const 0 i64.store offset=16 - local.get $3 + local.get $21 i64.const 0 i64.store offset=24 - local.get $3 + local.get $21 i32.const 1056 i32.store i32.const 1056 @@ -4193,17 +4188,17 @@ i32.const 12 i32.const 3 call $~lib/rt/itcms/__new - local.tee $3 + local.tee $21 i32.const 1312 i32.const 12 call $~lib/memory/memory.copy - local.get $3 + local.get $21 global.set $std/staticarray/arr3 global.get $~lib/memory/__stack_pointer global.get $std/staticarray/arr3 - local.tee $3 + local.tee $21 i32.store - local.get $3 + local.get $21 i32.const 0 call $~lib/staticarray/StaticArray#__get i32.const 5 @@ -4218,9 +4213,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/staticarray/arr3 - local.tee $3 + local.tee $21 i32.store - local.get $3 + local.get $21 i32.const 1 call $~lib/staticarray/StaticArray#__get i32.const 6 @@ -4235,9 +4230,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/staticarray/arr3 - local.tee $3 + local.tee $21 i32.store - local.get $3 + local.get $21 i32.const 2 call $~lib/staticarray/StaticArray#__get i32.const 7 @@ -4252,9 +4247,9 @@ end global.get $~lib/memory/__stack_pointer global.get $std/staticarray/arr3 - local.tee $3 + local.tee $21 i32.store - local.get $3 + local.get $21 i32.const 20 i32.sub i32.load offset=16 @@ -4272,16 +4267,16 @@ end global.get $~lib/memory/__stack_pointer global.get $std/staticarray/arr3 - local.tee $3 + local.tee $21 i32.store - local.get $3 + local.get $21 i32.const 8 call $~lib/staticarray/StaticArray#__set global.get $~lib/memory/__stack_pointer global.get $std/staticarray/arr3 - local.tee $3 + local.tee $21 i32.store - local.get $3 + local.get $21 i32.const 1 call $~lib/staticarray/StaticArray#__get i32.const 8 @@ -4297,17 +4292,17 @@ i32.const 12 i32.const 3 call $~lib/rt/itcms/__new - local.tee $3 + local.tee $21 i32.const 1312 i32.const 12 call $~lib/memory/memory.copy - local.get $3 + local.get $21 global.set $std/staticarray/arr3 global.get $~lib/memory/__stack_pointer global.get $std/staticarray/arr3 - local.tee $3 + local.tee $21 i32.store - local.get $3 + local.get $21 i32.const 1 call $~lib/staticarray/StaticArray#__get i32.const 6 @@ -4324,17 +4319,17 @@ i32.const 8 i32.const 5 call $~lib/rt/itcms/__new - local.tee $3 + local.tee $21 i32.store offset=4 - local.get $3 + local.get $21 i32.const 0 call $std/staticarray/Ref#constructor call $~lib/staticarray/StaticArray#__uset - local.get $3 + local.get $21 i32.const 1 call $std/staticarray/Ref#constructor call $~lib/staticarray/StaticArray#__uset - local.get $3 + local.get $21 global.set $std/staticarray/arr4 i32.const 0 global.set $std/staticarray/arr3 @@ -4350,25 +4345,22 @@ i32.lt_s br_if $folding-inner0 global.get $~lib/memory/__stack_pointer - local.tee $3 + local.tee $22 i32.const 0 i32.store - local.get $3 + local.get $22 i32.const 12 i32.const 3 call $~lib/rt/itcms/__new - local.tee $3 + local.tee $22 i32.store - local.get $3 - i32.const 12 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $22 i32.store offset=4 - local.get $3 + local.get $22 i32.const 20 i32.sub i32.load offset=16 @@ -4385,17 +4377,17 @@ unreachable end loop $for-loop|0 - local.get $3 + local.get $22 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.get $2 + local.get $1 i32.gt_s if - local.get $3 - local.get $2 + local.get $22 + local.get $1 call $~lib/staticarray/StaticArray#__get if i32.const 0 @@ -4405,10 +4397,10 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $1 i32.const 1 i32.add - local.set $2 + local.set $1 br $for-loop|0 end end @@ -4417,16 +4409,16 @@ i32.const 6 i32.const 1728 call $~lib/rt/__newArray - local.tee $3 + local.tee $1 i32.store offset=8 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $1 call $~lib/staticarray/StaticArray.fromArray - local.tee $2 + local.tee $21 i32.store offset=4 - local.get $3 + local.get $1 i32.load offset=12 - local.get $2 + local.get $21 i32.const 20 i32.sub i32.load offset=16 @@ -4442,16 +4434,16 @@ unreachable end loop $for-loop|1 - local.get $3 + local.get $1 i32.load offset=12 - local.get $6 + local.get $0 i32.gt_s if - local.get $2 - local.get $6 + local.get $21 + local.get $0 call $~lib/staticarray/StaticArray#__get - local.get $3 - local.get $6 + local.get $1 + local.get $0 call $~lib/array/Array#__get i32.ne if @@ -4462,10 +4454,10 @@ call $~lib/builtins/abort unreachable end - local.get $6 + local.get $0 i32.const 1 i32.add - local.set $6 + local.set $0 br $for-loop|1 end end @@ -4474,15 +4466,15 @@ i32.const 6 i32.const 1824 call $~lib/rt/__newArray - local.set $2 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $2 + local.get $1 i32.store - local.get $2 + local.get $1 call $~lib/staticarray/StaticArray.fromArray - local.tee $2 + local.tee $0 i32.store offset=4 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4500,29 +4492,29 @@ i32.const 8 i32.const 3 call $~lib/rt/itcms/__new - local.tee $5 + local.tee $0 i32.const 1856 i32.const 8 call $~lib/memory/memory.copy - local.get $5 + local.get $0 i32.store offset=4 global.get $~lib/memory/__stack_pointer i32.const 4 i32.const 3 call $~lib/rt/itcms/__new - local.tee $2 + local.tee $21 i32.const 1888 i32.const 4 call $~lib/memory/memory.copy global.get $~lib/memory/__stack_pointer - local.get $2 + local.get $21 i32.store offset=12 - local.get $5 - local.get $2 + local.get $0 + local.get $21 call $~lib/staticarray/StaticArray.concat - local.tee $2 + local.tee $1 i32.store offset=8 - local.get $2 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -4542,25 +4534,25 @@ i32.const 0 i32.const 3 call $~lib/rt/itcms/__new - local.tee $2 + local.tee $21 i32.const 1920 i32.const 0 call $~lib/memory/memory.copy global.get $~lib/memory/__stack_pointer - local.get $2 + local.get $21 i32.store offset=12 - local.get $5 - local.get $2 + local.get $0 + local.get $21 call $~lib/staticarray/StaticArray.concat - local.tee $2 + local.tee $1 i32.store offset=8 - local.get $2 + local.get $1 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.get $5 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4579,26 +4571,26 @@ i32.const 20 i32.const 8 call $~lib/rt/itcms/__new - local.tee $7 + local.tee $1 i32.const 2128 i32.const 20 call $~lib/memory/memory.copy - local.get $7 + local.get $1 i32.store offset=8 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const 0 i32.const 2147483647 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $6 + local.tee $21 i32.store offset=4 - local.get $6 + local.get $21 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.get $7 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -4614,33 +4606,33 @@ unreachable end i32.const 0 - local.set $2 + local.set $0 loop $for-loop|2 - local.get $7 + local.get $1 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.get $2 + local.get $0 i32.gt_s if - local.get $7 - local.get $2 + local.get $1 + local.get $0 call $~lib/staticarray/StaticArray<~lib/string/String>#__get - local.set $5 + local.set $22 global.get $~lib/memory/__stack_pointer - local.get $5 + local.get $22 i32.store - local.get $6 - local.get $2 + local.get $21 + local.get $0 call $~lib/staticarray/StaticArray<~lib/string/String>#__get - local.set $3 + local.set $23 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $23 i32.store offset=12 - local.get $5 - local.get $3 + local.get $22 + local.get $23 call $~lib/string/String.__eq i32.eqz if @@ -4651,21 +4643,21 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|2 end end global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const 1 i32.const 3 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $5 + local.tee $0 i32.store offset=4 - local.get $5 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4681,18 +4673,18 @@ call $~lib/builtins/abort unreachable end - local.get $5 + local.get $0 i32.const 0 call $~lib/staticarray/StaticArray<~lib/string/String>#__get - local.set $3 + local.set $21 global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $3 + local.tee $22 + local.get $21 i32.store - local.get $2 + local.get $22 i32.const 1984 i32.store offset=12 - local.get $3 + local.get $21 i32.const 1984 call $~lib/string/String.__eq i32.eqz @@ -4704,18 +4696,18 @@ call $~lib/builtins/abort unreachable end - local.get $5 + local.get $0 i32.const 1 call $~lib/staticarray/StaticArray<~lib/string/String>#__get - local.set $3 + local.set $0 global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $3 + local.tee $21 + local.get $0 i32.store - local.get $2 + local.get $21 i32.const 2016 i32.store offset=12 - local.get $3 + local.get $0 i32.const 2016 call $~lib/string/String.__eq i32.eqz @@ -4728,13 +4720,13 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const 1 i32.const 2147483647 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $2 + local.tee $0 i32.store offset=4 - local.get $7 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -4742,7 +4734,7 @@ i32.shr_u i32.const 1 i32.sub - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4758,19 +4750,19 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const 0 i32.const 50 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $2 + local.tee $0 i32.store offset=4 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.get $7 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -4786,13 +4778,13 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const 100 i32.const 2147483647 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $2 + local.tee $0 i32.store offset=4 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4807,13 +4799,13 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const -1 i32.const 2147483647 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $2 + local.tee $0 i32.store offset=4 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4829,18 +4821,18 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 0 call $~lib/staticarray/StaticArray<~lib/string/String>#__get - local.set $3 + local.set $0 global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $3 + local.tee $21 + local.get $0 i32.store - local.get $2 + local.get $21 i32.const 2080 i32.store offset=12 - local.get $3 + local.get $0 i32.const 2080 call $~lib/string/String.__eq i32.eqz @@ -4853,13 +4845,13 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const -2 i32.const -2 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $2 + local.tee $0 i32.store offset=4 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4874,13 +4866,13 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $1 i32.const 2 i32.const -2 call $~lib/staticarray/StaticArray.slice<~lib/string/String> - local.tee $2 + local.tee $0 i32.store offset=4 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -4896,18 +4888,18 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 0 call $~lib/staticarray/StaticArray<~lib/string/String>#__get - local.set $3 + local.set $0 global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $3 + local.tee $1 + local.get $0 i32.store - local.get $2 + local.get $1 i32.const 2016 i32.store offset=12 - local.get $3 + local.get $0 i32.const 2016 call $~lib/string/String.__eq i32.eqz @@ -4923,29 +4915,29 @@ i32.const 20 i32.const 8 call $~lib/rt/itcms/__new - local.tee $5 + local.tee $1 i32.const 2304 i32.const 20 call $~lib/memory/memory.copy - local.get $5 + local.get $1 i32.store offset=4 global.get $~lib/memory/__stack_pointer i32.const 0 i32.const 9 i32.const 2352 call $~lib/rt/__newArray - local.set $2 + local.set $21 global.get $~lib/memory/__stack_pointer - local.get $2 + local.get $21 i32.store offset=12 - local.get $5 - local.get $2 + local.get $1 + local.get $21 call $~lib/staticarray/StaticArray<~lib/string/String>#concat - local.tee $2 + local.tee $0 i32.store offset=16 - local.get $2 + local.get $0 i32.load offset=12 - local.get $5 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -4965,18 +4957,18 @@ i32.const 9 i32.const 2416 call $~lib/rt/__newArray - local.set $2 + local.set $21 global.get $~lib/memory/__stack_pointer - local.get $2 + local.get $21 i32.store offset=12 - local.get $5 - local.get $2 + local.get $1 + local.get $21 call $~lib/staticarray/StaticArray<~lib/string/String>#concat - local.tee $2 + local.tee $0 i32.store offset=16 - local.get $2 + local.get $0 i32.load offset=12 - local.get $5 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -4997,16 +4989,16 @@ i32.const 20 i32.const 8 call $~lib/rt/itcms/__new - local.tee $2 + local.tee $1 i32.const 2448 i32.const 20 call $~lib/memory/memory.copy - local.get $2 + local.get $1 i32.store offset=16 global.get $~lib/memory/__stack_pointer i32.const 1984 i32.store offset=12 - local.get $2 + local.get $1 i32.const 1984 i32.const 0 call $~lib/staticarray/StaticArray<~lib/string/String>#includes @@ -5023,7 +5015,7 @@ global.get $~lib/memory/__stack_pointer i32.const 2384 i32.store offset=12 - local.get $2 + local.get $1 i32.const 2384 i32.const 0 call $~lib/staticarray/StaticArray<~lib/string/String>#includes @@ -5038,7 +5030,7 @@ global.get $~lib/memory/__stack_pointer i32.const 2080 i32.store offset=12 - local.get $2 + local.get $1 i32.const 2080 i32.const 5 call $~lib/staticarray/StaticArray<~lib/string/String>#includes @@ -5053,7 +5045,7 @@ global.get $~lib/memory/__stack_pointer i32.const 2080 i32.store offset=12 - local.get $2 + local.get $1 i32.const 2080 i32.const -1 call $~lib/staticarray/StaticArray<~lib/string/String>#includes @@ -5071,49 +5063,49 @@ i32.const 8 i32.const 10 call $~lib/rt/itcms/__new - local.tee $3 + local.tee $0 i32.const 2496 i32.const 8 call $~lib/memory/memory.copy global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $0 i32.store i32.const 0 - local.get $3 + local.get $0 i32.const 20 i32.sub i32.load offset=16 i32.const 3 i32.shr_u - local.tee $2 + local.tee $1 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop loop $while-continue|0 - local.get $0 - local.get $2 - i32.lt_s + local.get $1 + local.get $7 + i32.gt_s if i32.const 1 - local.get $0 + local.get $7 i32.const 3 i32.shl - local.get $3 + local.get $0 i32.add f64.load - local.tee $17 + local.tee $12 f64.const nan:0x8000000000000 f64.eq - local.get $17 - local.get $17 + local.get $12 + local.get $12 f64.ne i32.or br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop - local.get $0 + local.get $7 i32.const 1 i32.add - local.set $0 + local.set $7 br $while-continue|0 end end @@ -5132,49 +5124,49 @@ i32.const 4 i32.const 11 call $~lib/rt/itcms/__new - local.tee $2 + local.tee $0 i32.const 2528 i32.const 4 call $~lib/memory/memory.copy global.get $~lib/memory/__stack_pointer - local.get $2 + local.get $0 i32.store i32.const 0 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $0 + local.tee $1 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop loop $while-continue|09 - local.get $0 - local.get $9 + local.get $1 + local.get $8 i32.gt_s if i32.const 1 - local.get $9 + local.get $8 i32.const 2 i32.shl - local.get $2 + local.get $0 i32.add f32.load - local.tee $16 + local.tee $11 f32.const nan:0x400000 f32.eq - local.get $16 - local.get $16 + local.get $11 + local.get $11 f32.ne i32.or br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop - local.get $9 + local.get $8 i32.const 1 i32.add - local.set $9 + local.set $8 br $while-continue|09 end end @@ -5193,34 +5185,34 @@ i32.const 12 i32.const 3 call $~lib/rt/itcms/__new - local.tee $3 + local.tee $7 i32.const 2560 i32.const 12 call $~lib/memory/memory.copy - local.get $3 + local.get $7 i32.store offset=16 i32.const -1 local.set $0 block $__inlined_func$~lib/staticarray/StaticArray#indexOf - local.get $3 + local.get $7 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $2 + local.tee $1 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf loop $while-continue|012 local.get $1 local.get $2 - i32.lt_s + i32.gt_s if - local.get $1 + local.get $2 local.tee $0 i32.const 2 i32.shl - local.get $3 + local.get $7 i32.add i32.load i32.const 2 @@ -5229,7 +5221,7 @@ local.get $0 i32.const 1 i32.add - local.set $1 + local.set $2 br $while-continue|012 end end @@ -5248,7 +5240,7 @@ i32.const -1 local.set $0 block $__inlined_func$~lib/staticarray/StaticArray#indexOf13 - local.get $3 + local.get $7 i32.const 20 i32.sub i32.load offset=16 @@ -5259,14 +5251,14 @@ br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf13 loop $while-continue|028 local.get $1 - local.get $4 + local.get $3 i32.gt_s if - local.get $4 + local.get $3 local.tee $0 i32.const 2 i32.shl - local.get $3 + local.get $7 i32.add i32.load i32.const 7 @@ -5275,7 +5267,7 @@ local.get $0 i32.const 1 i32.add - local.set $4 + local.set $3 br $while-continue|028 end end @@ -5294,11 +5286,11 @@ unreachable end i32.const 2 - local.set $1 - i32.const -1 local.set $0 + i32.const -1 + local.set $1 block $__inlined_func$~lib/staticarray/StaticArray#indexOf29 - local.get $3 + local.get $7 i32.const 20 i32.sub i32.load offset=16 @@ -5312,31 +5304,31 @@ select br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf29 loop $while-continue|033 - local.get $1 + local.get $0 local.get $2 i32.lt_s if - local.get $1 - local.tee $0 + local.get $0 + local.tee $1 i32.const 2 i32.shl - local.get $3 + local.get $7 i32.add i32.load i32.const 9 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf29 - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $1 + local.set $0 br $while-continue|033 end end i32.const -1 - local.set $0 + local.set $1 end - local.get $0 + local.get $1 i32.const 2 i32.ne if @@ -5348,22 +5340,22 @@ unreachable end i32.const -1 - local.set $1 + local.set $0 block $__inlined_func$~lib/staticarray/StaticArray#indexOf34 - local.get $3 + local.get $7 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $2 + local.tee $1 i32.const 0 i32.lt_u i32.const 1 - local.get $2 + local.get $1 select br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf34 - local.get $2 + local.get $1 i32.const 1 i32.sub local.tee $0 @@ -5372,32 +5364,32 @@ i32.const 0 i32.gt_s select - local.set $1 + local.set $0 loop $while-continue|037 + local.get $0 local.get $1 - local.get $2 i32.lt_s if - local.get $1 + local.get $0 i32.const 2 i32.shl - local.get $3 + local.get $7 i32.add i32.load i32.const 2 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf34 - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $while-continue|037 end end i32.const -1 - local.set $1 + local.set $0 end - local.get $1 + local.get $0 i32.const -1 i32.ne if @@ -5409,56 +5401,56 @@ unreachable end i32.const -1 - local.set $2 + local.set $1 block $__inlined_func$~lib/staticarray/StaticArray#indexOf38 - local.get $3 + local.get $7 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $1 + local.tee $0 i32.const -3 i32.le_s i32.const 1 - local.get $1 + local.get $0 select br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf38 - local.get $1 + local.get $0 i32.const 3 i32.sub - local.tee $0 + local.tee $1 i32.const 0 - local.get $0 + local.get $1 i32.const 0 i32.gt_s select - local.set $2 + local.set $1 loop $while-continue|041 + local.get $0 local.get $1 - local.get $2 i32.gt_s if - local.get $2 + local.get $1 i32.const 2 i32.shl - local.get $3 + local.get $7 i32.add i32.load i32.const 2 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#indexOf38 - local.get $2 + local.get $1 i32.const 1 i32.add - local.set $2 + local.set $1 br $while-continue|041 end end i32.const -1 - local.set $2 + local.set $1 end - local.get $2 + local.get $1 if i32.const 0 i32.const 1216 @@ -5471,76 +5463,75 @@ i32.const 16 i32.const 3 call $~lib/rt/itcms/__new - local.tee $3 + local.tee $2 i32.const 2592 i32.const 16 call $~lib/memory/memory.copy - local.get $3 + local.get $2 i32.store offset=16 i32.const 1 global.set $~argumentsLength - local.get $3 - local.tee $0 + local.get $2 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.set $4 - i32.const -1 local.set $1 + i32.const -1 + local.set $0 block $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf - local.get $0 + local.get $2 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $2 + local.tee $3 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf - local.get $2 - local.get $4 + local.get $1 + local.get $3 i32.add - local.get $2 + local.get $3 i32.const 1 i32.sub - local.get $4 - local.get $2 - local.get $4 - i32.le_s + local.get $1 + local.get $1 + local.get $3 + i32.ge_s select - local.get $4 + local.get $1 i32.const 0 i32.lt_s select - local.set $2 + local.set $1 loop $while-continue|01 - local.get $2 + local.get $1 i32.const 0 i32.ge_s if - local.get $2 - local.tee $1 + local.get $1 + local.tee $0 i32.const 2 i32.shl - local.get $0 + local.get $2 i32.add i32.load i32.const 2 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf - local.get $1 + local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $1 br $while-continue|01 end end i32.const -1 - local.set $1 + local.set $0 end - local.get $1 + local.get $0 i32.const 3 i32.ne if @@ -5553,62 +5544,62 @@ end i32.const 1 global.set $~argumentsLength - local.get $0 + local.get $2 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $4 - local.set $2 + local.tee $1 + local.set $3 i32.const -1 - local.set $1 + local.set $0 block $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf6 - local.get $4 + local.get $1 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf6 - local.get $2 - local.get $4 + local.get $1 + local.get $3 i32.add - local.get $4 + local.get $1 i32.const 1 i32.sub - local.get $2 - local.get $2 - local.get $4 - i32.ge_s + local.get $3 + local.get $1 + local.get $3 + i32.le_s select - local.get $2 + local.get $3 i32.const 0 i32.lt_s select - local.set $2 + local.set $1 loop $while-continue|07 - local.get $2 + local.get $1 i32.const 0 i32.ge_s if - local.get $2 - local.tee $1 + local.get $1 + local.tee $0 i32.const 2 i32.shl - local.get $0 + local.get $2 i32.add i32.load i32.const 7 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf6 - local.get $1 + local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $1 br $while-continue|07 end end i32.const -1 - local.set $1 + local.set $0 end - local.get $1 + local.get $0 i32.const -1 i32.ne if @@ -5620,51 +5611,51 @@ unreachable end i32.const -1 - local.set $1 + local.set $7 block $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf8 - local.get $0 + local.get $2 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $2 + local.tee $0 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf8 - local.get $2 + local.get $0 i32.const 1 i32.sub i32.const 3 - local.get $2 + local.get $0 i32.const 3 i32.le_s select - local.set $1 + local.set $7 loop $while-continue|044 - local.get $1 + local.get $7 i32.const 0 i32.ge_s if - local.get $1 + local.get $7 i32.const 2 i32.shl - local.get $0 + local.get $2 i32.add i32.load i32.const 2 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf8 - local.get $1 + local.get $7 i32.const 1 i32.sub - local.set $1 + local.set $7 br $while-continue|044 end end i32.const -1 - local.set $1 + local.set $7 end - local.get $1 + local.get $7 i32.const 3 i32.ne if @@ -5676,51 +5667,51 @@ unreachable end i32.const -1 - local.set $1 + local.set $7 block $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf45 - local.get $0 + local.get $2 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $2 + local.tee $0 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf45 - local.get $2 + local.get $0 i32.const 1 i32.sub i32.const 2 - local.get $2 + local.get $0 i32.const 2 i32.le_s select - local.set $1 + local.set $7 loop $while-continue|048 - local.get $1 + local.get $7 i32.const 0 i32.ge_s if - local.get $1 + local.get $7 i32.const 2 i32.shl - local.get $0 + local.get $2 i32.add i32.load i32.const 2 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf45 - local.get $1 + local.get $7 i32.const 1 i32.sub - local.set $1 + local.set $7 br $while-continue|048 end end i32.const -1 - local.set $1 + local.set $7 end - local.get $1 + local.get $7 if i32.const 0 i32.const 1216 @@ -5730,46 +5721,46 @@ unreachable end i32.const -1 - local.set $1 + local.set $7 block $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf49 - local.get $0 + local.get $2 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $2 + local.tee $0 i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf49 - local.get $2 + local.get $0 i32.const 2 i32.sub - local.set $1 + local.set $7 loop $while-continue|052 - local.get $1 + local.get $7 i32.const 0 i32.ge_s if - local.get $1 + local.get $7 i32.const 2 i32.shl - local.get $0 + local.get $2 i32.add i32.load i32.const 2 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf49 - local.get $1 + local.get $7 i32.const 1 i32.sub - local.set $1 + local.set $7 br $while-continue|052 end end i32.const -1 - local.set $1 + local.set $7 end - local.get $1 + local.get $7 if i32.const 0 i32.const 1216 @@ -5779,9 +5770,9 @@ unreachable end i32.const -1 - local.set $2 + local.set $8 block $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf53 - local.get $3 + local.get $2 i32.const 20 i32.sub i32.load offset=16 @@ -5793,32 +5784,32 @@ local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $8 loop $while-continue|056 - local.get $2 + local.get $8 i32.const 0 i32.ge_s if - local.get $2 + local.get $8 i32.const 2 i32.shl - local.get $3 + local.get $2 i32.add i32.load i32.const 2 i32.eq br_if $__inlined_func$~lib/staticarray/StaticArray#lastIndexOf53 - local.get $2 + local.get $8 i32.const 1 i32.sub - local.set $2 + local.set $8 br $while-continue|056 end end i32.const -1 - local.set $2 + local.set $8 end - local.get $2 + local.get $8 i32.const 3 i32.ne if @@ -5833,17 +5824,17 @@ i32.const 12 i32.const 8 call $~lib/rt/itcms/__new - local.tee $2 + local.tee $1 i32.const 2736 i32.const 12 call $~lib/memory/memory.copy - local.get $2 + local.get $1 i32.store offset=16 global.get $~lib/memory/__stack_pointer i32.const 2800 i32.store offset=20 - local.get $2 - local.get $2 + local.get $1 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -5873,8 +5864,8 @@ global.get $~lib/memory/__stack_pointer i32.const 2768 i32.store offset=20 - local.get $2 - local.get $2 + local.get $1 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -5904,8 +5895,8 @@ global.get $~lib/memory/__stack_pointer i32.const 2928 i32.store offset=20 - local.get $2 - local.get $2 + local.get $1 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -5935,8 +5926,8 @@ global.get $~lib/memory/__stack_pointer i32.const 3008 i32.store offset=20 - local.get $2 - local.get $2 + local.get $1 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -5966,8 +5957,8 @@ global.get $~lib/memory/__stack_pointer i32.const 2800 i32.store offset=20 - local.get $2 - local.get $2 + local.get $1 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -5975,9 +5966,9 @@ i32.shr_u i32.const 2800 call $~lib/util/string/joinStringArray - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer - local.get $1 + local.get $0 i32.store global.get $~lib/memory/__stack_pointer i32.const 4 @@ -5988,14 +5979,14 @@ i32.lt_s br_if $folding-inner0 global.get $~lib/memory/__stack_pointer - local.tee $0 + local.tee $2 i32.const 0 i32.store - local.get $0 + local.get $2 i32.const 2800 i32.store - local.get $2 - local.get $2 + local.get $1 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -6003,16 +5994,16 @@ i32.shr_u i32.const 2800 call $~lib/util/string/joinStringArray - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=12 local.get $1 + i32.store offset=12 local.get $0 + local.get $1 call $~lib/string/String.__eq i32.eqz if @@ -6027,45 +6018,45 @@ i32.const 8 i32.const 3 call $~lib/rt/itcms/__new - local.tee $2 + local.tee $0 i32.const 3104 i32.const 8 call $~lib/memory/memory.copy - local.get $2 + local.get $0 i32.store offset=16 i32.const 1 - local.get $2 + local.get $0 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $1 - local.get $1 + local.tee $2 + local.get $2 i32.const 1 i32.gt_s select - local.set $0 + local.set $1 loop $for-loop|060 - local.get $0 local.get $1 + local.get $2 i32.lt_s if - local.get $0 + local.get $1 i32.const 2 i32.shl - local.get $2 + local.get $0 i32.add i32.const 1 i32.store - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|060 end end - local.get $2 + local.get $0 i32.const 0 call $~lib/staticarray/StaticArray#__get if @@ -6076,7 +6067,7 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 1 call $~lib/staticarray/StaticArray#__get i32.const 1 @@ -6093,13 +6084,13 @@ i32.const 12 i32.const 3 call $~lib/rt/itcms/__new - local.tee $4 + local.tee $1 i32.const 3136 i32.const 12 call $~lib/memory/memory.copy - local.get $4 + local.get $1 i32.store offset=16 - local.get $4 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -6112,47 +6103,47 @@ local.get $0 i32.const 1 i32.shr_u - local.set $3 + local.set $2 local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $0 loop $while-continue|064 - local.get $3 - local.get $10 + local.get $2 + local.get $4 i32.gt_u if - local.get $10 + local.get $4 i32.const 2 i32.shl - local.get $4 + local.get $1 i32.add - local.tee $0 + local.tee $3 i32.load - local.set $1 + local.set $7 + local.get $3 local.get $0 - local.get $2 - local.get $10 + local.get $4 i32.sub i32.const 2 i32.shl - local.get $4 + local.get $1 i32.add - local.tee $0 + local.tee $3 i32.load i32.store - local.get $0 - local.get $1 + local.get $3 + local.get $7 i32.store - local.get $10 + local.get $4 i32.const 1 i32.add - local.set $10 + local.set $4 br $while-continue|064 end end end - local.get $4 + local.get $1 i32.const 0 call $~lib/staticarray/StaticArray#__get i32.const 3 @@ -6165,7 +6156,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $1 i32.const 1 call $~lib/staticarray/StaticArray#__get i32.const 2 @@ -6178,7 +6169,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $1 i32.const 2 call $~lib/staticarray/StaticArray#__get i32.const 1 @@ -6195,78 +6186,79 @@ i32.const 20 i32.const 3 call $~lib/rt/itcms/__new - local.tee $4 + local.tee $1 i32.const 3168 i32.const 20 call $~lib/memory/memory.copy - local.get $4 + local.get $1 i32.store offset=16 - local.get $4 + local.get $1 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $3 - local.set $0 + local.tee $0 + local.tee $2 + local.set $3 i32.const 0 - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.const 0 i32.gt_s select local.tee $2 i32.const 2 i32.shl - local.get $4 + local.get $1 i32.add i32.const 3 - local.get $3 - local.get $3 + local.get $0 + local.get $0 i32.const 3 i32.gt_s select - local.tee $1 + local.tee $4 i32.const 2 i32.shl - local.get $4 + local.get $1 i32.add - local.get $0 + local.get $3 i32.const 0 i32.lt_s if (result i32) local.get $0 local.get $3 i32.add - local.tee $0 + local.tee $3 i32.const 0 - local.get $0 + local.get $3 i32.const 0 i32.gt_s select else - local.get $0 local.get $3 local.get $0 + local.get $0 local.get $3 - i32.lt_s + i32.gt_s select end - local.get $1 + local.get $4 i32.sub - local.tee $1 - local.get $3 + local.tee $3 + local.get $0 local.get $2 i32.sub local.tee $0 local.get $0 - local.get $1 + local.get $3 i32.gt_s select i32.const 2 i32.shl call $~lib/memory/memory.copy - local.get $4 + local.get $1 i32.const 0 call $~lib/staticarray/StaticArray#__get i32.const 4 @@ -6279,7 +6271,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $1 i32.const 1 call $~lib/staticarray/StaticArray#__get i32.const 5 @@ -6292,7 +6284,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $1 i32.const 2 call $~lib/staticarray/StaticArray#__get i32.const 3 @@ -6305,7 +6297,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $1 i32.const 3 call $~lib/staticarray/StaticArray#__get i32.const 4 @@ -6318,7 +6310,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $1 i32.const 4 call $~lib/staticarray/StaticArray#__get i32.const 5 @@ -6335,17 +6327,17 @@ i32.const 12 i32.const 3 call $~lib/rt/itcms/__new - local.tee $4 + local.tee $1 i32.const 3216 i32.const 12 call $~lib/memory/memory.copy - local.get $4 + local.get $1 i32.store offset=16 global.get $~lib/memory/__stack_pointer - local.tee $6 + local.tee $2 i32.const 3248 i32.store offset=12 - local.get $6 + local.get $2 i32.const 4 i32.sub global.set $~lib/memory/__stack_pointer @@ -6358,50 +6350,51 @@ i32.const 0 i32.store local.get $0 - local.get $4 + local.get $1 + local.tee $0 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.tee $5 + local.tee $3 i32.const 6 i32.const 0 call $~lib/rt/__newArray - local.tee $3 + local.tee $4 i32.store - local.get $3 + local.get $4 i32.load offset=4 - local.set $2 + local.set $7 loop $for-loop|042 + local.get $3 local.get $5 - local.get $11 i32.gt_s if - local.get $11 + local.get $5 i32.const 2 i32.shl - local.tee $1 - local.get $4 + local.tee $8 + local.get $0 i32.add i32.load - local.set $0 + local.set $21 i32.const 3 global.set $~argumentsLength - local.get $1 - local.get $2 + local.get $7 + local.get $8 i32.add + local.get $21 + local.get $5 local.get $0 - local.get $11 - local.get $4 i32.const 3248 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) i32.store - local.get $11 + local.get $5 i32.const 1 i32.add - local.set $11 + local.set $5 br $for-loop|042 end end @@ -6409,10 +6402,10 @@ i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $6 - local.get $3 + local.get $2 + local.get $4 i32.store offset=4 - local.get $3 + local.get $4 i32.const 0 call $~lib/array/Array#__get i32.const 2 @@ -6425,7 +6418,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $4 i32.const 1 call $~lib/array/Array#__get i32.const 3 @@ -6438,7 +6431,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $4 i32.const 2 call $~lib/array/Array#__get i32.const 4 @@ -6454,35 +6447,35 @@ global.get $~lib/memory/__stack_pointer i32.const 3280 i32.store offset=12 - local.get $4 + local.get $0 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.set $1 + local.set $2 loop $for-loop|070 - local.get $1 - local.get $8 + local.get $2 + local.get $6 i32.gt_s if - local.get $8 + local.get $6 i32.const 2 i32.shl - local.get $4 + local.get $0 i32.add i32.load i32.const 3 global.set $~argumentsLength - local.get $8 - local.get $4 + local.get $6 + local.get $0 i32.const 3280 i32.load call_indirect $0 (type $i32_i32_i32_=>_none) - local.get $8 + local.get $6 i32.const 1 i32.add - local.set $8 + local.set $6 br $for-loop|070 end end @@ -6498,10 +6491,10 @@ unreachable end global.get $~lib/memory/__stack_pointer - local.tee $11 + local.tee $5 i32.const 3312 i32.store offset=12 - local.get $11 + local.get $5 i32.const 4 i32.sub global.set $~lib/memory/__stack_pointer @@ -6510,101 +6503,102 @@ i32.lt_s br_if $folding-inner0 global.get $~lib/memory/__stack_pointer - local.tee $0 + local.tee $2 i32.const 0 i32.store - local.get $0 + local.get $2 i32.const 0 i32.const 6 i32.const 0 call $~lib/rt/__newArray - local.tee $3 + local.tee $2 i32.store - local.get $4 + local.get $0 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.set $10 + local.set $4 loop $for-loop|045 - local.get $10 - local.get $23 + local.get $4 + local.get $18 i32.gt_s if - local.get $23 + local.get $18 i32.const 2 i32.shl - local.get $4 + local.get $0 i32.add i32.load - local.set $9 + local.set $6 i32.const 3 global.set $~argumentsLength - local.get $9 - local.get $23 - local.get $4 + local.get $6 + local.get $18 + local.get $0 i32.const 3312 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) if - local.get $3 + local.get $2 + local.tee $3 i32.load offset=12 - local.tee $8 + local.tee $7 i32.const 1 i32.add - local.tee $7 + local.tee $8 + local.set $21 local.get $3 - local.tee $2 i32.load offset=8 - local.tee $6 + local.tee $22 i32.const 2 i32.shr_u - i32.gt_u + local.get $8 + i32.lt_u if - local.get $7 + local.get $21 i32.const 268435455 i32.gt_u if i32.const 1680 i32.const 1776 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/rt/itcms/__renew - local.get $6 + block $__inlined_func$~lib/rt/itcms/__renew (result i32) + local.get $22 i32.const 1 i32.shl - local.tee $0 + local.tee $22 i32.const 1073741820 - local.get $0 + local.get $22 i32.const 1073741820 i32.lt_u select - local.tee $1 - local.get $7 + local.tee $22 + local.get $21 i32.const 8 - local.get $7 + local.get $21 i32.const 8 i32.gt_u select i32.const 2 i32.shl - local.tee $0 - local.get $0 - local.get $1 + local.tee $21 + local.get $21 + local.get $22 i32.lt_u select - local.tee $13 - local.get $2 + local.tee $21 + local.get $3 i32.load - local.tee $5 - local.tee $0 + local.tee $22 i32.const 20 i32.sub - local.tee $12 + local.tee $23 i32.load i32.const -4 i32.and @@ -6612,74 +6606,67 @@ i32.sub i32.le_u if - local.get $12 - local.get $13 + local.get $23 + local.get $21 i32.store offset=16 + local.get $22 br $__inlined_func$~lib/rt/itcms/__renew end - local.get $13 - local.get $12 + local.get $21 + local.get $23 i32.load offset=12 call $~lib/rt/itcms/__new - local.tee $1 - local.get $0 - local.get $13 - local.get $12 + local.tee $24 + local.get $22 + local.get $21 + local.get $23 i32.load offset=16 - local.tee $0 - local.get $0 - local.get $13 - i32.gt_u + local.tee $23 + local.get $21 + local.get $23 + i32.lt_u select call $~lib/memory/memory.copy - local.get $1 - local.set $0 + local.get $24 end - local.get $0 - local.get $6 - i32.add - local.get $13 - local.get $6 - i32.sub - call $~lib/memory/memory.fill - local.get $0 - local.get $5 + local.tee $23 + local.get $22 i32.ne if - local.get $2 - local.get $0 + local.get $3 + local.get $23 i32.store - local.get $2 - local.get $0 + local.get $3 + local.get $23 i32.store offset=4 - local.get $0 + local.get $23 if - local.get $2 - local.get $0 + local.get $3 + local.get $23 i32.const 0 call $byn-split-outlined-A$~lib/rt/itcms/__link end end - local.get $2 - local.get $13 + local.get $3 + local.get $21 i32.store offset=8 end - local.get $2 + local.get $3 i32.load offset=4 - local.get $8 + local.get $7 i32.const 2 i32.shl i32.add - local.get $9 + local.get $6 i32.store - local.get $2 - local.get $7 + local.get $3 + local.get $8 i32.store offset=12 end - local.get $23 + local.get $18 i32.const 1 i32.add - local.set $23 + local.set $18 br $for-loop|045 end end @@ -6687,10 +6674,10 @@ i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $11 - local.get $3 + local.get $5 + local.get $2 i32.store offset=24 - local.get $3 + local.get $2 i32.load offset=12 i32.const 2 i32.ne @@ -6702,7 +6689,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.const 0 call $~lib/array/Array#__get i32.const 2 @@ -6715,7 +6702,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.const 1 call $~lib/array/Array#__get i32.const 3 @@ -6731,8 +6718,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3344 i32.store offset=12 - local.get $4 - local.tee $0 + local.get $0 i32.const 20 i32.sub i32.load offset=16 @@ -6741,34 +6727,34 @@ local.set $2 loop $for-loop|076 local.get $2 - local.get $22 + local.get $17 i32.gt_s if - local.get $22 + local.get $17 i32.const 2 i32.shl local.get $0 i32.add i32.load - local.set $1 + local.set $3 i32.const 4 global.set $~argumentsLength - local.get $15 - local.get $1 - local.get $22 + local.get $10 + local.get $3 + local.get $17 local.get $0 i32.const 3344 i32.load call_indirect $0 (type $i32_i32_i32_i32_=>_i32) - local.set $15 - local.get $22 + local.set $10 + local.get $17 i32.const 1 i32.add - local.set $22 + local.set $17 br $for-loop|076 end end - local.get $15 + local.get $10 i32.const 6 i32.ne if @@ -6782,7 +6768,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3376 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -6790,13 +6776,13 @@ i32.shr_u i32.const 1 i32.sub - local.set $1 + local.set $8 loop $for-loop|080 - local.get $1 + local.get $8 i32.const 0 i32.ge_s if - local.get $1 + local.get $8 i32.const 2 i32.shl local.get $0 @@ -6805,22 +6791,22 @@ local.set $2 i32.const 4 global.set $~argumentsLength - local.get $14 + local.get $9 local.get $2 - local.get $1 + local.get $8 local.get $0 i32.const 3376 i32.load call_indirect $0 (type $i32_i32_i32_i32_=>_i32) - local.set $14 - local.get $1 + local.set $9 + local.get $8 i32.const 1 i32.sub - local.set $1 + local.set $8 br $for-loop|080 end end - local.get $14 + local.get $9 i32.const 6 i32.ne if @@ -6835,7 +6821,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3408 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -6844,31 +6830,31 @@ local.set $2 loop $for-loop|084 local.get $2 - local.get $21 + local.get $16 i32.gt_s if - local.get $21 + local.get $16 i32.const 2 i32.shl local.get $0 i32.add i32.load - local.set $1 + local.set $3 i32.const 3 global.set $~argumentsLength i32.const 1 - local.get $1 - local.get $21 + local.get $3 + local.get $16 local.get $0 i32.const 3408 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) br_if $__inlined_func$~lib/staticarray/StaticArray#some drop - local.get $21 + local.get $16 i32.const 1 i32.add - local.set $21 + local.set $16 br $for-loop|084 end end @@ -6887,7 +6873,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3440 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -6896,31 +6882,31 @@ local.set $2 loop $for-loop|089 local.get $2 - local.get $20 + local.get $15 i32.gt_s if - local.get $20 + local.get $15 i32.const 2 i32.shl local.get $0 i32.add i32.load - local.set $1 + local.set $3 i32.const 3 global.set $~argumentsLength i32.const 1 - local.get $1 - local.get $20 + local.get $3 + local.get $15 local.get $0 i32.const 3440 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) br_if $__inlined_func$~lib/staticarray/StaticArray#some86 drop - local.get $20 + local.get $15 i32.const 1 i32.add - local.set $20 + local.set $15 br $for-loop|089 end end @@ -6938,7 +6924,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3472 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -6947,21 +6933,21 @@ local.set $2 loop $for-loop|093 local.get $2 - local.get $19 + local.get $14 i32.gt_s if - local.get $19 + local.get $14 i32.const 2 i32.shl local.get $0 i32.add i32.load - local.set $1 + local.set $3 i32.const 3 global.set $~argumentsLength i32.const 0 - local.get $1 - local.get $19 + local.get $3 + local.get $14 local.get $0 i32.const 3472 i32.load @@ -6969,10 +6955,10 @@ i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#every drop - local.get $19 + local.get $14 i32.const 1 i32.add - local.set $19 + local.set $14 br $for-loop|093 end end @@ -6991,7 +6977,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3504 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -7000,21 +6986,21 @@ local.set $2 loop $for-loop|098 local.get $2 - local.get $18 + local.get $13 i32.gt_s if - local.get $18 + local.get $13 i32.const 2 i32.shl local.get $0 i32.add i32.load - local.set $1 + local.set $3 i32.const 3 global.set $~argumentsLength i32.const 0 - local.get $1 - local.get $18 + local.get $3 + local.get $13 local.get $0 i32.const 3504 i32.load @@ -7022,10 +7008,10 @@ i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#every95 drop - local.get $18 + local.get $13 i32.const 1 i32.add - local.set $18 + local.set $13 br $for-loop|098 end end @@ -7042,7 +7028,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3536 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -7052,10 +7038,10 @@ block $__inlined_func$~lib/staticarray/StaticArray#findIndex loop $for-loop|0102 local.get $2 - local.get $25 + local.get $20 i32.gt_s if - local.get $25 + local.get $20 i32.const 2 i32.shl local.get $0 @@ -7063,23 +7049,23 @@ i32.load i32.const 3 global.set $~argumentsLength - local.get $25 + local.get $20 local.get $0 i32.const 3536 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) br_if $__inlined_func$~lib/staticarray/StaticArray#findIndex - local.get $25 + local.get $20 i32.const 1 i32.add - local.set $25 + local.set $20 br $for-loop|0102 end end i32.const -1 - local.set $25 + local.set $20 end - local.get $25 + local.get $20 i32.const 1 i32.ne if @@ -7093,7 +7079,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3568 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -7103,10 +7089,10 @@ block $__inlined_func$~lib/staticarray/StaticArray#findIndex104 loop $for-loop|0107 local.get $2 - local.get $24 + local.get $19 i32.gt_s if - local.get $24 + local.get $19 i32.const 2 i32.shl local.get $0 @@ -7114,23 +7100,23 @@ i32.load i32.const 3 global.set $~argumentsLength - local.get $24 + local.get $19 local.get $0 i32.const 3568 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) br_if $__inlined_func$~lib/staticarray/StaticArray#findIndex104 - local.get $24 + local.get $19 i32.const 1 i32.add - local.set $24 + local.set $19 br $for-loop|0107 end end i32.const -1 - local.set $24 + local.set $19 end - local.get $24 + local.get $19 i32.const -1 i32.ne if @@ -7144,7 +7130,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3600 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -7152,14 +7138,14 @@ i32.shr_u i32.const 1 i32.sub - local.set $1 + local.set $8 block $__inlined_func$~lib/staticarray/StaticArray#findLastIndex loop $for-loop|0111 - local.get $1 + local.get $8 i32.const 0 i32.ge_s if - local.get $1 + local.get $8 i32.const 2 i32.shl local.get $0 @@ -7167,23 +7153,23 @@ i32.load i32.const 3 global.set $~argumentsLength - local.get $1 + local.get $8 local.get $0 i32.const 3600 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) br_if $__inlined_func$~lib/staticarray/StaticArray#findLastIndex - local.get $1 + local.get $8 i32.const 1 i32.sub - local.set $1 + local.set $8 br $for-loop|0111 end end i32.const -1 - local.set $1 + local.set $8 end - local.get $1 + local.get $8 i32.const 1 i32.ne if @@ -7197,7 +7183,7 @@ global.get $~lib/memory/__stack_pointer i32.const 3632 i32.store offset=12 - local.get $0 + local.get $1 i32.const 20 i32.sub i32.load offset=16 @@ -7205,38 +7191,38 @@ i32.shr_u i32.const 1 i32.sub - local.set $2 + local.set $0 block $__inlined_func$~lib/staticarray/StaticArray#findLastIndex113 loop $for-loop|0116 - local.get $2 + local.get $0 i32.const 0 i32.ge_s if - local.get $2 + local.get $0 i32.const 2 i32.shl - local.get $0 + local.get $1 i32.add i32.load i32.const 3 global.set $~argumentsLength - local.get $2 local.get $0 + local.get $1 i32.const 3632 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) br_if $__inlined_func$~lib/staticarray/StaticArray#findLastIndex113 - local.get $2 + local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $0 br $for-loop|0116 end end i32.const -1 - local.set $2 + local.set $0 end - local.get $2 + local.get $0 i32.const -1 i32.ne if @@ -7251,16 +7237,16 @@ i32.const 16 i32.const 3 call $~lib/rt/itcms/__new - local.tee $0 + local.tee $1 i32.const 3664 i32.const 16 call $~lib/memory/memory.copy - local.get $0 + local.get $1 i32.store offset=28 i32.const 0 global.set $~argumentsLength i32.const 0 - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -7281,25 +7267,25 @@ unreachable end i32.const 3712 - local.set $1 + local.set $0 global.get $~lib/memory/__stack_pointer i32.const 3712 i32.store end - local.get $0 - local.get $0 + local.get $1 + local.get $1 i32.const 20 i32.sub i32.load offset=16 i32.const 2 i32.shr_u - local.get $1 + local.get $0 call $~lib/util/sort/SORT global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.const 0 call $~lib/staticarray/StaticArray#__get if @@ -7310,7 +7296,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 call $~lib/staticarray/StaticArray#__get i32.const 1 @@ -7323,7 +7309,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 call $~lib/staticarray/StaticArray#__get i32.const 2 @@ -7336,7 +7322,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 3 call $~lib/staticarray/StaticArray#__get i32.const 3 @@ -7587,7 +7573,7 @@ if i32.const 1680 i32.const 1152 - i32.const 43 + i32.const 44 i32.const 60 call $~lib/builtins/abort unreachable @@ -7780,7 +7766,7 @@ if i32.const 1088 i32.const 1152 - i32.const 115 + i32.const 118 i32.const 41 call $~lib/builtins/abort unreachable @@ -7799,7 +7785,7 @@ if i32.const 2176 i32.const 1152 - i32.const 119 + i32.const 122 i32.const 40 call $~lib/builtins/abort unreachable @@ -7855,7 +7841,7 @@ if i32.const 1680 i32.const 1152 - i32.const 230 + i32.const 233 i32.const 60 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/staticarray.untouched.wat b/tests/compiler/std/staticarray.untouched.wat index d60707ed56..3153dd3c4a 100644 --- a/tests/compiler/std/staticarray.untouched.wat +++ b/tests/compiler/std/staticarray.untouched.wat @@ -16,6 +16,9 @@ (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/staticarray/arr1 i32 (i32.const 32)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $std/staticarray/arr2 i32 (i32.const 256)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -31,6 +34,7 @@ (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $std/staticarray/arr3 (mut i32) (i32.const 0)) (global $std/staticarray/arr4 (mut i32) (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $std/staticarray/maxVal (mut i32) (i32.const 0)) @@ -129,7 +133,7 @@ if i32.const 64 i32.const 128 - i32.const 115 + i32.const 118 i32.const 41 call $~lib/builtins/abort unreachable @@ -164,7 +168,7 @@ if i32.const 64 i32.const 128 - i32.const 130 + i32.const 133 i32.const 41 call $~lib/builtins/abort unreachable @@ -3847,7 +3851,7 @@ if i32.const 64 i32.const 752 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4812,7 +4816,7 @@ if i32.const 656 i32.const 752 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -4856,14 +4860,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -8751,7 +8751,7 @@ if i32.const 656 i32.const 128 - i32.const 90 + i32.const 91 i32.const 60 call $~lib/builtins/abort unreachable @@ -8766,10 +8766,10 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store - local.get $3 - i32.const 0 - local.get $2 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $3 local.set $4 global.get $~lib/memory/__stack_pointer @@ -8910,7 +8910,7 @@ if i32.const 656 i32.const 128 - i32.const 43 + i32.const 44 i32.const 60 call $~lib/builtins/abort unreachable @@ -9106,7 +9106,7 @@ if i32.const 64 i32.const 128 - i32.const 115 + i32.const 118 i32.const 41 call $~lib/builtins/abort unreachable @@ -9130,7 +9130,7 @@ if i32.const 1152 i32.const 128 - i32.const 119 + i32.const 122 i32.const 40 call $~lib/builtins/abort unreachable @@ -9188,7 +9188,7 @@ if i32.const 656 i32.const 128 - i32.const 230 + i32.const 233 i32.const 60 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-casemapping.untouched.wat b/tests/compiler/std/string-casemapping.untouched.wat index 69c093d509..b6f0e112cf 100644 --- a/tests/compiler/std/string-casemapping.untouched.wat +++ b/tests/compiler/std/string-casemapping.untouched.wat @@ -18,6 +18,9 @@ (import "string_casemapping" "toLowerCaseFromIndex" (func $std/string-casemapping/toLowerCaseFromIndex (param i32 i32) (result i32))) (import "string_casemapping" "toUpperCaseFromIndex" (func $std/string-casemapping/toUpperCaseFromIndex (param i32 i32) (result i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index 9b35842eba..b5d8c553e8 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -11,6 +11,9 @@ (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string-encoding/str (mut i32) (i32.const 32)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index de9d16b7bf..98f5851467 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -4,8 +4,8 @@ (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_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f64_=>_i32 (func (param f64) (result i32))) @@ -2236,182 +2236,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -2480,7 +2304,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -2495,7 +2319,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -2508,7 +2332,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -2516,7 +2340,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -2527,16 +2351,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -2547,16 +2371,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -2564,7 +2388,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -2572,8 +2396,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -2590,7 +2414,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -2600,13 +2424,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -2619,40 +2443,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -2712,10 +2536,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/string/String#at (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -5925,7 +5921,6 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $0 i32.load offset=12 local.tee $3 @@ -5934,7 +5929,7 @@ local.tee $2 local.get $0 i32.load offset=8 - local.tee $4 + local.tee $5 i32.const 2 i32.shr_u i32.gt_u @@ -5945,24 +5940,24 @@ if i32.const 13648 i32.const 15248 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable end local.get $0 i32.load - local.tee $5 - local.get $4 + local.tee $4 + local.get $5 i32.const 1 i32.shl - local.tee $6 + local.tee $5 i32.const 1073741820 - local.get $6 + local.get $5 i32.const 1073741820 i32.lt_u select - local.tee $6 + local.tee $5 local.get $2 i32.const 8 local.get $2 @@ -5971,40 +5966,33 @@ select i32.const 2 i32.shl - local.tee $7 + local.tee $6 + local.get $5 local.get $6 - local.get $7 i32.gt_u select - local.tee $6 + local.tee $5 call $~lib/rt/itcms/__renew - local.tee $7 - local.get $4 - i32.add - local.get $6 + local.tee $6 local.get $4 - i32.sub - call $~lib/memory/memory.fill - local.get $5 - local.get $7 i32.ne if local.get $0 - local.get $7 + local.get $6 i32.store local.get $0 - local.get $7 + local.get $6 i32.store offset=4 - local.get $7 + local.get $6 if local.get $0 - local.get $7 + local.get $6 i32.const 0 call $byn-split-outlined-A$~lib/rt/itcms/__link end end local.get $0 - local.get $6 + local.get $5 i32.store offset=8 end local.get $0 @@ -23599,7 +23587,7 @@ if i32.const 1264 i32.const 15248 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -23619,7 +23607,7 @@ if i32.const 15296 i32.const 15248 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 7ec58f8860..4c539bfd82 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -25,6 +25,9 @@ (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string/str (mut i32) (i32.const 32)) (global $std/string/nullStr (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -49,6 +52,7 @@ (global $~lib/builtins/f64.MIN_VALUE f64 (f64.const 5e-324)) (global $std/string/Ox1p_1073 f64 (f64.const 1e-323)) (global $std/string/Ox1_0000000000001p_1022 f64 (f64.const 2.225073858507202e-308)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/u64.MAX_VALUE i64 (i64.const -1)) (global $~lib/builtins/i64.MIN_VALUE i64 (i64.const -9223372036854775808)) @@ -7276,7 +7280,7 @@ if i32.const 12624 i32.const 14224 - i32.const 18 + i32.const 19 i32.const 48 call $~lib/builtins/abort unreachable @@ -7320,14 +7324,10 @@ local.get $6 call $~lib/rt/itcms/__renew local.set $8 - local.get $8 - local.get $4 - i32.add - i32.const 0 - local.get $6 - local.get $4 - i32.sub - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $8 local.get $5 i32.ne @@ -27000,7 +27000,7 @@ if i32.const 240 i32.const 14224 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -27025,7 +27025,7 @@ if i32.const 14272 i32.const 14224 - i32.const 111 + i32.const 118 i32.const 40 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 61749a24f2..30c8aa5278 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -1295,182 +1295,6 @@ end end ) - (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 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=1 - local.get $0 - i32.const 0 - i32.store8 offset=2 - local.get $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store8 offset=3 - local.get $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $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 $1 - i32.add - local.tee $2 - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - br_if $~lib/util/memory/memset|inlined.0 - local.get $0 - i32.const 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 $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - i32.add - local.set $0 - local.get $1 - local.get $2 - 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 $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -1539,7 +1363,7 @@ call $~lib/rt/tlsf/initialize end global.get $~lib/rt/tlsf/ROOT - local.set $4 + local.set $5 local.get $0 i32.const 16 i32.add @@ -1554,7 +1378,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 i32.const 12 local.get $2 i32.const 19 @@ -1567,7 +1391,7 @@ i32.const 12 i32.le_u select - local.tee $5 + local.tee $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1575,7 +1399,7 @@ memory.size local.tee $2 i32.const 4 - local.get $4 + local.get $5 i32.load offset=1568 local.get $2 i32.const 16 @@ -1586,16 +1410,16 @@ i32.shl i32.const 1 i32.const 27 - local.get $5 + local.get $3 i32.clz i32.sub i32.shl i32.const 1 i32.sub - local.get $5 + local.get $3 i32.add - local.get $5 - local.get $5 + local.get $3 + local.get $3 i32.const 536870910 i32.lt_u select @@ -1606,16 +1430,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 + local.tee $4 local.get $2 - local.get $3 + local.get $4 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $3 + local.get $4 memory.grow i32.const 0 i32.lt_s @@ -1623,7 +1447,7 @@ unreachable end end - local.get $4 + local.get $5 local.get $2 i32.const 16 i32.shl @@ -1631,8 +1455,8 @@ i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - local.get $4 local.get $5 + local.get $3 call $~lib/rt/tlsf/searchBlock local.tee $2 i32.eqz @@ -1649,7 +1473,7 @@ i32.load i32.const -4 i32.and - local.get $5 + local.get $3 i32.lt_u if i32.const 0 @@ -1659,13 +1483,13 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $5 local.get $2 call $~lib/rt/tlsf/removeBlock local.get $2 i32.load - local.set $3 - local.get $5 + local.set $6 + local.get $3 i32.const 4 i32.add i32.const 15 @@ -1678,40 +1502,40 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $6 i32.const -4 i32.and - local.get $5 + local.get $3 i32.sub - local.tee $6 + local.tee $4 i32.const 16 i32.ge_u if local.get $2 - local.get $3 + local.get $6 i32.const 2 i32.and - local.get $5 + local.get $3 i32.or i32.store - local.get $5 + local.get $3 local.get $2 i32.const 4 i32.add i32.add local.tee $3 - local.get $6 + local.get $4 i32.const 4 i32.sub i32.const 1 i32.or i32.store - local.get $4 + local.get $5 local.get $3 call $~lib/rt/tlsf/insertBlock else local.get $2 - local.get $3 + local.get $6 i32.const -2 i32.and i32.store @@ -1771,10 +1595,182 @@ local.get $2 i32.const 20 i32.add - local.tee $1 - local.get $0 - call $~lib/memory/memory.fill - local.get $1 + local.tee $2 + local.set $1 + block $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=1 + local.get $1 + i32.const 0 + i32.store8 offset=2 + local.get $3 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store8 offset=3 + local.get $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $1 + i32.sub + i32.const 3 + i32.and + local.tee $3 + i32.add + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.get $0 + local.get $3 + i32.sub + i32.const -4 + i32.and + local.tee $0 + i32.add + local.tee $3 + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $3 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $1 + local.get $1 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $3 + i32.add + local.set $1 + local.get $0 + local.get $3 + i32.sub + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 32 + i32.ge_u + if + local.get $1 + i64.const 0 + i64.store + local.get $1 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + i64.const 0 + i64.store offset=24 + local.get $0 + i32.const 32 + i32.sub + local.set $0 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $while-continue|0 + end + end + end + local.get $2 ) (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) (local $1 i32) @@ -4779,7 +4775,6 @@ global.set $~lib/memory/__stack_pointer ) (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) - (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -4804,7 +4799,7 @@ if i32.const 1536 i32.const 1584 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -4813,16 +4808,13 @@ local.get $0 i32.const 0 call $~lib/rt/itcms/__new - local.tee $1 + local.tee $0 i32.store - local.get $1 - local.get $0 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $1 + local.get $0 ) (func $byn-split-outlined-A$~lib/rt/itcms/__visit (param $0 i32) global.get $~lib/rt/itcms/white diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 5acb40dd14..b41fcb2bfb 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -22,10 +22,14 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~lib/symbol/idToString (mut i32) (i32.const 0)) (global $std/symbol/sym3 (mut i32) (i32.const 0)) (global $std/symbol/sym4 (mut i32) (i32.const 0)) @@ -5691,7 +5695,7 @@ if i32.const 512 i32.const 560 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -5702,10 +5706,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index bd3f8b1c8f..fe2e03facc 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -4886,7 +4886,7 @@ if i32.const 1360 i32.const 1760 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -4919,7 +4919,7 @@ if i32.const 1360 i32.const 1760 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -63559,7 +63559,7 @@ if i32.const 1056 i32.const 1104 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -63573,10 +63573,6 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store offset=4 - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill local.get $0 local.get $2 i32.store @@ -65752,7 +65748,6 @@ local.get $1 ) (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (result i32) - (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -65777,7 +65772,7 @@ if i32.const 1056 i32.const 1104 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -65786,17 +65781,13 @@ local.get $0 i32.const 0 call $~lib/rt/itcms/__new - local.tee $1 + local.tee $0 i32.store - local.get $1 - i32.const 0 - local.get $0 - call $~lib/memory/memory.fill global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $1 + local.get $0 ) (func $~lib/arraybuffer/ArrayBuffer#slice (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index bf2c7a5a80..a59cf9b188 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -64,6 +64,9 @@ (global $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT i32 (i32.const 8)) (global $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32 (i32.const 4)) (global $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT i32 (i32.const 8)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) @@ -76,6 +79,7 @@ (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/ASC_RUNTIME i32 (i32.const 2)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) @@ -5974,7 +5978,7 @@ if i32.const 336 i32.const 736 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -6149,7 +6153,7 @@ if i32.const 336 i32.const 736 - i32.const 107 + i32.const 114 i32.const 42 call $~lib/builtins/abort unreachable @@ -62639,7 +62643,7 @@ if i32.const 32 i32.const 80 - i32.const 18 + i32.const 19 i32.const 57 call $~lib/builtins/abort unreachable @@ -62653,10 +62657,10 @@ call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 - local.get $3 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $0 local.get $3 call $~lib/arraybuffer/ArrayBufferView#set:buffer @@ -69675,7 +69679,7 @@ if i32.const 32 i32.const 80 - i32.const 49 + i32.const 52 i32.const 43 call $~lib/builtins/abort unreachable @@ -69686,10 +69690,10 @@ call $~lib/rt/itcms/__new local.tee $2 i32.store - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill + i32.const 2 + global.get $~lib/shared/runtime/Runtime.Incremental + i32.ne + drop local.get $2 local.set $3 global.get $~lib/memory/__stack_pointer diff --git a/tests/compiler/std/uri.untouched.wat b/tests/compiler/std/uri.untouched.wat index 86fca127d2..05f634cf74 100644 --- a/tests/compiler/std/uri.untouched.wat +++ b/tests/compiler/std/uri.untouched.wat @@ -10,6 +10,9 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/util/uri/URL_UNSAFE i32 (i32.const 44)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) diff --git a/tests/compiler/super-inline.untouched.wat b/tests/compiler/super-inline.untouched.wat index 01fe2657f3..c27fd26d61 100644 --- a/tests/compiler/super-inline.untouched.wat +++ b/tests/compiler/super-inline.untouched.wat @@ -17,6 +17,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) diff --git a/tests/compiler/templateliteral.untouched.wat b/tests/compiler/templateliteral.untouched.wat index 324a967b2c..0190703438 100644 --- a/tests/compiler/templateliteral.untouched.wat +++ b/tests/compiler/templateliteral.untouched.wat @@ -17,6 +17,9 @@ (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) diff --git a/tests/compiler/throw.untouched.wat b/tests/compiler/throw.untouched.wat index 61aae9f920..06f4c2c127 100644 --- a/tests/compiler/throw.untouched.wat +++ b/tests/compiler/throw.untouched.wat @@ -14,6 +14,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) diff --git a/tests/compiler/typeof.untouched.wat b/tests/compiler/typeof.untouched.wat index 422b7142f8..63390e1779 100644 --- a/tests/compiler/typeof.untouched.wat +++ b/tests/compiler/typeof.untouched.wat @@ -11,6 +11,9 @@ (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $typeof/SomeNamespace.a i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $typeof/b (mut i32) (i32.const 1)) (global $typeof/i (mut i32) (i32.const 1)) diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat index 20215aa66f..f8c72e9010 100644 --- a/tests/compiler/wasi/abort.untouched.wat +++ b/tests/compiler/wasi/abort.untouched.wat @@ -8,6 +8,9 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 220)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16604)) diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index 13b2f46cb4..bf82ac0d78 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -14,6 +14,9 @@ (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~argumentsLength (mut i32) (i32.const 0)) diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 024fa87b47..cea58d34f9 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -18,6 +18,9 @@ (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) + (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) + (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0))