diff --git a/src/builtins.ts b/src/builtins.ts index 142011a5..2ff4516d 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -4287,13 +4287,12 @@ export function compileBuiltinArraySetWithValue( } } - // handle Array: value = LINK(value, this) + // handle Array: value = RETAIN(value, this) if (isManaged) { let program = compiler.program; - let linkPrototype = assert(program.linkPrototype); - let linkInstance = compiler.resolver.resolveFunction(linkPrototype, [ type, target.type ]); - if (!linkInstance) return module.createUnreachable(); - valueExpr = compiler.makeCallInlinePrechecked(linkInstance, [ + let retainInstance = compiler.resolver.resolveFunction(assert(program.retainPrototype), [ type, target.type ]); + if (!retainInstance) return module.createUnreachable(); + valueExpr = compiler.makeCallInlinePrechecked(retainInstance, [ valueExpr, module.createGetLocal(assert(tempThis).index, nativeSizeType) ], 0, true); diff --git a/src/common.ts b/src/common.ts index f53af582..dc38a71d 100644 --- a/src/common.ts +++ b/src/common.ts @@ -187,7 +187,8 @@ export namespace LibrarySymbols { export const REALLOCATE = "REALLOCATE"; export const DISCARD = "DISCARD"; export const REGISTER = "REGISTER"; - export const LINK = "LINK"; + export const RETAIN = "RETAIN"; + export const RELEASE = "RELEASE"; export const WRAPARRAY = "WRAPARRAY"; // other export const length = "length"; diff --git a/src/compiler.ts b/src/compiler.ts index 98ccb0c2..3a8d8650 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -4870,16 +4870,16 @@ export class Compiler extends DiagnosticEmitter { let program = this.program; let tempThis: Local | null = null; if (type.isManaged(program) && thisType.isManaged(program)) { - let linkInstance = this.resolver.resolveFunction(assert(program.linkPrototype), [ type, thisType ]); - if (!linkInstance) { + let retainInstance = this.resolver.resolveFunction(assert(program.retainPrototype), [ type, thisType ]); + if (!retainInstance) { this.currentType = tee ? type : Type.void; return module.createUnreachable(); } tempThis = this.currentFlow.getTempLocal(thisType, false); // this = (tempThis = this) thisExpr = module.createTeeLocal(tempThis.index, thisExpr); - // value = LINK(value, tempThis) - valueWithCorrectType = this.makeCallInlinePrechecked(linkInstance, [ + // value = RETAIN(value, tempThis) + valueWithCorrectType = this.makeCallInlinePrechecked(retainInstance, [ valueWithCorrectType, module.createGetLocal(tempThis.index, this.options.nativeSizeType) ], 0, true); @@ -6795,8 +6795,8 @@ export class Compiler extends DiagnosticEmitter { ) ); var isManaged = elementType.isManaged(program) && arrayType.isManaged(program); - var linkInstance = isManaged - ? this.resolver.resolveFunction(assert(program.linkPrototype), [ elementType, arrayType ]) + var retainInstance = isManaged + ? this.resolver.resolveFunction(assert(program.retainPrototype), [ elementType, arrayType ]) : null; for (let i = 0, alignLog2 = elementType.alignLog2; i < length; ++i) { let valueExpression = expressions[i]; @@ -6804,11 +6804,11 @@ export class Compiler extends DiagnosticEmitter { ? this.compileExpression(valueExpression, elementType, ConversionKind.IMPLICIT, WrapMode.NONE) : elementType.toNativeZero(module); if (isManaged) { - if (!linkInstance) { + if (!retainInstance) { valueExpr = module.createUnreachable(); } else { - // value = LINK(value, tempThis) - valueExpr = this.makeCallInlinePrechecked(linkInstance, [ + // value = RETAIN(value, tempThis) + valueExpr = this.makeCallInlinePrechecked(retainInstance, [ valueExpr, module.createGetLocal(tempThis.index, nativeArrayType) ], 0, true); diff --git a/src/program.ts b/src/program.ts index c194322e..809995c6 100644 --- a/src/program.ts +++ b/src/program.ts @@ -364,8 +364,10 @@ export class Program extends DiagnosticEmitter { discardInstance: Function | null = null; /** Runtime register function. */ registerPrototype: FunctionPrototype | null = null; - /** Runtime link function. */ - linkPrototype: FunctionPrototype | null = null; + /** Runtime retain function. */ + retainPrototype: FunctionPrototype | null = null; + /** Runtime release function. */ + releasePrototype: FunctionPrototype | null = null; /** Runtime wrap array function. */ wrapArrayPrototype: FunctionPrototype | null = null; @@ -828,9 +830,13 @@ export class Program extends DiagnosticEmitter { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.registerPrototype = element; } - if (element = this.lookupGlobal(LibrarySymbols.LINK)) { + if (element = this.lookupGlobal(LibrarySymbols.RETAIN)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); - this.linkPrototype = element; + this.retainPrototype = element; + } + if (element = this.lookupGlobal(LibrarySymbols.RELEASE)) { + assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); + this.releasePrototype = element; } if (element = this.lookupGlobal(LibrarySymbols.WRAPARRAY)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); diff --git a/std/assembly/array.ts b/std/assembly/array.ts index c500c878..4fbebd33 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -1,4 +1,4 @@ -import { ALLOCATE, REALLOCATE, DISCARD, LINK, REGISTER, MAX_BYTELENGTH, ArrayBufferView, UNLINK } from "./runtime"; +import { ALLOCATE, REALLOCATE, DISCARD, RETAIN, RELEASE, REGISTER, MAX_BYTELENGTH, ArrayBufferView } from "./runtime"; import { ArrayBuffer } from "./arraybuffer"; import { COMPARATOR, SORT } from "./util/sort"; import { itoa, dtoa, itoa_stream, dtoa_stream, MAX_DOUBLE_LENGTH } from "./util/number"; @@ -76,8 +76,8 @@ export class Array extends ArrayBufferView { if (isManaged()) { let offset = this.dataStart + (index << alignof()); let oldValue = load(offset); - store(offset, LINK(value, this)); - UNLINK(oldValue, this); // order is important + store(offset, RETAIN(value, this)); + RELEASE(oldValue, this); // order is important } else { store(this.dataStart + (index << alignof()), value); } @@ -140,7 +140,7 @@ export class Array extends ArrayBufferView { this.length_ = newLength; store(this.dataStart + ((newLength - 1) << alignof()), isManaged() - ? LINK(element, this) + ? RETAIN(element, this) : element ); return newLength; @@ -156,13 +156,13 @@ export class Array extends ArrayBufferView { let thisStart = this.dataStart; for (let offset: usize = 0; offset < thisSize; offset += sizeof()) { let element = load(thisStart + offset); - store(outStart + offset, LINK>(element, out)); + store(outStart + offset, RETAIN>(element, out)); } let otherStart = other.dataStart; let otherSize = otherLen << alignof(); for (let offset: usize = 0; offset < otherSize; offset += sizeof()) { let element = load(otherStart + offset); - store(outStart + thisSize + offset, LINK>(element, out)); + store(outStart + thisSize + offset, RETAIN>(element, out)); } } else { memory.copy(outStart, this.dataStart, thisSize); @@ -221,7 +221,7 @@ export class Array extends ArrayBufferView { let result = callbackfn(value, index, this); store(outStart + (index << alignof()), isManaged() - ? LINK>(result, out) + ? RETAIN>(result, out) : result ); } @@ -296,7 +296,7 @@ export class Array extends ArrayBufferView { ); store(base, isManaged() - ? LINK(element, this) + ? RETAIN(element, this) : element ); this.length_ = newLength; @@ -316,7 +316,7 @@ export class Array extends ArrayBufferView { let element = load(thisBase + offset); store(sliceBase + offset, isManaged() - ? LINK>(element, slice) + ? RETAIN>(element, slice) : element ); } @@ -334,8 +334,8 @@ export class Array extends ArrayBufferView { for (let i = 0; i < deleteCount; ++i) { let deleted = load(thisBase + (i << alignof())); if (isManaged()) { - store(resultStart + (i << alignof()), LINK>(deleted, result)); - UNLINK(deleted, this); // order is important + store(resultStart + (i << alignof()), RETAIN>(deleted, result)); + RELEASE(deleted, this); // order is important } else { store(resultStart + (i << alignof()), deleted); } @@ -655,16 +655,17 @@ export class Array extends ArrayBufferView { return this.join(); } - // private __gc(): void { - // var buffer = this.buffer_; - // __gc_mark(changetype(buffer)); // tslint:disable-line - // if (isManaged()) { - // let offset: usize = 0; - // let end = this.length_ << alignof(); - // while (offset < end) { - // __gc_mark(load(changetype(buffer) + offset, HEADER_SIZE)); // tslint:disable-line - // offset += sizeof(); - // } - // } - // } + // GC integration + + @unsafe private __iter(fn: (ref: usize) => void): void { + fn(changetype(this.data)); + if (isManaged()) { + let cur = this.dataStart; + let end = cur + this.dataLength; + while (cur < end) { + fn(load(cur)); + cur += sizeof(); + } + } + } } diff --git a/std/assembly/collector/pure.ts b/std/assembly/collector/pure.ts index 99478f6d..0ced1fc4 100644 --- a/std/assembly/collector/pure.ts +++ b/std/assembly/collector/pure.ts @@ -1,8 +1,7 @@ // A Pure Reference Counting Garbage Collector // -// After the paper by DAVID F. BACON, CLEMENT R. ATTANASIO, V.T. RAJAN, STEPHEN E. SMITH -// D. Bacon, IBM T.J. Watson Research Center -// 2001 ACM 0164-0925/99/0100-0111 $00.75 +// After the paper by D. Bacon et al., 2001, IBM T.J. Watson Research Center +// https://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon03Pure.pdf import { HEADER, HEADER_SIZE } from "../runtime"; diff --git a/std/assembly/fixedarray.ts b/std/assembly/fixedarray.ts index b888eeaa..fc209af9 100644 --- a/std/assembly/fixedarray.ts +++ b/std/assembly/fixedarray.ts @@ -1,4 +1,4 @@ -import { ALLOCATE, REGISTER, MAX_BYTELENGTH, HEADER, HEADER_SIZE, LINK, UNLINK } from "./runtime"; +import { ALLOCATE, REGISTER, MAX_BYTELENGTH, HEADER, HEADER_SIZE, RETAIN, RELEASE } from "./runtime"; // NOTE: DO NOT USE YET! @@ -38,10 +38,23 @@ export class FixedArray { if (isManaged()) { let offset = changetype(this) + (index << alignof()); let oldValue = load(offset); - store(offset, LINK(value, this)); - UNLINK(oldValue, this); // order is important + store(offset, RETAIN(value, this)); + RELEASE(oldValue, this); // order is important } else { store(changetype(this) + (index << alignof()), value); } } + + // GC integration + + @unsafe private __iter(fn: (ref: usize) => void): void { + if (isManaged()) { + let cur = changetype(this); + let end = cur + changetype
(changetype(this) - HEADER_SIZE).payloadSize; + while (cur < end) { + fn(load(cur)); + cur += sizeof(); + } + } + } } diff --git a/std/assembly/map.ts b/std/assembly/map.ts index 93784ff1..3e72b880 100644 --- a/std/assembly/map.ts +++ b/std/assembly/map.ts @@ -1,4 +1,4 @@ -import { LINK, UNLINK } from "./runtime"; +import { RETAIN, RELEASE, HEADER } from "./runtime"; import { HASH } from "./util/hash"; // A deterministic hash map based on CloseTable from https://github.com/jorendorff/dht @@ -106,8 +106,8 @@ export class Map { if (entry) { if (isManaged()) { let oldValue = entry.value; - entry.value = LINK(value, this); - UNLINK(oldValue, this); // order is important + entry.value = RETAIN(value, this); + RELEASE(oldValue, this); // order is important } else { entry.value = value; } @@ -126,8 +126,8 @@ export class Map { changetype(entries) + this.entriesOffset++ * ENTRY_SIZE() ); // link with the map - entry.key = isManaged() ? LINK(key, this) : key; - entry.value = isManaged() ? LINK(value, this) : value; + entry.key = isManaged() ? RETAIN(key, this) : key; + entry.value = isManaged() ? RETAIN(value, this) : value; ++this.entriesCount; // link with previous entry in bucket let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE; @@ -139,8 +139,8 @@ export class Map { delete(key: K): bool { var entry = this.find(key, HASH(key)); if (!entry) return false; - if (isManaged()) UNLINK(entry.key, this); - if (isManaged()) UNLINK(entry.value, this); + if (isManaged()) RELEASE(entry.key, this); + if (isManaged()) RELEASE(entry.value, this); entry.taggedNext |= EMPTY; --this.entriesCount; // check if rehashing is appropriate @@ -188,23 +188,23 @@ export class Map { return "[object Map]"; } - // private __gc(): void { - // __gc_mark(changetype(this.buckets)); // tslint:disable-line - // var entries = this.entries; - // __gc_mark(changetype(entries)); // tslint:disable-line - // if (isManaged() || isManaged()) { - // let offset: usize = 0; - // let end: usize = this.entriesOffset * ENTRY_SIZE(); - // while (offset < end) { - // let entry = changetype>( - // changetype(entries) + HEADER_SIZE_AB + offset * ENTRY_SIZE() - // ); - // if (!(entry.taggedNext & EMPTY)) { - // if (isManaged()) __gc_mark(changetype(entry.key)); // tslint:disable-line - // if (isManaged()) __gc_mark(changetype(entry.value)); // tslint:disable-line - // } - // offset += ENTRY_SIZE(); - // } - // } - // } + // GC integration + + @unsafe private __iter(fn: (ref: usize) => void): void { + fn(changetype(this.buckets)); + var entries = this.entries; + fn(changetype(entries)); + if (isManaged() || isManaged()) { + let cur = changetype(entries); + let end = cur + this.entriesOffset * ENTRY_SIZE(); + while (cur < end) { + let entry = changetype>(cur); + if (!(entry.taggedNext & EMPTY)) { + if (isManaged()) fn(changetype(entry.key)); + if (isManaged()) fn(changetype(entry.value)); + } + cur += ENTRY_SIZE(); + } + } + } } diff --git a/std/assembly/runtime.ts b/std/assembly/runtime.ts index 5a3dd1fb..e92d3e80 100644 --- a/std/assembly/runtime.ts +++ b/std/assembly/runtime.ts @@ -141,17 +141,17 @@ function doRegister(ref: usize, classId: u32): usize { return ref; } -/** Links a registered object with an object that is now referencing it. */ +/** Retains a registered object. */ // @ts-ignore: decorator @unsafe @inline -export function LINK(ref: T, parentRef: TParent): T { +export function RETAIN(ref: T, parentRef: TParent): T { if (!isManaged()) ERROR("managed reference expected"); if (!isManaged()) ERROR("managed reference expected"); - doLink(changetype(ref), changetype(parentRef)); + doRetain(changetype(ref), changetype(parentRef)); return ref; } -function doLink(ref: usize, parentRef: usize): void { +function doRetain(ref: usize, parentRef: usize): void { if (!ASC_NO_ASSERT) { assertRegistered(ref); assertRegistered(parentRef); @@ -160,16 +160,16 @@ function doLink(ref: usize, parentRef: usize): void { if (GC_IMPLEMENTED) __gc_link(changetype(ref), changetype(parentRef)); } -/** Unlinks a registered object from an object that was referencing it. */ +/** Releases a registered object. */ // @ts-ignore: decorator @unsafe @inline -export function UNLINK(ref: T, parentRef: TParent): void { +export function RELEASE(ref: T, parentRef: TParent): void { if (!isManaged()) ERROR("managed reference expected"); if (!isManaged()) ERROR("managed reference expected"); - doUnlink(changetype(ref), changetype(parentRef)); + doRelease(changetype(ref), changetype(parentRef)); } -function doUnlink(ref: usize, parentRef: usize): void { +function doRelease(ref: usize, parentRef: usize): void { if (!ASC_NO_ASSERT) { assertRegistered(ref); assertRegistered(parentRef); diff --git a/std/assembly/set.ts b/std/assembly/set.ts index 8d070e17..fd0b006d 100644 --- a/std/assembly/set.ts +++ b/std/assembly/set.ts @@ -1,4 +1,4 @@ -import { LINK, UNLINK } from "./runtime"; +import { RETAIN, RELEASE } from "./runtime"; import { HASH } from "./util/hash"; // A deterministic hash set based on CloseTable from https://github.com/jorendorff/dht @@ -109,7 +109,7 @@ export class Set { changetype(entries) + this.entriesOffset++ * ENTRY_SIZE() ); // link with the set - entry.key = isManaged() ? LINK(key, this) : key; + entry.key = isManaged() ? RETAIN(key, this) : key; ++this.entriesCount; // link with previous entry in bucket let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE; @@ -121,7 +121,7 @@ export class Set { delete(key: K): bool { var entry = this.find(key, HASH(key)); if (!entry) return false; - if (isManaged()) UNLINK(entry.key, this); + if (isManaged()) RELEASE(entry.key, this); entry.taggedNext |= EMPTY; --this.entriesCount; // check if rehashing is appropriate @@ -168,20 +168,20 @@ export class Set { return "[object Set]"; } - // private __gc(): void { - // __gc_mark(changetype(this.buckets)); // tslint:disable-line - // var entries = this.entries; - // __gc_mark(changetype(entries)); // tslint:disable-line - // if (isManaged()) { - // let offset: usize = 0; - // let end: usize = this.entriesOffset * ENTRY_SIZE(); - // while (offset < end) { - // let entry = changetype>( - // changetype(entries) + HEADER_SIZE_AB + offset * ENTRY_SIZE() - // ); - // if (!(entry.taggedNext & EMPTY)) __gc_mark(changetype(entry.key)); // tslint:disable-line - // offset += ENTRY_SIZE(); - // } - // } - // } + // GC integration + + @unsafe private __iter(fn: (ref: usize) => void): void { + fn(changetype(this.buckets)); + var entries = this.entries; + fn(changetype(entries)); + if (isManaged()) { + let cur = changetype(entries); + let end = cur + this.entriesOffset * ENTRY_SIZE(); + while (cur < end) { + let entry = changetype>(cur); + if (!(entry.taggedNext & EMPTY)) fn(changetype(entry.key)); + cur += ENTRY_SIZE(); + } + } + } } diff --git a/std/assembly/string.ts b/std/assembly/string.ts index d7666611..1da04389 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -1,4 +1,4 @@ -import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, ArrayBufferView, LINK } from "./runtime"; +import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, ArrayBufferView, RETAIN } from "./runtime"; import { MAX_SIZE_32 } from "./util/allocator"; import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./util/string"; @@ -365,7 +365,7 @@ import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./ut // result[i] = charStr store(resultStart + (i << alignof()), isManaged() - ? LINK>(REGISTER(charStr), result) + ? RETAIN>(REGISTER(charStr), result) : REGISTER(charStr) ); } diff --git a/tests/compiler/std/runtime.optimized.wat b/tests/compiler/std/runtime.optimized.wat index 6d39f7a0..15d8230d 100644 --- a/tests/compiler/std/runtime.optimized.wat +++ b/tests/compiler/std/runtime.optimized.wat @@ -50,7 +50,7 @@ if i32.const 0 i32.const 24 - i32.const 130 + i32.const 135 i32.const 4 call $~lib/env/abort unreachable @@ -70,7 +70,7 @@ if i32.const 0 i32.const 24 - i32.const 153 + i32.const 158 i32.const 4 call $~lib/env/abort unreachable @@ -81,7 +81,7 @@ if i32.const 0 i32.const 24 - i32.const 154 + i32.const 159 i32.const 4 call $~lib/env/abort unreachable @@ -107,7 +107,7 @@ if i32.const 0 i32.const 24 - i32.const 76 + i32.const 81 i32.const 4 call $~lib/env/abort unreachable @@ -125,7 +125,7 @@ if i32.const 0 i32.const 24 - i32.const 77 + i32.const 82 i32.const 11 call $~lib/env/abort unreachable @@ -138,7 +138,7 @@ if i32.const 0 i32.const 24 - i32.const 414 + i32.const 419 i32.const 2 call $~lib/env/abort unreachable @@ -155,7 +155,7 @@ if i32.const 0 i32.const 24 - i32.const 144 + i32.const 149 i32.const 4 call $~lib/env/abort unreachable @@ -166,7 +166,7 @@ if i32.const 0 i32.const 24 - i32.const 145 + i32.const 150 i32.const 4 call $~lib/env/abort unreachable @@ -189,7 +189,7 @@ if i32.const 0 i32.const 24 - i32.const 124 + i32.const 129 i32.const 4 call $~lib/env/abort unreachable @@ -215,7 +215,7 @@ if i32.const 0 i32.const 24 - i32.const 244 + i32.const 249 i32.const 4 call $~lib/env/abort unreachable @@ -238,7 +238,7 @@ if i32.const 0 i32.const 24 - i32.const 246 + i32.const 251 i32.const 4 call $~lib/env/abort unreachable @@ -339,7 +339,7 @@ if i32.const 0 i32.const 24 - i32.const 68 + i32.const 73 i32.const 4 call $~lib/env/abort unreachable @@ -353,7 +353,7 @@ if i32.const 0 i32.const 24 - i32.const 69 + i32.const 74 i32.const 11 call $~lib/env/abort unreachable @@ -369,7 +369,7 @@ if i32.const 0 i32.const 24 - i32.const 320 + i32.const 325 i32.const 4 call $~lib/env/abort unreachable @@ -381,7 +381,7 @@ if i32.const 0 i32.const 24 - i32.const 321 + i32.const 326 i32.const 4 call $~lib/env/abort unreachable @@ -394,7 +394,7 @@ if i32.const 0 i32.const 24 - i32.const 322 + i32.const 327 i32.const 4 call $~lib/env/abort unreachable @@ -416,7 +416,7 @@ if i32.const 0 i32.const 24 - i32.const 175 + i32.const 180 i32.const 4 call $~lib/env/abort unreachable @@ -430,7 +430,7 @@ if i32.const 0 i32.const 24 - i32.const 177 + i32.const 182 i32.const 4 call $~lib/env/abort unreachable @@ -454,7 +454,7 @@ if i32.const 0 i32.const 24 - i32.const 179 + i32.const 184 i32.const 4 call $~lib/env/abort unreachable @@ -466,7 +466,7 @@ if i32.const 0 i32.const 24 - i32.const 183 + i32.const 188 i32.const 23 call $~lib/env/abort unreachable @@ -508,7 +508,7 @@ if i32.const 0 i32.const 24 - i32.const 197 + i32.const 202 i32.const 24 call $~lib/env/abort unreachable @@ -522,7 +522,7 @@ if i32.const 0 i32.const 24 - i32.const 199 + i32.const 204 i32.const 6 call $~lib/env/abort unreachable @@ -571,7 +571,7 @@ if i32.const 0 i32.const 24 - i32.const 212 + i32.const 217 i32.const 4 call $~lib/env/abort unreachable @@ -650,7 +650,7 @@ if i32.const 0 i32.const 24 - i32.const 363 + i32.const 368 i32.const 4 call $~lib/env/abort unreachable @@ -661,7 +661,7 @@ if i32.const 0 i32.const 24 - i32.const 364 + i32.const 369 i32.const 4 call $~lib/env/abort unreachable @@ -672,7 +672,7 @@ if i32.const 0 i32.const 24 - i32.const 365 + i32.const 370 i32.const 4 call $~lib/env/abort unreachable @@ -689,7 +689,7 @@ if i32.const 0 i32.const 24 - i32.const 370 + i32.const 375 i32.const 6 call $~lib/env/abort unreachable @@ -717,7 +717,7 @@ if i32.const 0 i32.const 24 - i32.const 379 + i32.const 384 i32.const 6 call $~lib/env/abort unreachable @@ -770,7 +770,7 @@ if i32.const 0 i32.const 24 - i32.const 408 + i32.const 413 i32.const 2 call $~lib/env/abort unreachable @@ -795,7 +795,7 @@ if i32.const 0 i32.const 24 - i32.const 282 + i32.const 287 i32.const 4 call $~lib/env/abort unreachable @@ -875,7 +875,7 @@ if i32.const 0 i32.const 24 - i32.const 309 + i32.const 314 i32.const 16 call $~lib/env/abort unreachable @@ -903,7 +903,7 @@ if i32.const 0 i32.const 24 - i32.const 334 + i32.const 339 i32.const 4 call $~lib/env/abort unreachable @@ -923,7 +923,7 @@ if i32.const 0 i32.const 24 - i32.const 335 + i32.const 340 i32.const 4 call $~lib/env/abort unreachable @@ -934,7 +934,7 @@ if i32.const 0 i32.const 24 - i32.const 336 + i32.const 341 i32.const 4 call $~lib/env/abort unreachable @@ -986,7 +986,7 @@ if i32.const 0 i32.const 24 - i32.const 354 + i32.const 359 i32.const 25 call $~lib/env/abort unreachable @@ -1149,7 +1149,7 @@ if i32.const 0 i32.const 24 - i32.const 467 + i32.const 472 i32.const 12 call $~lib/env/abort unreachable @@ -1164,7 +1164,7 @@ if i32.const 0 i32.const 24 - i32.const 470 + i32.const 475 i32.const 2 call $~lib/env/abort unreachable @@ -2523,7 +2523,7 @@ if i32.const 0 i32.const 24 - i32.const 483 + i32.const 488 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/runtime.untouched.wat b/tests/compiler/std/runtime.untouched.wat index 50d34f17..59331d29 100644 --- a/tests/compiler/std/runtime.untouched.wat +++ b/tests/compiler/std/runtime.untouched.wat @@ -70,7 +70,7 @@ if i32.const 0 i32.const 24 - i32.const 109 + i32.const 114 i32.const 0 call $~lib/env/abort unreachable @@ -119,7 +119,7 @@ if i32.const 0 i32.const 24 - i32.const 130 + i32.const 135 i32.const 4 call $~lib/env/abort unreachable @@ -140,7 +140,7 @@ if i32.const 0 i32.const 24 - i32.const 153 + i32.const 158 i32.const 4 call $~lib/env/abort unreachable @@ -152,7 +152,7 @@ if i32.const 0 i32.const 24 - i32.const 154 + i32.const 159 i32.const 4 call $~lib/env/abort unreachable @@ -185,7 +185,7 @@ if i32.const 0 i32.const 24 - i32.const 76 + i32.const 81 i32.const 4 call $~lib/env/abort unreachable @@ -205,7 +205,7 @@ if (result i32) i32.const 0 i32.const 24 - i32.const 77 + i32.const 82 i32.const 11 call $~lib/env/abort unreachable @@ -221,7 +221,7 @@ if i32.const 0 i32.const 24 - i32.const 414 + i32.const 419 i32.const 2 call $~lib/env/abort unreachable @@ -239,7 +239,7 @@ if i32.const 0 i32.const 24 - i32.const 144 + i32.const 149 i32.const 4 call $~lib/env/abort unreachable @@ -251,7 +251,7 @@ if i32.const 0 i32.const 24 - i32.const 145 + i32.const 150 i32.const 4 call $~lib/env/abort unreachable @@ -275,7 +275,7 @@ if i32.const 0 i32.const 24 - i32.const 124 + i32.const 129 i32.const 4 call $~lib/env/abort unreachable @@ -305,7 +305,7 @@ if i32.const 0 i32.const 24 - i32.const 244 + i32.const 249 i32.const 4 call $~lib/env/abort unreachable @@ -331,7 +331,7 @@ if i32.const 0 i32.const 24 - i32.const 246 + i32.const 251 i32.const 4 call $~lib/env/abort unreachable @@ -442,7 +442,7 @@ if i32.const 0 i32.const 24 - i32.const 68 + i32.const 73 i32.const 4 call $~lib/env/abort unreachable @@ -456,7 +456,7 @@ if (result i32) i32.const 0 i32.const 24 - i32.const 69 + i32.const 74 i32.const 11 call $~lib/env/abort unreachable @@ -473,7 +473,7 @@ if i32.const 0 i32.const 24 - i32.const 320 + i32.const 325 i32.const 4 call $~lib/env/abort unreachable @@ -486,7 +486,7 @@ if i32.const 0 i32.const 24 - i32.const 321 + i32.const 326 i32.const 4 call $~lib/env/abort unreachable @@ -499,7 +499,7 @@ if i32.const 0 i32.const 24 - i32.const 322 + i32.const 327 i32.const 4 call $~lib/env/abort unreachable @@ -525,7 +525,7 @@ if i32.const 0 i32.const 24 - i32.const 175 + i32.const 180 i32.const 4 call $~lib/env/abort unreachable @@ -540,7 +540,7 @@ if i32.const 0 i32.const 24 - i32.const 177 + i32.const 182 i32.const 4 call $~lib/env/abort unreachable @@ -566,7 +566,7 @@ if i32.const 0 i32.const 24 - i32.const 179 + i32.const 184 i32.const 4 call $~lib/env/abort unreachable @@ -578,7 +578,7 @@ if (result i32) i32.const 0 i32.const 24 - i32.const 183 + i32.const 188 i32.const 23 call $~lib/env/abort unreachable @@ -626,7 +626,7 @@ if (result i32) i32.const 0 i32.const 24 - i32.const 197 + i32.const 202 i32.const 24 call $~lib/env/abort unreachable @@ -644,7 +644,7 @@ if i32.const 0 i32.const 24 - i32.const 199 + i32.const 204 i32.const 6 call $~lib/env/abort unreachable @@ -699,7 +699,7 @@ if i32.const 0 i32.const 24 - i32.const 212 + i32.const 217 i32.const 4 call $~lib/env/abort unreachable @@ -790,7 +790,7 @@ if i32.const 0 i32.const 24 - i32.const 363 + i32.const 368 i32.const 4 call $~lib/env/abort unreachable @@ -803,7 +803,7 @@ if i32.const 0 i32.const 24 - i32.const 364 + i32.const 369 i32.const 4 call $~lib/env/abort unreachable @@ -816,7 +816,7 @@ if i32.const 0 i32.const 24 - i32.const 365 + i32.const 370 i32.const 4 call $~lib/env/abort unreachable @@ -837,7 +837,7 @@ if i32.const 0 i32.const 24 - i32.const 370 + i32.const 375 i32.const 6 call $~lib/env/abort unreachable @@ -866,7 +866,7 @@ if i32.const 0 i32.const 24 - i32.const 379 + i32.const 384 i32.const 6 call $~lib/env/abort unreachable @@ -937,7 +937,7 @@ if i32.const 0 i32.const 24 - i32.const 408 + i32.const 413 i32.const 2 call $~lib/env/abort unreachable @@ -953,7 +953,7 @@ if i32.const 0 i32.const 24 - i32.const 408 + i32.const 413 i32.const 2 call $~lib/env/abort unreachable @@ -983,7 +983,7 @@ if i32.const 0 i32.const 24 - i32.const 282 + i32.const 287 i32.const 4 call $~lib/env/abort unreachable @@ -1079,7 +1079,7 @@ else i32.const 0 i32.const 24 - i32.const 309 + i32.const 314 i32.const 16 call $~lib/env/abort unreachable @@ -1116,7 +1116,7 @@ if i32.const 0 i32.const 24 - i32.const 334 + i32.const 339 i32.const 4 call $~lib/env/abort unreachable @@ -1136,7 +1136,7 @@ if i32.const 0 i32.const 24 - i32.const 335 + i32.const 340 i32.const 4 call $~lib/env/abort unreachable @@ -1149,7 +1149,7 @@ if i32.const 0 i32.const 24 - i32.const 336 + i32.const 341 i32.const 4 call $~lib/env/abort unreachable @@ -1209,7 +1209,7 @@ if (result i32) i32.const 0 i32.const 24 - i32.const 354 + i32.const 359 i32.const 25 call $~lib/env/abort unreachable @@ -1439,7 +1439,7 @@ if (result i32) i32.const 0 i32.const 24 - i32.const 467 + i32.const 472 i32.const 12 call $~lib/env/abort unreachable @@ -1460,7 +1460,7 @@ if i32.const 0 i32.const 24 - i32.const 470 + i32.const 475 i32.const 2 call $~lib/env/abort unreachable @@ -3211,7 +3211,7 @@ if i32.const 0 i32.const 24 - i32.const 483 + i32.const 488 i32.const 6 call $~lib/env/abort unreachable