1
0
mirror of https://github.com/fluencelabs/assemblyscript synced 2025-06-20 18:26:40 +00:00

rtti & refactoring

This commit is contained in:
dcode
2019-04-06 20:17:48 +02:00
parent a9e4813798
commit e1070cee86
266 changed files with 23295 additions and 33925 deletions
cli
src
std
tests/compiler
abi.optimized.watabi.untouched.watasc-constants.optimized.watasc-constants.untouched.watassert-nonnull.jsonassert-nonnull.optimized.watassert-nonnull.tsassert-nonnull.untouched.watassert.optimized.watassert.untouched.watbinary.optimized.watbinary.untouched.watbool.optimized.watbool.untouched.watbuiltins.optimized.watbuiltins.untouched.watcall-inferred.optimized.watcall-inferred.untouched.watcall-optional.optimized.watcall-optional.untouched.watcall-super.jsoncall-super.optimized.watcall-super.tscall-super.untouched.watclass-extends.jsonclass-extends.optimized.watclass-extends.untouched.watclass-overloading.optimized.watclass-overloading.untouched.watclass.jsonclass.optimized.watclass.tsclass.untouched.watclosure.jsonclosure.optimized.watclosure.untouched.watcomma.optimized.watcomma.untouched.watconstructor.jsonconstructor.optimized.watconstructor.tsconstructor.untouched.watdeclare.optimized.watdeclare.untouched.watdo.optimized.watdo.untouched.watempty.optimized.watempty.untouched.watenum.optimized.watenum.untouched.watexport.optimized.watexport.untouched.watexports.optimized.watexports.untouched.watexternal.optimized.watexternal.untouched.watfor.optimized.watfor.untouched.watfunction-expression.optimized.watfunction-expression.untouched.watfunction-types.optimized.watfunction-types.untouched.watfunction.optimized.watfunction.untouched.watgc.jsongc.optimized.watgc.tsgc.untouched.wat
gc
getter-call.optimized.watgetter-call.untouched.watgetter-setter.optimized.watgetter-setter.untouched.wati64-polyfill.optimized.wati64-polyfill.untouched.watif.optimized.watif.untouched.watimport.optimized.watimport.untouched.watinfer-type.optimized.watinfer-type.untouched.watinlining-blocklocals.optimized.watinlining-blocklocals.untouched.watinlining-recursive.optimized.watinlining-recursive.untouched.watinlining.optimized.watinlining.untouched.watinstanceof.optimized.watinstanceof.untouched.watlimits.optimized.watlimits.untouched.watliterals.optimized.watliterals.untouched.watlogical.optimized.watlogical.untouched.watmain.optimized.watmain.untouched.watmandelbrot.optimized.watmandelbrot.untouched.watmany-locals.optimized.watmany-locals.untouched.watmemcpy.optimized.watmemcpy.untouched.watmemmove.optimized.watmemmove.untouched.watmemset.optimized.watmemset.untouched.watmerge.optimized.watmerge.untouched.watnamed-export-default.optimized.watnamed-export-default.untouched.watnamed-import-default.optimized.watnamed-import-default.untouched.watnamespace.optimized.watnamespace.untouched.watnumber.jsonnumber.optimized.watnumber.tsnumber.untouched.watoptional-typeparameters.optimized.watoptional-typeparameters.untouched.watoverflow.optimized.watoverflow.untouched.watportable-conversions.optimized.watportable-conversions.untouched.watrecursive.optimized.watrecursive.untouched.watreexport.optimized.watreexport.untouched.watrereexport.optimized.watrereexport.untouched.watresolve-nested.optimized.watresolve-nested.untouched.watretain-i32.optimized.watretain-i32.untouched.watruntime-arena.optimized.watruntime-arena.untouched.watruntime-default.optimized.watruntime-default.untouched.watruntime-none.optimized.watruntime-none.untouched.wat
runtime
scoped.optimized.watscoped.untouched.watsimd.optimized.watsimd.untouched.watstatic-this.optimized.watstatic-this.untouched.wat
std
switch.optimized.watswitch.untouched.watternary.optimized.watternary.untouched.watthreads.optimized.watthreads.untouched.wattypealias.optimized.wattypealias.untouched.watunary.optimized.watunary.untouched.watvoid.optimized.watvoid.untouched.watwasi.optimized.watwasi.tswasi.untouched.watwhile.optimized.watwhile.untouched.watwildcard-export.optimized.watwildcard-export.untouched.wat

@ -454,8 +454,8 @@ exports.main = function main(argv, options, callback) {
// Initialize default aliases
assemblyscript.setGlobalAlias(compilerOptions, "Math", "NativeMath");
assemblyscript.setGlobalAlias(compilerOptions, "Mathf", "NativeMathf");
assemblyscript.setGlobalAlias(compilerOptions, "abort", "~lib/env/abort");
assemblyscript.setGlobalAlias(compilerOptions, "trace", "~lib/env/trace");
assemblyscript.setGlobalAlias(compilerOptions, "abort", "~lib/builtins/abort");
assemblyscript.setGlobalAlias(compilerOptions, "trace", "~lib/builtins/trace");
}
// Add or override aliases if specified

@ -6,8 +6,7 @@
import {
Compiler,
ConversionKind,
WrapMode,
Feature
WrapMode
} from "./compiler";
import {
@ -57,7 +56,6 @@ import {
Field,
Global,
DecoratorFlags,
RuntimeFlags,
Program
} from "./program";
@ -70,7 +68,9 @@ import {
} from "./resolver";
import {
CommonFlags
CommonFlags,
Feature,
RTTIFlags
} from "./common";
import {
@ -479,14 +479,15 @@ export namespace BuiltinSymbols {
export const memory_reset = "~lib/memory/memory.reset";
// std/runtime.ts
export const RTTI_BASE = "~lib/runtime/RTTI_BASE";
export const runtime_id = "~lib/runtime/__runtime_id";
export const runtime_instanceof = "~lib/runtime/__runtime_instanceof";
export const runtime_flags = "~lib/runtime/__runtime_flags";
export const runtime_instanceof = "~lib/runtime/runtime.instanceof";
export const runtime_flags = "~lib/runtime/runtime.flags";
export const runtime_allocate = "~lib/util/runtime/allocate";
export const runtime_reallocate = "~lib/util/runtime/reallocate";
export const runtime_register = "~lib/util/runtime/register";
export const runtime_discard = "~lib/util/runtime/discard";
export const runtime_newArray = "~lib/runtime/runtime.newArray";
export const runtime_makeArray = "~lib/util/runtime/makeArray";
export const gc_mark_roots = "~lib/runtime/__gc_mark_roots";
export const gc_mark_members = "~lib/runtime/__gc_mark_members";
@ -3651,34 +3652,7 @@ export function compileCall(
);
return module.createUnreachable();
}
return module.createI32(classReference.ensureId());
}
case BuiltinSymbols.runtime_instanceof: {
if (
checkTypeAbsent(typeArguments, reportNode, prototype) |
checkArgsRequired(operands, 2, reportNode, compiler)
) {
compiler.currentType = Type.bool;
return module.createUnreachable();
}
let arg0 = compiler.compileExpression(operands[0], Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE);
let arg1 = compiler.compileExpression(operands[1], Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE);
compiler.needsRuntimeInstanceOf = true;
compiler.currentType = Type.bool;
return module.createCall(BuiltinSymbols.runtime_instanceof, [ arg0, arg1 ], NativeType.I32);
}
case BuiltinSymbols.runtime_flags: {
if (
checkTypeAbsent(typeArguments, reportNode, prototype) |
checkArgsRequired(operands, 1, reportNode, compiler)
) {
compiler.currentType = Type.i32;
return module.createUnreachable();
}
let arg0 = compiler.compileExpression(operands[0], Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE);
compiler.needsRuntimeFlags = true;
compiler.currentType = Type.i32;
return module.createCall(BuiltinSymbols.runtime_flags, [ arg0 ], NativeType.I32);
return module.createI32(classReference.id);
}
case BuiltinSymbols.gc_mark_roots: {
if (
@ -4191,7 +4165,7 @@ export function compileMarkMembers(compiler: Compiler): void {
let fieldType = (<Field>member).type;
if (fieldType.isManaged(program)) {
let fieldClass = fieldType.classReference!;
let fieldClassId = fieldClass.ensureId();
let fieldClassId = fieldClass.id;
let fieldOffset = (<Field>member).memoryOffset;
assert(fieldOffset >= 0);
block.push(
@ -4250,144 +4224,58 @@ export function compileMarkMembers(compiler: Compiler): void {
module.addFunction(BuiltinSymbols.gc_mark_members, ftype, [ nativeSizeType ], current);
}
/** Compiles the `__runtime_instanceof` function. */
export function compileRuntimeInstanceOf(compiler: Compiler): void {
function typeToRuntimeFlags(type: Type, program: Program): RTTIFlags {
var flags = RTTIFlags.VALUE_ALIGN_0 * (1 << type.alignLog2);
if (type.is(TypeFlags.NULLABLE)) flags |= RTTIFlags.VALUE_NULLABLE;
if (type.isManaged(program)) flags |= RTTIFlags.VALUE_MANAGED;
return flags / RTTIFlags.VALUE_ALIGN_0;
}
/** Compiles runtime type information for use by stdlib. */
export function compileRTTI(compiler: Compiler): void {
// TODO: only add this if actually accessed?
var program = compiler.program;
var module = compiler.module;
var managedClasses = program.managedClasses;
var ftype = compiler.ensureFunctionType([ Type.i32, Type.i32 ], Type.i32); // $0 instanceof $1 -> bool
// NOTE: There are multiple ways to model this. The one chosen here is to compute
// all possibilities in a branchless expression, growing linearly with the number
// of chained base classes.
//
// switch ($0) {
// case ANIMAL_ID: {
// return ($1 == ANIMAL_ID);
// }
// case CAT_ID: {
// return ($1 == CAT_ID) | ($1 == ANIMAL_ID);
// }
// case BLACKCAT_ID: {
// return ($1 == BLACKCAT_ID) | ($1 == CAT_ID) | ($1 == ANIMAL_ID);
// }
// }
// return false;
//
// Another one would be an inner br_table, but class id distribution in larger
// programs in unclear, possibly leading to lots of holes in that table that
// could either degenerate into multiple ifs when compiling for size or to
// huge tables when compiling for speed.
//
// Maybe a combination of both could be utilized, like statically analyzing the
// ids and make a decision based on profiling experience?
var names: string[] = [ "nope" ];
var blocks = new Array<ExpressionRef[]>();
var count = managedClasses.size;
var size = 8 + 8 * count;
var data = new Uint8Array(size);
writeI32(count, data, 0);
var off = 8;
var lastId = 0;
for (let [id, instance] of managedClasses) {
assert(id == ++lastId);
names.push(instance.internalName);
let condition = module.createBinary(BinaryOp.EqI32,
module.createGetLocal(1, NativeType.I32),
module.createI32(id)
);
let base = instance.base;
while (base) {
condition = module.createBinary(BinaryOp.OrI32,
condition,
module.createBinary(BinaryOp.EqI32,
module.createGetLocal(1, NativeType.I32),
module.createI32(base.ensureId())
)
);
base = base.base;
}
blocks.push([
module.createReturn(condition)
]);
}
var current: ExpressionRef;
if (blocks.length) {
current = module.createBlock(names[1], [
module.createSwitch(names, "nope", module.createGetLocal(0, NativeType.I32))
]);
for (let i = 0, k = blocks.length; i < k; ++i) {
blocks[i].unshift(current);
current = module.createBlock(i == k - 1 ? "nope" : names[i + 2], blocks[i]);
}
current = module.createBlock(null, [
current,
module.createReturn(module.createI32(0))
]);
} else {
current = module.createReturn(module.createI32(0));
}
module.addFunction(BuiltinSymbols.runtime_instanceof, ftype, null, current);
}
function typeToRuntimeFlags(type: Type, program: Program): RuntimeFlags {
var flags = RuntimeFlags.VALUE_ALIGN_0 * (1 << type.alignLog2);
if (type.is(TypeFlags.NULLABLE)) flags |= RuntimeFlags.VALUE_NULLABLE;
if (type.isManaged(program)) flags |= RuntimeFlags.VALUE_MANAGED;
return flags / RuntimeFlags.VALUE_ALIGN_0;
}
/** Compiles the `__runtime_flags` function. */
export function compileRuntimeFlags(compiler: Compiler): void {
var program = compiler.program;
var module = compiler.module;
var managedClasses = program.managedClasses;
var ftype = compiler.ensureFunctionType([ Type.i32 ], Type.i32); // $0 -> i32
var names: string[] = [ "invalid" ];
var blocks = new Array<ExpressionRef[]>();
var lastId = 0;
for (let [id, instance] of managedClasses) {
assert(id == ++lastId);
names.push(instance.internalName);
let flags: RuntimeFlags = 0;
let flags: RTTIFlags = 0;
if (instance.prototype.extends(program.arrayPrototype)) {
let typeArguments = assert(instance.typeArguments);
assert(typeArguments.length == 1);
flags |= RuntimeFlags.ARRAY;
flags |= RuntimeFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[0], program);
flags |= RTTIFlags.ARRAY;
flags |= RTTIFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[0], program);
} else if (instance.prototype.extends(program.setPrototype)) {
let typeArguments = assert(instance.typeArguments);
assert(typeArguments.length == 1);
flags |= RuntimeFlags.SET;
flags |= RuntimeFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[0], program);
flags |= RTTIFlags.SET;
flags |= RTTIFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[0], program);
} else if (instance.prototype.extends(program.mapPrototype)) {
let typeArguments = assert(instance.typeArguments);
assert(typeArguments.length == 2);
flags |= RuntimeFlags.MAP;
flags |= RuntimeFlags.KEY_ALIGN_0 * typeToRuntimeFlags(typeArguments[0], program);
flags |= RuntimeFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[1], program);
flags |= RTTIFlags.MAP;
flags |= RTTIFlags.KEY_ALIGN_0 * typeToRuntimeFlags(typeArguments[0], program);
flags |= RTTIFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[1], program);
}
blocks.push([
module.createReturn(module.createI32(flags))
]);
writeI32(flags, data, off); off += 4;
let base = instance.base;
writeI32(base ? base.id : 0, data, off); off += 4;
}
var current: ExpressionRef;
if (blocks.length) {
current = module.createBlock(names[1], [
module.createSwitch(names, "invalid", module.createGetLocal(0, NativeType.I32))
]);
for (let i = 0, k = blocks.length; i < k; ++i) {
blocks[i].unshift(current);
current = module.createBlock(i == k - 1 ? "invalid" : names[i + 2], blocks[i]);
}
current = module.createBlock(null, [
current,
module.createUnreachable()
]);
assert(off == size);
var usizeType = program.options.usizeType;
var segment = compiler.addMemorySegment(data);
if (usizeType.size == 8) {
let offset = segment.offset;
module.addGlobal(BuiltinSymbols.RTTI_BASE, NativeType.I64, false, module.createI64(i64_low(offset), i64_high(offset)));
} else {
current = module.createUnreachable();
module.addGlobal(BuiltinSymbols.RTTI_BASE, NativeType.I32, false, module.createI32(i64_low(segment.offset)));
}
module.addFunction(BuiltinSymbols.runtime_flags, ftype, null, current);
}
// Helpers

@ -190,3 +190,10 @@ export namespace CommonSymbols {
export const newArrayBuffer = "newArrayBuffer";
export const newArray = "newArray";
}
// shared
import { Capability } from "../std/assembly/common/capability";
import { Feature } from "../std/assembly/common/feature";
import { RTTIData, RTTIFlags } from "../std/assembly/common/rtti";
import { Target } from "../std/assembly/common/target";
export { Capability, Feature, RTTIData, RTTIFlags, Target };

@ -4,13 +4,12 @@
*//***/
import {
BuiltinSymbols,
compileCall as compileBuiltinCall,
compileAbort,
compileMarkRoots,
compileMarkMembers,
compileRuntimeInstanceOf,
compileRuntimeFlags,
BuiltinSymbols,
compileRTTI,
} from "./builtins";
import {
@ -50,7 +49,10 @@ import {
GETTER_PREFIX,
SETTER_PREFIX,
CommonSymbols,
INDEX_SUFFIX
INDEX_SUFFIX,
Capability,
Feature,
Target
} from "./common";
import {
@ -174,14 +176,6 @@ import {
makeMap
} from "./util";
/** Compilation target. */
export enum Target {
/** WebAssembly with 32-bit pointers. */
WASM32,
/** WebAssembly with 64-bit pointers. Experimental and not supported by any runtime yet. */
WASM64
}
/** Compiler options. */
export class Options {
@ -235,32 +229,6 @@ export class Options {
}
}
/** Indicates specific features to activate. */
export const enum Feature {
/** No additional features. */
NONE = 0,
/** Sign extension operations. */
SIGN_EXTENSION = 1 << 0, // see: https://github.com/WebAssembly/sign-extension-ops
/** Mutable global imports and exports. */
MUTABLE_GLOBAL = 1 << 1, // see: https://github.com/WebAssembly/mutable-global
/** Bulk memory operations. */
BULK_MEMORY = 1 << 2, // see: https://github.com/WebAssembly/bulk-memory-operations
/** SIMD types and operations. */
SIMD = 1 << 3, // see: https://github.com/WebAssembly/simd
/** Threading and atomic operations. */
THREADS = 1 << 4 // see: https://github.com/WebAssembly/threads
}
/** Indicates module capabilities. */
export const enum Capability {
/** No specific capabilities. */
NONE = 0,
/** Uses WebAssembly with 64-bit pointers. */
WASM64 = 1 << 0,
/** Garbage collector is present (full runtime header). */
GC = 1 << 1
}
/** Indicates the desired kind of a conversion. */
export const enum ConversionKind {
/** No conversion. */
@ -312,12 +280,12 @@ export class Compiler extends DiagnosticEmitter {
argcVar: GlobalRef = 0;
/** Argument count helper setter. */
argcSet: FunctionRef = 0;
/** Whether HEAP_BASE is required. */
needsHeap: bool = false;
/** Indicates whether the __gc_mark_* functions must be generated. */
needsGcMark: bool = false;
/** Indicates whether the __runtime_instanceof function must be generated. */
needsRuntimeInstanceOf: bool = false;
/** Indicates whether the __runtime_flags function must be generated. */
needsRuntimeFlags: bool = false;
/** Whether RTTI is required. */
needsRTTI: bool = false;
/** Compiles a {@link Program} to a {@link Module} using the specified options. */
static compile(program: Program, options: Options | null = null): Module {
@ -357,19 +325,11 @@ export class Compiler extends DiagnosticEmitter {
// add a mutable heap base dummy
if (options.isWasm64) {
module.addGlobal(
BuiltinSymbols.HEAP_BASE,
NativeType.I64,
true,
module.createI64(0, 0)
);
module.addGlobal(BuiltinSymbols.HEAP_BASE, NativeType.I64, true, module.createI64(0));
module.addGlobal(BuiltinSymbols.RTTI_BASE, NativeType.I64, true, module.createI64(0));
} else {
module.addGlobal(
BuiltinSymbols.HEAP_BASE,
NativeType.I32,
false,
module.createI32(0)
);
module.addGlobal(BuiltinSymbols.HEAP_BASE, NativeType.I32, true, module.createI32(0));
module.addGlobal(BuiltinSymbols.RTTI_BASE, NativeType.I32, true, module.createI32(0));
}
// compile entry file(s) while traversing reachable elements
@ -405,15 +365,18 @@ export class Compiler extends DiagnosticEmitter {
compileMarkMembers(this);
}
// compile runtime features if utilized
if (this.needsRuntimeInstanceOf) compileRuntimeInstanceOf(this);
if (this.needsRuntimeFlags) compileRuntimeFlags(this);
// compile runtime type information
module.removeGlobal(BuiltinSymbols.RTTI_BASE);
if (this.needsRTTI) {
compileRTTI(this);
}
// update the heap base pointer
var memoryOffset = this.memoryOffset;
memoryOffset = i64_align(memoryOffset, options.usizeType.byteSize);
this.memoryOffset = memoryOffset;
module.removeGlobal(BuiltinSymbols.HEAP_BASE);
if (this.needsHeap) {
if (options.isWasm64) {
module.addGlobal(
BuiltinSymbols.HEAP_BASE,
@ -429,6 +392,7 @@ export class Compiler extends DiagnosticEmitter {
module.createI32(i64_low(memoryOffset))
);
}
}
// set up memory
var isSharedMemory = options.hasFeature(Feature.THREADS) && options.sharedMemory > 0;
@ -449,7 +413,6 @@ export class Compiler extends DiagnosticEmitter {
// set up function table
var functionTable = this.functionTable;
module.setFunctionTable(functionTable.length, 0xffffffff, functionTable);
module.addTableExport("0", "table");
module.addFunction("null", this.ensureFunctionType(null, Type.void), null, module.createBlock(null, []));
// import table if requested (default table is named '0' by Binaryen)
@ -612,7 +575,7 @@ export class Compiler extends DiagnosticEmitter {
if (!(<Class>element).type.isUnmanaged) {
let module = this.module;
let internalName = (<Class>element).internalName;
module.addGlobal(internalName, NativeType.I32, false, module.createI32((<Class>element).ensureId()));
module.addGlobal(internalName, NativeType.I32, false, module.createI32((<Class>element).id));
module.addGlobalExport(internalName, prefix + name);
}
break;
@ -829,7 +792,11 @@ export class Compiler extends DiagnosticEmitter {
}
// ambient builtins like 'HEAP_BASE' need to be resolved but are added explicitly
if (global.is(CommonFlags.AMBIENT) && global.hasDecorator(DecoratorFlags.BUILTIN)) return true;
if (global.is(CommonFlags.AMBIENT) && global.hasDecorator(DecoratorFlags.BUILTIN)) {
if (global.internalName == BuiltinSymbols.HEAP_BASE) this.needsHeap = true;
else if (global.internalName == BuiltinSymbols.RTTI_BASE) this.needsRTTI = true;
return true;
}
var type = global.type;
var nativeType = type.toNativeType();
@ -1432,7 +1399,7 @@ export class Compiler extends DiagnosticEmitter {
} else {
let length = stringValue.length;
let buffer = new Uint8Array(rtHeaderSize + (length << 1));
program.writeRuntimeHeader(buffer, 0, stringInstance.ensureId(), length << 1);
program.writeRuntimeHeader(buffer, 0, stringInstance.id, length << 1);
for (let i = 0; i < length; ++i) {
writeI16(stringValue.charCodeAt(i), buffer, rtHeaderSize + (i << 1));
}
@ -1458,7 +1425,7 @@ export class Compiler extends DiagnosticEmitter {
var runtimeHeaderSize = program.runtimeHeaderSize;
var buf = new Uint8Array(runtimeHeaderSize + byteLength);
program.writeRuntimeHeader(buf, 0, bufferInstance.ensureId(), byteLength);
program.writeRuntimeHeader(buf, 0, bufferInstance.id, byteLength);
var pos = runtimeHeaderSize;
var nativeType = elementType.toNativeType();
switch (nativeType) {
@ -1545,7 +1512,7 @@ export class Compiler extends DiagnosticEmitter {
var arrayLength = i32(bufferLength / elementType.byteSize);
var buf = new Uint8Array(runtimeHeaderSize + arrayInstanceSize);
program.writeRuntimeHeader(buf, 0, arrayInstance.ensureId(), arrayInstanceSize);
program.writeRuntimeHeader(buf, 0, arrayInstance.id, arrayInstanceSize);
var bufferAddress32 = i64_low(bufferSegment.offset) + runtimeHeaderSize;
assert(!program.options.isWasm64); // TODO
@ -6720,11 +6687,11 @@ export class Compiler extends DiagnosticEmitter {
// upcast - check dynamically
if (expectedType.isAssignableTo(actualType)) {
let program = this.program;
this.needsRuntimeInstanceOf = true;
if (!(actualType.isUnmanaged || expectedType.isUnmanaged)) {
let flow = this.currentFlow;
let tempLocal = flow.getAndFreeTempLocal(actualType, false);
this.needsRuntimeInstanceOf = true;
let instanceofInstance = assert(program.instanceofInstance);
this.compileFunction(instanceofInstance);
return module.createIf(
module.createUnary(
nativeSizeType == NativeType.I64
@ -6733,16 +6700,10 @@ export class Compiler extends DiagnosticEmitter {
module.createTeeLocal(tempLocal.index, expr),
),
module.createI32(0),
module.createCall(BuiltinSymbols.runtime_instanceof, [
module.createLoad(4, false,
module.createBinary(BinaryOp.SubI32,
this.makeCallDirect(instanceofInstance, [
module.createGetLocal(tempLocal.index, nativeSizeType),
module.createI32(program.runtimeHeaderSize)
),
NativeType.I32
),
module.createI32(expectedType.classReference!.ensureId())
], NativeType.I32)
module.createI32(expectedType.classReference!.id)
], expression)
);
} else {
this.error(
@ -6771,7 +6732,8 @@ export class Compiler extends DiagnosticEmitter {
// uninitialized (thus zero) `var a: A` to be an instance of something.
let flow = this.currentFlow;
let tempLocal = flow.getAndFreeTempLocal(actualType, false);
this.needsRuntimeInstanceOf = true;
let instanceofInstance = assert(program.instanceofInstance);
this.compileFunction(instanceofInstance);
return module.createIf(
module.createUnary(
nativeSizeType == NativeType.I64
@ -6780,16 +6742,10 @@ export class Compiler extends DiagnosticEmitter {
module.createTeeLocal(tempLocal.index, expr),
),
module.createI32(0),
module.createCall(BuiltinSymbols.runtime_instanceof, [
module.createLoad(4, false,
module.createBinary(BinaryOp.SubI32,
this.makeCallDirect(instanceofInstance, [
module.createGetLocal(tempLocal.index, nativeSizeType),
module.createI32(program.runtimeHeaderSize)
),
NativeType.I32
),
module.createI32(expectedType.classReference!.ensureId())
], NativeType.I32)
module.createI32(expectedType.classReference!.id)
], expression)
);
} else {
this.error(
@ -6946,13 +6902,13 @@ export class Compiler extends DiagnosticEmitter {
// otherwise allocate a new array header and make it wrap a copy of the static buffer
} else {
// newArray(length, alignLog2, classId, staticBuffer)
let expr = this.makeCallDirect(assert(program.newArrayInstance), [
// makeArray(length, alignLog2, classId, staticBuffer)
let expr = this.makeCallDirect(assert(program.makeArrayInstance), [
module.createI32(length),
program.options.isWasm64
? module.createI64(elementType.alignLog2)
: module.createI32(elementType.alignLog2),
module.createI32(arrayInstance.ensureId()),
module.createI32(arrayInstance.id),
program.options.isWasm64
? module.createI64(i64_low(bufferAddress), i64_high(bufferAddress))
: module.createI32(i64_low(bufferAddress))
@ -6976,9 +6932,9 @@ export class Compiler extends DiagnosticEmitter {
var flow = this.currentFlow;
var tempThis = flow.getTempLocal(arrayType, false);
var tempDataStart = flow.getTempLocal(arrayBufferInstance.type);
var newArrayInstance = assert(program.newArrayInstance);
var newArrayInstance = assert(program.makeArrayInstance);
var stmts = new Array<ExpressionRef>();
// tempThis = newArray(length, alignLog2, classId, source = 0)
// tempThis = makeArray(length, alignLog2, classId, source = 0)
stmts.push(
module.createSetLocal(tempThis.index,
this.makeCallDirect(newArrayInstance, [
@ -6986,7 +6942,7 @@ export class Compiler extends DiagnosticEmitter {
program.options.isWasm64
? module.createI64(elementType.alignLog2)
: module.createI32(elementType.alignLog2),
module.createI32(arrayInstance.ensureId()),
module.createI32(arrayInstance.id),
program.options.isWasm64
? module.createI64(0)
: module.createI32(0)
@ -8244,7 +8200,7 @@ export class Compiler extends DiagnosticEmitter {
? module.createI64(classInstance.currentMemoryOffset)
: module.createI32(classInstance.currentMemoryOffset)
], reportNode),
module.createI32(classInstance.ensureId())
module.createI32(classInstance.id)
], reportNode);
}
}
@ -8449,7 +8405,7 @@ export class Compiler extends DiagnosticEmitter {
module.createBreak(label,
module.createBinary(BinaryOp.EqI32, // classId == class.id
module.createTeeLocal(idTemp.index, idExpr),
module.createI32(classInstance.ensureId())
module.createI32(classInstance.id)
),
module.createI32(1) // ? true
)

@ -3,39 +3,14 @@
* @module index
*//***/
import {
Compiler,
Options,
Target,
Feature
} from "./compiler";
import {
Decompiler
} from "./decompiler";
import {
IDLBuilder,
TSDBuilder
} from "./definitions";
import {
DiagnosticMessage,
DiagnosticCategory,
formatDiagnosticMessage
} from "./diagnostics";
import {
Module
} from "./module";
import {
Parser
} from "./parser";
import {
Program
} from "./program";
import { Target, Feature } from "./common";
import { Compiler, Options } from "./compiler";
import { Decompiler } from "./decompiler";
import { IDLBuilder, TSDBuilder } from "./definitions";
import { DiagnosticMessage, DiagnosticCategory, formatDiagnosticMessage } from "./diagnostics";
import { Module } from "./module";
import { Parser } from "./parser";
import { Program } from "./program";
/** Parses a source file. If `parser` has been omitted a new one is created. */
export function parseFile(text: string, path: string, isEntry: bool = false,

@ -3,9 +3,7 @@
* @module module
*//***/
import {
Target
} from "./compiler";
import { Target } from "./common";
export type ModuleRef = usize;
export type FunctionTypeRef = usize;

@ -13,13 +13,13 @@ import {
INNER_DELIMITER,
LIBRARY_SUBST,
INDEX_SUFFIX,
CommonSymbols
CommonSymbols,
Feature,
Target
} from "./common";
import {
Options,
Feature,
Compiler
Options
} from "./compiler";
import {
@ -316,45 +316,6 @@ export enum CollectorKind {
COUNTING
}
/** Runtime flags. */
export const enum RuntimeFlags { // keep in sync with std/runtime.ts
NONE = 0,
/** Type is an `Array`. */
ARRAY = 1 << 0,
/** Type is a `Set`. */
SET = 1 << 1,
/** Type is a `Map`. */
MAP = 1 << 2,
/** Value alignment of 1 byte. */
VALUE_ALIGN_0 = 1 << 3,
/** Value alignment of 2 bytes. */
VALUE_ALIGN_1 = 1 << 4,
/** Value alignment of 4 bytes. */
VALUE_ALIGN_2 = 1 << 5,
/** Value alignment of 8 bytes. */
VALUE_ALIGN_3 = 1 << 6,
/** Value alignment of 16 bytes. */
VALUE_ALIGN_4 = 1 << 7,
/** Value type is nullable. */
VALUE_NULLABLE = 1 << 8,
/** Value type is managed. */
VALUE_MANAGED = 1 << 9,
/** Key alignment of 1 byte. */
KEY_ALIGN_0 = 1 << 10,
/** Key alignment of 2 bytes. */
KEY_ALIGN_1 = 1 << 11,
/** Key alignment of 4 bytes. */
KEY_ALIGN_2 = 1 << 12,
/** Key alignment of 8 bytes. */
KEY_ALIGN_3 = 1 << 13,
/** Key alignment of 16 bytes. */
KEY_ALIGN_4 = 1 << 14,
/** Key type is nullable. */
KEY_NULLABLE = 1 << 15,
/** Key type is managed. */
KEY_MANAGED = 1 << 16
}
/** Represents an AssemblyScript program. */
export class Program extends DiagnosticEmitter {
@ -418,7 +379,11 @@ export class Program extends DiagnosticEmitter {
/** Runtime register function. `register(ref: usize, cid: u32): usize` */
registerInstance: Function | null = null;
/** Runtime make array function. `newArray(length: i32, alignLog2: usize, id: u32, source: usize = 0): usize` */
newArrayInstance: Function | null = null;
makeArrayInstance: Function | null = null;
/** Runtime instanceof function. */
instanceofInstance: Function | null = null;
/** Runtime flags function. */
flagsInstance: Function | null = null;
/** The kind of garbage collector being present. */
collectorKind: CollectorKind = CollectorKind.NONE;
@ -598,7 +563,7 @@ export class Program extends DiagnosticEmitter {
// register compiler hints
this.registerConstantInteger(CommonSymbols.ASC_TARGET, Type.i32,
i64_new(options.isWasm64 ? 2 : 1));
i64_new(options.isWasm64 ? Target.WASM64 : Target.WASM32));
this.registerConstantInteger(CommonSymbols.ASC_NO_ASSERT, Type.bool,
i64_new(options.noAssert ? 1 : 0, 0));
this.registerConstantInteger(CommonSymbols.ASC_MEMORY_BASE, Type.i32,
@ -895,9 +860,17 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.registerInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.runtime_newArray)) {
if (element = this.lookupGlobal(BuiltinSymbols.runtime_makeArray)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.newArrayInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
this.makeArrayInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.runtime_instanceof)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.instanceofInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.runtime_flags)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.flagsInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
// memory allocator interface
if (element = this.lookupGlobal("__mem_allocate")) {
@ -3069,15 +3042,10 @@ export class Class extends TypedElement {
/** Unique class id. */
private _id: u32 = 0;
/** Ensures that this class has an id. */
ensureId(): i32 {
/** Gets the unique runtime id of this class. Must be a managed class. */
get id(): u32 {
var id = this._id;
if (!id) {
assert(!this.hasDecorator(DecoratorFlags.UNMANAGED));
let program = this.program;
this._id = id = program.nextClassId++;
program.managedClasses.set(id, this);
}
assert(id); // must be managed to have an id
return id;
}
@ -3122,13 +3090,20 @@ export class Class extends TypedElement {
prototype.parent,
prototype.declaration
);
var program = this.program;
this.prototype = prototype;
this.flags = prototype.flags;
this.decoratorFlags = prototype.decoratorFlags;
this.typeArguments = typeArguments;
this.setType(this.program.options.usizeType.asClass(this));
this.setType(program.options.usizeType.asClass(this));
this.base = base;
if (!this.hasDecorator(DecoratorFlags.UNMANAGED)) {
let id = program.nextClassId++;
this._id = id;
program.managedClasses.set(id, this);
}
// inherit static members and contextual type arguments from base class
if (base) {
let inheritedTypeArguments = base.contextualTypeArguments;
@ -3157,7 +3132,7 @@ export class Class extends TypedElement {
} else if (typeParameters && typeParameters.length) {
throw new Error("type argument count mismatch");
}
registerConcreteElement(this.program, this);
registerConcreteElement(program, this);
}
/** Tests if a value of this class type is assignable to a target of the specified class type. */

@ -1,8 +1,8 @@
/// <reference path="./collector/index.d.ts" />
import { MAX_BYTELENGTH, allocate, reallocate, discard, register } from "./util/runtime";
import { MAX_BYTELENGTH, allocate, reallocate, discard, register, NEWARRAY } from "./util/runtime";
import { COMPARATOR, SORT } from "./util/sort";
import { runtime, __runtime_id, __gc_mark_members } from "./runtime";
import { __runtime_id, __gc_mark_members } from "./runtime";
import { ArrayBuffer, ArrayBufferView } from "./arraybuffer";
import { itoa, dtoa, itoa_stream, dtoa_stream, MAX_DOUBLE_LENGTH } from "./util/number";
import { isArray as builtin_isArray } from "./builtins";
@ -42,9 +42,9 @@ export class Array<T> extends ArrayBufferView {
static create<T>(capacity: i32 = 0): Array<T> {
if (<u32>capacity > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError(E_INVALIDLENGTH);
var array = changetype<Array<T>>(runtime.newArray(capacity, alignof<T>(), __runtime_id<Array<T>>()));
memory.fill(array.dataStart, 0, <usize>array.dataLength);
array.length_ = 0; // !
var array = NEWARRAY<T>(capacity);
array.length_ = 0; // safe even if T is a non-nullable reference
memory.fill(array.dataStart, 0, array.dataLength);
return array;
}
@ -232,7 +232,9 @@ export class Array<T> extends ArrayBufferView {
concat(other: Array<T>): Array<T> {
var thisLen = this.length_;
var otherLen = select(0, other.length_, other === null);
var out = changetype<Array<T>>(runtime.newArray(thisLen + otherLen, alignof<T>(), __runtime_id<Array<T>>()));
var outLen = thisLen + otherLen;
if (<u32>outLen > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new Error(E_INVALIDLENGTH);
var out = NEWARRAY<T>(outLen);
var outStart = out.dataStart;
var thisSize = <usize>thisLen << alignof<T>();
if (isManaged<T>()) {
@ -320,7 +322,7 @@ export class Array<T> extends ArrayBufferView {
map<U>(callbackfn: (value: T, index: i32, array: Array<T>) => U): Array<U> {
var length = this.length_;
var out = changetype<Array<U>>(runtime.newArray(length, alignof<U>(), __runtime_id<Array<U>>()));
var out = NEWARRAY<U>(length);
var outStart = out.dataStart;
for (let index = 0; index < min(length, this.length_); ++index) {
let value = load<T>(this.dataStart + (<usize>index << alignof<T>()));
@ -346,7 +348,7 @@ export class Array<T> extends ArrayBufferView {
}
filter(callbackfn: (value: T, index: i32, array: Array<T>) => bool): Array<T> {
var result = changetype<Array<T>>(runtime.newArray(0, alignof<T>(), __runtime_id<Array<T>>()));
var result = NEWARRAY<T>(0);
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
let value = load<T>(this.dataStart + (<usize>index << alignof<T>()));
if (callbackfn(value, index, this)) result.push(value);
@ -434,7 +436,7 @@ export class Array<T> extends ArrayBufferView {
begin = begin < 0 ? max(begin + length, 0) : min(begin, length);
end = end < 0 ? max(end + length, 0) : min(end , length);
length = max(end - begin, 0);
var slice = changetype<Array<T>>(runtime.newArray(length, alignof<T>(), __runtime_id<Array<T>>()));
var slice = NEWARRAY<T>(length);
var sliceBase = slice.dataStart;
var thisBase = this.dataStart + (<usize>begin << alignof<T>());
if (isManaged<T>()) {
@ -466,7 +468,7 @@ export class Array<T> extends ArrayBufferView {
var length = this.length_;
start = start < 0 ? max<i32>(length + start, 0) : min<i32>(start, length);
deleteCount = max<i32>(min<i32>(deleteCount, length - start), 0);
var result = changetype<Array<T>>(runtime.newArray(deleteCount, alignof<T>(), __runtime_id<Array<T>>()));
var result = NEWARRAY<T>(deleteCount);
var resultStart = result.dataStart;
var thisStart = this.dataStart;
var thisBase = thisStart + (<usize>start << alignof<T>());

@ -1715,3 +1715,36 @@ export namespace v8x16 {
l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8
): v128;
}
// @ts-ignore: decorator
@builtin
export declare function ERROR(message?: string): void;
// @ts-ignore: decorator
@builtin
export declare function WARNING(message?: string): void;
// @ts-ignore: decorator
@builtin
export declare function INFO(message?: string): void;
// @ts-ignore: decorator
@external("env", "abort")
declare function abort(
message?: string | null,
fileName?: string | null,
lineNumber?: u32,
columnNumber?: u32
): void;
// @ts-ignore: decorator
@external("env", "trace")
declare function trace(
message: string,
n?: i32,
a0?: f64,
a1?: f64,
a2?: f64,
a3?: f64,
a4?: f64
): void;

@ -0,0 +1 @@
These source files are used by both the standard library *and* compiler. Must remain portable.

@ -0,0 +1,9 @@
/** Indicates module capabilities. */
export const enum Capability {
/** No specific capabilities. */
NONE = 0,
/** Uses WebAssembly with 64-bit pointers. */
WASM64 = 1 << 0,
/** Garbage collector is present (full runtime header). */
GC = 1 << 1
}

@ -0,0 +1,15 @@
/** Indicates specific features to activate. */
export const enum Feature {
/** No additional features. */
NONE = 0,
/** Sign extension operations. */
SIGN_EXTENSION = 1 << 0, // see: https://github.com/WebAssembly/sign-extension-ops
/** Mutable global imports and exports. */
MUTABLE_GLOBAL = 1 << 1, // see: https://github.com/WebAssembly/mutable-global
/** Bulk memory operations. */
BULK_MEMORY = 1 << 2, // see: https://github.com/WebAssembly/bulk-memory-operations
/** SIMD types and operations. */
SIMD = 1 << 3, // see: https://github.com/WebAssembly/simd
/** Threading and atomic operations. */
THREADS = 1 << 4 // see: https://github.com/WebAssembly/threads
}

@ -0,0 +1,60 @@
// ╒═════════════════════ RTTI interpretation ═════════════════════╕
// 3 2 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits
// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ◄─ RTTI_BASE
// │ count │
// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤
// │ reserved │
// ╞═══════════════════════════════════════════════════════════════╡ ┐
// │ RTTIData#flags [id=1] │ id=1..count
// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤
// │ RTTIData#base [id=1] │
// ├───────────────────────────────────────────────────────────────┤
// │ ... │
/** Runtime type information data structure. */
@unmanaged
export class RTTIData {
flags: RTTIFlags;
base: u32;
}
/** Runtime type information flags. */
export const enum RTTIFlags {
/** No specific flags. */
NONE = 0,
/** Type is an `Array`. */
ARRAY = 1 << 0,
/** Type is a `Set`. */
SET = 1 << 1,
/** Type is a `Map`. */
MAP = 1 << 2,
/** Value alignment of 1 byte. */
VALUE_ALIGN_0 = 1 << 3,
/** Value alignment of 2 bytes. */
VALUE_ALIGN_1 = 1 << 4,
/** Value alignment of 4 bytes. */
VALUE_ALIGN_2 = 1 << 5,
/** Value alignment of 8 bytes. */
VALUE_ALIGN_3 = 1 << 6,
/** Value alignment of 16 bytes. */
VALUE_ALIGN_4 = 1 << 7,
/** Value type is nullable. */
VALUE_NULLABLE = 1 << 8,
/** Value type is managed. */
VALUE_MANAGED = 1 << 9,
/** Key alignment of 1 byte. */
KEY_ALIGN_0 = 1 << 10,
/** Key alignment of 2 bytes. */
KEY_ALIGN_1 = 1 << 11,
/** Key alignment of 4 bytes. */
KEY_ALIGN_2 = 1 << 12,
/** Key alignment of 8 bytes. */
KEY_ALIGN_3 = 1 << 13,
/** Key alignment of 16 bytes. */
KEY_ALIGN_4 = 1 << 14,
/** Key type is nullable. */
KEY_NULLABLE = 1 << 15,
/** Key type is managed. */
KEY_MANAGED = 1 << 16
}

@ -0,0 +1,9 @@
/** Compilation target. */
export enum Target {
/** WebAssembly with 32-bit pointers. */
WASM32,
/** WebAssembly with 64-bit pointers. Experimental and not supported by any runtime yet. */
WASM64,
/** Portable. */
JS
}

@ -1,11 +0,0 @@
// @ts-ignore: decorator
@builtin
export declare function ERROR(message?: string): void;
// @ts-ignore: decorator
@builtin
export declare function WARNING(message?: string): void;
// @ts-ignore: decorator
@builtin
export declare function INFO(message?: string): void;

@ -1,16 +0,0 @@
declare function abort(
message?: string | null,
fileName?: string | null,
lineNumber?: u32,
columnNumber?: u32
): void;
declare function trace(
message: string,
n?: i32,
a0?: f64,
a1?: f64,
a2?: f64,
a3?: f64,
a4?: f64
): void;

@ -1485,13 +1485,6 @@ interface TypedPropertyDescriptor<T> {
set?(value: T): void;
}
/** Annotates an element as a program global. */
declare function global(
target: any,
propertyKey: string,
descriptor: TypedPropertyDescriptor<any>
): TypedPropertyDescriptor<any> | void;
/** Annotates a method as a binary operator overload for the specified `token`. */
declare function operator(token:
"[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" |
@ -1526,6 +1519,9 @@ declare namespace operator {
) => TypedPropertyDescriptor<any> | void;
}
/** Annotates an element as a program global. */
declare function global(...args: any[]): any;
/** Annotates a class as being unmanaged with limited capabilities. */
declare function unmanaged(constructor: Function): void;

@ -3,63 +3,18 @@
import { HEADER, HEADER_SIZE, allocate, register } from "./util/runtime";
import { E_NOTIMPLEMENTED } from "./util/error";
import { memory } from "./memory";
import { ArrayBufferView } from "./arraybuffer";
import { RTTIFlags, RTTIData } from "./common/rtti";
// @ts-ignore: decorator
@builtin
export declare const RTTI_BASE: usize;
/** Gets the computed unique id of a class type. */
// @ts-ignore: decorator
@builtin
export declare function __runtime_id<T>(): u32;
/** Tests if a managed class is the same as or a superclass of another. */
// @ts-ignore: decorator
@builtin
export declare function __runtime_instanceof(id: u32, superId: u32): bool;
/** Runtime flags. */
const enum RuntimeFlags { // keep in sync with src/program.ts
NONE = 0,
/** Type is an `Array`. */
ARRAY = 1 << 0,
/** Type is a `Set`. */
SET = 1 << 1,
/** Type is a `Map`. */
MAP = 1 << 2,
/** Value alignment of 1 byte. */
VALUE_ALIGN_0 = 1 << 3,
/** Value alignment of 2 bytes. */
VALUE_ALIGN_1 = 1 << 4,
/** Value alignment of 4 bytes. */
VALUE_ALIGN_2 = 1 << 5,
/** Value alignment of 8 bytes. */
VALUE_ALIGN_3 = 1 << 6,
/** Value alignment of 16 bytes. */
VALUE_ALIGN_4 = 1 << 7,
/** Value type is nullable. */
VALUE_NULLABLE = 1 << 8,
/** Value type is managed. */
VALUE_MANAGED = 1 << 9,
/** Key alignment of 1 byte. */
KEY_ALIGN_0 = 1 << 10,
/** Key alignment of 2 bytes. */
KEY_ALIGN_1 = 1 << 11,
/** Key alignment of 4 bytes. */
KEY_ALIGN_2 = 1 << 12,
/** Key alignment of 8 bytes. */
KEY_ALIGN_3 = 1 << 13,
/** Key alignment of 16 bytes. */
KEY_ALIGN_4 = 1 << 14,
/** Key type is nullable. */
KEY_NULLABLE = 1 << 15,
/** Key type is managed. */
KEY_MANAGED = 1 << 16
}
/** Gets the runtime flags of the managed type represented by the specified runtime id. */
// @ts-ignore: decorator
@builtin
export declare function __runtime_flags(id: u32): RuntimeFlags;
/** Marks root objects when a tracing GC is present. */
// @ts-ignore: decorator
@unsafe @builtin
@ -76,20 +31,24 @@ export class runtime {
private constructor() { return unreachable(); }
/** Determines whether a managed object is considered to be an instance of the class represented by the specified runtime id. */
@unsafe
static instanceof(ref: usize, id: u32): bool { // keyword
return ref
? __runtime_instanceof(
changetype<HEADER>(ref - HEADER_SIZE).classId,
id
)
: false;
static instanceof(ref: usize, superId: u32): bool { // keyword
var id = changetype<HEADER>(ref - HEADER_SIZE).classId;
var ptr = RTTI_BASE;
if (id && id <= load<u32>(ptr)) {
do if (id == superId) return true;
while (id = changetype<RTTIData>(ptr + id * offsetof<RTTIData>()).base);
}
return false;
}
}
export namespace runtime {
export function flags(id: u32): RuntimeFlags {
return __runtime_flags(id);
/** Gets the runtime flags of the managed type represented by the specified runtime id. */
export function flags(id: u32): RTTIFlags {
var ptr = RTTI_BASE;
return !id || id > load<u32>(ptr)
? unreachable()
: changetype<RTTIData>(ptr + id * offsetof<RTTIData>()).flags;
}
/** Allocates and registers, but doesn't initialize the data of, a new managed object of the specified kind. */
@ -113,57 +72,36 @@ export namespace runtime {
return newObject(byteLength, __runtime_id<ArrayBuffer>());
}
/** Allocates and registers, but doesn't initialize the data of, a new `Array` of the specified length and element alignment.*/
/** Allocates and registers a new `Array` of the specified kind using the given backing buffer.*/
// @ts-ignore: decorator
@unsafe
export function newArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize {
// TODO: This API isn't great, but the compiler requires it for array literals anyway,
// that is when an array literal is encountered and its data is static, this function is
// called and the static buffer provided as `data`. This function can also be used to
// create typed arrays in that `Array` also implements `ArrayBufferView` but has an
// additional `.length_` property that remains unused overhead for typed arrays.
var array = register(allocate(offsetof<i32[]>()), id);
var bufferSize = <usize>length << alignLog2;
var buffer = register(allocate(bufferSize), __runtime_id<ArrayBuffer>());
export function newArray(id: u32, buffer: usize): usize {
var flags = runtime.flags(id); // traps if invalid
var alignLog2 = (<u32>flags / RTTIFlags.VALUE_ALIGN_0) & 31;
var byteLength: i32;
if (!buffer) buffer = newArrayBuffer(byteLength = 0);
else byteLength = changetype<ArrayBuffer>(buffer).byteLength;
var array = newObject(id, offsetof<i32[]>());
changetype<ArrayBufferView>(array).data = changetype<ArrayBuffer>(buffer); // links
changetype<ArrayBufferView>(array).dataStart = buffer;
changetype<ArrayBufferView>(array).dataLength = bufferSize;
store<i32>(changetype<usize>(array), length, offsetof<i32[]>("length_"));
if (data) memory.copy(buffer, data, bufferSize);
// TODO: a way to determine whether the array has managed elements that must be linked?
changetype<ArrayBufferView>(array).dataLength = byteLength;
store<i32>(changetype<usize>(array), byteLength >>> alignLog2, offsetof<i32[]>("length_"));
if (flags & RTTIFlags.VALUE_MANAGED) {
let cur = buffer;
let end = cur + <usize>byteLength;
while (cur < end) {
let ref = load<usize>(cur);
if (ref) {
if (isDefined(__ref_link)) __ref_link(ref, array);
else if (isDefined(__ref_retain)) __ref_retain(ref);
else assert(false);
}
cur += sizeof<usize>();
}
}
return array;
}
// export function newArray2(id: u32, buffer: usize): usize {
// var flags = __runtime_flags(id); // traps if invalid
// var alignLog2 = (flags / RuntimeFlags.VALUE_ALIGN_0) & 31;
// var byteLength: i32;
// if (!buffer) {
// buffer = newArrayBuffer(byteLength = 0);
// } else {
// byteLength = changetype<ArrayBuffer>(buffer).byteLength;
// }
// var array = register(allocate(offsetof<i32[]>()), id);
// changetype<ArrayBufferView>(array).data = changetype<ArrayBuffer>(buffer); // links
// changetype<ArrayBufferView>(array).dataStart = buffer;
// changetype<ArrayBufferView>(array).dataLength = byteLength;
// store<i32>(changetype<usize>(array), byteLength >>> alignLog2, offsetof<i32[]>("length_"));
// if (flags & RuntimeFlags.VALUE_MANAGED) {
// let cur = buffer;
// let end = cur + <usize>byteLength;
// while (cur < end) {
// let ref = load<usize>(cur);
// if (ref) {
// if (isDefined(__ref_link)) __ref_link(ref, array);
// else if (isDefined(__ref_retain)) __ref_retain(ref);
// else assert(false);
// }
// cur += sizeof<usize>();
// }
// }
// return array;
// }
/** Retains a managed object externally, making sure that it doesn't become collected. */
// @ts-ignore: decorator
@unsafe

@ -1 +1,3 @@
import "allocator/arena";
export { runtime as $ };

@ -1,10 +1,10 @@
/// <reference path="./collector/index.d.ts" />
import { MAX_SIZE_32 } from "./util/allocator";
import { HEADER, HEADER_SIZE, allocate, register } from "./util/runtime";
import { HEADER, HEADER_SIZE, allocate, register, NEWARRAY } from "./util/runtime";
import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./util/string";
import { E_INVALIDLENGTH } from "./util/error";
import { runtime, __runtime_id } from "./runtime";
import { __runtime_id } from "./runtime";
import { ArrayBufferView } from "./arraybuffer";
@sealed export abstract class String {
@ -362,16 +362,16 @@ import { ArrayBufferView } from "./arraybuffer";
split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] {
assert(this !== null);
if (!limit) return changetype<String[]>(runtime.newArray(0, alignof<String>(), __runtime_id<String[]>()));
if (!limit) return NEWARRAY<String>(0);
if (separator === null) return <String[]>[this];
var length: isize = this.length;
var sepLen: isize = separator.length;
if (limit < 0) limit = i32.MAX_VALUE;
if (!sepLen) {
if (!length) return changetype<String[]>(runtime.newArray(0, alignof<String>(), __runtime_id<String>()));
if (!length) return NEWARRAY<String>(0);
// split by chars
length = min<isize>(length, <isize>limit);
let result = changetype<String[]>(runtime.newArray(length, alignof<String>(), __runtime_id<String[]>()));
let result = NEWARRAY<String>(length);
let resultStart = changetype<ArrayBufferView>(result).dataStart;
for (let i: isize = 0; i < length; ++i) {
let charStr = allocate(2);
@ -385,11 +385,11 @@ import { ArrayBufferView } from "./arraybuffer";
}
return result;
} else if (!length) {
let result = changetype<String[]>(runtime.newArray(1, alignof<String>(), __runtime_id<String[]>()));
let result = NEWARRAY<String>(1);
store<string>(changetype<ArrayBufferView>(result).dataStart, ""); // no need to register/link
return result;
}
var result = changetype<String[]>(runtime.newArray(0, alignof<String>(), __runtime_id<String[]>()));
var result = NEWARRAY<String>(0);
var end = 0, start = 0, i = 0;
while ((end = this.indexOf(separator!, start)) != -1) {
let len = end - start;
@ -404,7 +404,7 @@ import { ArrayBufferView } from "./arraybuffer";
start = end + sepLen;
}
if (!start) {
let result = changetype<String[]>(runtime.newArray(1, alignof<String>(), __runtime_id<String[]>()));
let result = NEWARRAY<String>(1);
unchecked(result[0] = this);
return result;
}

@ -1,4 +1,7 @@
import { AL_MASK, MAX_SIZE_32 } from "./allocator";
import { __runtime_id } from "../runtime";
import { Array } from "../array";
import { ArrayBufferView } from "../arraybuffer";
/**
* The common runtime object header prepended to all managed objects. Has a size of 16 bytes in
@ -136,22 +139,22 @@ export function register(ref: usize, id: u32): usize {
return ref;
}
/** Allocates and registers, but doesn't initialize the data of, a new `Array` of the specified length and element alignment. */
// @ts-ignore: decorator
@unsafe
export function newArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize {
// TODO: This API isn't great, but the compiler requires it for array literals anyway,
// that is when an array literal is encountered and its data is static, this function is
// called and the static buffer provided as `data`. This function can also be used to
// create typed arrays in that `Array` also implements `ArrayBufferView` but has an
// additional `.length_` property that remains unused overhead for typed arrays.
var array = newObject(offsetof<i32[]>(), id);
var bufferSize = <u32>length << alignLog2;
var buffer = newArrayBuffer(bufferSize);
export function makeArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize {
var array = register(allocate(offsetof<i32[]>()), id);
var bufferSize = <usize>length << alignLog2;
var buffer = register(allocate(bufferSize), __runtime_id<ArrayBuffer>());
changetype<ArrayBufferView>(array).data = changetype<ArrayBuffer>(buffer); // links
changetype<ArrayBufferView>(array).dataStart = buffer;
changetype<ArrayBufferView>(array).dataLength = bufferSize;
store<i32>(changetype<usize>(array), length, offsetof<i32[]>("length_"));
if (data) memory.copy(buffer, data, <usize>bufferSize);
if (data) memory.copy(buffer, data, bufferSize);
return array;
}
// @ts-ignore: decorator
@inline
export function NEWARRAY<T>(length: i32): Array<T> {
return changetype<Array<T>>(makeArray(length, alignof<T>(), __runtime_id<Array<T>>(), 0));
}

@ -644,3 +644,6 @@ declare namespace console {
/** @deprecated */
function log(message: string): void;
}
/** Annotates a class as being unmanaged with limited capabilities. */
declare function unmanaged(constructor: Function): void;

@ -2,7 +2,7 @@
var globalScope = typeof window !== "undefined" && window || typeof global !== "undefined" && global || self;
globalScope.ASC_TARGET = 0; // JS
globalScope.ASC_TARGET = 2; // Target.JS
globalScope.ASC_NO_ASSERT = false;
globalScope.ASC_MEMORY_BASE = 0;
globalScope.ASC_OPTIMIZE_LEVEL = 3;
@ -311,3 +311,5 @@ globalScope["store"] = globalScope["__store"] || function store(ptr, value, offs
globalScope["load"] = globalScope["__load"] || function load(ptr, offset) {
return HEAP[(ptr | 0) + (offset | 0)];
};
globalScope["unmanaged"] = function() {};

@ -2,15 +2,12 @@
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
(global $abi/condition (mut i32) (i32.const 0))
(global $abi/y (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(export "exported" (func $abi/exported))
(export "exportedExported" (func $abi/exported))
(export "exportedInternal" (func $abi/exported))
@ -29,7 +26,7 @@
i32.const 16
i32.const 65
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -2,16 +2,14 @@
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $abi/condition (mut i32) (i32.const 0))
(global $abi/y (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 28))
(export "memory" (memory $0))
(export "table" (table $0))
(export "exported" (func $abi/exported))
(export "exportedExported" (func $abi/exportedExported))
(export "exportedInternal" (func $abi/exportedInternal))
@ -42,7 +40,7 @@
i32.const 16
i32.const 32
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
end
@ -81,7 +79,7 @@
i32.const 16
i32.const 45
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
end
@ -112,7 +110,7 @@
i32.const 16
i32.const 58
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
end
@ -131,7 +129,7 @@
i32.const 16
i32.const 65
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
end
@ -148,7 +146,7 @@
i32.const 16
i32.const 72
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -163,7 +161,7 @@
i32.const 16
i32.const 74
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -176,7 +174,7 @@
i32.const 16
i32.const 77
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -189,7 +187,7 @@
i32.const 16
i32.const 79
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
end

@ -1,10 +1,7 @@
(module
(type $FUNCSIG$v (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $start)
(export "memory" (memory $0))
(export "table" (table $0))
(func $start (; 0 ;) (type $FUNCSIG$v)
nop
)

@ -13,12 +13,10 @@
(global $~lib/ASC_FEATURE_BULK_MEMORY i32 (i32.const 0))
(global $~lib/ASC_FEATURE_SIMD i32 (i32.const 0))
(global $~lib/ASC_FEATURE_THREADS i32 (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:asc-constants (; 0 ;) (type $FUNCSIG$v)
i32.const 1
i32.const 0
drop
i32.const 0
drop

@ -1,5 +1,5 @@
{
"asc_flags": [
"--runtime arena"
"--runtime none"
]
}

@ -3,14 +3,13 @@
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 8) "\10\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/argc (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(export "testVar" (func $assert-nonnull/testVar))
(export "testObj" (func $assert-nonnull/testObj))
(export "testProp" (func $assert-nonnull/testProp))
@ -60,7 +59,7 @@
i32.const 16
i32.const 96
i32.const 45
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -74,7 +73,7 @@
i32.const 16
i32.const 99
i32.const 61
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -102,7 +101,7 @@
i32.const 16
i32.const 99
i32.const 61
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0

@ -1,3 +1,5 @@
import "allocator/arena";
export function testVar(n: Error | null): Error {
return n!;
}

@ -4,15 +4,13 @@
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/argc (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 44))
(export "memory" (memory $0))
(export "table" (table $0))
(export "testVar" (func $assert-nonnull/testVar))
(export "testObj" (func $assert-nonnull/testObj))
(export "testProp" (func $assert-nonnull/testProp))
@ -76,7 +74,7 @@
i32.const 16
i32.const 96
i32.const 45
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $1
@ -90,7 +88,7 @@
i32.const 16
i32.const 99
i32.const 61
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -130,7 +128,7 @@
i32.const 16
i32.const 99
i32.const 61
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0

@ -1,12 +1,9 @@
(module
(type $FUNCSIG$v (func))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s")
(data (i32.const 40) "\01\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e")
(table $0 1 funcref)
(elem (i32.const 0) $start)
(data (i32.const 8) "\10\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s")
(data (i32.const 40) "\10\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e")
(export "memory" (memory $0))
(export "table" (table $0))
(func $start (; 0 ;) (type $FUNCSIG$v)
nop
)

@ -1,15 +1,13 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00")
(data (i32.const 40) "\01\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00")
(data (i32.const 8) "\10\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00")
(data (i32.const 40) "\10\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/memory/HEAP_BASE i32 (i32.const 72))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:assert (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
@ -20,7 +18,7 @@
i32.const 16
i32.const 1
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -30,7 +28,7 @@
i32.const 16
i32.const 2
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -42,7 +40,7 @@
i32.const 16
i32.const 3
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const 0.5
@ -53,7 +51,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const 0.5
@ -65,7 +63,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 4294967296
@ -75,7 +73,7 @@
i32.const 16
i32.const 6
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 4294967296
@ -87,7 +85,7 @@
i32.const 16
i32.const 7
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -99,7 +97,7 @@
i32.const 16
i32.const 10
i32.const 5
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.eqz

@ -3,15 +3,12 @@
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$ff (func (param f32) (result f32)))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $binary/b (mut i32) (i32.const 0))
(global $binary/i (mut i32) (i32.const 0))
(global $binary/I (mut i64) (i64.const 0))
(global $binary/f (mut f32) (f32.const 0))
(global $binary/F (mut f64) (f64.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $~lib/math/NativeMath.pow (; 0 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64)
(local $1 i32)

@ -14,9 +14,7 @@
(global $binary/I (mut i64) (i64.const 0))
(global $binary/f (mut f32) (f32.const 0))
(global $binary/F (mut f64) (f64.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $~lib/math/NativeMath.scalbn (; 0 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64)
(local $2 f64)

@ -1,11 +1,9 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s")
(global $bool/i (mut i32) (i32.const 2))
(global $bool/I (mut i64) (i64.const 2))
(global $bool/u (mut i32) (i32.const 2))
@ -14,7 +12,6 @@
(global $bool/F (mut f64) (f64.const 2))
(global $bool/uu (mut i32) (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:bool (; 1 ;) (type $FUNCSIG$v)
global.get $bool/i
@ -27,7 +24,7 @@
i32.const 16
i32.const 2
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/I
@ -40,7 +37,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/u
@ -53,7 +50,7 @@
i32.const 16
i32.const 6
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/U
@ -66,7 +63,7 @@
i32.const 16
i32.const 8
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/f
@ -79,7 +76,7 @@
i32.const 16
i32.const 10
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/F
@ -92,7 +89,7 @@
i32.const 16
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/uu
@ -105,7 +102,7 @@
i32.const 16
i32.const 14
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,9 +1,9 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $bool/i (mut i32) (i32.const 2))
@ -13,9 +13,7 @@
(global $bool/f (mut f32) (f32.const 2))
(global $bool/F (mut f64) (f64.const 2))
(global $bool/uu (mut i32) (i32.const 2))
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:bool (; 1 ;) (type $FUNCSIG$v)
global.get $bool/i
@ -29,7 +27,7 @@
i32.const 16
i32.const 2
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/I
@ -43,7 +41,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/u
@ -57,7 +55,7 @@
i32.const 16
i32.const 6
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/U
@ -71,7 +69,7 @@
i32.const 16
i32.const 8
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/f
@ -85,7 +83,7 @@
i32.const 16
i32.const 10
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/F
@ -99,7 +97,7 @@
i32.const 16
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $bool/uu
@ -113,7 +111,7 @@
i32.const 16
i32.const 14
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -2,11 +2,11 @@
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s")
(data (i32.const 40) "\01")
(data (i32.const 48) "\01\00\00\00\06\00\00\00a\00b\00c")
(data (i32.const 8) "\10\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s")
(data (i32.const 40) "\10")
(data (i32.const 48) "\10\00\00\00\06\00\00\00a\00b\00c")
(table $0 2 funcref)
(elem (i32.const 0) $builtins/test $start:builtins~anonymous|0)
(global $builtins/b (mut i32) (i32.const 0))
@ -19,7 +19,6 @@
(global $builtins/s (mut i32) (i32.const 0))
(global $builtins/fn (mut i32) (i32.const 1))
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $builtins/test))
(start $start)
(func $start:builtins~anonymous|0 (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
@ -46,7 +45,7 @@
i32.const 16
i32.const 67
i32.const 19
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -59,7 +58,7 @@
i32.const 16
i32.const 68
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -72,7 +71,7 @@
i32.const 16
i32.const 69
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 63
@ -95,7 +94,7 @@
i32.const 16
i32.const 85
i32.const 19
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 2
@ -108,7 +107,7 @@
i32.const 16
i32.const 86
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 1
@ -121,7 +120,7 @@
i32.const 16
i32.const 87
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const nan:0x400000

@ -4,11 +4,11 @@
(type $FUNCSIG$id (func (param f64) (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00")
(data (i32.const 40) "\01\00\00\00\00\00\00\00")
(data (i32.const 48) "\01\00\00\00\06\00\00\00a\00b\00c\00")
(data (i32.const 8) "\10\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00")
(data (i32.const 40) "\10\00\00\00\00\00\00\00")
(data (i32.const 48) "\10\00\00\00\06\00\00\00a\00b\00c\00")
(table $0 2 funcref)
(elem (i32.const 0) $null $start:builtins~anonymous|0)
(global $builtins/b (mut i32) (i32.const 0))
@ -51,9 +51,7 @@
(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 $~lib/memory/HEAP_BASE i32 (i32.const 64))
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $builtins/test))
(start $start)
(func $~lib/builtins/isNaN<f32> (; 1 ;) (type $FUNCSIG$if) (param $0 f32) (result i32)
@ -95,7 +93,7 @@
i32.const 16
i32.const 6
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -106,7 +104,7 @@
i32.const 16
i32.const 7
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -116,7 +114,7 @@
i32.const 16
i32.const 8
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -127,7 +125,7 @@
i32.const 16
i32.const 9
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -137,7 +135,7 @@
i32.const 16
i32.const 10
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -148,7 +146,7 @@
i32.const 16
i32.const 11
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -158,7 +156,7 @@
i32.const 16
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -169,7 +167,7 @@
i32.const 16
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -179,7 +177,7 @@
i32.const 16
i32.const 14
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -189,7 +187,7 @@
i32.const 16
i32.const 15
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -199,7 +197,7 @@
i32.const 16
i32.const 16
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -210,7 +208,7 @@
i32.const 16
i32.const 17
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -220,7 +218,7 @@
i32.const 16
i32.const 18
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -231,7 +229,7 @@
i32.const 16
i32.const 19
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -241,7 +239,7 @@
i32.const 16
i32.const 20
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -252,7 +250,7 @@
i32.const 16
i32.const 21
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -262,7 +260,7 @@
i32.const 16
i32.const 23
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -273,7 +271,7 @@
i32.const 16
i32.const 24
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -283,7 +281,7 @@
i32.const 16
i32.const 25
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -294,7 +292,7 @@
i32.const 16
i32.const 26
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -304,7 +302,7 @@
i32.const 16
i32.const 27
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -315,7 +313,7 @@
i32.const 16
i32.const 28
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -325,7 +323,7 @@
i32.const 16
i32.const 29
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -335,7 +333,7 @@
i32.const 16
i32.const 30
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -346,7 +344,7 @@
i32.const 16
i32.const 31
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -356,7 +354,7 @@
i32.const 16
i32.const 32
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -366,7 +364,7 @@
i32.const 16
i32.const 33
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -376,7 +374,7 @@
i32.const 16
i32.const 34
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -386,7 +384,7 @@
i32.const 16
i32.const 35
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -397,7 +395,7 @@
i32.const 16
i32.const 36
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -407,7 +405,7 @@
i32.const 16
i32.const 37
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -418,7 +416,7 @@
i32.const 16
i32.const 38
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -428,7 +426,7 @@
i32.const 16
i32.const 39
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -439,7 +437,7 @@
i32.const 16
i32.const 40
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -449,7 +447,7 @@
i32.const 16
i32.const 44
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -460,7 +458,7 @@
i32.const 16
i32.const 45
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -470,7 +468,7 @@
i32.const 16
i32.const 46
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -481,7 +479,7 @@
i32.const 16
i32.const 47
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -565,7 +563,7 @@
i32.const 16
i32.const 67
i32.const 19
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -586,7 +584,7 @@
i32.const 16
i32.const 68
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -607,7 +605,7 @@
i32.const 16
i32.const 69
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 1
@ -673,7 +671,7 @@
i32.const 16
i32.const 85
i32.const 19
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 1
@ -694,7 +692,7 @@
i32.const 16
i32.const 86
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i64.const 1
@ -715,7 +713,7 @@
i32.const 16
i32.const 87
i32.const 20
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const nan:0x400000
@ -762,7 +760,7 @@
i32.const 16
i32.const 104
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const nan:0x400000
@ -775,7 +773,7 @@
i32.const 16
i32.const 105
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const 1.25
@ -788,7 +786,7 @@
i32.const 16
i32.const 106
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const inf
@ -801,7 +799,7 @@
i32.const 16
i32.const 107
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const inf
@ -815,7 +813,7 @@
i32.const 16
i32.const 108
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const nan:0x400000
@ -828,7 +826,7 @@
i32.const 16
i32.const 109
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const nan:0x400000
@ -919,7 +917,7 @@
i32.const 16
i32.const 140
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const nan:0x8000000000000
@ -932,7 +930,7 @@
i32.const 16
i32.const 141
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const 1.25
@ -945,7 +943,7 @@
i32.const 16
i32.const 142
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const inf
@ -958,7 +956,7 @@
i32.const 16
i32.const 143
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const inf
@ -972,7 +970,7 @@
i32.const 16
i32.const 144
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const nan:0x8000000000000
@ -985,7 +983,7 @@
i32.const 16
i32.const 145
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const nan:0x8000000000000
@ -1285,7 +1283,7 @@
i32.const 16
i32.const 264
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -1297,7 +1295,7 @@
i32.const 16
i32.const 265
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 4
@ -1309,7 +1307,7 @@
i32.const 16
i32.const 266
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 8
@ -1321,7 +1319,7 @@
i32.const 16
i32.const 267
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 4
@ -1335,7 +1333,7 @@
i32.const 16
i32.const 269
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -1347,7 +1345,7 @@
i32.const 16
i32.const 270
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -1359,7 +1357,7 @@
i32.const 16
i32.const 271
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 4
@ -1371,7 +1369,7 @@
i32.const 16
i32.const 272
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 8
@ -1383,7 +1381,7 @@
i32.const 16
i32.const 273
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 4
@ -1397,7 +1395,7 @@
i32.const 16
i32.const 275
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 8
@ -1409,7 +1407,7 @@
i32.const 16
i32.const 276
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -1421,7 +1419,7 @@
i32.const 16
i32.const 278
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -1433,7 +1431,7 @@
i32.const 16
i32.const 279
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -1445,7 +1443,7 @@
i32.const 16
i32.const 280
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 3
@ -1457,7 +1455,7 @@
i32.const 16
i32.const 281
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -1469,7 +1467,7 @@
i32.const 16
i32.const 282
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -1481,7 +1479,7 @@
i32.const 16
i32.const 285
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 4
@ -1493,7 +1491,7 @@
i32.const 16
i32.const 286
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -1505,7 +1503,7 @@
i32.const 16
i32.const 287
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -1517,7 +1515,7 @@
i32.const 16
i32.const 288
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -1529,7 +1527,7 @@
i32.const 16
i32.const 290
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 8
@ -1541,7 +1539,7 @@
i32.const 16
i32.const 291
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const nan:0x8000000000000
@ -1553,7 +1551,7 @@
i32.const 16
i32.const 293
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const nan:0x400000
@ -1564,7 +1562,7 @@
i32.const 16
i32.const 294
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const nan:0x8000000000000
@ -1575,7 +1573,7 @@
i32.const 16
i32.const 295
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const nan:0x400000
@ -1587,7 +1585,7 @@
i32.const 16
i32.const 296
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const inf
@ -1599,7 +1597,7 @@
i32.const 16
i32.const 297
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const nan:0x8000000000000
@ -1611,7 +1609,7 @@
i32.const 16
i32.const 298
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const inf
@ -1623,7 +1621,7 @@
i32.const 16
i32.const 299
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const 0
@ -1634,7 +1632,7 @@
i32.const 16
i32.const 300
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const 0
@ -1645,7 +1643,7 @@
i32.const 16
i32.const 301
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i8.MIN_VALUE
@ -1661,7 +1659,7 @@
i32.const 16
i32.const 314
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i8.MAX_VALUE
@ -1673,7 +1671,7 @@
i32.const 16
i32.const 315
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i16.MIN_VALUE
@ -1689,7 +1687,7 @@
i32.const 16
i32.const 316
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i16.MAX_VALUE
@ -1701,7 +1699,7 @@
i32.const 16
i32.const 317
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i32.MIN_VALUE
@ -1713,7 +1711,7 @@
i32.const 16
i32.const 318
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i32.MAX_VALUE
@ -1725,7 +1723,7 @@
i32.const 16
i32.const 319
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i64.MIN_VALUE
@ -1737,7 +1735,7 @@
i32.const 16
i32.const 320
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/i64.MAX_VALUE
@ -1749,7 +1747,7 @@
i32.const 16
i32.const 321
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u8.MIN_VALUE
@ -1761,7 +1759,7 @@
i32.const 16
i32.const 323
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u8.MAX_VALUE
@ -1773,7 +1771,7 @@
i32.const 16
i32.const 324
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u16.MIN_VALUE
@ -1785,7 +1783,7 @@
i32.const 16
i32.const 325
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u16.MAX_VALUE
@ -1797,7 +1795,7 @@
i32.const 16
i32.const 326
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u32.MIN_VALUE
@ -1809,7 +1807,7 @@
i32.const 16
i32.const 327
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u32.MAX_VALUE
@ -1821,7 +1819,7 @@
i32.const 16
i32.const 328
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u64.MIN_VALUE
@ -1833,7 +1831,7 @@
i32.const 16
i32.const 329
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/u64.MAX_VALUE
@ -1845,7 +1843,7 @@
i32.const 16
i32.const 330
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/bool.MIN_VALUE
@ -1857,7 +1855,7 @@
i32.const 16
i32.const 331
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/bool.MIN_VALUE
@ -1869,7 +1867,7 @@
i32.const 16
i32.const 331
i32.const 29
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/bool.MAX_VALUE
@ -1881,7 +1879,7 @@
i32.const 16
i32.const 332
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/bool.MAX_VALUE
@ -1893,7 +1891,7 @@
i32.const 16
i32.const 332
i32.const 29
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f32.MIN_NORMAL_VALUE
@ -1905,7 +1903,7 @@
i32.const 16
i32.const 334
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f32.MIN_VALUE
@ -1917,7 +1915,7 @@
i32.const 16
i32.const 335
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f32.MAX_VALUE
@ -1929,7 +1927,7 @@
i32.const 16
i32.const 336
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f32.MIN_SAFE_INTEGER
@ -1941,7 +1939,7 @@
i32.const 16
i32.const 337
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f32.MAX_SAFE_INTEGER
@ -1953,7 +1951,7 @@
i32.const 16
i32.const 338
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f32.EPSILON
@ -1965,7 +1963,7 @@
i32.const 16
i32.const 339
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f64.MIN_NORMAL_VALUE
@ -1977,7 +1975,7 @@
i32.const 16
i32.const 341
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f64.MIN_VALUE
@ -1989,7 +1987,7 @@
i32.const 16
i32.const 342
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f64.MAX_VALUE
@ -2001,7 +1999,7 @@
i32.const 16
i32.const 343
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f64.MIN_SAFE_INTEGER
@ -2013,7 +2011,7 @@
i32.const 16
i32.const 344
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f64.MAX_SAFE_INTEGER
@ -2025,7 +2023,7 @@
i32.const 16
i32.const 345
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $~lib/builtins/f64.EPSILON
@ -2037,7 +2035,7 @@
i32.const 16
i32.const 346
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const 1

@ -1,11 +1,8 @@
(module
(type $FUNCSIG$v (func))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $start)
(data (i32.const 8) "\10\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s")
(export "memory" (memory $0))
(export "table" (table $0))
(func $start (; 0 ;) (type $FUNCSIG$v)
nop
)

@ -4,14 +4,12 @@
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$ff (func (param f32) (result f32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/memory/HEAP_BASE i32 (i32.const 48))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $call-inferred/foo<i32> (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
@ -36,7 +34,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f64.const 42
@ -49,7 +47,7 @@
i32.const 16
i32.const 6
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const 42
@ -62,7 +60,7 @@
i32.const 16
i32.const 7
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
f32.const 42
@ -75,7 +73,7 @@
i32.const 16
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -2,15 +2,14 @@
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s")
(data (i32.const 8) "\10\00\00\00 \00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s")
(table $0 2 funcref)
(elem (i32.const 0) $null $call-optional/opt|trampoline)
(global $~lib/argc (mut i32) (i32.const 0))
(global $call-optional/optIndirect (mut i32) (i32.const 1))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $call-optional/opt|trampoline (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
block $2of2
@ -68,7 +67,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -106,7 +105,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -121,7 +120,7 @@
i32.const 16
i32.const 9
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -138,7 +137,7 @@
i32.const 16
i32.const 10
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 3
@ -155,7 +154,7 @@
i32.const 16
i32.const 11
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -2,16 +2,14 @@
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00 \00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00")
(table $0 2 funcref)
(elem (i32.const 0) $null $call-optional/opt|trampoline)
(global $~lib/argc (mut i32) (i32.const 0))
(global $call-optional/optIndirect (mut i32) (i32.const 1))
(global $~lib/memory/HEAP_BASE i32 (i32.const 48))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $call-optional/opt (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
@ -60,7 +58,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -79,7 +77,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 3
@ -94,7 +92,7 @@
i32.const 16
i32.const 6
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -114,7 +112,7 @@
i32.const 16
i32.const 9
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -134,7 +132,7 @@
i32.const 16
i32.const 10
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -154,7 +152,7 @@
i32.const 16
i32.const 11
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,5 +1,5 @@
{
"asc_flags": [
"--runtime arena"
"--runtime none"
]
}

@ -4,16 +4,13 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(data (i32.const 56) "\02\00\00\00\1a\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(data (i32.const 56) "\10\00\00\00\1a\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s")
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $~lib/allocator/arena/__mem_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
@ -106,9 +103,9 @@
if
i32.const 0
i32.const 16
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -121,9 +118,9 @@
if
i32.const 0
i32.const 16
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -137,7 +134,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $0
end
@ -151,9 +148,9 @@
if
i32.const 0
i32.const 64
i32.const 6
i32.const 8
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -162,7 +159,7 @@
(local $0 i32)
i32.const 8
call $~lib/util/runtime/allocate
i32.const 3
i32.const 18
call $~lib/util/runtime/register
call $call-super/A#constructor
local.tee $0
@ -175,9 +172,9 @@
if
i32.const 0
i32.const 64
i32.const 15
i32.const 17
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -187,9 +184,9 @@
if
i32.const 0
i32.const 64
i32.const 16
i32.const 18
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -204,9 +201,9 @@
if
i32.const 0
i32.const 64
i32.const 22
i32.const 24
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -216,9 +213,9 @@
if
i32.const 0
i32.const 64
i32.const 23
i32.const 25
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -226,14 +223,14 @@
(local $0 i32)
i32.const 8
call $~lib/util/runtime/allocate
i32.const 5
i32.const 20
call $~lib/util/runtime/register
local.tee $0
i32.eqz
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 4
i32.const 19
call $~lib/util/runtime/register
local.set $0
end
@ -250,9 +247,9 @@
if
i32.const 0
i32.const 64
i32.const 38
i32.const 40
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -262,9 +259,9 @@
if
i32.const 0
i32.const 64
i32.const 39
i32.const 41
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -279,9 +276,9 @@
if
i32.const 0
i32.const 64
i32.const 45
i32.const 47
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -291,9 +288,9 @@
if
i32.const 0
i32.const 64
i32.const 46
i32.const 48
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -303,7 +300,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 6
i32.const 21
call $~lib/util/runtime/register
local.set $0
end
@ -317,9 +314,9 @@
if
i32.const 0
i32.const 64
i32.const 56
i32.const 58
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -328,7 +325,7 @@
(local $0 i32)
i32.const 8
call $~lib/util/runtime/allocate
i32.const 7
i32.const 22
call $~lib/util/runtime/register
call $call-super/E#constructor
local.tee $0
@ -341,9 +338,9 @@
if
i32.const 0
i32.const 64
i32.const 66
i32.const 68
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -353,9 +350,9 @@
if
i32.const 0
i32.const 64
i32.const 67
i32.const 69
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -363,14 +360,14 @@
(local $0 i32)
i32.const 8
call $~lib/util/runtime/allocate
i32.const 9
i32.const 24
call $~lib/util/runtime/register
local.tee $0
i32.eqz
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 8
i32.const 23
call $~lib/util/runtime/register
local.set $0
end
@ -394,9 +391,9 @@
if
i32.const 0
i32.const 64
i32.const 84
i32.const 86
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -406,9 +403,9 @@
if
i32.const 0
i32.const 64
i32.const 85
i32.const 87
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -416,14 +413,14 @@
(local $0 i32)
i32.const 8
call $~lib/util/runtime/allocate
i32.const 11
i32.const 26
call $~lib/util/runtime/register
local.tee $0
i32.eqz
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 10
i32.const 25
call $~lib/util/runtime/register
local.set $0
end
@ -447,9 +444,9 @@
if
i32.const 0
i32.const 64
i32.const 104
i32.const 106
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -459,9 +456,9 @@
if
i32.const 0
i32.const 64
i32.const 105
i32.const 107
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,3 +1,5 @@
import "allocator/arena";
// both constructors present
class A {

@ -3,10 +3,10 @@
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 56) "\02\00\00\00\1a\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 56) "\10\00\00\00\1a\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/util/runtime/HEADER_SIZE i32 (i32.const 8))
@ -16,7 +16,6 @@
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 92))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 1
@ -139,9 +138,9 @@
if
i32.const 0
i32.const 16
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -156,9 +155,9 @@
if
i32.const 0
i32.const 16
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -173,7 +172,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $0
end
@ -189,9 +188,9 @@
if
i32.const 0
i32.const 64
i32.const 6
i32.const 8
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -203,7 +202,7 @@
else
i32.const 8
call $~lib/util/runtime/allocate
i32.const 3
i32.const 18
call $~lib/util/runtime/register
end
call $call-super/A#constructor
@ -219,9 +218,9 @@
if
i32.const 0
i32.const 64
i32.const 15
i32.const 17
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -232,9 +231,9 @@
if
i32.const 0
i32.const 64
i32.const 16
i32.const 18
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -252,9 +251,9 @@
if
i32.const 0
i32.const 64
i32.const 22
i32.const 24
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -265,9 +264,9 @@
if
i32.const 0
i32.const 64
i32.const 23
i32.const 25
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -277,7 +276,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 4
i32.const 19
call $~lib/util/runtime/register
local.set $0
end
@ -293,7 +292,7 @@
else
i32.const 8
call $~lib/util/runtime/allocate
i32.const 5
i32.const 20
call $~lib/util/runtime/register
end
call $call-super/C#constructor
@ -309,9 +308,9 @@
if
i32.const 0
i32.const 64
i32.const 38
i32.const 40
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -322,9 +321,9 @@
if
i32.const 0
i32.const 64
i32.const 39
i32.const 41
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -342,9 +341,9 @@
if
i32.const 0
i32.const 64
i32.const 45
i32.const 47
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -355,9 +354,9 @@
if
i32.const 0
i32.const 64
i32.const 46
i32.const 48
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -368,7 +367,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 6
i32.const 21
call $~lib/util/runtime/register
local.set $0
end
@ -384,9 +383,9 @@
if
i32.const 0
i32.const 64
i32.const 56
i32.const 58
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -397,7 +396,7 @@
if
i32.const 8
call $~lib/util/runtime/allocate
i32.const 7
i32.const 22
call $~lib/util/runtime/register
local.set $0
end
@ -422,9 +421,9 @@
if
i32.const 0
i32.const 64
i32.const 66
i32.const 68
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -435,9 +434,9 @@
if
i32.const 0
i32.const 64
i32.const 67
i32.const 69
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -447,7 +446,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 8
i32.const 23
call $~lib/util/runtime/register
local.set $0
end
@ -462,7 +461,7 @@
if
i32.const 8
call $~lib/util/runtime/allocate
i32.const 9
i32.const 24
call $~lib/util/runtime/register
local.set $0
end
@ -487,9 +486,9 @@
if
i32.const 0
i32.const 64
i32.const 84
i32.const 86
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -500,9 +499,9 @@
if
i32.const 0
i32.const 64
i32.const 85
i32.const 87
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)
@ -512,7 +511,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 10
i32.const 25
call $~lib/util/runtime/register
local.set $0
end
@ -527,7 +526,7 @@
if
i32.const 8
call $~lib/util/runtime/allocate
i32.const 11
i32.const 26
call $~lib/util/runtime/register
local.set $0
end
@ -552,9 +551,9 @@
if
i32.const 0
i32.const 64
i32.const 104
i32.const 106
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -565,9 +564,9 @@
if
i32.const 0
i32.const 64
i32.const 105
i32.const 107
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1 +1,5 @@
{}
{
"asc_flags": [
"--runtime none"
]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -2,10 +2,7 @@
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $start)
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $class-overloading/test))
(func $class-overloading/test (; 0 ;) (type $FUNCSIG$vi) (param $0 i32)
nop

@ -4,9 +4,7 @@
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $class-overloading/test))
(start $start)
(func $class-overloading/Foo#baz (; 0 ;) (type $FUNCSIG$vi) (param $0 i32)

@ -1 +1,5 @@
{}
{
"asc_flags": [
"--runtime none"
]
}

File diff suppressed because it is too large Load Diff

@ -1,3 +1,5 @@
import "allocator/arena";
class Animal<T> {
static ONE: i32 = 1;
static add(a: i32, b: i32): i32 { return a + b + Animal.ONE; }

File diff suppressed because it is too large Load Diff

@ -1 +1,5 @@
{}
{
"asc_flags": [
"--runtime none"
]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,15 +1,12 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s")
(global $comma/a (mut i32) (i32.const 0))
(global $comma/b (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:comma (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
@ -28,7 +25,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -37,7 +34,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/a
@ -55,7 +52,7 @@
i32.const 16
i32.const 8
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -66,7 +63,7 @@
i32.const 16
i32.const 9
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -88,7 +85,7 @@
i32.const 16
i32.const 14
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -99,7 +96,7 @@
i32.const 16
i32.const 15
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/a
@ -119,7 +116,7 @@
i32.const 16
i32.const 18
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -130,7 +127,7 @@
i32.const 16
i32.const 19
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -160,7 +157,7 @@
i32.const 16
i32.const 22
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,16 +1,14 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $comma/a (mut i32) (i32.const 0))
(global $comma/b (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:comma (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
@ -37,7 +35,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -49,7 +47,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block
@ -69,7 +67,7 @@
i32.const 16
i32.const 8
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -81,7 +79,7 @@
i32.const 16
i32.const 9
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -108,7 +106,7 @@
i32.const 16
i32.const 14
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -120,7 +118,7 @@
i32.const 16
i32.const 15
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -145,7 +143,7 @@
i32.const 16
i32.const 18
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $comma/b
@ -157,7 +155,7 @@
i32.const 16
i32.const 19
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block $break|0
@ -194,7 +192,7 @@
i32.const 16
i32.const 22
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block

@ -1 +1,5 @@
{}
{
"asc_flags": [
"--runtime none"
]
}

File diff suppressed because it is too large Load Diff

@ -1,3 +1,5 @@
import "allocator/arena";
// trailing conditional allocate
class EmptyCtor {
constructor() {}

File diff suppressed because it is too large Load Diff

@ -4,14 +4,11 @@
(import "declare" "externalConstant" (global $declare/externalConstant i32))
(import "declare" "my.externalConstant" (global $declare/my.externalConstant i32))
(import "declare" "externalFunction" (func $declare/externalFunction))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "declare" "my.externalFunction" (func $declare/my.externalFunction))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s")
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:declare (; 3 ;) (type $FUNCSIG$v)
call $declare/externalFunction
@ -23,7 +20,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
call $declare/my.externalFunction
@ -35,7 +32,7 @@
i32.const 16
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -4,15 +4,13 @@
(import "declare" "externalConstant" (global $declare/externalConstant i32))
(import "declare" "my.externalConstant" (global $declare/my.externalConstant i32))
(import "declare" "externalFunction" (func $declare/externalFunction))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "declare" "my.externalFunction" (func $declare/my.externalFunction))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/memory/HEAP_BASE i32 (i32.const 36))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:declare (; 3 ;) (type $FUNCSIG$v)
call $declare/externalFunction
@ -25,7 +23,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
call $declare/my.externalFunction
@ -38,7 +36,7 @@
i32.const 16
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,16 +1,13 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\n\00\00\00d\00o\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00\n\00\00\00d\00o\00.\00t\00s")
(global $do/n (mut i32) (i32.const 10))
(global $do/m (mut i32) (i32.const 0))
(global $do/o (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:do (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
@ -32,7 +29,7 @@
i32.const 16
i32.const 7
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/m
@ -43,7 +40,7 @@
i32.const 16
i32.const 8
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 10
@ -65,7 +62,7 @@
i32.const 16
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 10
@ -99,7 +96,7 @@
i32.const 16
i32.const 24
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/o
@ -110,7 +107,7 @@
i32.const 16
i32.const 25
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/n
@ -122,7 +119,7 @@
i32.const 16
i32.const 27
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/m
@ -133,7 +130,7 @@
i32.const 16
i32.const 28
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/o
@ -144,7 +141,7 @@
i32.const 16
i32.const 29
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,17 +1,15 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\n\00\00\00d\00o\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\n\00\00\00d\00o\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $do/n (mut i32) (i32.const 10))
(global $do/m (mut i32) (i32.const 0))
(global $do/o (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 28))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:do (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
@ -40,7 +38,7 @@
i32.const 16
i32.const 7
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/m
@ -52,7 +50,7 @@
i32.const 16
i32.const 8
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 10
@ -80,7 +78,7 @@
i32.const 16
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 10
@ -123,7 +121,7 @@
i32.const 16
i32.const 24
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/o
@ -135,7 +133,7 @@
i32.const 16
i32.const 25
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
end
@ -152,7 +150,7 @@
i32.const 16
i32.const 27
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/m
@ -164,7 +162,7 @@
i32.const 16
i32.const 28
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $do/o
@ -176,7 +174,7 @@
i32.const 16
i32.const 29
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,10 +1,7 @@
(module
(type $FUNCSIG$v (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(export "memory" (memory $0))
(export "table" (table $0))
(func $null (; 0 ;) (type $FUNCSIG$v)
nop
)

@ -3,9 +3,7 @@
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(func $null (; 0 ;) (type $FUNCSIG$v)
)
)

@ -1,8 +1,6 @@
(module
(type $FUNCSIG$v (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $enum/Implicit.ZERO i32 (i32.const 0))
(global $enum/Implicit.ONE i32 (i32.const 1))
(global $enum/Implicit.TWO i32 (i32.const 2))
@ -34,7 +32,6 @@
(global $enum/SelfReferenceConst.ZERO i32 (i32.const 0))
(global $enum/SelfReferenceConst.ONE i32 (i32.const 1))
(export "memory" (memory $0))
(export "table" (table $0))
(export "Implicit.ZERO" (global $enum/Implicit.ZERO))
(export "Implicit.ONE" (global $enum/Implicit.ONE))
(export "Implicit.TWO" (global $enum/Implicit.TWO))

@ -35,9 +35,7 @@
(global $enum/SelfReferenceConst.ZERO i32 (i32.const 0))
(global $enum/SelfReferenceConst.ONE i32 (i32.const 1))
(global $enum/enumType (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(export "Implicit.ZERO" (global $enum/Implicit.ZERO))
(export "Implicit.ONE" (global $enum/Implicit.ONE))
(export "Implicit.TWO" (global $enum/Implicit.TWO))

@ -2,13 +2,10 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$v (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $export/ns.one)
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $export/c i32 (i32.const 3))
(export "memory" (memory $0))
(export "table" (table $0))
(export "add" (func $export/add))
(export "sub" (func $export/sub))
(export "renamed_mul" (func $export/mul))

@ -7,9 +7,7 @@
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $export/c i32 (i32.const 3))
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(export "add" (func $export/add))
(export "sub" (func $export/sub))
(export "renamed_mul" (func $export/mul))

@ -6,11 +6,9 @@
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(global $exports/Animal.CAT i32 (i32.const 0))
(global $exports/Animal.DOG i32 (i32.const 1))
(global $exports/animals.Animal.CAT i32 (i32.const 0))
@ -21,10 +19,9 @@
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $~lib/argc (mut i32) (i32.const 0))
(global $exports/Car i32 (i32.const 1))
(global $exports/vehicles.Car i32 (i32.const 3))
(global $exports/Car i32 (i32.const 17))
(global $exports/vehicles.Car i32 (i32.const 18))
(export "memory" (memory $0))
(export "table" (table $0))
(export "add" (func $exports/add))
(export "$.setArgc" (func $~lib/setargc))
(export "subOpt" (func $exports/subOpt|trampoline))
@ -150,9 +147,9 @@
if
i32.const 0
i32.const 16
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -165,9 +162,9 @@
if
i32.const 0
i32.const 16
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -234,7 +231,7 @@
i32.eqz
if
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $0
end
@ -262,7 +259,7 @@
i32.eqz
if
call $~lib/util/runtime/allocate
i32.const 3
i32.const 18
call $~lib/util/runtime/register
local.set $0
end

@ -6,9 +6,9 @@
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00(\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $exports/Animal.CAT i32 (i32.const 0))
@ -25,10 +25,9 @@
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 56))
(global $~lib/argc (mut i32) (i32.const 0))
(global $exports/Car i32 (i32.const 1))
(global $exports/vehicles.Car i32 (i32.const 3))
(global $exports/Car i32 (i32.const 17))
(global $exports/vehicles.Car i32 (i32.const 18))
(export "memory" (memory $0))
(export "table" (table $0))
(export "add" (func $exports/add))
(export "$.setArgc" (func $~lib/setargc))
(export "subOpt" (func $exports/subOpt|trampoline))
@ -196,9 +195,9 @@
if
i32.const 0
i32.const 16
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -213,9 +212,9 @@
if
i32.const 0
i32.const 16
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -230,7 +229,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $0
end
@ -265,7 +264,7 @@
if
i32.const 4
call $~lib/util/runtime/allocate
i32.const 3
i32.const 18
call $~lib/util/runtime/register
local.set $0
end

@ -6,10 +6,7 @@
(import "external" "bar" (func $external/two))
(import "foo" "baz" (func $external/three))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(export "memory" (memory $0))
(export "table" (table $0))
(export "foo" (func $external/foo))
(export "foo.bar" (func $external/foo.bar))
(export "two" (func $external/two))

@ -8,9 +8,7 @@
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(export "foo" (func $external/foo))
(export "foo.bar" (func $external/foo.bar))
(export "two" (func $external/two))

@ -1,14 +1,11 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\0c\00\00\00f\00o\00r\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(data (i32.const 8) "\10\00\00\00\0c\00\00\00f\00o\00r\00.\00t\00s")
(global $for/i (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:for (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
@ -36,7 +33,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
loop $repeat|1
@ -71,7 +68,7 @@
i32.const 16
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
loop $repeat|3
@ -119,7 +116,7 @@
i32.const 16
i32.const 19
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0

@ -1,15 +1,13 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\0c\00\00\00f\00o\00r\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\0c\00\00\00f\00o\00r\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $for/i (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 28))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:for (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
@ -44,7 +42,7 @@
i32.const 16
i32.const 5
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block $break|1
@ -92,7 +90,7 @@
i32.const 16
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block $break|3
@ -168,7 +166,7 @@
i32.const 16
i32.const 19
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block $break|6

@ -4,9 +4,9 @@
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00,\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s")
(data (i32.const 8) "\10\00\00\00,\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s")
(table $0 11 funcref)
(elem (i32.const 0) $start:function-expression~someName $start:function-expression~anonymous|0 $start:function-expression~anonymous|0 $start:function-expression~someName $start:function-expression~anonymous|2 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5)
(global $function-expression/f1 (mut i32) (i32.const 1))
@ -15,7 +15,6 @@
(global $function-expression/f3 (mut i32) (i32.const 3))
(global $function-expression/f4 (mut i32) (i32.const 4))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:function-expression~anonymous|0 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
@ -50,7 +49,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -65,7 +64,7 @@
i32.const 16
i32.const 9
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -83,7 +82,7 @@
i32.const 16
i32.const 16
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -99,7 +98,7 @@
i32.const 16
i32.const 21
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -115,7 +114,7 @@
i32.const 16
i32.const 22
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -131,7 +130,7 @@
i32.const 16
i32.const 23
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -147,7 +146,7 @@
i32.const 16
i32.const 34
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -163,7 +162,7 @@
i32.const 16
i32.const 35
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -179,7 +178,7 @@
i32.const 16
i32.const 36
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -4,9 +4,9 @@
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00,\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00,\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00")
(table $0 11 funcref)
(elem (i32.const 0) $null $start:function-expression~anonymous|0 $start:function-expression~anonymous|1 $start:function-expression~someName $start:function-expression~anonymous|2 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $function-expression/testOmittedReturn1~anonymous|0 $function-expression/testOmittedReturn2~anonymous|0 $function-expression/testOmittedReturn3~anonymous|0)
(global $function-expression/f1 (mut i32) (i32.const 1))
@ -14,9 +14,7 @@
(global $function-expression/f2 (mut i32) (i32.const 2))
(global $function-expression/f3 (mut i32) (i32.const 3))
(global $function-expression/f4 (mut i32) (i32.const 4))
(global $~lib/memory/HEAP_BASE i32 (i32.const 60))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start:function-expression~anonymous|0 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
@ -85,7 +83,7 @@
i32.const 16
i32.const 4
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -103,7 +101,7 @@
i32.const 16
i32.const 9
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block
@ -126,7 +124,7 @@
i32.const 16
i32.const 16
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 5
@ -139,7 +137,7 @@
i32.const 16
i32.const 21
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 6
@ -152,7 +150,7 @@
i32.const 16
i32.const 22
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 7
@ -165,7 +163,7 @@
i32.const 16
i32.const 23
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -184,7 +182,7 @@
i32.const 16
i32.const 34
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -203,7 +201,7 @@
i32.const 16
i32.const 35
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -222,7 +220,7 @@
i32.const 16
i32.const 36
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -4,16 +4,15 @@
(type $FUNCSIG$jjj (func (param i64 i64) (result i64)))
(type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\"\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s")
(data (i32.const 8) "\10\00\00\00\"\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s")
(table $0 5 funcref)
(elem (i32.const 0) $null $function-types/makeAdder<i32>~anonymous|0 $function-types/makeAdder<i64>~anonymous|0 $function-types/makeAdder<f64>~anonymous|0 $function-types/makeAdder<i32>~anonymous|0)
(global $function-types/i32Adder (mut i32) (i32.const 0))
(global $~lib/argc (mut i32) (i32.const 0))
(global $function-types/i64Adder (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $function-types/makeAdder<i32>~anonymous|0 (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
@ -47,7 +46,7 @@
i32.const 16
i32.const 11
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -65,7 +64,7 @@
i32.const 16
i32.const 15
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -81,7 +80,7 @@
i32.const 16
i32.const 17
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -97,7 +96,7 @@
i32.const 16
i32.const 23
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -113,7 +112,7 @@
i32.const 16
i32.const 29
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -129,7 +128,7 @@
i32.const 16
i32.const 35
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -160,7 +159,7 @@
i32.const 16
i32.const 41
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -176,7 +175,7 @@
i32.const 16
i32.const 42
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -6,17 +6,15 @@
(type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\01\00\00\00\"\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\"\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s\00")
(table $0 5 funcref)
(elem (i32.const 0) $null $function-types/makeAdder<i32>~anonymous|0 $function-types/makeAdder<i64>~anonymous|0 $function-types/makeAdder<f64>~anonymous|0 $function-types/addI32)
(global $function-types/i32Adder (mut i32) (i32.const 0))
(global $~lib/argc (mut i32) (i32.const 0))
(global $function-types/i64Adder (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 52))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $function-types/makeAdder<i32>~anonymous|0 (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
@ -109,7 +107,7 @@
i32.const 16
i32.const 11
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
call $function-types/makeAdder<i64>
@ -130,7 +128,7 @@
i32.const 16
i32.const 15
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result f64)
@ -149,7 +147,7 @@
i32.const 16
i32.const 17
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 2
@ -164,7 +162,7 @@
i32.const 16
i32.const 23
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 3
@ -178,7 +176,7 @@
i32.const 16
i32.const 29
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 4
@ -193,7 +191,7 @@
i32.const 16
i32.const 35
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
block (result i32)
@ -212,7 +210,7 @@
i32.const 16
i32.const 41
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 1
@ -227,7 +225,7 @@
i32.const 16
i32.const 42
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,10 +1,7 @@
(module
(type $FUNCSIG$v (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $start)
(export "memory" (memory $0))
(export "table" (table $0))
(func $start (; 0 ;) (type $FUNCSIG$v)
nop
)

@ -17,9 +17,7 @@
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $function/_ (; 0 ;) (type $FUNCSIG$v)
nop

@ -1,5 +1,5 @@
{
"asc_flags": [
"--runtime arena"
"--runtime none"
]
}

@ -7,23 +7,21 @@
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(")
(data (i32.const 8) "\10\00\00\00(")
(data (i32.const 24) "~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(data (i32.const 64) "\02\00\00\00\16")
(data (i32.const 64) "\10\00\00\00\16")
(data (i32.const 80) "g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r")
(data (i32.const 104) "\02\00\00\00\0e")
(data (i32.const 104) "\10\00\00\00\0e")
(data (i32.const 120) "g\00c\00.\00l\00i\00n\00k")
(data (i32.const 136) "\02\00\00\00\n")
(data (i32.const 136) "\10\00\00\00\n")
(data (i32.const 152) "g\00c\00.\00t\00s")
(data (i32.const 168) "\02\00\00\00\12")
(data (i32.const 168) "\10\00\00\00\12")
(data (i32.const 184) "g\00c\00.\00u\00n\00l\00i\00n\00k")
(data (i32.const 208) "\02\00\00\00\14")
(data (i32.const 208) "\10\00\00\00\14")
(data (i32.const 224) "g\00c\00.\00c\00o\00l\00l\00e\00c\00t")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $gc/_dummy/collect_count (mut i32) (i32.const 0))
(global $gc/_dummy/register_count (mut i32) (i32.const 0))
(global $gc/_dummy/register_ref (mut i32) (i32.const 0))
@ -39,7 +37,6 @@
(global $~lib/started (mut i32) (i32.const 0))
(global $~lib/capabilities i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $gc/main))
(export "$.capabilities" (global $~lib/capabilities))
(func $~lib/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
@ -133,7 +130,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/register_count
i32.const 1
i32.add
@ -149,9 +146,9 @@
if
i32.const 0
i32.const 24
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -164,9 +161,9 @@
if
i32.const 0
i32.const 24
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -186,7 +183,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/link_count
i32.const 1
i32.add
@ -206,7 +203,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/unlink_count
i32.const 1
i32.add
@ -229,14 +226,14 @@
global.get $~lib/allocator/arena/startOffset
global.set $~lib/allocator/arena/offset
call $~lib/util/runtime/allocate
i32.const 3
i32.const 18
call $~lib/util/runtime/register
global.set $~lib/runtime/ROOT
i32.const 1
global.set $~lib/started
end
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $2
global.get $gc/_dummy/link_count
@ -256,9 +253,9 @@
if
i32.const 0
i32.const 152
i32.const 14
i32.const 15
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -267,9 +264,9 @@
if
i32.const 0
i32.const 152
i32.const 15
i32.const 16
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/collect_count
@ -278,9 +275,9 @@
if
i32.const 0
i32.const 152
i32.const 16
i32.const 17
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -298,9 +295,9 @@
if
i32.const 0
i32.const 152
i32.const 23
i32.const 24
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -311,9 +308,9 @@
if
i32.const 0
i32.const 152
i32.const 24
i32.const 25
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/collect_count
@ -322,9 +319,9 @@
if
i32.const 0
i32.const 152
i32.const 25
i32.const 26
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -340,7 +337,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/collect_count
i32.const 1
i32.add
@ -351,9 +348,9 @@
if
i32.const 0
i32.const 152
i32.const 32
i32.const 33
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -362,9 +359,9 @@
if
i32.const 0
i32.const 152
i32.const 33
i32.const 34
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/collect_count
@ -375,9 +372,9 @@
if
i32.const 0
i32.const 152
i32.const 34
i32.const 35
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,3 +1,4 @@
import "allocator/arena";
import { link_count, unlink_count, collect_count } from "./gc/_dummy";
class Ref {}

@ -6,15 +6,15 @@
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
(type $FUNCSIG$vii (func (param i32 i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 64) "\02\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r\00")
(data (i32.const 104) "\02\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00l\00i\00n\00k\00")
(data (i32.const 136) "\02\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00t\00s\00")
(data (i32.const 168) "\02\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00u\00n\00l\00i\00n\00k\00")
(data (i32.const 208) "\02\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00c\00o\00l\00l\00e\00c\00t\00")
(data (i32.const 8) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 64) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r\00")
(data (i32.const 104) "\10\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00l\00i\00n\00k\00")
(data (i32.const 136) "\10\00\00\00\n\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00t\00s\00")
(data (i32.const 168) "\10\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00u\00n\00l\00i\00n\00k\00")
(data (i32.const 208) "\10\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00c\00o\00l\00l\00e\00c\00t\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $gc/_dummy/collect_count (mut i32) (i32.const 0))
@ -38,7 +38,6 @@
(global $~lib/memory/HEAP_BASE i32 (i32.const 244))
(global $~lib/capabilities i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $gc/main))
(export "$.capabilities" (global $~lib/capabilities))
(func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
@ -168,7 +167,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/register_count
i32.const 1
i32.add
@ -185,9 +184,9 @@
if
i32.const 0
i32.const 24
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -202,9 +201,9 @@
if
i32.const 0
i32.const 24
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -220,7 +219,7 @@
if
i32.const 0
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $0
end
@ -232,7 +231,7 @@
if
i32.const 0
call $~lib/util/runtime/allocate
i32.const 3
i32.const 18
call $~lib/util/runtime/register
local.set $0
end
@ -248,7 +247,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/link_count
i32.const 1
i32.add
@ -273,7 +272,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/unlink_count
i32.const 1
i32.add
@ -296,7 +295,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/collect_count
i32.const 1
i32.add
@ -337,9 +336,9 @@
if
i32.const 0
i32.const 152
i32.const 14
i32.const 15
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -349,9 +348,9 @@
if
i32.const 0
i32.const 152
i32.const 15
i32.const 16
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/collect_count
@ -361,9 +360,9 @@
if
i32.const 0
i32.const 152
i32.const 16
i32.const 17
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -381,9 +380,9 @@
if
i32.const 0
i32.const 152
i32.const 23
i32.const 24
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -395,9 +394,9 @@
if
i32.const 0
i32.const 152
i32.const 24
i32.const 25
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/collect_count
@ -407,9 +406,9 @@
if
i32.const 0
i32.const 152
i32.const 25
i32.const 26
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -426,9 +425,9 @@
if
i32.const 0
i32.const 152
i32.const 32
i32.const 33
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -438,9 +437,9 @@
if
i32.const 0
i32.const 152
i32.const 33
i32.const 34
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/collect_count
@ -452,9 +451,9 @@
if
i32.const 0
i32.const 152
i32.const 34
i32.const 35
i32.const 2
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,5 +1,5 @@
{
"asc_flags": [
"--runtime arena"
"--runtime none"
]
}

@ -5,17 +5,15 @@
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(")
(data (i32.const 8) "\10\00\00\00(")
(data (i32.const 24) "~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(data (i32.const 64) "\02\00\00\00\16")
(data (i32.const 64) "\10\00\00\00\16")
(data (i32.const 80) "g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r")
(data (i32.const 104) "\02\00\00\00&")
(data (i32.const 104) "\10\00\00\00&")
(data (i32.const 120) "g\00c\00/\00g\00l\00o\00b\00a\00l\00-\00a\00s\00s\00i\00g\00n\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $gc/_dummy/register_count (mut i32) (i32.const 0))
(global $gc/_dummy/register_ref (mut i32) (i32.const 0))
(global $gc/_dummy/link_count (mut i32) (i32.const 0))
@ -27,7 +25,6 @@
(global $~lib/started (mut i32) (i32.const 0))
(global $~lib/capabilities i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $gc/global-assign/main))
(export "$.capabilities" (global $~lib/capabilities))
(func $~lib/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
@ -121,7 +118,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/register_count
i32.const 1
i32.add
@ -137,9 +134,9 @@
if
i32.const 0
i32.const 24
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -152,13 +149,13 @@
if
i32.const 0
i32.const 24
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $1
i32.const 1
i32.const 17
i32.store
local.get $0
call $gc/_dummy/__ref_register
@ -180,27 +177,27 @@
if
i32.const 0
i32.const 120
i32.const 11
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
if
i32.const 0
i32.const 120
i32.const 12
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
if
i32.const 0
i32.const 120
i32.const 13
i32.const 14
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
call $~lib/util/runtime/allocate
@ -212,27 +209,27 @@
if
i32.const 0
i32.const 120
i32.const 18
i32.const 19
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
if
i32.const 0
i32.const 120
i32.const 19
i32.const 20
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
if
i32.const 0
i32.const 120
i32.const 20
i32.const 21
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,3 +1,4 @@
import "allocator/arena";
import { register_count, link_count, unlink_count } from "./_dummy";
@start export function main(): void {}

@ -5,12 +5,12 @@
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 64) "\02\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r\00")
(data (i32.const 104) "\02\00\00\00&\00\00\00\00\00\00\00\00\00\00\00g\00c\00/\00g\00l\00o\00b\00a\00l\00-\00a\00s\00s\00i\00g\00n\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 64) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r\00")
(data (i32.const 104) "\10\00\00\00&\00\00\00\00\00\00\00\00\00\00\00g\00c\00/\00g\00l\00o\00b\00a\00l\00-\00a\00s\00s\00i\00g\00n\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $gc/_dummy/collect_count (mut i32) (i32.const 0))
@ -35,7 +35,6 @@
(global $~lib/memory/HEAP_BASE i32 (i32.const 160))
(global $~lib/capabilities i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $gc/global-assign/main))
(export "$.capabilities" (global $~lib/capabilities))
(func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
@ -165,7 +164,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/register_count
i32.const 1
i32.add
@ -182,9 +181,9 @@
if
i32.const 0
i32.const 24
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -199,9 +198,9 @@
if
i32.const 0
i32.const 24
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -217,7 +216,7 @@
if
i32.const 0
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $0
end
@ -246,9 +245,9 @@
if
i32.const 0
i32.const 120
i32.const 11
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -258,9 +257,9 @@
if
i32.const 0
i32.const 120
i32.const 12
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -270,9 +269,9 @@
if
i32.const 0
i32.const 120
i32.const 13
i32.const 14
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -285,9 +284,9 @@
if
i32.const 0
i32.const 120
i32.const 18
i32.const 19
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -297,9 +296,9 @@
if
i32.const 0
i32.const 120
i32.const 19
i32.const 20
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -309,9 +308,9 @@
if
i32.const 0
i32.const 120
i32.const 20
i32.const 21
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,5 +1,5 @@
{
"asc_flags": [
"--runtime arena"
"--runtime none"
]
}

@ -5,17 +5,15 @@
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(")
(data (i32.const 8) "\10\00\00\00(")
(data (i32.const 24) "~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(data (i32.const 64) "\02\00\00\00\16")
(data (i32.const 64) "\10\00\00\00\16")
(data (i32.const 80) "g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r")
(data (i32.const 104) "\02\00\00\00\"")
(data (i32.const 104) "\10\00\00\00\"")
(data (i32.const 120) "g\00c\00/\00g\00l\00o\00b\00a\00l\00-\00i\00n\00i\00t\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $gc/_dummy/register_count (mut i32) (i32.const 0))
(global $gc/_dummy/register_ref (mut i32) (i32.const 0))
(global $gc/_dummy/link_count (mut i32) (i32.const 0))
@ -26,7 +24,6 @@
(global $~lib/started (mut i32) (i32.const 0))
(global $~lib/capabilities i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $gc/global-init/main))
(export "$.capabilities" (global $~lib/capabilities))
(func $~lib/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
@ -120,7 +117,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/register_count
i32.const 1
i32.add
@ -136,9 +133,9 @@
if
i32.const 0
i32.const 24
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -151,13 +148,13 @@
if
i32.const 0
i32.const 24
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $1
i32.const 1
i32.const 17
i32.store
local.get $0
call $gc/_dummy/__ref_register
@ -177,27 +174,27 @@
if
i32.const 0
i32.const 120
i32.const 10
i32.const 11
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
if
i32.const 0
i32.const 120
i32.const 11
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
if
i32.const 0
i32.const 120
i32.const 12
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
call $~lib/util/runtime/allocate
@ -209,27 +206,27 @@
if
i32.const 0
i32.const 120
i32.const 15
i32.const 16
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
if
i32.const 0
i32.const 120
i32.const 16
i32.const 17
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
if
i32.const 0
i32.const 120
i32.const 17
i32.const 18
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,3 +1,4 @@
import "allocator/arena";
import { register_count, link_count, unlink_count } from "./_dummy";
@start export function main(): void {}

@ -5,12 +5,12 @@
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 64) "\02\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r\00")
(data (i32.const 104) "\02\00\00\00\"\00\00\00\00\00\00\00\00\00\00\00g\00c\00/\00g\00l\00o\00b\00a\00l\00-\00i\00n\00i\00t\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00(\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 64) "\10\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r\00")
(data (i32.const 104) "\10\00\00\00\"\00\00\00\00\00\00\00\00\00\00\00g\00c\00/\00g\00l\00o\00b\00a\00l\00-\00i\00n\00i\00t\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $gc/_dummy/collect_count (mut i32) (i32.const 0))
@ -34,7 +34,6 @@
(global $~lib/memory/HEAP_BASE i32 (i32.const 156))
(global $~lib/capabilities i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $gc/global-init/main))
(export "$.capabilities" (global $~lib/capabilities))
(func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
@ -164,7 +163,7 @@
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
call $~lib/builtins/trace
global.get $gc/_dummy/register_count
i32.const 1
i32.add
@ -181,9 +180,9 @@
if
i32.const 0
i32.const 24
i32.const 128
i32.const 131
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $0
@ -198,9 +197,9 @@
if
i32.const 0
i32.const 24
i32.const 130
i32.const 133
i32.const 4
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
local.get $2
@ -216,7 +215,7 @@
if
i32.const 0
call $~lib/util/runtime/allocate
i32.const 1
i32.const 17
call $~lib/util/runtime/register
local.set $0
end
@ -243,9 +242,9 @@
if
i32.const 0
i32.const 120
i32.const 10
i32.const 11
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -255,9 +254,9 @@
if
i32.const 0
i32.const 120
i32.const 11
i32.const 12
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -267,9 +266,9 @@
if
i32.const 0
i32.const 120
i32.const 12
i32.const 13
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
i32.const 0
@ -282,9 +281,9 @@
if
i32.const 0
i32.const 120
i32.const 15
i32.const 16
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/link_count
@ -294,9 +293,9 @@
if
i32.const 0
i32.const 120
i32.const 16
i32.const 17
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
global.get $gc/_dummy/unlink_count
@ -306,9 +305,9 @@
if
i32.const 0
i32.const 120
i32.const 17
i32.const 18
i32.const 0
call $~lib/env/abort
call $~lib/builtins/abort
unreachable
end
)

@ -1,5 +1,5 @@
{
"asc_flags": [
"--runtime arena"
"--runtime none"
]
}

Some files were not shown because too many files have changed in this diff Show More