From 2dac623b93b6fa7a71b508350efb280ef6b38cde Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 31 Jan 2020 20:08:53 +0100 Subject: [PATCH 1/5] Add a low memory limit hint --- cli/asc.js | 1 + cli/asc.json | 6 ++++++ src/common.ts | 1 + src/compiler.ts | 9 +++++++++ src/diagnosticMessages.generated.ts | 2 ++ src/diagnosticMessages.json | 1 + src/glue/js/i64.d.ts | 1 + src/glue/js/i64.js | 4 ++++ src/glue/wasm/i64.ts | 5 +++++ src/index.ts | 5 +++++ src/program.ts | 2 ++ std/assembly/index.d.ts | 2 ++ std/assembly/rt/tlsf.ts | 9 ++++++++- 13 files changed, 47 insertions(+), 1 deletion(-) diff --git a/cli/asc.js b/cli/asc.js index c88ec45bd3..225ea5d5f0 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -231,6 +231,7 @@ exports.main = function main(argv, options, callback) { assemblyscript.setSourceMap(compilerOptions, args.sourceMap != null); assemblyscript.setNoUnsafe(compilerOptions, args.noUnsafe); assemblyscript.setPedantic(compilerOptions, args.pedantic); + assemblyscript.setLowMemoryLimit(compilerOptions, args.lowMemoryLimit >>> 0); // Initialize default aliases assemblyscript.setGlobalAlias(compilerOptions, "Math", "NativeMath"); diff --git a/cli/asc.json b/cli/asc.json index 936d849320..a538d3654e 100644 --- a/cli/asc.json +++ b/cli/asc.json @@ -191,6 +191,12 @@ "type": "S", "alias": "u" }, + "lowMemoryLimit": { + "category": "Features", + "description": "Enforces very low (<64k) memory constraints.", + "default": 0, + "type": "i" + }, "memoryBase": { "category": "Linking", diff --git a/src/common.ts b/src/common.ts index db286f4ae1..0362cc1609 100644 --- a/src/common.ts +++ b/src/common.ts @@ -154,6 +154,7 @@ export namespace CommonNames { export const ASC_TABLE_BASE = "ASC_TABLE_BASE"; export const ASC_OPTIMIZE_LEVEL = "ASC_OPTIMIZE_LEVEL"; export const ASC_SHRINK_LEVEL = "ASC_SHRINK_LEVEL"; + export const ASC_LOW_MEMORY_LIMIT = "ASC_LOW_MEMORY_LIMIT"; export const ASC_FEATURE_SIGN_EXTENSION = "ASC_FEATURE_SIGN_EXTENSION"; export const ASC_FEATURE_MUTABLE_GLOBALS = "ASC_FEATURE_MUTABLE_GLOBALS"; export const ASC_FEATURE_NONTRAPPING_F2I = "ASC_FEATURE_NONTRAPPING_F2I"; diff --git a/src/compiler.ts b/src/compiler.ts index fbb4a8d1ed..bfb9fad9a7 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -214,6 +214,8 @@ export class Options { noUnsafe: bool = false; /** If true, enables pedantic diagnostics. */ pedantic: bool = false; + /** Indicates a very low (<64k) memory limit. */ + lowMemoryLimit: i32 = 0; /** Hinted optimize level. Not applied by the compiler itself. */ optimizeLevelHint: i32 = 0; @@ -464,6 +466,13 @@ export class Compiler extends DiagnosticEmitter { // update the heap base pointer var memoryOffset = this.memoryOffset; memoryOffset = i64_align(memoryOffset, options.usizeType.byteSize); + var lowMemoryLimit = i64_new(this.options.lowMemoryLimit); + if (i64_ne(lowMemoryLimit, i64_zero) && i64_gt(memoryOffset, lowMemoryLimit)) { + this.error( + DiagnosticCode.Low_memory_limit_exceeded_by_static_data_0_1, + null, i64_to_string(memoryOffset), i64_to_string(lowMemoryLimit) + ); + } this.memoryOffset = memoryOffset; module.removeGlobal(BuiltinNames.heap_base); if (this.runtimeFeatures & RuntimeFeatures.HEAP) { diff --git a/src/diagnosticMessages.generated.ts b/src/diagnosticMessages.generated.ts index 7078c27a5b..646559dd12 100644 --- a/src/diagnosticMessages.generated.ts +++ b/src/diagnosticMessages.generated.ts @@ -11,6 +11,7 @@ export enum DiagnosticCode { Operation_is_unsafe = 101, User_defined_0 = 102, Feature_0_is_not_enabled = 103, + Low_memory_limit_exceeded_by_static_data_0_1 = 104, Conversion_from_type_0_to_1_requires_an_explicit_cast = 200, Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit = 201, Type_0_cannot_be_changed_to_type_1 = 202, @@ -160,6 +161,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 101: return "Operation is unsafe."; case 102: return "User-defined: {0}"; case 103: return "Feature '{0}' is not enabled."; + case 104: return "Low memory limit exceeded by static data: {0} > {1}"; case 200: return "Conversion from type '{0}' to '{1}' requires an explicit cast."; case 201: return "Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit."; case 202: return "Type '{0}' cannot be changed to type '{1}'."; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index de8c842aaa..c1b7dc6a1c 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -3,6 +3,7 @@ "Operation is unsafe.": 101, "User-defined: {0}": 102, "Feature '{0}' is not enabled.": 103, + "Low memory limit exceeded by static data: {0} > {1}": 104, "Conversion from type '{0}' to '{1}' requires an explicit cast.": 200, "Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.": 201, diff --git a/src/glue/js/i64.d.ts b/src/glue/js/i64.d.ts index 23ca983a6e..96e70b2627 100644 --- a/src/glue/js/i64.d.ts +++ b/src/glue/js/i64.d.ts @@ -26,6 +26,7 @@ declare function i64_not(value: I64): I64; declare function i64_eq(left: I64, right: I64): bool; declare function i64_ne(left: I64, right: I64): bool; +declare function i64_gt(left: I64, right: I64): bool; declare function i64_align(value: I64, alignment: i32): I64; diff --git a/src/glue/js/i64.js b/src/glue/js/i64.js index 4338536350..67ec0b643f 100644 --- a/src/glue/js/i64.js +++ b/src/glue/js/i64.js @@ -80,6 +80,10 @@ global.i64_ne = function(left, right) { return left.ne(right); }; +global.i64_gt = function(left, right) { + return left.gt(right); +}; + global.i64_align = function(value, alignment) { assert(alignment && (alignment & (alignment - 1)) == 0); var mask = Long.fromInt(alignment - 1); diff --git a/src/glue/wasm/i64.ts b/src/glue/wasm/i64.ts index 633a5f0aad..bd5926cdb2 100644 --- a/src/glue/wasm/i64.ts +++ b/src/glue/wasm/i64.ts @@ -103,6 +103,11 @@ function i64_ne(left: I64, right: I64): bool { return left != right; } +@global +function i64_gt(left: I64, right: I64): bool { + return left > right; +} + @global function i64_align(value: I64, alignment: i64): I64 { var mask: i64 = alignment - 1; diff --git a/src/index.ts b/src/index.ts index ea4fa60787..3cfe3ba137 100644 --- a/src/index.ts +++ b/src/index.ts @@ -79,6 +79,11 @@ export function setNoUnsafe(options: Options, noUnsafe: bool): void { options.noUnsafe = noUnsafe; } +/** Sets the `lowMemoryLimit` option. */ +export function setLowMemoryLimit(options: Options, lowMemoryLimit: i32): void { + options.lowMemoryLimit = lowMemoryLimit; +} + /** Sign extension operations. */ export const FEATURE_SIGN_EXTENSION = Feature.SIGN_EXTENSION; /** Mutable global imports and exports. */ diff --git a/src/program.ts b/src/program.ts index cd7d486aa8..f5fe290849 100644 --- a/src/program.ts +++ b/src/program.ts @@ -685,6 +685,8 @@ export class Program extends DiagnosticEmitter { i64_new(options.optimizeLevelHint, 0)); this.registerConstantInteger(CommonNames.ASC_SHRINK_LEVEL, Type.i32, i64_new(options.shrinkLevelHint, 0)); + this.registerConstantInteger(CommonNames.ASC_LOW_MEMORY_LIMIT, Type.i32, + i64_new(options.lowMemoryLimit, 0)); // register feature hints this.registerConstantInteger(CommonNames.ASC_FEATURE_SIGN_EXTENSION, Type.bool, diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 5a08d69078..8a51896ab1 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -52,6 +52,8 @@ declare const ASC_TABLE_BASE: i32; declare const ASC_OPTIMIZE_LEVEL: i32; /** Provided shrinkLevel option. */ declare const ASC_SHRINK_LEVEL: i32; +/** Provided lowMemoryLimit option. */ +declare const ASC_LOW_MEMORY_LIMIT: i32; /** Whether the sign extension feature is enabled. */ declare const ASC_FEATURE_SIGN_EXTENSION: bool; /** Whether the mutable globals feature is enabled. */ diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts index c797f21794..94d4f7192e 100644 --- a/std/assembly/rt/tlsf.ts +++ b/std/assembly/rt/tlsf.ts @@ -475,7 +475,14 @@ export function maybeInitialize(): Root { SETHEAD(root, fl, sl, null); } } - addMemory(root, (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK, memory.size() << 16); + if (ASC_LOW_MEMORY_LIMIT > 0) { + const start = (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK; + const end = (ASC_LOW_MEMORY_LIMIT + AL_MASK) & ~AL_MASK; + if (start > end) ERROR("Low memory limit exceeded by TLSF bookkeeping"); + else if (start < end) addMemory(root, start, end); + } else { + addMemory(root, (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK, memory.size() << 16); + } ROOT = root; } return root; From 31592538c561a382f450fefc1cba0e5722ab38f0 Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 31 Jan 2020 20:16:25 +0100 Subject: [PATCH 2/5] update fixtures --- tests/compiler/do.optimized.wat | 6 +++--- tests/compiler/do.untouched.wat | 9 +++++---- tests/compiler/extends-baseaggregate.optimized.wat | 8 ++++---- tests/compiler/extends-baseaggregate.untouched.wat | 11 ++++++----- tests/compiler/for.optimized.wat | 6 +++--- tests/compiler/for.untouched.wat | 9 +++++---- tests/compiler/managed-cast.optimized.wat | 6 +++--- tests/compiler/managed-cast.untouched.wat | 9 +++++---- tests/compiler/rc/local-init.optimized.wat | 6 +++--- tests/compiler/rc/local-init.untouched.wat | 9 +++++---- tests/compiler/rc/logical-and-mismatch.optimized.wat | 6 +++--- tests/compiler/rc/logical-and-mismatch.untouched.wat | 9 +++++---- tests/compiler/rc/logical-or-mismatch.optimized.wat | 6 +++--- tests/compiler/rc/logical-or-mismatch.untouched.wat | 9 +++++---- tests/compiler/rc/optimize.optimized.wat | 6 +++--- tests/compiler/rc/optimize.untouched.wat | 9 +++++---- tests/compiler/rc/rereturn.optimized.wat | 6 +++--- tests/compiler/rc/rereturn.untouched.wat | 9 +++++---- tests/compiler/rc/ternary-mismatch.optimized.wat | 6 +++--- tests/compiler/rc/ternary-mismatch.untouched.wat | 9 +++++---- tests/compiler/resolve-ternary.optimized.wat | 8 ++++---- tests/compiler/resolve-ternary.untouched.wat | 11 ++++++----- tests/compiler/retain-release-sanity.optimized.wat | 8 ++++---- tests/compiler/retain-release-sanity.untouched.wat | 11 ++++++----- tests/compiler/retain-return.optimized.wat | 6 +++--- tests/compiler/retain-return.untouched.wat | 9 +++++---- tests/compiler/runtime-full.optimized.wat | 6 +++--- tests/compiler/runtime-full.untouched.wat | 9 +++++---- tests/compiler/std/array-literal.optimized.wat | 6 +++--- tests/compiler/std/array-literal.untouched.wat | 9 +++++---- tests/compiler/std/array.optimized.wat | 8 ++++---- tests/compiler/std/array.untouched.wat | 11 ++++++----- tests/compiler/std/arraybuffer.optimized.wat | 6 +++--- tests/compiler/std/arraybuffer.untouched.wat | 9 +++++---- tests/compiler/std/dataview.optimized.wat | 6 +++--- tests/compiler/std/dataview.untouched.wat | 9 +++++---- tests/compiler/std/map.optimized.wat | 8 ++++---- tests/compiler/std/map.untouched.wat | 11 ++++++----- tests/compiler/std/set.optimized.wat | 8 ++++---- tests/compiler/std/set.untouched.wat | 11 ++++++----- tests/compiler/std/string-encoding.optimized.wat | 8 ++++---- tests/compiler/std/string-encoding.untouched.wat | 11 ++++++----- tests/compiler/std/string.optimized.wat | 8 ++++---- tests/compiler/std/string.untouched.wat | 11 ++++++----- tests/compiler/std/typedarray.optimized.wat | 8 ++++---- tests/compiler/std/typedarray.untouched.wat | 11 ++++++----- tests/compiler/while.optimized.wat | 6 +++--- tests/compiler/while.untouched.wat | 9 +++++---- 48 files changed, 210 insertions(+), 186 deletions(-) diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 679f0a64c1..be5d6d5608 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -1091,7 +1091,7 @@ if i32.const 0 i32.const 64 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1119,7 +1119,7 @@ if i32.const 0 i32.const 64 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1135,7 +1135,7 @@ if i32.const 0 i32.const 64 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 8f7f07a553..a29fe70336 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -21,6 +21,7 @@ (table $0 1 funcref) (global $do/ran (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/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~started (mut i32) (i32.const 0)) @@ -1674,7 +1675,7 @@ if i32.const 0 i32.const 64 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1715,7 +1716,7 @@ if i32.const 0 i32.const 64 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1734,7 +1735,7 @@ if i32.const 0 i32.const 64 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1751,7 +1752,7 @@ if i32.const 0 i32.const 64 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index bfee7a0532..1904c42cd1 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -980,7 +980,7 @@ if i32.const 0 i32.const 128 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 128 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1031,7 +1031,7 @@ if i32.const 0 i32.const 128 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -1169,7 +1169,7 @@ if i32.const 0 i32.const 128 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index d884895242..0c02a72d81 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -26,6 +26,7 @@ (global $extends-baseaggregate/poolB i32 (i32.const 48)) (global $extends-baseaggregate/poolA i32 (i32.const 96)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1294,7 +1295,7 @@ if i32.const 0 i32.const 128 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1335,7 +1336,7 @@ if i32.const 0 i32.const 128 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1354,7 +1355,7 @@ if i32.const 0 i32.const 128 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1371,7 +1372,7 @@ if i32.const 0 i32.const 128 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -1532,7 +1533,7 @@ if i32.const 0 i32.const 128 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index b85f0a6a0e..95c5f04589 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -1111,7 +1111,7 @@ if i32.const 0 i32.const 64 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1139,7 +1139,7 @@ if i32.const 0 i32.const 64 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1155,7 +1155,7 @@ if i32.const 0 i32.const 64 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 343f64b7cb..4b0bab388c 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -21,6 +21,7 @@ (table $0 1 funcref) (global $for/ran (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/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~started (mut i32) (i32.const 0)) @@ -1708,7 +1709,7 @@ if i32.const 0 i32.const 64 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1749,7 +1750,7 @@ if i32.const 0 i32.const 64 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1768,7 +1769,7 @@ if i32.const 0 i32.const 64 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1785,7 +1786,7 @@ if i32.const 0 i32.const 64 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 58ecfcccb2..6d34f71408 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -844,7 +844,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -872,7 +872,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -888,7 +888,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index e11cbbe3f0..3148d8982d 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -21,6 +21,7 @@ (data (i32.const 224) "\05\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\04\00\00\00\10\00\00\00\00\00\00\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~started (mut i32) (i32.const 0)) @@ -1286,7 +1287,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1327,7 +1328,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1346,7 +1347,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1363,7 +1364,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat index 2546c53138..1213c9285d 100644 --- a/tests/compiler/rc/local-init.optimized.wat +++ b/tests/compiler/rc/local-init.optimized.wat @@ -841,7 +841,7 @@ if i32.const 0 i32.const 48 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -869,7 +869,7 @@ if i32.const 0 i32.const 48 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -885,7 +885,7 @@ if i32.const 0 i32.const 48 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.untouched.wat b/tests/compiler/rc/local-init.untouched.wat index e3317e073c..74863fad65 100644 --- a/tests/compiler/rc/local-init.untouched.wat +++ b/tests/compiler/rc/local-init.untouched.wat @@ -20,6 +20,7 @@ (data (i32.const 144) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/heap/__heap_base i32 (i32.const 192)) @@ -1297,7 +1298,7 @@ if i32.const 0 i32.const 48 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1338,7 +1339,7 @@ if i32.const 0 i32.const 48 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1357,7 +1358,7 @@ if i32.const 0 i32.const 48 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1374,7 +1375,7 @@ if i32.const 0 i32.const 48 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat index 8c15e149a8..c3b0fa55fd 100644 --- a/tests/compiler/rc/logical-and-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -841,7 +841,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -869,7 +869,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -885,7 +885,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.untouched.wat b/tests/compiler/rc/logical-and-mismatch.untouched.wat index fd373fc2bf..3682b8a11b 100644 --- a/tests/compiler/rc/logical-and-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-and-mismatch.untouched.wat @@ -19,6 +19,7 @@ (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $rc/logical-and-mismatch/gloRef (mut i32) (i32.const 0)) @@ -1283,7 +1284,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1324,7 +1325,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1343,7 +1344,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1360,7 +1361,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat index 632d30caae..ed18c96856 100644 --- a/tests/compiler/rc/logical-or-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -841,7 +841,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -869,7 +869,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -885,7 +885,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.untouched.wat b/tests/compiler/rc/logical-or-mismatch.untouched.wat index 848645e60a..8d3f13a2c9 100644 --- a/tests/compiler/rc/logical-or-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-or-mismatch.untouched.wat @@ -19,6 +19,7 @@ (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $rc/logical-or-mismatch/gloRef (mut i32) (i32.const 0)) @@ -1283,7 +1284,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1324,7 +1325,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1343,7 +1344,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1360,7 +1361,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index f8ebeb7e2e..d6512124f9 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -1063,7 +1063,7 @@ if i32.const 0 i32.const 80 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1097,7 +1097,7 @@ if i32.const 0 i32.const 80 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1113,7 +1113,7 @@ if i32.const 0 i32.const 80 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.untouched.wat b/tests/compiler/rc/optimize.untouched.wat index b2b3451198..41419bfdf9 100644 --- a/tests/compiler/rc/optimize.untouched.wat +++ b/tests/compiler/rc/optimize.untouched.wat @@ -20,6 +20,7 @@ (data (i32.const 176) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/heap/__heap_base i32 (i32.const 196)) @@ -1378,7 +1379,7 @@ if i32.const 0 i32.const 80 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1419,7 +1420,7 @@ if i32.const 0 i32.const 80 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1438,7 +1439,7 @@ if i32.const 0 i32.const 80 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1455,7 +1456,7 @@ if i32.const 0 i32.const 80 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat index 2897aa2f4f..7b9260a3ad 100644 --- a/tests/compiler/rc/rereturn.optimized.wat +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -973,7 +973,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1007,7 +1007,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1023,7 +1023,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.untouched.wat b/tests/compiler/rc/rereturn.untouched.wat index 51e073a9af..7d1c08eb18 100644 --- a/tests/compiler/rc/rereturn.untouched.wat +++ b/tests/compiler/rc/rereturn.untouched.wat @@ -16,6 +16,7 @@ (data (i32.const 176) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/rt/__rtti_base i32 (i32.const 176)) @@ -1285,7 +1286,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1326,7 +1327,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1345,7 +1346,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1362,7 +1363,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat index b28eb3de12..edb41f20a0 100644 --- a/tests/compiler/rc/ternary-mismatch.optimized.wat +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -843,7 +843,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -871,7 +871,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -887,7 +887,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.untouched.wat b/tests/compiler/rc/ternary-mismatch.untouched.wat index 9171afcb76..007718c193 100644 --- a/tests/compiler/rc/ternary-mismatch.untouched.wat +++ b/tests/compiler/rc/ternary-mismatch.untouched.wat @@ -19,6 +19,7 @@ (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $rc/ternary-mismatch/gloRef (mut i32) (i32.const 0)) @@ -1285,7 +1286,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1326,7 +1327,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1345,7 +1346,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1362,7 +1363,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index a81d570c72..a07d48dbbb 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -998,7 +998,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1032,7 +1032,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1048,7 +1048,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -2394,7 +2394,7 @@ if i32.const 0 i32.const 32 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index ac8b01b6de..625f6a605b 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -40,6 +40,7 @@ (table $0 5 funcref) (elem (i32.const 1) $start:resolve-ternary~anonymous|0 $start:resolve-ternary~anonymous|1 $resolve-ternary/g1 $resolve-ternary/g2) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $resolve-ternary/b (mut i32) (i32.const 1)) @@ -1321,7 +1322,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1362,7 +1363,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1381,7 +1382,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1398,7 +1399,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -4625,7 +4626,7 @@ if i32.const 0 i32.const 32 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 7148aac301..5caaa187e0 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -987,7 +987,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1022,7 +1022,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1038,7 +1038,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -1447,7 +1447,7 @@ if i32.const 0 i32.const 144 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.untouched.wat b/tests/compiler/retain-release-sanity.untouched.wat index 7256d7be45..3bbb7e3fa1 100644 --- a/tests/compiler/retain-release-sanity.untouched.wat +++ b/tests/compiler/retain-release-sanity.untouched.wat @@ -32,6 +32,7 @@ (data (i32.const 640) "\08\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\04\00\00\02\00\00\00\93 \00\00\02\00\00\00\93 \00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1300,7 +1301,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1341,7 +1342,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1360,7 +1361,7 @@ if i32.const 0 i32.const 144 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1377,7 +1378,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -1875,7 +1876,7 @@ if i32.const 0 i32.const 144 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.optimized.wat b/tests/compiler/retain-return.optimized.wat index 94d87b58bf..ea9b466df9 100644 --- a/tests/compiler/retain-return.optimized.wat +++ b/tests/compiler/retain-return.optimized.wat @@ -840,7 +840,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -868,7 +868,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -884,7 +884,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.untouched.wat b/tests/compiler/retain-return.untouched.wat index 08eddcc5bc..c8ee02fb89 100644 --- a/tests/compiler/retain-return.untouched.wat +++ b/tests/compiler/retain-return.untouched.wat @@ -16,6 +16,7 @@ (table $0 7 funcref) (elem (i32.const 1) $start:retain-return~anonymous|0 $start:retain-return~anonymous|1 $start:retain-return~anonymous|2 $start:retain-return~anonymous|3 $start:retain-return~anonymous|4 $start:retain-return~anonymous|5) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $retain-return/ref (mut i32) (i32.const 0)) @@ -1289,7 +1290,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1330,7 +1331,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1349,7 +1350,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1366,7 +1367,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index c4a045295d..000902af72 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -973,7 +973,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1007,7 +1007,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1023,7 +1023,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/runtime-full.untouched.wat b/tests/compiler/runtime-full.untouched.wat index 48d89739c4..0b24052fa6 100644 --- a/tests/compiler/runtime-full.untouched.wat +++ b/tests/compiler/runtime-full.untouched.wat @@ -16,6 +16,7 @@ (data (i32.const 176) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/rt/__rtti_base i32 (i32.const 176)) @@ -1284,7 +1285,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1325,7 +1326,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1344,7 +1345,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1361,7 +1362,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 483763b972..005970407c 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1025,7 +1025,7 @@ if i32.const 0 i32.const 384 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 384 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1075,7 +1075,7 @@ if i32.const 0 i32.const 384 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index a7c5ae6447..b7960e5608 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -33,6 +33,7 @@ (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 352)) (global $std/array-literal/i (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/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1367,7 +1368,7 @@ if i32.const 0 i32.const 384 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1408,7 +1409,7 @@ if i32.const 0 i32.const 384 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1427,7 +1428,7 @@ if i32.const 0 i32.const 384 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1444,7 +1445,7 @@ if i32.const 0 i32.const 384 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 09b4f7e5cf..3d687caf6c 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -1190,7 +1190,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1224,7 +1224,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1240,7 +1240,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -2189,7 +2189,7 @@ if i32.const 0 i32.const 144 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 5a4a2b0ea9..f1ea69335d 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -220,6 +220,7 @@ (table $0 57 funcref) (elem (i32.const 1) $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|4 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|18 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|30 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|34 $start:std/array~anonymous|35 $start:std/array~anonymous|36 $start:std/array~anonymous|37 $start:std/array~anonymous|38 $start:std/array~anonymous|39 $start:std/array~anonymous|40 $start:std/array~anonymous|41 $start:std/array~anonymous|42 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1505,7 +1506,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1546,7 +1547,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1565,7 +1566,7 @@ if i32.const 0 i32.const 144 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1582,7 +1583,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -3922,7 +3923,7 @@ if i32.const 0 i32.const 144 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 9878ce32ec..e107b74013 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -978,7 +978,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1012,7 +1012,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1028,7 +1028,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 8b41a1e88f..cce61fb7a7 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -25,6 +25,7 @@ (data (i32.const 384) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1291,7 +1292,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1332,7 +1333,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1351,7 +1352,7 @@ if i32.const 0 i32.const 144 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1368,7 +1369,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 5682ba9b3d..2a56707a56 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -986,7 +986,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1020,7 +1020,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1036,7 +1036,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index b537be9945..6f7ed758fc 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -33,6 +33,7 @@ (data (i32.const 464) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1299,7 +1300,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1340,7 +1341,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1359,7 +1360,7 @@ if i32.const 0 i32.const 144 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1376,7 +1377,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 2af6de2ae7..09f076907d 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1001,7 +1001,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1035,7 +1035,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1051,7 +1051,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -1854,7 +1854,7 @@ if i32.const 0 i32.const 32 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index e3ec160c65..2a6cba5685 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -46,6 +46,7 @@ (data (i32.const 512) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1310,7 +1311,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1351,7 +1352,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1370,7 +1371,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1387,7 +1388,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -2358,7 +2359,7 @@ if i32.const 0 i32.const 32 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 65ac307eb2..289556a161 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -993,7 +993,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1027,7 +1027,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1043,7 +1043,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -1812,7 +1812,7 @@ if i32.const 0 i32.const 32 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 6ce1bac741..2fde964704 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -41,6 +41,7 @@ (data (i32.const 400) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1305,7 +1306,7 @@ if i32.const 0 i32.const 32 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1346,7 +1347,7 @@ if i32.const 0 i32.const 32 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1365,7 +1366,7 @@ if i32.const 0 i32.const 32 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1382,7 +1383,7 @@ if i32.const 0 i32.const 32 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -2306,7 +2307,7 @@ if i32.const 0 i32.const 32 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index cb8ad9bd81..186a62e5ad 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -1055,7 +1055,7 @@ if i32.const 0 i32.const 176 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1089,7 +1089,7 @@ if i32.const 0 i32.const 176 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1105,7 +1105,7 @@ if i32.const 0 i32.const 176 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -2454,7 +2454,7 @@ if i32.const 0 i32.const 176 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index f01ce1e805..b60a90d4af 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -35,6 +35,7 @@ (table $0 1 funcref) (global $std/string-encoding/str (mut i32) (i32.const 32)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1396,7 +1397,7 @@ if i32.const 0 i32.const 176 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1437,7 +1438,7 @@ if i32.const 0 i32.const 176 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1456,7 +1457,7 @@ if i32.const 0 i32.const 176 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1473,7 +1474,7 @@ if i32.const 0 i32.const 176 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -4125,7 +4126,7 @@ if i32.const 0 i32.const 176 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index d2b157e0e1..fd77a97cf0 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -1654,7 +1654,7 @@ if i32.const 0 i32.const 352 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1688,7 +1688,7 @@ if i32.const 0 i32.const 352 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1704,7 +1704,7 @@ if i32.const 0 i32.const 352 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -4576,7 +4576,7 @@ if i32.const 0 i32.const 352 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 1c6b1d32d8..7ec5681bba 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -479,6 +479,7 @@ (global $std/string/nullStr (mut i32) (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL 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/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~argumentsLength (mut i32) (i32.const 0)) @@ -2084,7 +2085,7 @@ if i32.const 0 i32.const 352 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -2125,7 +2126,7 @@ if i32.const 0 i32.const 352 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -2144,7 +2145,7 @@ if i32.const 0 i32.const 352 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -2161,7 +2162,7 @@ if i32.const 0 i32.const 352 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -7238,7 +7239,7 @@ if i32.const 0 i32.const 352 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 0882aa4a6f..85297e53d8 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -1162,7 +1162,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1196,7 +1196,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1212,7 +1212,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -2526,7 +2526,7 @@ if i32.const 0 i32.const 144 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 67dc9ecda7..50c5e10eef 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -201,6 +201,7 @@ (global $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32 (i32.const 4)) (global $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT i32 (i32.const 8)) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) @@ -1486,7 +1487,7 @@ if i32.const 0 i32.const 144 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1527,7 +1528,7 @@ if i32.const 0 i32.const 144 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1546,7 +1547,7 @@ if i32.const 0 i32.const 144 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1563,7 +1564,7 @@ if i32.const 0 i32.const 144 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable @@ -3191,7 +3192,7 @@ if i32.const 0 i32.const 144 - i32.const 570 + i32.const 577 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 8c300ec39a..e2e5c31e3b 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -1120,7 +1120,7 @@ if i32.const 0 i32.const 64 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1148,7 +1148,7 @@ if i32.const 0 i32.const 64 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1164,7 +1164,7 @@ if i32.const 0 i32.const 64 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 08894a2c67..43a5270522 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -21,6 +21,7 @@ (table $0 1 funcref) (global $while/ran (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/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~started (mut i32) (i32.const 0)) @@ -1712,7 +1713,7 @@ if i32.const 0 i32.const 64 - i32.const 490 + i32.const 497 i32.const 13 call $~lib/builtins/abort unreachable @@ -1753,7 +1754,7 @@ if i32.const 0 i32.const 64 - i32.const 502 + i32.const 509 i32.const 19 call $~lib/builtins/abort unreachable @@ -1772,7 +1773,7 @@ if i32.const 0 i32.const 64 - i32.const 507 + i32.const 514 i32.const 17 call $~lib/builtins/abort unreachable @@ -1789,7 +1790,7 @@ if i32.const 0 i32.const 64 - i32.const 510 + i32.const 517 i32.const 13 call $~lib/builtins/abort unreachable From ede06a82c1ce29e10e06ef607062051ffa195aee Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 31 Jan 2020 22:49:19 +0100 Subject: [PATCH 3/5] can't use a static error --- std/assembly/rt/tlsf.ts | 12 ++++++------ tests/compiler/do.untouched.wat | 8 ++++++-- tests/compiler/extends-baseaggregate.untouched.wat | 8 ++++++-- tests/compiler/for.untouched.wat | 8 ++++++-- tests/compiler/managed-cast.untouched.wat | 8 ++++++-- tests/compiler/rc/local-init.untouched.wat | 8 ++++++-- tests/compiler/rc/logical-and-mismatch.untouched.wat | 8 ++++++-- tests/compiler/rc/logical-or-mismatch.untouched.wat | 8 ++++++-- tests/compiler/rc/optimize.untouched.wat | 8 ++++++-- tests/compiler/rc/rereturn.untouched.wat | 8 ++++++-- tests/compiler/rc/ternary-mismatch.untouched.wat | 8 ++++++-- tests/compiler/resolve-ternary.untouched.wat | 8 ++++++-- tests/compiler/retain-release-sanity.untouched.wat | 8 ++++++-- tests/compiler/retain-return.untouched.wat | 8 ++++++-- tests/compiler/runtime-full.untouched.wat | 8 ++++++-- tests/compiler/std/array-literal.untouched.wat | 8 ++++++-- tests/compiler/std/array.untouched.wat | 8 ++++++-- tests/compiler/std/arraybuffer.untouched.wat | 8 ++++++-- tests/compiler/std/dataview.untouched.wat | 8 ++++++-- tests/compiler/std/map.untouched.wat | 8 ++++++-- tests/compiler/std/set.untouched.wat | 8 ++++++-- tests/compiler/std/string-encoding.untouched.wat | 8 ++++++-- tests/compiler/std/string.untouched.wat | 8 ++++++-- tests/compiler/std/typedarray.untouched.wat | 8 ++++++-- tests/compiler/while.untouched.wat | 8 ++++++-- 25 files changed, 150 insertions(+), 54 deletions(-) diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts index 94d4f7192e..1cf97e4997 100644 --- a/std/assembly/rt/tlsf.ts +++ b/std/assembly/rt/tlsf.ts @@ -462,7 +462,7 @@ function prepareSize(size: usize): usize { export function maybeInitialize(): Root { var root = ROOT; if (!root) { - const rootOffset = (__heap_base + AL_MASK) & ~AL_MASK; + let rootOffset = (__heap_base + AL_MASK) & ~AL_MASK; let pagesBefore = memory.size(); let pagesNeeded = ((((rootOffset + ROOT_SIZE) + 0xffff) & ~0xffff) >>> 16); if (pagesNeeded > pagesBefore && memory.grow(pagesNeeded - pagesBefore) < 0) unreachable(); @@ -475,13 +475,13 @@ export function maybeInitialize(): Root { SETHEAD(root, fl, sl, null); } } + let memStart = (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK; if (ASC_LOW_MEMORY_LIMIT > 0) { - const start = (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK; - const end = (ASC_LOW_MEMORY_LIMIT + AL_MASK) & ~AL_MASK; - if (start > end) ERROR("Low memory limit exceeded by TLSF bookkeeping"); - else if (start < end) addMemory(root, start, end); + const memEnd = (ASC_LOW_MEMORY_LIMIT + AL_MASK) & ~AL_MASK; + if (memStart <= memEnd) addMemory(root, memStart, memEnd); + else unreachable(); // low memory limit already exceeded } else { - addMemory(root, (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK, memory.size() << 16); + addMemory(root, memStart, memory.size() << 16); } ROOT = root; } diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index a29fe70336..fd81b81429 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -1146,7 +1146,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -1255,7 +1257,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -1265,6 +1266,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index 0c02a72d81..f0caf714e4 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -766,7 +766,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -875,7 +877,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -885,6 +886,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 4b0bab388c..b9e5dfc09d 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -1180,7 +1180,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -1289,7 +1291,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -1299,6 +1300,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index 3148d8982d..6f84228fb6 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -758,7 +758,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -867,7 +869,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -877,6 +878,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/rc/local-init.untouched.wat b/tests/compiler/rc/local-init.untouched.wat index 74863fad65..b787f61c1f 100644 --- a/tests/compiler/rc/local-init.untouched.wat +++ b/tests/compiler/rc/local-init.untouched.wat @@ -769,7 +769,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -878,7 +880,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -888,6 +889,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/rc/logical-and-mismatch.untouched.wat b/tests/compiler/rc/logical-and-mismatch.untouched.wat index 3682b8a11b..fdf7c725db 100644 --- a/tests/compiler/rc/logical-and-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-and-mismatch.untouched.wat @@ -755,7 +755,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -864,7 +866,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -874,6 +875,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/rc/logical-or-mismatch.untouched.wat b/tests/compiler/rc/logical-or-mismatch.untouched.wat index 8d3f13a2c9..cfbb8c9298 100644 --- a/tests/compiler/rc/logical-or-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-or-mismatch.untouched.wat @@ -755,7 +755,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -864,7 +866,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -874,6 +875,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/rc/optimize.untouched.wat b/tests/compiler/rc/optimize.untouched.wat index 41419bfdf9..a2d00dc35a 100644 --- a/tests/compiler/rc/optimize.untouched.wat +++ b/tests/compiler/rc/optimize.untouched.wat @@ -850,7 +850,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -959,7 +961,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -969,6 +970,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/rc/rereturn.untouched.wat b/tests/compiler/rc/rereturn.untouched.wat index 7d1c08eb18..25098fa2c3 100644 --- a/tests/compiler/rc/rereturn.untouched.wat +++ b/tests/compiler/rc/rereturn.untouched.wat @@ -757,7 +757,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -866,7 +868,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -876,6 +877,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/rc/ternary-mismatch.untouched.wat b/tests/compiler/rc/ternary-mismatch.untouched.wat index 007718c193..32a5994cfb 100644 --- a/tests/compiler/rc/ternary-mismatch.untouched.wat +++ b/tests/compiler/rc/ternary-mismatch.untouched.wat @@ -757,7 +757,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -866,7 +868,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -876,6 +877,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index 625f6a605b..61904f36ba 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -793,7 +793,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -902,7 +904,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -912,6 +913,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/retain-release-sanity.untouched.wat b/tests/compiler/retain-release-sanity.untouched.wat index 3bbb7e3fa1..5379353854 100644 --- a/tests/compiler/retain-release-sanity.untouched.wat +++ b/tests/compiler/retain-release-sanity.untouched.wat @@ -772,7 +772,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -881,7 +883,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -891,6 +892,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/retain-return.untouched.wat b/tests/compiler/retain-return.untouched.wat index c8ee02fb89..1a7c062c75 100644 --- a/tests/compiler/retain-return.untouched.wat +++ b/tests/compiler/retain-return.untouched.wat @@ -761,7 +761,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -870,7 +872,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -880,6 +881,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/runtime-full.untouched.wat b/tests/compiler/runtime-full.untouched.wat index 0b24052fa6..8b2fe8839c 100644 --- a/tests/compiler/runtime-full.untouched.wat +++ b/tests/compiler/runtime-full.untouched.wat @@ -756,7 +756,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -865,7 +867,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -875,6 +876,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index b7960e5608..ad3b29a156 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -839,7 +839,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -948,7 +950,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -958,6 +959,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index f1ea69335d..8bfcb9ff7b 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -977,7 +977,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -1086,7 +1088,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -1096,6 +1097,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index cce61fb7a7..326913fef3 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -763,7 +763,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -872,7 +874,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -882,6 +883,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index 6f7ed758fc..f1886b1afc 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -771,7 +771,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -880,7 +882,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -890,6 +891,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 2a6cba5685..58c03b5c79 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -782,7 +782,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -891,7 +893,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -901,6 +902,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 2fde964704..90d253404d 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -777,7 +777,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -886,7 +888,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -896,6 +897,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index b60a90d4af..5ec49c2ad6 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -868,7 +868,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -977,7 +979,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -987,6 +988,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 7ec5681bba..d292e20c53 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -1556,7 +1556,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -1665,7 +1667,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -1675,6 +1676,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 50c5e10eef..8ea8507771 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -958,7 +958,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -1067,7 +1069,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -1077,6 +1078,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 43a5270522..23dac3add3 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -1184,7 +1184,9 @@ global.get $~lib/heap/__heap_base i32.const 15 i32.add - i32.const -16 + i32.const 15 + i32.const -1 + i32.xor i32.and local.set $1 memory.size @@ -1293,7 +1295,6 @@ br $for-loop|0 end end - local.get $0 local.get $1 i32.const 1572 i32.add @@ -1303,6 +1304,9 @@ i32.const -1 i32.xor i32.and + local.set $5 + local.get $0 + local.get $5 memory.size i32.const 16 i32.shl From 3137d332b7d60fa4bc2b268bd11c0a5ac4997d28 Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 1 Feb 2020 00:49:59 +0100 Subject: [PATCH 4/5] trap on grow memory --- std/assembly/rt/tlsf.ts | 6 +++++- tests/compiler/do.optimized.wat | 6 +++--- tests/compiler/do.untouched.wat | 10 +++++----- tests/compiler/extends-baseaggregate.optimized.wat | 10 +++++----- tests/compiler/extends-baseaggregate.untouched.wat | 12 ++++++------ tests/compiler/for.optimized.wat | 6 +++--- tests/compiler/for.untouched.wat | 10 +++++----- tests/compiler/managed-cast.optimized.wat | 6 +++--- tests/compiler/managed-cast.untouched.wat | 10 +++++----- tests/compiler/rc/local-init.optimized.wat | 6 +++--- tests/compiler/rc/local-init.untouched.wat | 10 +++++----- tests/compiler/rc/logical-and-mismatch.optimized.wat | 6 +++--- tests/compiler/rc/logical-and-mismatch.untouched.wat | 10 +++++----- tests/compiler/rc/logical-or-mismatch.optimized.wat | 6 +++--- tests/compiler/rc/logical-or-mismatch.untouched.wat | 10 +++++----- tests/compiler/rc/optimize.optimized.wat | 8 ++++---- tests/compiler/rc/optimize.untouched.wat | 10 +++++----- tests/compiler/rc/rereturn.optimized.wat | 8 ++++---- tests/compiler/rc/rereturn.untouched.wat | 10 +++++----- tests/compiler/rc/ternary-mismatch.optimized.wat | 6 +++--- tests/compiler/rc/ternary-mismatch.untouched.wat | 10 +++++----- tests/compiler/resolve-ternary.optimized.wat | 10 +++++----- tests/compiler/resolve-ternary.untouched.wat | 12 ++++++------ tests/compiler/retain-release-sanity.optimized.wat | 10 +++++----- tests/compiler/retain-release-sanity.untouched.wat | 12 ++++++------ tests/compiler/retain-return.optimized.wat | 6 +++--- tests/compiler/retain-return.untouched.wat | 10 +++++----- tests/compiler/runtime-full.optimized.wat | 8 ++++---- tests/compiler/runtime-full.untouched.wat | 10 +++++----- tests/compiler/std/array-literal.optimized.wat | 8 ++++---- tests/compiler/std/array-literal.untouched.wat | 10 +++++----- tests/compiler/std/array.optimized.wat | 10 +++++----- tests/compiler/std/array.untouched.wat | 12 ++++++------ tests/compiler/std/arraybuffer.optimized.wat | 8 ++++---- tests/compiler/std/arraybuffer.untouched.wat | 10 +++++----- tests/compiler/std/dataview.optimized.wat | 8 ++++---- tests/compiler/std/dataview.untouched.wat | 10 +++++----- tests/compiler/std/map.optimized.wat | 10 +++++----- tests/compiler/std/map.untouched.wat | 12 ++++++------ tests/compiler/std/set.optimized.wat | 10 +++++----- tests/compiler/std/set.untouched.wat | 12 ++++++------ tests/compiler/std/string-encoding.optimized.wat | 10 +++++----- tests/compiler/std/string-encoding.untouched.wat | 12 ++++++------ tests/compiler/std/string.optimized.wat | 10 +++++----- tests/compiler/std/string.untouched.wat | 12 ++++++------ tests/compiler/std/typedarray.optimized.wat | 10 +++++----- tests/compiler/std/typedarray.untouched.wat | 12 ++++++------ tests/compiler/while.optimized.wat | 6 +++--- tests/compiler/while.untouched.wat | 10 +++++----- 49 files changed, 230 insertions(+), 226 deletions(-) diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts index 1cf97e4997..d8caccdc2c 100644 --- a/std/assembly/rt/tlsf.ts +++ b/std/assembly/rt/tlsf.ts @@ -433,6 +433,10 @@ function addMemory(root: Root, start: usize, end: usize): bool { /** Grows memory to fit at least another block of the specified size. */ function growMemory(root: Root, size: usize): void { + if (ASC_LOW_MEMORY_LIMIT) { + unreachable(); + return; + } // Here, both rounding performed in searchBlock ... const halfMaxSize = BLOCK_MAXSIZE >> 1; if (size < halfMaxSize) { // don't round last fl @@ -476,7 +480,7 @@ export function maybeInitialize(): Root { } } let memStart = (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK; - if (ASC_LOW_MEMORY_LIMIT > 0) { + if (ASC_LOW_MEMORY_LIMIT) { const memEnd = (ASC_LOW_MEMORY_LIMIT + AL_MASK) & ~AL_MASK; if (memStart <= memEnd) addMemory(root, memStart, memEnd); else unreachable(); // low memory limit already exceeded diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index be5d6d5608..500ba68ebd 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -1091,7 +1091,7 @@ if i32.const 0 i32.const 64 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1119,7 +1119,7 @@ if i32.const 0 i32.const 64 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1135,7 +1135,7 @@ if i32.const 0 i32.const 64 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index fd81b81429..f74a3bd715 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -1288,7 +1288,7 @@ if i32.const 112 i32.const 64 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1679,7 +1679,7 @@ if i32.const 0 i32.const 64 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1720,7 +1720,7 @@ if i32.const 0 i32.const 64 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1739,7 +1739,7 @@ if i32.const 0 i32.const 64 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1756,7 +1756,7 @@ if i32.const 0 i32.const 64 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index 1904c42cd1..6e124887dd 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -687,7 +687,7 @@ if i32.const 176 i32.const 128 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -980,7 +980,7 @@ if i32.const 0 i32.const 128 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1015,7 +1015,7 @@ if i32.const 0 i32.const 128 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1031,7 +1031,7 @@ if i32.const 0 i32.const 128 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -1169,7 +1169,7 @@ if i32.const 0 i32.const 128 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index f0caf714e4..d4610bc817 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -908,7 +908,7 @@ if i32.const 176 i32.const 128 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1299,7 +1299,7 @@ if i32.const 0 i32.const 128 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1340,7 +1340,7 @@ if i32.const 0 i32.const 128 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1359,7 +1359,7 @@ if i32.const 0 i32.const 128 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1376,7 +1376,7 @@ if i32.const 0 i32.const 128 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -1537,7 +1537,7 @@ if i32.const 0 i32.const 128 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 95c5f04589..c6b8b70b00 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -1111,7 +1111,7 @@ if i32.const 0 i32.const 64 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1139,7 +1139,7 @@ if i32.const 0 i32.const 64 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1155,7 +1155,7 @@ if i32.const 0 i32.const 64 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index b9e5dfc09d..7357637e6a 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -1322,7 +1322,7 @@ if i32.const 112 i32.const 64 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1713,7 +1713,7 @@ if i32.const 0 i32.const 64 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1754,7 +1754,7 @@ if i32.const 0 i32.const 64 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1773,7 +1773,7 @@ if i32.const 0 i32.const 64 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1790,7 +1790,7 @@ if i32.const 0 i32.const 64 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 6d34f71408..269724f90d 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -844,7 +844,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -872,7 +872,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -888,7 +888,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index 6f84228fb6..ae656b50ac 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -900,7 +900,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1291,7 +1291,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1332,7 +1332,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1351,7 +1351,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1368,7 +1368,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat index 1213c9285d..2b7be6a97a 100644 --- a/tests/compiler/rc/local-init.optimized.wat +++ b/tests/compiler/rc/local-init.optimized.wat @@ -841,7 +841,7 @@ if i32.const 0 i32.const 48 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -869,7 +869,7 @@ if i32.const 0 i32.const 48 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -885,7 +885,7 @@ if i32.const 0 i32.const 48 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/local-init.untouched.wat b/tests/compiler/rc/local-init.untouched.wat index b787f61c1f..86dd3812b9 100644 --- a/tests/compiler/rc/local-init.untouched.wat +++ b/tests/compiler/rc/local-init.untouched.wat @@ -911,7 +911,7 @@ if i32.const 96 i32.const 48 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1302,7 +1302,7 @@ if i32.const 0 i32.const 48 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1343,7 +1343,7 @@ if i32.const 0 i32.const 48 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1362,7 +1362,7 @@ if i32.const 0 i32.const 48 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1379,7 +1379,7 @@ if i32.const 0 i32.const 48 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat index c3b0fa55fd..9bc9286c5d 100644 --- a/tests/compiler/rc/logical-and-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -841,7 +841,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -869,7 +869,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -885,7 +885,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-and-mismatch.untouched.wat b/tests/compiler/rc/logical-and-mismatch.untouched.wat index fdf7c725db..4e82f39702 100644 --- a/tests/compiler/rc/logical-and-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-and-mismatch.untouched.wat @@ -897,7 +897,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1288,7 +1288,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1329,7 +1329,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1348,7 +1348,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1365,7 +1365,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat index ed18c96856..58c0c35629 100644 --- a/tests/compiler/rc/logical-or-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -841,7 +841,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -869,7 +869,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -885,7 +885,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/logical-or-mismatch.untouched.wat b/tests/compiler/rc/logical-or-mismatch.untouched.wat index cfbb8c9298..6d1cbe845c 100644 --- a/tests/compiler/rc/logical-or-mismatch.untouched.wat +++ b/tests/compiler/rc/logical-or-mismatch.untouched.wat @@ -897,7 +897,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1288,7 +1288,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1329,7 +1329,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1348,7 +1348,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1365,7 +1365,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index d6512124f9..ee67d9194c 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -770,7 +770,7 @@ if i32.const 128 i32.const 80 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1063,7 +1063,7 @@ if i32.const 0 i32.const 80 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1097,7 +1097,7 @@ if i32.const 0 i32.const 80 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1113,7 +1113,7 @@ if i32.const 0 i32.const 80 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/optimize.untouched.wat b/tests/compiler/rc/optimize.untouched.wat index a2d00dc35a..fa51324f9f 100644 --- a/tests/compiler/rc/optimize.untouched.wat +++ b/tests/compiler/rc/optimize.untouched.wat @@ -992,7 +992,7 @@ if i32.const 128 i32.const 80 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1383,7 +1383,7 @@ if i32.const 0 i32.const 80 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1424,7 +1424,7 @@ if i32.const 0 i32.const 80 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1443,7 +1443,7 @@ if i32.const 0 i32.const 80 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1460,7 +1460,7 @@ if i32.const 0 i32.const 80 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat index 7b9260a3ad..474b2ef2bc 100644 --- a/tests/compiler/rc/rereturn.optimized.wat +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -680,7 +680,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -973,7 +973,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1007,7 +1007,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1023,7 +1023,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/rereturn.untouched.wat b/tests/compiler/rc/rereturn.untouched.wat index 25098fa2c3..d9a93ea405 100644 --- a/tests/compiler/rc/rereturn.untouched.wat +++ b/tests/compiler/rc/rereturn.untouched.wat @@ -899,7 +899,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1290,7 +1290,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1331,7 +1331,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1350,7 +1350,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1367,7 +1367,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat index edb41f20a0..5e0b5346ab 100644 --- a/tests/compiler/rc/ternary-mismatch.optimized.wat +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -843,7 +843,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -871,7 +871,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -887,7 +887,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/rc/ternary-mismatch.untouched.wat b/tests/compiler/rc/ternary-mismatch.untouched.wat index 32a5994cfb..c7338717ec 100644 --- a/tests/compiler/rc/ternary-mismatch.untouched.wat +++ b/tests/compiler/rc/ternary-mismatch.untouched.wat @@ -899,7 +899,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1290,7 +1290,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1331,7 +1331,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1350,7 +1350,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1367,7 +1367,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index a07d48dbbb..195bdc7cd6 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -705,7 +705,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -998,7 +998,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1032,7 +1032,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1048,7 +1048,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -2394,7 +2394,7 @@ if i32.const 0 i32.const 32 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index 61904f36ba..3b7b0fd02f 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -935,7 +935,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1326,7 +1326,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1367,7 +1367,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1386,7 +1386,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1403,7 +1403,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -4630,7 +4630,7 @@ if i32.const 0 i32.const 32 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 5caaa187e0..eef79cfcef 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -694,7 +694,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -987,7 +987,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1022,7 +1022,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1038,7 +1038,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -1447,7 +1447,7 @@ if i32.const 0 i32.const 144 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-release-sanity.untouched.wat b/tests/compiler/retain-release-sanity.untouched.wat index 5379353854..2008574814 100644 --- a/tests/compiler/retain-release-sanity.untouched.wat +++ b/tests/compiler/retain-release-sanity.untouched.wat @@ -914,7 +914,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1305,7 +1305,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1346,7 +1346,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1365,7 +1365,7 @@ if i32.const 0 i32.const 144 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1382,7 +1382,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -1880,7 +1880,7 @@ if i32.const 0 i32.const 144 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.optimized.wat b/tests/compiler/retain-return.optimized.wat index ea9b466df9..13f9fe163e 100644 --- a/tests/compiler/retain-return.optimized.wat +++ b/tests/compiler/retain-return.optimized.wat @@ -840,7 +840,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -868,7 +868,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -884,7 +884,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/retain-return.untouched.wat b/tests/compiler/retain-return.untouched.wat index 1a7c062c75..c6f3108342 100644 --- a/tests/compiler/retain-return.untouched.wat +++ b/tests/compiler/retain-return.untouched.wat @@ -903,7 +903,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1294,7 +1294,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1335,7 +1335,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1354,7 +1354,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1371,7 +1371,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index 000902af72..cbcea1f11b 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -680,7 +680,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -973,7 +973,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1007,7 +1007,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1023,7 +1023,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/runtime-full.untouched.wat b/tests/compiler/runtime-full.untouched.wat index 8b2fe8839c..bd5143cc56 100644 --- a/tests/compiler/runtime-full.untouched.wat +++ b/tests/compiler/runtime-full.untouched.wat @@ -898,7 +898,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1289,7 +1289,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1330,7 +1330,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1349,7 +1349,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1366,7 +1366,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 005970407c..07d5dc543d 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -732,7 +732,7 @@ if i32.const 432 i32.const 384 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1025,7 +1025,7 @@ if i32.const 0 i32.const 384 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1059,7 +1059,7 @@ if i32.const 0 i32.const 384 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1075,7 +1075,7 @@ if i32.const 0 i32.const 384 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index ad3b29a156..bf7c31de6f 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -981,7 +981,7 @@ if i32.const 432 i32.const 384 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1372,7 +1372,7 @@ if i32.const 0 i32.const 384 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1413,7 +1413,7 @@ if i32.const 0 i32.const 384 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1432,7 +1432,7 @@ if i32.const 0 i32.const 384 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1449,7 +1449,7 @@ if i32.const 0 i32.const 384 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 3d687caf6c..ba8d04856e 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -897,7 +897,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1190,7 +1190,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1224,7 +1224,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1240,7 +1240,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -2189,7 +2189,7 @@ if i32.const 0 i32.const 144 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 8bfcb9ff7b..53de651ca4 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -1119,7 +1119,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1510,7 +1510,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1551,7 +1551,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1570,7 +1570,7 @@ if i32.const 0 i32.const 144 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1587,7 +1587,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -3927,7 +3927,7 @@ if i32.const 0 i32.const 144 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index e107b74013..d59b3bf07c 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -685,7 +685,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -978,7 +978,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1012,7 +1012,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1028,7 +1028,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 326913fef3..0bbde69c25 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -905,7 +905,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1296,7 +1296,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1337,7 +1337,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1356,7 +1356,7 @@ if i32.const 0 i32.const 144 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1373,7 +1373,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 2a56707a56..635e838f14 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -693,7 +693,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -986,7 +986,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1020,7 +1020,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1036,7 +1036,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index f1886b1afc..607e9d4299 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -913,7 +913,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1304,7 +1304,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1345,7 +1345,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1364,7 +1364,7 @@ if i32.const 0 i32.const 144 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1381,7 +1381,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 09f076907d..b66e85e068 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -708,7 +708,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1001,7 +1001,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1035,7 +1035,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1051,7 +1051,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -1854,7 +1854,7 @@ if i32.const 0 i32.const 32 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 58c03b5c79..223c3db7a3 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -924,7 +924,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1315,7 +1315,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1356,7 +1356,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1375,7 +1375,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1392,7 +1392,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -2363,7 +2363,7 @@ if i32.const 0 i32.const 32 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 289556a161..eb78e3acd9 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -700,7 +700,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -993,7 +993,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1027,7 +1027,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1043,7 +1043,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -1812,7 +1812,7 @@ if i32.const 0 i32.const 32 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 90d253404d..a2ec6fa504 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -919,7 +919,7 @@ if i32.const 80 i32.const 32 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1310,7 +1310,7 @@ if i32.const 0 i32.const 32 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1351,7 +1351,7 @@ if i32.const 0 i32.const 32 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1370,7 +1370,7 @@ if i32.const 0 i32.const 32 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1387,7 +1387,7 @@ if i32.const 0 i32.const 32 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -2311,7 +2311,7 @@ if i32.const 0 i32.const 32 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index 186a62e5ad..e2804c87e3 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -762,7 +762,7 @@ if i32.const 224 i32.const 176 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1055,7 +1055,7 @@ if i32.const 0 i32.const 176 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1089,7 +1089,7 @@ if i32.const 0 i32.const 176 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1105,7 +1105,7 @@ if i32.const 0 i32.const 176 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -2454,7 +2454,7 @@ if i32.const 0 i32.const 176 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index 5ec49c2ad6..35a9fc6386 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -1010,7 +1010,7 @@ if i32.const 224 i32.const 176 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1401,7 +1401,7 @@ if i32.const 0 i32.const 176 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1442,7 +1442,7 @@ if i32.const 0 i32.const 176 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1461,7 +1461,7 @@ if i32.const 0 i32.const 176 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1478,7 +1478,7 @@ if i32.const 0 i32.const 176 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -4130,7 +4130,7 @@ if i32.const 0 i32.const 176 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index fd77a97cf0..68aa6a2b84 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -1361,7 +1361,7 @@ if i32.const 400 i32.const 352 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1654,7 +1654,7 @@ if i32.const 0 i32.const 352 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1688,7 +1688,7 @@ if i32.const 0 i32.const 352 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1704,7 +1704,7 @@ if i32.const 0 i32.const 352 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -4576,7 +4576,7 @@ if i32.const 0 i32.const 352 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index d292e20c53..928b47e677 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -1698,7 +1698,7 @@ if i32.const 400 i32.const 352 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -2089,7 +2089,7 @@ if i32.const 0 i32.const 352 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -2130,7 +2130,7 @@ if i32.const 0 i32.const 352 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -2149,7 +2149,7 @@ if i32.const 0 i32.const 352 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -2166,7 +2166,7 @@ if i32.const 0 i32.const 352 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -7243,7 +7243,7 @@ if i32.const 0 i32.const 352 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 85297e53d8..a44394b0c6 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -869,7 +869,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1162,7 +1162,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1196,7 +1196,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1212,7 +1212,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -2526,7 +2526,7 @@ if i32.const 0 i32.const 144 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 8ea8507771..0e366ad7f5 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -1100,7 +1100,7 @@ if i32.const 192 i32.const 144 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1491,7 +1491,7 @@ if i32.const 0 i32.const 144 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1532,7 +1532,7 @@ if i32.const 0 i32.const 144 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1551,7 +1551,7 @@ if i32.const 0 i32.const 144 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1568,7 +1568,7 @@ if i32.const 0 i32.const 144 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable @@ -3196,7 +3196,7 @@ if i32.const 0 i32.const 144 - i32.const 577 + i32.const 581 i32.const 2 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index e2e5c31e3b..9ac7bb814f 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -1120,7 +1120,7 @@ if i32.const 0 i32.const 64 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1148,7 +1148,7 @@ if i32.const 0 i32.const 64 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1164,7 +1164,7 @@ if i32.const 0 i32.const 64 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 23dac3add3..699691eea7 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -1326,7 +1326,7 @@ if i32.const 112 i32.const 64 - i32.const 457 + i32.const 461 i32.const 29 call $~lib/builtins/abort unreachable @@ -1717,7 +1717,7 @@ if i32.const 0 i32.const 64 - i32.const 497 + i32.const 501 i32.const 13 call $~lib/builtins/abort unreachable @@ -1758,7 +1758,7 @@ if i32.const 0 i32.const 64 - i32.const 509 + i32.const 513 i32.const 19 call $~lib/builtins/abort unreachable @@ -1777,7 +1777,7 @@ if i32.const 0 i32.const 64 - i32.const 514 + i32.const 518 i32.const 17 call $~lib/builtins/abort unreachable @@ -1794,7 +1794,7 @@ if i32.const 0 i32.const 64 - i32.const 517 + i32.const 521 i32.const 13 call $~lib/builtins/abort unreachable From 53fb68542c19db11228e24da1ee489ebba4aa864 Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 14 Mar 2020 10:54:03 +0100 Subject: [PATCH 5/5] careful not to exceed limit, disable lowMemoryUnused --- src/compiler.ts | 19 +++++++++++-------- std/assembly/rt/tlsf.ts | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index 88f6d7fe7b..ea4ecb7cd3 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -363,7 +363,7 @@ export class Compiler extends DiagnosticEmitter { this.memoryOffset = i64_new(options.memoryBase); module.setLowMemoryUnused(false); } else { - if (options.optimizeLevelHint >= 2) { + if (options.optimizeLevelHint >= 2 && !options.lowMemoryLimit) { this.memoryOffset = i64_new(1024); module.setLowMemoryUnused(true); } else { @@ -504,12 +504,15 @@ export class Compiler extends DiagnosticEmitter { // update the heap base pointer var memoryOffset = this.memoryOffset; memoryOffset = i64_align(memoryOffset, options.usizeType.byteSize); - var lowMemoryLimit = i64_new(this.options.lowMemoryLimit); - if (i64_ne(lowMemoryLimit, i64_zero) && i64_gt(memoryOffset, lowMemoryLimit)) { - this.error( - DiagnosticCode.Low_memory_limit_exceeded_by_static_data_0_1, - null, i64_to_string(memoryOffset), i64_to_string(lowMemoryLimit) - ); + var lowMemoryLimit32 = this.options.lowMemoryLimit; + if (lowMemoryLimit32) { + let lowMemoryLimit = i64_new(lowMemoryLimit32 & ~15); + if (i64_gt(memoryOffset, lowMemoryLimit)) { + this.error( + DiagnosticCode.Low_memory_limit_exceeded_by_static_data_0_1, + null, i64_to_string(memoryOffset), i64_to_string(lowMemoryLimit) + ); + } } this.memoryOffset = memoryOffset; module.removeGlobal(BuiltinNames.heap_base); @@ -535,7 +538,7 @@ export class Compiler extends DiagnosticEmitter { var isSharedMemory = options.hasFeature(Feature.THREADS) && options.sharedMemory > 0; module.setMemory( this.options.memoryBase /* is specified */ || this.memorySegments.length - ? i64_low(i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0))) + ? i64_low(i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16))) : 0, isSharedMemory ? options.sharedMemory : Module.UNLIMITED_MEMORY, this.memorySegments, diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts index c0407d6c15..2a71356ff3 100644 --- a/std/assembly/rt/tlsf.ts +++ b/std/assembly/rt/tlsf.ts @@ -481,7 +481,7 @@ export function maybeInitialize(): Root { } let memStart = (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK; if (ASC_LOW_MEMORY_LIMIT) { - const memEnd = (ASC_LOW_MEMORY_LIMIT + AL_MASK) & ~AL_MASK; + const memEnd = ASC_LOW_MEMORY_LIMIT & ~AL_MASK; if (memStart <= memEnd) addMemory(root, memStart, memEnd); else unreachable(); // low memory limit already exceeded } else {