Rework static memory segment creation; Fix stdlib gc hooks not marking own fields; Align everything to 8 bytes that might be touched by GC

This commit is contained in:
dcodeIO 2018-08-04 00:36:59 +02:00
parent 61de7cf962
commit 631478c7c9
61 changed files with 11944 additions and 5286 deletions

2
dist/asc.js vendored

File diff suppressed because one or more lines are too long

2
dist/asc.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,8 @@ import {
compileCall as compileBuiltinCall,
compileAllocate,
compileAbort,
compileIterateRoots
compileIterateRoots,
ensureGCHook
} from "./builtins";
import {
@ -6226,53 +6227,51 @@ export class Compiler extends DiagnosticEmitter {
/** Ensures that the specified string exists in static memory and returns a pointer to it. */
ensureStaticString(stringValue: string): ExpressionRef {
var program = this.program;
var module = this.module;
var options = this.options;
var stringSegments = this.stringSegments;
var needsGCHeader = program.hasGC;
var hasGC = program.hasGC;
var gcHeaderSize = program.gcHeaderSize;
var stringInstance = assert(program.stringInstance);
var stringSegment: MemorySegment;
var stringOffset: I64;
if (!stringSegments.has(stringValue)) {
let stringLength = stringValue.length;
let stringSize = 4 + stringLength * 2;
let offset = 0;
let gcHeaderSize = program.gcHeaderSize;
if (needsGCHeader) {
stringSize += gcHeaderSize;
offset += gcHeaderSize;
}
let stringBuffer = new Uint8Array(stringSize);
stringBuffer[offset ] = stringLength & 0xff;
stringBuffer[offset + 1] = (stringLength >>> 8) & 0xff;
stringBuffer[offset + 2] = (stringLength >>> 16) & 0xff;
stringBuffer[offset + 3] = (stringLength >>> 24) & 0xff;
for (let i = 0; i < stringLength; ++i) {
stringBuffer[offset + 4 + i * 2] = stringValue.charCodeAt(i) & 0xff;
stringBuffer[offset + 5 + i * 2] = (stringValue.charCodeAt(i) >>> 8) & 0xff;
}
stringSegment = this.addMemorySegment(stringBuffer, options.usizeType.byteSize);
stringSegments.set(stringValue, stringSegment);
if (needsGCHeader) {
stringOffset = i64_add(stringSegment.offset, i64_new(gcHeaderSize, 0));
// if the string already exists, reuse it
var segments = this.stringSegments;
if (segments.has(stringValue)) {
stringSegment = <MemorySegment>segments.get(stringValue);
// otherwise create it
} else {
stringOffset = stringSegment.offset;
}
let length = stringValue.length;
let headerSize = (stringInstance.currentMemoryOffset + 1) & ~1;
let totalSize = headerSize + length * 2;
let buf: Uint8Array;
let pos: u32;
if (hasGC) {
buf = new Uint8Array(gcHeaderSize + totalSize);
pos = gcHeaderSize;
writeI32(ensureGCHook(this, stringInstance), buf, program.gcHookOffset);
} else {
stringSegment = <MemorySegment>stringSegments.get(stringValue);
stringOffset = stringSegment.offset;
buf = new Uint8Array(totalSize);
pos = 0;
}
if (program.typesLookup.has("string")) {
let stringType = <Type>program.typesLookup.get("string");
this.currentType = stringType;
} else {
this.currentType = options.usizeType;
writeI32(length, buf, pos + stringInstance.offsetof("length"));
pos += headerSize;
for (let i = 0; i < length; ++i) {
writeI16(stringValue.charCodeAt(i), buf, pos + (i << 1));
}
if (options.isWasm64) {
return module.createI64(i64_low(stringOffset), i64_high(stringOffset));
stringSegment = this.addMemorySegment(buf);
segments.set(stringValue, stringSegment);
}
var stringOffset = stringSegment.offset;
if (hasGC) stringOffset = i64_add(stringOffset, i64_new(gcHeaderSize));
this.currentType = stringInstance.type;
if (this.options.isWasm64) {
return this.module.createI64(i64_low(stringOffset), i64_high(stringOffset));
} else {
assert(i64_is_i32(stringOffset));
return module.createI32(i64_low(stringOffset));
assert(i64_is_u32(stringOffset));
return this.module.createI32(i64_low(stringOffset));
}
}
@ -6282,52 +6281,32 @@ export class Compiler extends DiagnosticEmitter {
/** Ensures that the specified array exists in static memory and returns a pointer to it. */
ensureStaticArray(elementType: Type, values: ExpressionRef[]): ExpressionRef {
var program = this.program;
var hasGC = program.hasGC;
var gcHeaderSize = program.gcHeaderSize;
var length = values.length;
var byteSize = elementType.byteSize;
var byteLength = length * byteSize;
var usizeTypeSize = this.options.usizeType.byteSize;
// determine the size of the Array header
var arrayHeaderSize = (usizeTypeSize + 4 + 7) & ~7; // .buffer_ + .length_ + alignment
var arrayTotalSize = arrayHeaderSize;
var buf: Uint8Array;
var pos: u32;
// determine the size of the ArrayBuffer
var bufferHeaderSize = (4 + 7) & ~7; // .byteLength + alignment
var bufferTotalSize = 1 << (32 - clz(byteLength + bufferHeaderSize - 1)); // see internals
var program = this.program;
var needsGC = program.hasGC;
var gcHeaderSize = program.gcHeaderSize;
var offset = 0;
if (needsGC) {
offset += gcHeaderSize; // start writing after GC header
arrayTotalSize += gcHeaderSize;
bufferTotalSize += gcHeaderSize;
}
// create a compound segment holding both the the Array header and the ArrayBuffer
var buffer = new Uint8Array(arrayHeaderSize + bufferTotalSize);
var segment = this.addMemorySegment(buffer);
// write the Array header first
if (usizeTypeSize == 8) {
writeI64(i64_add(segment.offset, i64_new(arrayHeaderSize)), buffer, offset); // .buffer_
offset += 8;
// create the backing ArrayBuffer segment
var bufferInstance = assert(program.arrayBufferInstance);
var bufferHeaderSize = (bufferInstance.currentMemoryOffset + 7) & ~7;
var bufferTotalSize = 1 << (32 - clz(bufferHeaderSize + byteLength - 1));
if (hasGC) {
buf = new Uint8Array(gcHeaderSize + bufferTotalSize);
pos = gcHeaderSize;
writeI32(ensureGCHook(this, bufferInstance), buf, program.gcHookOffset);
} else {
assert(i64_is_u32(segment.offset));
writeI32(i64_low(segment.offset) + arrayHeaderSize, buffer, offset); // .buffer_
offset += 4;
buf = new Uint8Array(bufferTotalSize);
pos = 0;
}
writeI32(length, buffer, offset); // .length_
offset += 4;
assert(((offset + 7) & ~7) == arrayTotalSize); // incl. GC header if applicable
// append the ArrayBuffer
offset = arrayTotalSize;
if (needsGC) offset += gcHeaderSize;
writeI32(byteLength, buffer, offset); // .byteLength
offset += bufferHeaderSize; // align
writeI32(byteLength, buf, pos + bufferInstance.offsetof("byteLength"));
pos += bufferHeaderSize;
var nativeType = elementType.toNativeType();
switch (nativeType) {
case NativeType.I32: {
@ -6337,8 +6316,8 @@ export class Compiler extends DiagnosticEmitter {
let value = values[i];
assert(getExpressionType(value) == nativeType);
assert(getExpressionId(value) == ExpressionId.Const);
writeI8(getConstValueI32(value), buffer, offset);
offset += 1;
writeI8(getConstValueI32(value), buf, pos);
pos += 1;
}
break;
}
@ -6347,8 +6326,8 @@ export class Compiler extends DiagnosticEmitter {
let value = values[i];
assert(getExpressionType(value) == nativeType);
assert(getExpressionId(value) == ExpressionId.Const);
writeI16(getConstValueI32(value), buffer, offset);
offset += 2;
writeI16(getConstValueI32(value), buf, pos);
pos += 2;
}
break;
}
@ -6357,8 +6336,8 @@ export class Compiler extends DiagnosticEmitter {
let value = values[i];
assert(getExpressionType(value) == nativeType);
assert(getExpressionId(value) == ExpressionId.Const);
writeI32(getConstValueI32(value), buffer, offset);
offset += 4;
writeI32(getConstValueI32(value), buf, pos);
pos += 4;
}
break;
}
@ -6371,8 +6350,8 @@ export class Compiler extends DiagnosticEmitter {
let value = values[i];
assert(getExpressionType(value) == nativeType);
assert(getExpressionId(value) == ExpressionId.Const);
writeI64(i64_new(getConstValueI64Low(value), getConstValueI64High(value)), buffer, offset);
offset += 8;
writeI64(i64_new(getConstValueI64Low(value), getConstValueI64High(value)), buf, pos);
pos += 8;
}
break;
}
@ -6381,8 +6360,8 @@ export class Compiler extends DiagnosticEmitter {
let value = values[i];
assert(getExpressionType(value) == nativeType);
assert(getExpressionId(value) == ExpressionId.Const);
writeF32(getConstValueF32(value), buffer, offset);
offset += 4;
writeF32(getConstValueF32(value), buf, pos);
pos += 4;
}
break;
}
@ -6391,35 +6370,43 @@ export class Compiler extends DiagnosticEmitter {
let value = values[i];
assert(getExpressionType(value) == nativeType);
assert(getExpressionId(value) == ExpressionId.Const);
writeF64(getConstValueF64(value), buffer, offset);
offset += 8;
writeF64(getConstValueF64(value), buf, pos);
pos += 8;
}
break;
}
default: assert(false);
}
assert(offset <= arrayTotalSize + bufferTotalSize); // might have empty trailing space
var bufferSegment = this.addMemorySegment(buf);
var bufferOffset = bufferSegment.offset;
if (hasGC) bufferOffset = i64_add(bufferOffset, i64_new(gcHeaderSize));
var arrayPrototype = this.program.arrayPrototype;
if (arrayPrototype) {
let arrayInstance = this.resolver.resolveClass(arrayPrototype, [ elementType ], null, ReportMode.REPORT);
if (!arrayInstance) {
this.currentType = this.options.usizeType;
return this.module.createUnreachable();
// create the Array segment and return a pointer to it
var arrayPrototype = assert(program.arrayPrototype);
var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ]));
var arrayHeaderSize = (arrayInstance.currentMemoryOffset + 7) & ~7;
if (hasGC) {
buf = new Uint8Array(gcHeaderSize + arrayHeaderSize);
pos = gcHeaderSize;
writeI32(ensureGCHook(this, arrayInstance), buf, program.gcHookOffset);
} else {
buf = new Uint8Array(arrayHeaderSize);
pos = 0;
}
var arraySegment = this.addMemorySegment(buf);
var arrayOffset = arraySegment.offset;
if (hasGC) arrayOffset = i64_add(arrayOffset, i64_new(gcHeaderSize));
this.currentType = arrayInstance.type;
} else {
this.currentType = this.options.usizeType;
}
// return a pointer at the array header (skip GC header if present)
var address = segment.offset;
if (needsGC) address = i64_add(address, i64_new(gcHeaderSize, 0));
if (usizeTypeSize == 8) {
return this.module.createI64(i64_low(address), i64_high(address));
writeI64(bufferOffset, buf, pos + arrayInstance.offsetof("buffer_"));
writeI32(length, buf, pos + arrayInstance.offsetof("length_"));
return this.module.createI64(i64_low(arrayOffset), i64_high(arrayOffset));
} else {
assert(i64_is_u32(address));
return this.module.createI32(i64_low(address));
assert(i64_is_u32(bufferOffset));
writeI32(i64_low(bufferOffset), buf, pos + arrayInstance.offsetof("buffer_"));
writeI32(length, buf, pos + arrayInstance.offsetof("length_"));
assert(i64_is_u32(arrayOffset));
return this.module.createI32(i64_low(arrayOffset));
}
}
@ -6433,17 +6420,20 @@ export class Compiler extends DiagnosticEmitter {
// find out whether all elements are constant (array is static)
var length = expressions.length;
var values = new Array<ExpressionRef>(length);
var compiledValues = new Array<ExpressionRef>(length);
var constantValues = new Array<ExpressionRef>(length);
var nativeElementType = elementType.toNativeType();
var isStatic = true;
for (let i = 0; i < length; ++i) {
values[i] = expressions[i]
let expr = expressions[i]
? this.compileExpression(<Expression>expressions[i], elementType, ConversionKind.IMPLICIT, WrapMode.NONE)
: elementType.toNativeZero(module);
compiledValues[i] = expr;
if (isStatic) {
let expr = module.precomputeExpression(values[i]);
expr = module.precomputeExpression(compiledValues[i]);
if (getExpressionId(expr) == ExpressionId.Const) {
assert(getExpressionType(expr) == nativeElementType);
constantValues[i] = expr;
} else {
if (isConst) {
this.warning(
@ -6457,7 +6447,7 @@ export class Compiler extends DiagnosticEmitter {
}
// make a static array if possible
if (isStatic) return this.ensureStaticArray(elementType, values);
if (isStatic) return this.ensureStaticArray(elementType, constantValues);
// otherwise obtain the array type
var arrayPrototype = assert(this.program.arrayPrototype);
@ -6491,7 +6481,7 @@ export class Compiler extends DiagnosticEmitter {
stmts[index++] = this.makeCallDirect(setter, [
module.createGetLocal(tempLocal.index, nativeArrayType), // this
module.createI32(i),
values[i]
compiledValues[i]
]);
}
assert(index + 1 == stmts.length);

View File

@ -328,6 +328,8 @@ export class Program extends DiagnosticEmitter {
/** Module-level exports by exported name. */
moduleLevelExports: Map<string,ModuleExport> = new Map();
/** ArrayBuffer instance reference. */
arrayBufferInstance: Class | null = null;
/** Array prototype reference. */
arrayPrototype: ClassPrototype | null = null;
/** String instance reference. */
@ -351,6 +353,8 @@ export class Program extends DiagnosticEmitter {
gcMarkInstance: Function | null = null;
/** Size of a managed object header. */
gcHeaderSize: u32 = 0;
/** Offset of the GC hook. */
gcHookOffset: u32 = 0;
/** Currently processing filespace. */
currentFilespace: Filespace;
@ -603,6 +607,13 @@ export class Program extends DiagnosticEmitter {
}
}
// register 'ArrayBuffer'
if (this.elementsLookup.has("ArrayBuffer")) {
let element = assert(this.elementsLookup.get("ArrayBuffer"));
assert(element.kind == ElementKind.CLASS_PROTOTYPE);
this.arrayBufferInstance = resolver.resolveClass(<ClassPrototype>element, null);
}
// register 'Array'
if (this.elementsLookup.has("Array")) {
let element = assert(this.elementsLookup.get("Array"));
@ -708,7 +719,9 @@ export class Program extends DiagnosticEmitter {
this.gcAllocateInstance = gcAllocateInstance;
this.gcLinkInstance = gcLinkInstance;
this.gcMarkInstance = gcMarkInstance;
this.gcHeaderSize = (2 * options.usizeType.byteSize + 4 + 7) & ~7; // TODO: hardcoded atm
let gcHookOffset = 2 * options.usizeType.byteSize; // .next + .prev
this.gcHookOffset = gcHookOffset;
this.gcHeaderSize = (gcHookOffset + 4 + 7) & ~7; // + .hook index + alignment
this.hasGC = true;
}
}
@ -2911,6 +2924,14 @@ export class Class extends Element {
return null;
}
offsetof(fieldName: string): u32 {
var members = assert(this.members);
assert(members.has(fieldName));
var field = <Element>members.get(fieldName);
assert(field.kind == ElementKind.FIELD);
return (<Field>field).memoryOffset;
}
toString(): string {
return this.simpleName;
}

View File

@ -15,11 +15,10 @@ var offset: usize = startOffset;
// Memory allocator interface
@global export function __memory_allocate(size: usize): usize {
if (size) {
if (size > MAX_SIZE_32) unreachable();
let ptr = offset;
let newPtr = (ptr + size + AL_MASK) & ~AL_MASK;
let pagesBefore = memory.size();
var ptr = offset;
var newPtr = (ptr + max<usize>(size, 1) + AL_MASK) & ~AL_MASK;
var pagesBefore = memory.size();
if (newPtr > <usize>pagesBefore << 16) {
let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16;
let pagesWanted = max(pagesBefore, pagesNeeded); // double memory
@ -31,8 +30,6 @@ var offset: usize = startOffset;
}
offset = newPtr;
return ptr;
}
return 0;
}
@global export function __memory_free(ptr: usize): void { /* nop */ }

View File

@ -458,13 +458,12 @@ var ROOT: Root = changetype<Root>(0);
}
// search for a suitable block
var data: usize = 0;
if (size) {
if (size > Block.MAX_SIZE) unreachable();
// 32-bit MAX_SIZE is 1 << 30 and itself aligned, hence the following can't overflow MAX_SIZE
size = max<usize>((size + AL_MASK) & ~AL_MASK, Block.MIN_SIZE);
let block = root.search(size);
var block = root.search(size);
if (!block) {
// request more memory
@ -482,10 +481,7 @@ var ROOT: Root = changetype<Root>(0);
}
assert((block.info & ~TAGS) >= size);
data = root.use(<Block>block, size);
}
return data;
return root.use(<Block>block, size);
}
/** Frees the chunk of memory at the specified address. */

View File

@ -334,8 +334,9 @@ export class Array<T> {
}
private __gc(): void {
var buffer = this.buffer_;
__gc_mark(changetype<usize>(buffer)); // tslint:disable-line
if (isManaged<T>()) {
let buffer = this.buffer_;
let offset: usize = 0;
let end = <usize>this.length_ << alignof<usize>();
while (offset < end) {

View File

@ -153,6 +153,13 @@ function step(): void {
if (TRACE) trace("gc~step/MARK iterate", 1, objToRef(obj));
iter = obj;
obj.color = <i32>!white;
// if (TRACE) {
// trace(" next/prev/hook", 3,
// changetype<usize>(obj.next),
// changetype<usize>(obj.prev),
// changetype<u32>(obj.hookFn)
// );
// }
obj.hookFn(objToRef(obj));
} else {
if (TRACE) trace("gc~step/MARK finish");

View File

@ -166,8 +166,10 @@ export class Map<K,V> {
}
private __gc(): void {
__gc_mark(changetype<usize>(this.buckets)); // tslint:disable-line
var entries = this.entries;
__gc_mark(changetype<usize>(entries)); // tslint:disable-line
if (isManaged<K>() || isManaged<V>()) {
let entries = this.entries;
let offset: usize = 0;
let end: usize = this.entriesOffset * ENTRY_SIZE<K,V>();
while (offset < end) {

View File

@ -154,8 +154,10 @@ export class Set<K> {
}
private __gc(): void {
__gc_mark(changetype<usize>(this.buckets)); // tslint:disable-line
var entries = this.entries;
__gc_mark(changetype<usize>(entries)); // tslint:disable-line
if (isManaged<K>()) {
let entries = this.entries;
let offset: usize = 0;
let end: usize = this.entriesOffset * ENTRY_SIZE<K>();
while (offset < end) {

View File

@ -16,7 +16,7 @@
(elem (i32.const 0) $start~anonymous|0)
(memory $0 1)
(data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s")
(data (i32.const 36) "\01\00\00\001")
(data (i32.const 40) "\01\00\00\001")
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $builtins/test))

View File

@ -43,12 +43,12 @@
(global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991))
(global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991))
(global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16))
(global $HEAP_BASE i32 (i32.const 44))
(global $HEAP_BASE i32 (i32.const 48))
(table 1 1 anyfunc)
(elem (i32.const 0) $start~anonymous|0)
(memory $0 1)
(data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00")
(data (i32.const 36) "\01\00\00\001\00")
(data (i32.const 40) "\01\00\00\001\00")
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $builtins/test))

View File

@ -62,9 +62,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -74,14 +71,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -89,7 +93,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -99,13 +103,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -116,8 +120,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -126,7 +130,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -135,15 +139,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 4 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/allocator/arena/__memory_allocate
(get_local $0)

View File

@ -76,9 +76,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -89,13 +86,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -104,24 +112,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -134,16 +142,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -151,14 +159,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -168,15 +176,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/allocator/arena/__memory_allocate

View File

@ -10,16 +10,13 @@
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\0b\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d")
(data (i32.const 36) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s")
(data (i32.const 40) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/allocator/arena/__memory_allocate (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -29,14 +26,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -44,7 +48,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -54,13 +58,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -71,8 +75,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -81,7 +85,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -90,15 +94,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/allocator/arena/__memory_allocate
(get_local $0)
@ -236,7 +235,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 9)
(i32.const 2)
)
@ -255,7 +254,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 10)
(i32.const 2)
)
@ -274,7 +273,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 26)
(i32.const 2)
)
@ -293,7 +292,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 21)
(i32.const 4)
)

View File

@ -13,10 +13,10 @@
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 76))
(global $HEAP_BASE i32 (i32.const 80))
(memory $0 1)
(data (i32.const 8) "\0b\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d\00")
(data (i32.const 36) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00")
(data (i32.const 40) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
@ -26,9 +26,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -39,13 +36,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -54,24 +62,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -84,16 +92,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -101,14 +109,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -118,15 +126,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/allocator/arena/__memory_allocate
@ -275,7 +278,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 9)
(i32.const 2)
)
@ -294,7 +297,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 10)
(i32.const 2)
)
@ -315,7 +318,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 26)
(i32.const 2)
)
@ -336,7 +339,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 21)
(i32.const 4)
)

View File

@ -19,9 +19,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -31,14 +28,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -46,7 +50,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -56,13 +60,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -73,8 +77,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -83,7 +87,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -92,15 +96,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/memory/memset (; 2 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i64)

View File

@ -28,9 +28,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -41,13 +38,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -56,24 +64,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -86,16 +94,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -103,14 +111,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -120,15 +128,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/memory/memset (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)

View File

@ -6,8 +6,8 @@
(type $iiiiii (func (param i32 i32 i32 i32 i32) (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 12) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s")
(data (i32.const 44) "\04\00\00\00n\00u\00l\00l")
(data (i32.const 16) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s")
(data (i32.const 48) "\04\00\00\00n\00u\00l\00l")
(export "memory" (memory $0))
(export "i32ArrayArrayElementAccess" (func $std/array-access/i32ArrayArrayElementAccess))
(export "stringArrayPropertyAccess" (func $std/array-access/stringArrayPropertyAccess))
@ -135,7 +135,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 12)
(i32.const 16)
(i32.const 241)
(i32.const 4)
)
@ -147,7 +147,7 @@
(get_local $1)
)
(set_local $1
(i32.const 44)
(i32.const 48)
)
)
(if

View File

@ -10,11 +10,11 @@
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 56))
(global $HEAP_BASE i32 (i32.const 60))
(memory $0 1)
(data (i32.const 8) "\00\00\00\00")
(data (i32.const 12) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00")
(data (i32.const 44) "\04\00\00\00n\00u\00l\00l\00")
(data (i32.const 16) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00")
(data (i32.const 48) "\04\00\00\00n\00u\00l\00l\00")
(export "memory" (memory $0))
(export "i32ArrayArrayElementAccess" (func $std/array-access/i32ArrayArrayElementAccess))
(export "stringArrayPropertyAccess" (func $std/array-access/stringArrayPropertyAccess))
@ -220,7 +220,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 12)
(i32.const 16)
(i32.const 241)
(i32.const 4)
)
@ -233,7 +233,7 @@
(i32.const 0)
)
(set_local $1
(i32.const 44)
(i32.const 48)
)
)
(set_local $3

View File

@ -7,17 +7,19 @@
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 120))
(global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 128))
(global $std/array-literal/i (mut i32) (i32.const 0))
(global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0))
(global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00\03\00\00\00\03")
(data (i32.const 25) "\01\02")
(data (i32.const 8) "\03")
(data (i32.const 17) "\01\02")
(data (i32.const 24) "\08\00\00\00\03")
(data (i32.const 32) "\14\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s")
(data (i32.const 80) "X\00\00\00\03\00\00\00\0c")
(data (i32.const 100) "\01\00\00\00\02")
(data (i32.const 120) "\80")
(data (i32.const 80) "\0c")
(data (i32.const 92) "\01\00\00\00\02")
(data (i32.const 112) "P\00\00\00\03")
(data (i32.const 128) "x")
(data (i32.const 136) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
@ -97,9 +99,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -109,14 +108,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -124,7 +130,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -134,13 +140,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -151,8 +157,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -161,7 +167,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -170,15 +176,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(if
@ -703,7 +704,7 @@
(if
(i32.ne
(call $~lib/array/Array<i8>#get:length
(i32.const 8)
(i32.const 24)
)
(i32.const 3)
)
@ -720,7 +721,7 @@
(if
(i32.and
(call $~lib/array/Array<i8>#__get
(i32.const 8)
(i32.const 24)
(i32.const 0)
)
(i32.const 255)
@ -739,7 +740,7 @@
(i32.ne
(i32.and
(call $~lib/array/Array<i8>#__get
(i32.const 8)
(i32.const 24)
(i32.const 1)
)
(i32.const 255)
@ -760,7 +761,7 @@
(i32.ne
(i32.and
(call $~lib/array/Array<i8>#__get
(i32.const 8)
(i32.const 24)
(i32.const 2)
)
(i32.const 255)
@ -780,7 +781,7 @@
(if
(i32.ne
(call $~lib/array/Array<i8>#get:length
(i32.const 80)
(i32.const 112)
)
(i32.const 3)
)
@ -796,7 +797,7 @@
)
(if
(call $~lib/array/Array<i32>#__get
(i32.const 80)
(i32.const 112)
(i32.const 0)
)
(block
@ -812,7 +813,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 80)
(i32.const 112)
(i32.const 1)
)
(i32.const 1)
@ -830,7 +831,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 80)
(i32.const 112)
(i32.const 2)
)
(i32.const 2)

View File

@ -11,20 +11,23 @@
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $std/array-literal/staticArrayI8 i32 (i32.const 8))
(global $std/array-literal/staticArrayI8 i32 (i32.const 24))
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
(global $std/array-literal/staticArrayI32 i32 (i32.const 80))
(global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 120))
(global $std/array-literal/staticArrayI32 i32 (i32.const 112))
(global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 128))
(global $std/array-literal/i (mut i32) (i32.const 0))
(global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816))
(global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0))
(global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 228))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00\03\00\00\00\03\00\00\00\00\00\00\00\00\01\02\00\00\00\00\00")
(data (i32.const 8) "\03\00\00\00\00\00\00\00\00\01\02\00\00\00\00\00")
(data (i32.const 24) "\08\00\00\00\03\00\00\00")
(data (i32.const 32) "\14\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00")
(data (i32.const 80) "X\00\00\00\03\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(data (i32.const 120) "\80\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(data (i32.const 80) "\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(data (i32.const 112) "P\00\00\00\03\00\00\00")
(data (i32.const 120) "\00\00\00\00\00\00\00\00")
(data (i32.const 128) "x\00\00\00\00\00\00\00")
(data (i32.const 136) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(export "memory" (memory $0))
@ -125,9 +128,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -138,13 +138,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -153,24 +164,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -183,16 +194,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -200,14 +211,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -217,15 +228,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 7 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,8 @@
(global $std/arraybuffer/sliced (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 52) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 112) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 120) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/arraybuffer/computeSize (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
@ -34,9 +34,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -46,14 +43,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -61,7 +65,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -71,13 +75,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -88,8 +92,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -98,7 +102,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -107,15 +111,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(if
@ -126,7 +125,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 52)
(i32.const 56)
(i32.const 23)
(i32.const 2)
)
@ -2325,7 +2324,7 @@
)
(func $start (; 10 ;) (; has Stack IR ;) (type $v)
(set_global $~lib/allocator/arena/startOffset
(i32.const 152)
(i32.const 160)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
@ -2347,7 +2346,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 5)
(i32.const 0)
)
@ -2374,7 +2373,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 9)
(i32.const 0)
)
@ -2389,7 +2388,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 10)
(i32.const 0)
)
@ -2416,7 +2415,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 14)
(i32.const 0)
)
@ -2443,7 +2442,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 18)
(i32.const 0)
)
@ -2467,7 +2466,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 22)
(i32.const 0)
)
@ -2491,7 +2490,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 26)
(i32.const 0)
)
@ -2515,7 +2514,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 30)
(i32.const 0)
)
@ -2539,7 +2538,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 34)
(i32.const 0)
)
@ -2563,7 +2562,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 38)
(i32.const 0)
)
@ -2577,7 +2576,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 39)
(i32.const 0)
)

View File

@ -16,11 +16,11 @@
(global $std/arraybuffer/buffer (mut i32) (i32.const 0))
(global $~argc (mut i32) (i32.const 0))
(global $std/arraybuffer/sliced (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 152))
(global $HEAP_BASE i32 (i32.const 160))
(memory $0 1)
(data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 52) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 112) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 120) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32)
@ -47,9 +47,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -60,13 +57,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -75,24 +83,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -105,16 +113,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -122,14 +130,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -139,15 +147,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
@ -161,7 +164,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 52)
(i32.const 56)
(i32.const 23)
(i32.const 2)
)
@ -2901,7 +2904,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 5)
(i32.const 0)
)
@ -2932,7 +2935,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 9)
(i32.const 0)
)
@ -2949,7 +2952,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 10)
(i32.const 0)
)
@ -2980,7 +2983,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 14)
(i32.const 0)
)
@ -3011,7 +3014,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 18)
(i32.const 0)
)
@ -3037,7 +3040,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 22)
(i32.const 0)
)
@ -3063,7 +3066,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 26)
(i32.const 0)
)
@ -3089,7 +3092,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 30)
(i32.const 0)
)
@ -3115,7 +3118,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 34)
(i32.const 0)
)
@ -3146,7 +3149,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 38)
(i32.const 0)
)
@ -3163,7 +3166,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 39)
(i32.const 0)
)

View File

@ -21,9 +21,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -33,14 +30,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -48,7 +52,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -58,13 +62,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -75,8 +79,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -85,7 +89,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -94,15 +98,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/allocator/arena/__memory_allocate
(get_local $0)

View File

@ -29,9 +29,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -42,13 +39,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -57,24 +65,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -87,16 +95,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -104,14 +112,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -121,15 +129,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/allocator/arena/__memory_allocate

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
import "allocator/arena";
import "collector/itcm";
class Foo {
}
var arr: Foo[] = [];
gc.collect(); // should do nothing
arr[0] = {};
gc.collect(); // should do nothing
arr[1] = {};
gc.collect(); // should do nothing
arr[0] = {};
gc.collect(); // should collect the old one
export function main(): i32 { return 0; }

File diff suppressed because it is too large Load Diff

View File

@ -18,10 +18,10 @@
(global $std/gc-basics/obj (mut i32) (i32.const 0))
(global $std/gc-basics/obj2 (mut i32) (i32.const 0))
(global $~started (mut i32) (i32.const 0))
(table 2 2 anyfunc)
(elem (i32.const 0) $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark)
(table 3 3 anyfunc)
(elem (i32.const 0) $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc)
(memory $0 1)
(data (i32.const 24) "\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s")
(data (i32.const 16) "\02\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s")
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $std/gc-basics/main))
@ -32,9 +32,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -44,14 +41,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -59,7 +63,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -69,13 +73,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -86,8 +90,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -96,7 +100,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -105,15 +109,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/collector/itcm/ManagedObjectList#clear (; 3 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
(i32.store
(get_local $0)
@ -469,7 +468,18 @@
(i32.const 16)
)
)
(func $~lib/collector/itcm/__gc_collect (; 14 ;) (; has Stack IR ;) (type $v)
(func $~lib/string/String~gc (; 14 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
(if
(i32.eqz
(get_local $0)
)
(return)
)
(call $~lib/collector/itcm/__gc_mark
(get_local $0)
)
)
(func $~lib/collector/itcm/__gc_collect (; 15 ;) (; has Stack IR ;) (type $v)
(local $0 i32)
(block $break|0
(block $case1|0
@ -503,10 +513,10 @@
)
)
)
(func $~lib/gc/gc.collect (; 15 ;) (; has Stack IR ;) (type $v)
(func $~lib/gc/gc.collect (; 16 ;) (; has Stack IR ;) (type $v)
(call $~lib/collector/itcm/__gc_collect)
)
(func $std/gc-basics/main (; 16 ;) (; has Stack IR ;) (type $i) (result i32)
(func $std/gc-basics/main (; 17 ;) (; has Stack IR ;) (type $i) (result i32)
(if
(i32.eqz
(get_global $~started)
@ -520,7 +530,7 @@
)
(i32.const 0)
)
(func $start (; 17 ;) (; has Stack IR ;) (type $v)
(func $start (; 18 ;) (; has Stack IR ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
@ -605,7 +615,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 24)
(i32.const 21)
(i32.const 2)
)
@ -619,7 +629,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 24)
(i32.const 23)
(i32.const 2)
)
@ -636,7 +646,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 24)
(i32.const 25)
(i32.const 2)
)
@ -649,7 +659,7 @@
)
(call $~lib/gc/gc.collect)
)
(func $~iterateRoots (; 18 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
(func $~iterateRoots (; 19 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
(call_indirect (type $iv)
(get_global $std/gc-basics/obj)
(get_local $0)

View File

@ -29,10 +29,10 @@
(global $std/gc-basics/obj2 (mut i32) (i32.const 0))
(global $~started (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 60))
(table 2 2 anyfunc)
(elem (i32.const 0) $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark)
(table 3 3 anyfunc)
(elem (i32.const 0) $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc)
(memory $0 1)
(data (i32.const 8) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s\00")
(data (i32.const 8) "\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s\00")
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $std/gc-basics/main))
@ -46,9 +46,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -59,13 +56,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -74,24 +82,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -104,16 +112,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -121,14 +129,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -138,15 +146,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/collector/itcm/ManagedObjectList#clear (; 3 ;) (type $iv) (param $0 i32)
(i32.store
(get_local $0)
@ -583,7 +586,18 @@
)
)
)
(func $~lib/collector/itcm/__gc_collect (; 15 ;) (type $v)
(func $~lib/string/String~gc (; 15 ;) (type $iv) (param $0 i32)
(if
(i32.eqz
(get_local $0)
)
(return)
)
(call $~lib/collector/itcm/__gc_mark
(get_local $0)
)
)
(func $~lib/collector/itcm/__gc_collect (; 16 ;) (type $v)
(local $0 i32)
(block $break|0
(block $case1|0
@ -623,11 +637,11 @@
)
)
)
(func $~lib/gc/gc.collect (; 16 ;) (type $v)
(func $~lib/gc/gc.collect (; 17 ;) (type $v)
(call $~lib/collector/itcm/__gc_collect)
(return)
)
(func $std/gc-basics/main (; 17 ;) (type $i) (result i32)
(func $std/gc-basics/main (; 18 ;) (type $i) (result i32)
(if
(i32.eqz
(get_global $~started)
@ -641,7 +655,7 @@
)
(i32.const 0)
)
(func $start (; 18 ;) (type $v)
(func $start (; 19 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
@ -749,7 +763,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 24)
(i32.const 21)
(i32.const 2)
)
@ -771,7 +785,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 24)
(i32.const 23)
(i32.const 2)
)
@ -793,7 +807,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 24)
(i32.const 25)
(i32.const 2)
)
@ -807,7 +821,7 @@
)
(call $~lib/gc/gc.collect)
)
(func $~iterateRoots (; 19 ;) (type $iv) (param $0 i32)
(func $~iterateRoots (; 20 ;) (type $iv) (param $0 i32)
(call_indirect (type $iv)
(get_global $std/gc-basics/obj)
(get_local $0)

View File

@ -24,9 +24,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -36,14 +33,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -51,7 +55,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -61,13 +65,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -78,8 +82,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -88,7 +92,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -97,15 +101,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/collector/itcm/ManagedObjectList#clear (; 1 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
(i32.store
(get_local $0)

View File

@ -38,9 +38,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -51,13 +48,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -66,24 +74,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -96,16 +104,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -113,14 +121,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -130,15 +138,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/collector/itcm/ManagedObjectList#clear (; 1 ;) (type $iv) (param $0 i32)
(i32.store
(get_local $0)

View File

@ -3,9 +3,9 @@
(type $Ii (func (param i64) (result i32)))
(type $v (func))
(memory $0 1)
(data (i32.const 12) "\01\00\00\00a")
(data (i32.const 20) "\02\00\00\00a\00b")
(data (i32.const 28) "\03\00\00\00a\00b\00c")
(data (i32.const 16) "\01\00\00\00a")
(data (i32.const 24) "\02\00\00\00a\00b")
(data (i32.const 32) "\03\00\00\00a\00b\00c")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/hash/hashStr (; 0 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
@ -221,21 +221,21 @@
(drop
(call $std/hash/check
(call $~lib/internal/hash/hashStr
(i32.const 12)
(i32.const 16)
)
)
)
(drop
(call $std/hash/check
(call $~lib/internal/hash/hashStr
(i32.const 20)
(i32.const 24)
)
)
)
(drop
(call $std/hash/check
(call $~lib/internal/hash/hashStr
(i32.const 28)
(i32.const 32)
)
)
)

View File

@ -12,12 +12,12 @@
(global $~lib/internal/hash/FNV_PRIME i32 (i32.const 16777619))
(global $Infinity f64 (f64.const inf))
(global $NaN f64 (f64.const nan:0x8000000000000))
(global $HEAP_BASE i32 (i32.const 40))
(global $HEAP_BASE i32 (i32.const 44))
(memory $0 1)
(data (i32.const 8) "\00\00\00\00")
(data (i32.const 12) "\01\00\00\00a\00")
(data (i32.const 20) "\02\00\00\00a\00b\00")
(data (i32.const 28) "\03\00\00\00a\00b\00c\00")
(data (i32.const 16) "\01\00\00\00a\00")
(data (i32.const 24) "\02\00\00\00a\00b\00")
(data (i32.const 32) "\03\00\00\00a\00b\00c\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/hash/hashStr (; 0 ;) (type $ii) (param $0 i32) (result i32)
@ -305,7 +305,7 @@
(call $std/hash/check
(block $~lib/internal/hash/hash<String>|inlined.2 (result i32)
(set_local $0
(i32.const 12)
(i32.const 16)
)
(br $~lib/internal/hash/hash<String>|inlined.2
(call $~lib/internal/hash/hashStr
@ -319,7 +319,7 @@
(call $std/hash/check
(block $~lib/internal/hash/hash<String>|inlined.3 (result i32)
(set_local $0
(i32.const 20)
(i32.const 24)
)
(br $~lib/internal/hash/hash<String>|inlined.3
(call $~lib/internal/hash/hashStr
@ -333,7 +333,7 @@
(call $std/hash/check
(block $~lib/internal/hash/hash<String>|inlined.4 (result i32)
(set_local $0
(i32.const 28)
(i32.const 32)
)
(br $~lib/internal/hash/hash<String>|inlined.4
(call $~lib/internal/hash/hashStr

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@
(global $~lib/math/random_state1 (mut i64) (i64.const 0))
(memory $0 1)
(data (i32.const 8) "\0b\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s")
(data (i32.const 36) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s")
(data (i32.const 40) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/builtins/isNaN<f64> (; 30 ;) (; has Stack IR ;) (type $Fi) (param $0 f64) (result i32)
@ -11996,7 +11996,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 1000)
(i32.const 4)
)
@ -12027,7 +12027,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 1007)
(i32.const 24)
)

View File

@ -85,10 +85,10 @@
(global $~lib/math/random_state1 (mut i64) (i64.const 0))
(global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16))
(global $~lib/builtins/f32.EPSILON f32 (f32.const 1.1920928955078125e-07))
(global $HEAP_BASE i32 (i32.const 64))
(global $HEAP_BASE i32 (i32.const 68))
(memory $0 1)
(data (i32.const 8) "\0b\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s\00")
(data (i32.const 36) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00")
(data (i32.const 40) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/builtins/isNaN<f64> (; 30 ;) (type $Fi) (param $0 f64) (result i32)
@ -13786,7 +13786,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 1000)
(i32.const 4)
)
@ -13818,7 +13818,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 36)
(i32.const 40)
(i32.const 1007)
(i32.const 24)
)

View File

@ -12,9 +12,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -24,14 +21,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -39,7 +43,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -49,13 +53,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -66,8 +70,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -76,7 +80,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -85,15 +89,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/allocator/arena/__memory_allocate
(get_local $0)

View File

@ -20,9 +20,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -33,13 +30,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -48,24 +56,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -78,16 +86,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -95,14 +103,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -112,15 +120,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/allocator/arena/__memory_allocate

View File

@ -82,9 +82,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -94,14 +91,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -109,7 +113,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -119,13 +123,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -136,8 +140,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -146,7 +150,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -155,15 +159,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/allocator/arena/__memory_allocate
(get_local $0)

View File

@ -92,9 +92,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -105,13 +102,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -120,24 +128,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -150,16 +158,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -167,14 +175,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -184,15 +192,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/allocator/arena/__memory_allocate

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,15 +14,19 @@
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00\02\00\00\00\08\00\00\00\00\00\00\00\01\00\00\00\02")
(data (i32.const 32) "(\00\00\00\02\00\00\00\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04")
(data (i32.const 72) "P\00\00\00\02\00\00\00\08")
(data (i32.const 90) "\c0?\00\00 @")
(data (i32.const 96) "h\00\00\00\02\00\00\00\10")
(data (i32.const 118) "\f4?\00\00\00\00\00\00\02@")
(data (i32.const 8) "\08\00\00\00\00\00\00\00\01\00\00\00\02")
(data (i32.const 24) "\08\00\00\00\02")
(data (i32.const 32) "\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04")
(data (i32.const 64) " \00\00\00\02")
(data (i32.const 72) "\08")
(data (i32.const 82) "\c0?\00\00 @")
(data (i32.const 88) "H\00\00\00\02")
(data (i32.const 96) "\10")
(data (i32.const 110) "\f4?\00\00\00\00\00\00\02@")
(data (i32.const 128) "`\00\00\00\02")
(data (i32.const 136) "\13\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 180) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 212) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 184) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 216) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/array/Array<i32>#get:length (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
@ -407,9 +411,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -419,14 +420,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -434,7 +442,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -444,13 +452,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -461,8 +469,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -471,7 +479,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -480,15 +488,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(if
@ -499,7 +502,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 23)
(i32.const 2)
)
@ -2217,7 +2220,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 37)
(i32.const 4)
)
@ -2304,7 +2307,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 61)
(i32.const 4)
)
@ -2346,7 +2349,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2440,7 +2443,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2534,7 +2537,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2628,7 +2631,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2671,7 +2674,7 @@
)
(func $start (; 17 ;) (; has Stack IR ;) (type $v)
(set_global $~lib/allocator/arena/startOffset
(i32.const 272)
(i32.const 280)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
@ -2679,7 +2682,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 8)
(i32.const 24)
)
(i32.const 2)
)
@ -2696,7 +2699,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 8)
(i32.const 24)
(i32.const 0)
)
(i32.const 1)
@ -2714,7 +2717,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 8)
(i32.const 24)
(i32.const 1)
)
(i32.const 2)
@ -2730,14 +2733,14 @@
)
)
(call $~lib/array/Array<i32>#__set
(i32.const 8)
(i32.const 24)
(i32.const 0)
(i32.const 2)
)
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 8)
(i32.const 24)
(i32.const 0)
)
(i32.const 2)
@ -2755,7 +2758,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 32)
(i32.const 64)
)
(i32.const 2)
)
@ -2772,7 +2775,7 @@
(if
(i64.ne
(call $~lib/array/Array<i64>#__get
(i32.const 32)
(i32.const 64)
(i32.const 0)
)
(i64.const 3)
@ -2790,7 +2793,7 @@
(if
(i64.ne
(call $~lib/array/Array<i64>#__get
(i32.const 32)
(i32.const 64)
(i32.const 1)
)
(i64.const 4)
@ -2806,14 +2809,14 @@
)
)
(call $~lib/array/Array<i64>#__set
(i32.const 32)
(i32.const 64)
(i32.const 0)
(i64.const 4)
)
(if
(i64.ne
(call $~lib/array/Array<i64>#__get
(i32.const 32)
(i32.const 64)
(i32.const 0)
)
(i64.const 4)
@ -2831,7 +2834,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 72)
(i32.const 88)
)
(i32.const 2)
)
@ -2848,7 +2851,7 @@
(if
(f32.ne
(call $~lib/array/Array<f32>#__get
(i32.const 72)
(i32.const 88)
(i32.const 0)
)
(f32.const 1.5)
@ -2866,7 +2869,7 @@
(if
(f32.ne
(call $~lib/array/Array<f32>#__get
(i32.const 72)
(i32.const 88)
(i32.const 1)
)
(f32.const 2.5)
@ -2882,14 +2885,14 @@
)
)
(call $~lib/array/Array<f32>#__set
(i32.const 72)
(i32.const 88)
(i32.const 0)
(f32.const 2.5)
)
(if
(f32.ne
(call $~lib/array/Array<f32>#__get
(i32.const 72)
(i32.const 88)
(i32.const 0)
)
(f32.const 2.5)
@ -2907,7 +2910,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 96)
(i32.const 128)
)
(i32.const 2)
)
@ -2924,7 +2927,7 @@
(if
(f64.ne
(call $~lib/array/Array<f64>#__get
(i32.const 96)
(i32.const 128)
(i32.const 0)
)
(f64.const 1.25)
@ -2942,7 +2945,7 @@
(if
(f64.ne
(call $~lib/array/Array<f64>#__get
(i32.const 96)
(i32.const 128)
(i32.const 1)
)
(f64.const 2.25)
@ -2958,14 +2961,14 @@
)
)
(call $~lib/array/Array<f64>#__set
(i32.const 96)
(i32.const 128)
(i32.const 0)
(f64.const 2.25)
)
(if
(f64.ne
(call $~lib/array/Array<f64>#__get
(i32.const 96)
(i32.const 128)
(i32.const 0)
)
(f64.const 2.25)

View File

@ -17,21 +17,25 @@
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $std/static-array/i i32 (i32.const 8))
(global $std/static-array/I i32 (i32.const 32))
(global $std/static-array/f i32 (i32.const 72))
(global $std/static-array/F i32 (i32.const 96))
(global $std/static-array/i i32 (i32.const 24))
(global $std/static-array/I i32 (i32.const 64))
(global $std/static-array/f i32 (i32.const 88))
(global $std/static-array/F i32 (i32.const 128))
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
(global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816))
(global $HEAP_BASE i32 (i32.const 272))
(global $HEAP_BASE i32 (i32.const 276))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00\02\00\00\00\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00")
(data (i32.const 32) "(\00\00\00\02\00\00\00\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(data (i32.const 72) "P\00\00\00\02\00\00\00\08\00\00\00\00\00\00\00\00\00\c0?\00\00 @")
(data (i32.const 96) "h\00\00\00\02\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\00\00\f4?\00\00\00\00\00\00\02@\00\00\00\00\00\00\00\00")
(data (i32.const 8) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00")
(data (i32.const 24) "\08\00\00\00\02\00\00\00")
(data (i32.const 32) "\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(data (i32.const 64) " \00\00\00\02\00\00\00")
(data (i32.const 72) "\08\00\00\00\00\00\00\00\00\00\c0?\00\00 @")
(data (i32.const 88) "H\00\00\00\02\00\00\00")
(data (i32.const 96) "\10\00\00\00\00\00\00\00\00\00\00\00\00\00\f4?\00\00\00\00\00\00\02@\00\00\00\00\00\00\00\00")
(data (i32.const 128) "`\00\00\00\02\00\00\00")
(data (i32.const 136) "\13\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 180) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 212) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 184) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 216) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/array/Array<i32>#get:length (; 1 ;) (type $ii) (param $0 i32) (result i32)
@ -446,9 +450,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -459,13 +460,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -474,24 +486,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -504,16 +516,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -521,14 +533,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -538,15 +550,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
@ -560,7 +567,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 23)
(i32.const 2)
)
@ -2734,7 +2741,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 37)
(i32.const 4)
)
@ -2854,7 +2861,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 61)
(i32.const 4)
)
@ -2900,7 +2907,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -3011,7 +3018,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -3122,7 +3129,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -3233,7 +3240,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)

View File

@ -164,9 +164,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -176,14 +173,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -191,7 +195,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -201,13 +205,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -218,8 +222,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -228,7 +232,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -237,15 +241,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/string/String#toUTF8 (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)

View File

@ -184,9 +184,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -197,13 +194,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -212,24 +220,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -242,16 +250,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -259,14 +267,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -276,15 +284,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/string/String#toUTF8 (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,9 +24,9 @@
(global $std/symbol/key4 (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\03\00\00\001\002\003")
(data (i32.const 20) "\0d\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s")
(data (i32.const 52) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 96) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 24) "\0d\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s")
(data (i32.const 56) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 104) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/symbol/Symbol (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
@ -50,9 +50,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -62,14 +59,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -77,7 +81,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -87,13 +91,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -104,8 +108,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -114,7 +118,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -123,15 +127,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/allocator/arena/__memory_allocate
(get_local $0)
@ -161,7 +160,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 96)
(i32.const 104)
(i32.const 23)
(i32.const 2)
)
@ -520,7 +519,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 52)
(i32.const 56)
(i32.const 13)
(i32.const 40)
)
@ -1711,7 +1710,7 @@
)
(func $start (; 26 ;) (; has Stack IR ;) (type $v)
(set_global $~lib/allocator/arena/startOffset
(i32.const 160)
(i32.const 168)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
@ -1734,7 +1733,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 6)
(i32.const 0)
)
@ -1759,7 +1758,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 11)
(i32.const 0)
)
@ -1781,7 +1780,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 16)
(i32.const 0)
)
@ -1793,7 +1792,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 17)
(i32.const 0)
)
@ -1820,7 +1819,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 22)
(i32.const 0)
)
@ -1837,7 +1836,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 23)
(i32.const 0)
)

View File

@ -38,12 +38,12 @@
(global $std/symbol/key4 (mut i32) (i32.const 0))
(global $~lib/symbol/Symbol.hasInstance i32 (i32.const 1))
(global $~lib/symbol/Symbol.concatSpreadable i32 (i32.const 2))
(global $HEAP_BASE i32 (i32.const 156))
(global $HEAP_BASE i32 (i32.const 164))
(memory $0 1)
(data (i32.const 8) "\03\00\00\001\002\003\00")
(data (i32.const 20) "\0d\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s\00")
(data (i32.const 52) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 96) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 24) "\0d\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s\00")
(data (i32.const 56) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 104) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/symbol/Symbol (; 1 ;) (type $ii) (param $0 i32) (result i32)
@ -78,9 +78,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -91,13 +88,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -106,24 +114,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -136,16 +144,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -153,14 +161,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -170,15 +178,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/allocator/arena/__memory_allocate
@ -216,7 +219,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 96)
(i32.const 104)
(i32.const 23)
(i32.const 2)
)
@ -607,7 +610,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 52)
(i32.const 56)
(i32.const 13)
(i32.const 40)
)
@ -2088,7 +2091,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 6)
(i32.const 0)
)
@ -2115,7 +2118,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 11)
(i32.const 0)
)
@ -2142,7 +2145,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 16)
(i32.const 0)
)
@ -2159,7 +2162,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 17)
(i32.const 0)
)
@ -2186,7 +2189,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 22)
(i32.const 0)
)
@ -2203,7 +2206,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 20)
(i32.const 24)
(i32.const 23)
(i32.const 0)
)

View File

@ -7,11 +7,11 @@
(data (i32.const 8) "\0d\00\00\00z\00e\00r\00o\00_\00i\00m\00p\00l\00i\00c\00i\00t")
(data (i32.const 40) "\0d\00\00\00z\00e\00r\00o\00_\00e\00x\00p\00l\00i\00c\00i\00t")
(data (i32.const 72) "\07\00\00\00o\00n\00e\00_\00i\00n\00t")
(data (i32.const 92) "\07\00\00\00t\00w\00o\00_\00i\00n\00t")
(data (i32.const 112) "\t\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t")
(data (i32.const 136) "\08\00\00\00f\00o\00u\00r\00_\00i\00n\00t")
(data (i32.const 156) "\08\00\00\00f\00i\00v\00e\00_\00i\00n\00t")
(data (i32.const 176) "\08\00\00\00f\00i\00v\00e\00_\00d\00b\00l")
(data (i32.const 96) "\07\00\00\00t\00w\00o\00_\00i\00n\00t")
(data (i32.const 120) "\t\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t")
(data (i32.const 144) "\08\00\00\00f\00o\00u\00r\00_\00i\00n\00t")
(data (i32.const 168) "\08\00\00\00f\00i\00v\00e\00_\00i\00n\00t")
(data (i32.const 192) "\08\00\00\00f\00i\00v\00e\00_\00d\00b\00l")
(export "memory" (memory $0))
(export "main" (func $std/trace/main))
(func $std/trace/main (; 1 ;) (; has Stack IR ;) (type $v)
@ -56,7 +56,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 92)
(i32.const 96)
(i32.const 2)
(f64.const 1)
(f64.const 2)
@ -65,7 +65,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 112)
(i32.const 120)
(i32.const 3)
(f64.const 1)
(f64.const 2)
@ -74,7 +74,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 136)
(i32.const 144)
(i32.const 4)
(f64.const 1)
(f64.const 2)
@ -83,7 +83,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 156)
(i32.const 168)
(i32.const 5)
(f64.const 1)
(f64.const 2)
@ -92,7 +92,7 @@
(f64.const 5)
)
(call $~lib/env/trace
(i32.const 176)
(i32.const 192)
(i32.const 5)
(f64.const 1.1)
(f64.const 2.2)

View File

@ -3,16 +3,16 @@
(type $v (func))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(global $~started (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 196))
(global $HEAP_BASE i32 (i32.const 212))
(memory $0 1)
(data (i32.const 8) "\0d\00\00\00z\00e\00r\00o\00_\00i\00m\00p\00l\00i\00c\00i\00t\00")
(data (i32.const 40) "\0d\00\00\00z\00e\00r\00o\00_\00e\00x\00p\00l\00i\00c\00i\00t\00")
(data (i32.const 72) "\07\00\00\00o\00n\00e\00_\00i\00n\00t\00")
(data (i32.const 92) "\07\00\00\00t\00w\00o\00_\00i\00n\00t\00")
(data (i32.const 112) "\t\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t\00")
(data (i32.const 136) "\08\00\00\00f\00o\00u\00r\00_\00i\00n\00t\00")
(data (i32.const 156) "\08\00\00\00f\00i\00v\00e\00_\00i\00n\00t\00")
(data (i32.const 176) "\08\00\00\00f\00i\00v\00e\00_\00d\00b\00l\00")
(data (i32.const 96) "\07\00\00\00t\00w\00o\00_\00i\00n\00t\00")
(data (i32.const 120) "\t\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t\00")
(data (i32.const 144) "\08\00\00\00f\00o\00u\00r\00_\00i\00n\00t\00")
(data (i32.const 168) "\08\00\00\00f\00i\00v\00e\00_\00i\00n\00t\00")
(data (i32.const 192) "\08\00\00\00f\00i\00v\00e\00_\00d\00b\00l\00")
(export "memory" (memory $0))
(export "main" (func $std/trace/main))
(func $std/trace/main (; 1 ;) (type $v)
@ -57,7 +57,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 92)
(i32.const 96)
(i32.const 2)
(f64.const 1)
(f64.const 2)
@ -66,7 +66,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 112)
(i32.const 120)
(i32.const 3)
(f64.const 1)
(f64.const 2)
@ -75,7 +75,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 136)
(i32.const 144)
(i32.const 4)
(f64.const 1)
(f64.const 2)
@ -84,7 +84,7 @@
(f64.const 0)
)
(call $~lib/env/trace
(i32.const 156)
(i32.const 168)
(i32.const 5)
(f64.const 1)
(f64.const 2)
@ -93,7 +93,7 @@
(f64.const 5)
)
(call $~lib/env/trace
(i32.const 176)
(i32.const 192)
(i32.const 5)
(f64.const 1.1)
(f64.const 2.2)

View File

@ -14,7 +14,7 @@
(memory $0 1)
(data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 108) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 112) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/arraybuffer/computeSize (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
@ -35,9 +35,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -47,14 +44,21 @@
)
(if
(i32.gt_u
(tee_local $0
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
@ -62,7 +66,7 @@
)
)
(i32.shl
(tee_local $2
(tee_local $3
(current_memory)
)
(i32.const 16)
@ -72,13 +76,13 @@
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $2)
(get_local $1)
)
(i32.const 65535)
@ -89,8 +93,8 @@
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
(get_local $0)
)
)
)
@ -99,7 +103,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $3)
(get_local $0)
)
(i32.const 0)
)
@ -108,15 +112,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
(get_local $2)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(if
@ -127,7 +126,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 108)
(i32.const 112)
(i32.const 23)
(i32.const 2)
)
@ -1753,7 +1752,7 @@
(func $start (; 17 ;) (; has Stack IR ;) (type $v)
(local $0 i32)
(set_global $~lib/allocator/arena/startOffset
(i32.const 168)
(i32.const 176)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)

View File

@ -29,11 +29,11 @@
(global $std/typedarray/arr (mut i32) (i32.const 0))
(global $std/typedarray/clampedArr (mut i32) (i32.const 0))
(global $std/typedarray/MAX_F64LENGTH i32 (i32.const 134217727))
(global $HEAP_BASE i32 (i32.const 168))
(global $HEAP_BASE i32 (i32.const 172))
(memory $0 1)
(data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 108) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 112) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32)
@ -60,9 +60,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(if
(get_local $0)
(block
(if
(i32.gt_u
(get_local $0)
@ -73,13 +70,24 @@
(set_local $1
(get_global $~lib/allocator/arena/offset)
)
(set_local $2
(set_local $4
(i32.and
(i32.add
(i32.add
(get_local $1)
(select
(tee_local $2
(get_local $0)
)
(tee_local $3
(i32.const 1)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(get_global $~lib/internal/allocator/AL_MASK)
)
(i32.xor
@ -88,24 +96,24 @@
)
)
)
(set_local $3
(set_local $5
(current_memory)
)
(if
(i32.gt_u
(get_local $2)
(get_local $4)
(i32.shl
(get_local $3)
(get_local $5)
(i32.const 16)
)
)
(block
(set_local $4
(set_local $2
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $4)
(get_local $1)
)
(i32.const 65535)
@ -118,16 +126,16 @@
(i32.const 16)
)
)
(set_local $5
(set_local $3
(select
(tee_local $5
(get_local $3)
(tee_local $3
(get_local $5)
)
(tee_local $6
(get_local $4)
(get_local $2)
)
(i32.gt_s
(get_local $5)
(get_local $3)
(get_local $6)
)
)
@ -135,14 +143,14 @@
(if
(i32.lt_s
(grow_memory
(get_local $5)
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $4)
(get_local $2)
)
(i32.const 0)
)
@ -152,15 +160,10 @@
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
(get_local $4)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
@ -174,7 +177,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 108)
(i32.const 112)
(i32.const 23)
(i32.const 2)
)