mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-09 13:01:26 +00:00
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:
parent
61de7cf962
commit
631478c7c9
2
dist/asc.js
vendored
2
dist/asc.js
vendored
File diff suppressed because one or more lines are too long
2
dist/asc.js.map
vendored
2
dist/asc.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/assemblyscript.js
vendored
2
dist/assemblyscript.js
vendored
File diff suppressed because one or more lines are too long
2
dist/assemblyscript.js.map
vendored
2
dist/assemblyscript.js.map
vendored
File diff suppressed because one or more lines are too long
218
src/compiler.ts
218
src/compiler.ts
@ -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 {
|
||||
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 {
|
||||
stringOffset = stringSegment.offset;
|
||||
buf = new Uint8Array(totalSize);
|
||||
pos = 0;
|
||||
}
|
||||
} else {
|
||||
stringSegment = <MemorySegment>stringSegments.get(stringValue);
|
||||
stringOffset = stringSegment.offset;
|
||||
writeI32(length, buf, pos + stringInstance.offsetof("length"));
|
||||
pos += headerSize;
|
||||
for (let i = 0; i < length; ++i) {
|
||||
writeI16(stringValue.charCodeAt(i), buf, pos + (i << 1));
|
||||
}
|
||||
stringSegment = this.addMemorySegment(buf);
|
||||
segments.set(stringValue, stringSegment);
|
||||
}
|
||||
if (program.typesLookup.has("string")) {
|
||||
let stringType = <Type>program.typesLookup.get("string");
|
||||
this.currentType = stringType;
|
||||
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 {
|
||||
this.currentType = options.usizeType;
|
||||
}
|
||||
if (options.isWasm64) {
|
||||
return 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();
|
||||
}
|
||||
this.currentType = arrayInstance.type;
|
||||
// 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 {
|
||||
this.currentType = this.options.usizeType;
|
||||
buf = new Uint8Array(arrayHeaderSize);
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
// 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));
|
||||
var arraySegment = this.addMemorySegment(buf);
|
||||
var arrayOffset = arraySegment.offset;
|
||||
if (hasGC) arrayOffset = i64_add(arrayOffset, i64_new(gcHeaderSize));
|
||||
this.currentType = arrayInstance.type;
|
||||
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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -15,24 +15,21 @@ 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();
|
||||
if (newPtr > <usize>pagesBefore << 16) {
|
||||
let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16;
|
||||
let pagesWanted = max(pagesBefore, pagesNeeded); // double memory
|
||||
if (memory.grow(pagesWanted) < 0) {
|
||||
if (memory.grow(pagesNeeded) < 0) {
|
||||
unreachable(); // out of memory
|
||||
}
|
||||
if (size > MAX_SIZE_32) unreachable();
|
||||
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
|
||||
if (memory.grow(pagesWanted) < 0) {
|
||||
if (memory.grow(pagesNeeded) < 0) {
|
||||
unreachable(); // out of memory
|
||||
}
|
||||
}
|
||||
offset = newPtr;
|
||||
return ptr;
|
||||
}
|
||||
return 0;
|
||||
offset = newPtr;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@global export function __memory_free(ptr: usize): void { /* nop */ }
|
||||
|
@ -458,34 +458,30 @@ 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);
|
||||
if (size > Block.MAX_SIZE) unreachable();
|
||||
|
||||
let block = root.search(size);
|
||||
if (!block) {
|
||||
// 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);
|
||||
|
||||
// request more memory
|
||||
let pagesBefore = memory.size();
|
||||
let pagesNeeded = <i32>(((size + 0xffff) & ~0xffff) >>> 16);
|
||||
let pagesWanted = max(pagesBefore, pagesNeeded); // double memory
|
||||
if (memory.grow(pagesWanted) < 0) {
|
||||
if (memory.grow(pagesNeeded) < 0) {
|
||||
unreachable(); // out of memory
|
||||
}
|
||||
var block = root.search(size);
|
||||
if (!block) {
|
||||
|
||||
// request more memory
|
||||
let pagesBefore = memory.size();
|
||||
let pagesNeeded = <i32>(((size + 0xffff) & ~0xffff) >>> 16);
|
||||
let pagesWanted = max(pagesBefore, pagesNeeded); // double memory
|
||||
if (memory.grow(pagesWanted) < 0) {
|
||||
if (memory.grow(pagesNeeded) < 0) {
|
||||
unreachable(); // out of memory
|
||||
}
|
||||
let pagesAfter = memory.size();
|
||||
root.addMemory(<usize>pagesBefore << 16, <usize>pagesAfter << 16);
|
||||
block = assert(root.search(size)); // must be found now
|
||||
}
|
||||
|
||||
assert((block.info & ~TAGS) >= size);
|
||||
data = root.use(<Block>block, size);
|
||||
let pagesAfter = memory.size();
|
||||
root.addMemory(<usize>pagesBefore << 16, <usize>pagesAfter << 16);
|
||||
block = assert(root.search(size)); // must be found now
|
||||
}
|
||||
|
||||
return data;
|
||||
assert((block.info & ~TAGS) >= size);
|
||||
return root.use(<Block>block, size);
|
||||
}
|
||||
|
||||
/** Frees the chunk of memory at the specified address. */
|
||||
|
@ -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) {
|
||||
|
@ -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");
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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))
|
||||
|
@ -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))
|
||||
|
@ -63,86 +63,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 4 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $~lib/allocator/arena/__memory_allocate
|
||||
|
@ -77,105 +77,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
|
@ -10,7 +10,7 @@
|
||||
(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)
|
||||
@ -18,86 +18,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $~lib/allocator/arena/__memory_allocate
|
||||
@ -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)
|
||||
)
|
||||
|
@ -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)
|
||||
@ -27,105 +27,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
@ -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)
|
||||
)
|
||||
|
@ -20,86 +20,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/memory/memset (; 2 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
|
@ -29,105 +29,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/memory/memset (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
@ -98,86 +100,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
@ -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)
|
||||
|
@ -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))
|
||||
@ -126,105 +129,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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)
|
||||
@ -35,86 +35,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
@ -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)
|
||||
)
|
||||
|
@ -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)
|
||||
@ -48,105 +48,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 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)
|
||||
)
|
||||
|
@ -22,86 +22,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $~lib/allocator/arena/__memory_allocate
|
||||
|
@ -30,105 +30,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
|
2908
tests/compiler/std/gc-array.optimized.wat
Normal file
2908
tests/compiler/std/gc-array.optimized.wat
Normal file
File diff suppressed because it is too large
Load Diff
23
tests/compiler/std/gc-array.ts
Normal file
23
tests/compiler/std/gc-array.ts
Normal 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; }
|
3615
tests/compiler/std/gc-array.untouched.wat
Normal file
3615
tests/compiler/std/gc-array.untouched.wat
Normal file
File diff suppressed because it is too large
Load Diff
@ -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))
|
||||
@ -33,86 +33,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/collector/itcm/ManagedObjectList#clear (; 3 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
|
||||
(i32.store
|
||||
@ -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)
|
||||
|
@ -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))
|
||||
@ -47,105 +47,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/collector/itcm/ManagedObjectList#clear (; 3 ;) (type $iv) (param $0 i32)
|
||||
(i32.store
|
||||
@ -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)
|
||||
|
@ -25,86 +25,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/collector/itcm/ManagedObjectList#clear (; 1 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
|
||||
(i32.store
|
||||
|
@ -39,105 +39,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/collector/itcm/ManagedObjectList#clear (; 1 ;) (type $iv) (param $0 i32)
|
||||
(i32.store
|
||||
|
@ -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)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -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
@ -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)
|
||||
)
|
||||
|
@ -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)
|
||||
)
|
||||
|
@ -13,86 +13,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $~lib/allocator/arena/__memory_allocate
|
||||
|
@ -21,105 +21,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
|
@ -83,86 +83,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $~lib/allocator/arena/__memory_allocate
|
||||
|
@ -93,105 +93,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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)
|
||||
@ -408,86 +412,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
@ -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)
|
||||
|
@ -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)
|
||||
@ -447,105 +451,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 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)
|
||||
)
|
||||
|
@ -165,86 +165,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/string/String#toUTF8 (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
|
@ -185,105 +185,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/string/String#toUTF8 (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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)
|
||||
@ -51,86 +51,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(call $~lib/allocator/arena/__memory_allocate
|
||||
@ -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)
|
||||
)
|
||||
|
@ -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)
|
||||
@ -79,105 +79,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(return
|
||||
@ -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)
|
||||
)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
@ -36,86 +36,85 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(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)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $3)
|
||||
(tee_local $0
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(i32.const 1073741824)
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(tee_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(i32.shl
|
||||
(tee_local $2
|
||||
(current_memory)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $0)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
@ -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)
|
||||
|
@ -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)
|
||||
@ -61,105 +61,108 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_global $~lib/internal/allocator/MAX_SIZE_32)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(select
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
(tee_local $3
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(select
|
||||
(tee_local $5
|
||||
(get_local $3)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $5)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
(i32.xor
|
||||
(get_global $~lib/internal/allocator/AL_MASK)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(set_local $5
|
||||
(current_memory)
|
||||
)
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $4)
|
||||
(i32.shl
|
||||
(get_local $5)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $4)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.xor
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(select
|
||||
(tee_local $3
|
||||
(get_local $5)
|
||||
)
|
||||
(tee_local $6
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 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)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user