mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-30 17:32:16 +00:00
runtime integration and flag
This commit is contained in:
parent
c4a57025d2
commit
27f1905510
32
cli/asc.js
32
cli/asc.js
@ -82,6 +82,15 @@ exports.libraryFiles = exports.isBundle ? BUNDLE_LIBRARY : (() => { // set up if
|
||||
return bundled;
|
||||
})();
|
||||
|
||||
/** Bundled runtime templates. */
|
||||
exports.runtimeTemplates = exports.isBundle ? BUNDLE_RUNTIME : (() => {
|
||||
const rtDir = path.join(__dirname, "..", "std", "runtime");
|
||||
const rtFiles = require("glob").sync("**/!(*.d).ts", { cwd: rtDir });
|
||||
const bundled = {};
|
||||
rtFiles.forEach(file => bundled[file.replace(/\.ts$/, "")] = fs.readFileSync(path.join(rtDir, file), "utf8" ));
|
||||
return bundled;
|
||||
})();
|
||||
|
||||
/** Bundled definition files. */
|
||||
exports.definitionFiles = exports.isBundle ? BUNDLE_DEFINITIONS : (() => { // set up if not a bundle
|
||||
const stdDir = path.join(__dirname, "..", "std");
|
||||
@ -387,11 +396,34 @@ exports.main = function main(argv, options, callback) {
|
||||
stats.parseTime += measure(() => {
|
||||
parser = assemblyscript.parseFile(sourceText, sourcePath, true, parser);
|
||||
});
|
||||
}
|
||||
|
||||
// Include runtime template
|
||||
{
|
||||
let templateName = String(args.runtime);
|
||||
let templateText = exports.runtimeTemplates[templateName];
|
||||
if (templateText == null) {
|
||||
templateText = readFile(templateName + ".ts", baseDir);
|
||||
if (templateText == null) {
|
||||
return callback(Error("Runtime template '" + templateName + " not found."));
|
||||
}
|
||||
}
|
||||
stats.parseCount++;
|
||||
stats.parseTime += measure(() => {
|
||||
parser = assemblyscript.parseFile(templateText, templateName, true, parser);
|
||||
});
|
||||
}
|
||||
|
||||
// Parse entry files
|
||||
{
|
||||
let code = parseBacklog();
|
||||
if (code) return code;
|
||||
}
|
||||
|
||||
// Call afterParse transform hook
|
||||
applyTransform("afterParse", parser);
|
||||
|
||||
// Parse additional files, if any
|
||||
{
|
||||
let code = parseBacklog();
|
||||
if (code) return code;
|
||||
|
12
cli/asc.json
12
cli/asc.json
@ -81,6 +81,18 @@
|
||||
],
|
||||
"type": "s"
|
||||
},
|
||||
"runtime": {
|
||||
"description": [
|
||||
"Specifies the runtime template to include in the program.",
|
||||
"",
|
||||
" default TLSF memory allocator and ITCM garbage collector.",
|
||||
" arena Just the arena memory allocator. No free/GC.",
|
||||
" none No allocator/GC or compose your own.",
|
||||
""
|
||||
],
|
||||
"type": "s",
|
||||
"default": "default"
|
||||
},
|
||||
"debug": {
|
||||
"description": "Enables debug information in emitted binaries.",
|
||||
"type": "b",
|
||||
|
@ -8374,9 +8374,9 @@ export class Compiler extends DiagnosticEmitter {
|
||||
|
||||
var module = this.module;
|
||||
var options = this.options;
|
||||
var usizeType = options.usizeType;
|
||||
var nativeSizeType = options.nativeSizeType;
|
||||
var nativeSizeSize = options.usizeType.byteSize;
|
||||
// var signatureStr = Signature.makeSignatureString([ Type.u32 ], Type.void, options.usizeType);
|
||||
var body = new Array<ExpressionRef>();
|
||||
|
||||
// nothing to mark if 'this' is null (should not happen)
|
||||
@ -8398,6 +8398,9 @@ export class Compiler extends DiagnosticEmitter {
|
||||
assert(functionIndex < functionTable.length);
|
||||
assert(functionTable[functionIndex] == functionName);
|
||||
|
||||
var fnSig = Signature.makeSignatureString([ usizeType ], Type.void);
|
||||
this.ensureFunctionType([ usizeType ], Type.void);
|
||||
|
||||
// if the class extends a base class, call its hook first
|
||||
var baseInstance = classInstance.base;
|
||||
if (baseInstance) {
|
||||
@ -8441,7 +8444,7 @@ export class Compiler extends DiagnosticEmitter {
|
||||
module.createGetLocal(1, NativeType.I32),
|
||||
[
|
||||
module.createGetLocal(2, nativeSizeType)
|
||||
], "FUNCSIG$vi"
|
||||
], fnSig
|
||||
),
|
||||
module.createCall(functionTable[fieldClassId], [
|
||||
module.createGetLocal(2, nativeSizeType),
|
||||
|
@ -14,12 +14,24 @@
|
||||
import { AL_BITS, AL_SIZE, AL_MASK } from "../util/allocator";
|
||||
import { HEAP_BASE, memory } from "../memory";
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const SL_BITS: u32 = 5;
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const SL_SIZE: usize = 1 << <usize>SL_BITS;
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const SB_BITS: usize = <usize>(SL_BITS + AL_BITS);
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const SB_SIZE: usize = 1 << <usize>SB_BITS;
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const FL_BITS: u32 = (sizeof<usize>() == sizeof<u32>()
|
||||
? 30 // ^= up to 1GB per block
|
||||
: 32 // ^= up to 4GB per block
|
||||
@ -42,10 +54,18 @@ const FL_BITS: u32 = (sizeof<usize>() == sizeof<u32>()
|
||||
// F: FREE, L: LEFT_FREE
|
||||
|
||||
/** Tag indicating that this block is free. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const FREE: usize = 1 << 0;
|
||||
|
||||
/** Tag indicating that this block's left block is free. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const LEFT_FREE: usize = 1 << 1;
|
||||
|
||||
/** Mask to obtain all tags. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
const TAGS: usize = FREE | LEFT_FREE;
|
||||
|
||||
/** Block structure. */
|
||||
@ -55,6 +75,7 @@ const TAGS: usize = FREE | LEFT_FREE;
|
||||
info: usize;
|
||||
|
||||
/** End offset of the {@link Block#info} field. User data starts here. */
|
||||
@lazy
|
||||
static readonly INFO: usize = (sizeof<usize>() + AL_MASK) & ~AL_MASK;
|
||||
|
||||
/** Previous free block, if any. Only valid if free. */
|
||||
@ -63,9 +84,11 @@ const TAGS: usize = FREE | LEFT_FREE;
|
||||
next: Block | null;
|
||||
|
||||
/** Minimum size of a block, excluding {@link Block#info}. */
|
||||
@lazy
|
||||
static readonly MIN_SIZE: usize = (3 * sizeof<usize>() + AL_MASK) & ~AL_MASK;// prev + next + jump
|
||||
|
||||
/** Maximum size of a used block, excluding {@link Block#info}. */
|
||||
@lazy
|
||||
static readonly MAX_SIZE: usize = 1 << (FL_BITS + SB_BITS);
|
||||
|
||||
/** Gets this block's left (free) block in memory. */
|
||||
@ -111,7 +134,7 @@ const TAGS: usize = FREE | LEFT_FREE;
|
||||
// └───────────────────────────────────────────────────────────────┘ SIZE ┘
|
||||
// S: Small blocks map, P: Possibly padded if 64-bit
|
||||
|
||||
assert((1 << SL_BITS) <= 32); // second level must fit into 32 bits
|
||||
// assert((1 << SL_BITS) <= 32); // second level must fit into 32 bits
|
||||
|
||||
/** Root structure. */
|
||||
@unmanaged class Root {
|
||||
@ -120,6 +143,7 @@ assert((1 << SL_BITS) <= 32); // second level must fit into 32 bits
|
||||
flMap: usize = 0;
|
||||
|
||||
/** Start offset of second level maps. */
|
||||
@lazy
|
||||
private static readonly SL_START: usize = sizeof<usize>();
|
||||
|
||||
// Using *one* SL map per *FL bit*
|
||||
@ -137,11 +161,13 @@ assert((1 << SL_BITS) <= 32); // second level must fit into 32 bits
|
||||
}
|
||||
|
||||
/** End offset of second level maps. */
|
||||
@lazy
|
||||
private static readonly SL_END: usize = Root.SL_START + FL_BITS * 4;
|
||||
|
||||
// Using *number bits per SL* heads per *FL bit*
|
||||
|
||||
/** Start offset of FL/SL heads. */
|
||||
@lazy
|
||||
private static readonly HL_START: usize = (Root.SL_END + AL_MASK) & ~AL_MASK;
|
||||
|
||||
/** Gets the head of the specified first and second level index. */
|
||||
@ -164,6 +190,7 @@ assert((1 << SL_BITS) <= 32); // second level must fit into 32 bits
|
||||
}
|
||||
|
||||
/** End offset of FL/SL heads. */
|
||||
@lazy
|
||||
private static readonly HL_END: usize = (
|
||||
Root.HL_START + FL_BITS * SL_SIZE * sizeof<usize>()
|
||||
);
|
||||
@ -172,6 +199,7 @@ assert((1 << SL_BITS) <= 32); // second level must fit into 32 bits
|
||||
set tailRef(value: usize) { store<usize>(0, value, Root.HL_END); }
|
||||
|
||||
/** Total size of the {@link Root} structure. */
|
||||
@lazy
|
||||
static readonly SIZE: usize = Root.HL_END + sizeof<usize>();
|
||||
|
||||
/** Inserts a previously used block back into the free list. */
|
||||
@ -424,6 +452,8 @@ function fls<T extends number>(word: T): T {
|
||||
}
|
||||
|
||||
/** Reference to the initialized {@link Root} structure, once initialized. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
var ROOT: Root = changetype<Root>(0);
|
||||
|
||||
/** Allocates a chunk of memory. */
|
||||
|
@ -19,13 +19,23 @@ const enum State {
|
||||
}
|
||||
|
||||
/** Current collector state. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
var state = State.INIT;
|
||||
/** Current white color value. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
var white = 0;
|
||||
|
||||
// From and to spaces
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
var fromSpace: ManagedObjectList;
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
var toSpace: ManagedObjectList;
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
var iter: ManagedObject;
|
||||
|
||||
// ╒═══════════════ Managed object layout (32-bit) ════════════════╕
|
||||
|
@ -27,11 +27,15 @@ import { Array } from "./array";
|
||||
}
|
||||
|
||||
/** Common runtime header size. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
export const HEADER_SIZE: usize = isDefined(__ref_collect)
|
||||
? (offsetof<HEADER>( ) + AL_MASK) & ~AL_MASK // full header if GC is present
|
||||
: (offsetof<HEADER>("reserved1") + AL_MASK) & ~AL_MASK; // half header if GC is absent
|
||||
|
||||
/** Common runtime header magic. Used to assert registered/unregistered status. */
|
||||
// @ts-ignore: decorator
|
||||
@lazy
|
||||
export const HEADER_MAGIC: u32 = 0xA55E4B17;
|
||||
|
||||
/** Gets the computed unique class id of a class type. */
|
||||
|
38
std/runtime/README.md
Normal file
38
std/runtime/README.md
Normal file
@ -0,0 +1,38 @@
|
||||
AssemblyScript runtimes
|
||||
=======================
|
||||
|
||||
Default
|
||||
-------
|
||||
|
||||
```
|
||||
$> asc ...
|
||||
```
|
||||
|
||||
The [default runtime](./default.ts) adds proper support for dynamic memory management and garbage collection to your program.
|
||||
|
||||
* [TLSF memory allocator](../assembly/allocator/tlsf.ts)
|
||||
* [ITCM garbage collector](../assembly/collector/itcm.ts)
|
||||
|
||||
Arena
|
||||
-----
|
||||
|
||||
```
|
||||
$> asc ... --runtime arena
|
||||
```
|
||||
|
||||
The [arena runtime](./arena.ts) is just enough to make most language features work, but doesn't have sophisticated support for freeing memory. Useful when prototyping or for simple one-shot modules in that it produces very small modules with minimal overhead.
|
||||
|
||||
* [Arena memory allocator](../assembly/allocator/arena.ts) with `memory.reset()`
|
||||
* No garbage collector
|
||||
|
||||
None
|
||||
-----------------
|
||||
|
||||
```
|
||||
$> asc ... --runtime none
|
||||
```
|
||||
|
||||
[No runtime](./none.ts) features at all. Useful for building low-level modules that do not require language features like managed classes, or if you'd like to compose your own runtime by including a custom memory allocator and garbage collector.
|
||||
|
||||
* No memory allocator
|
||||
* No garbage collector
|
1
std/runtime/arena.ts
Normal file
1
std/runtime/arena.ts
Normal file
@ -0,0 +1 @@
|
||||
import "allocator/arena";
|
2
std/runtime/default.ts
Normal file
2
std/runtime/default.ts
Normal file
@ -0,0 +1,2 @@
|
||||
import "allocator/tlsf";
|
||||
import "collector/itcm";
|
0
std/runtime/none.ts
Normal file
0
std/runtime/none.ts
Normal file
6
std/runtime/tsconfig.json
Normal file
6
std/runtime/tsconfig.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../assembly.json",
|
||||
"include": [
|
||||
"./**/*.ts"
|
||||
]
|
||||
}
|
5
tests/compiler/abi.json
Normal file
5
tests/compiler/abi.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/asc-constants.json
Normal file
5
tests/compiler/asc-constants.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/assert-nonnull.json
Normal file
5
tests/compiler/assert-nonnull.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -11,19 +11,19 @@
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "testVar" (func $nonNullAssertion/testVar))
|
||||
(export "testObj" (func $nonNullAssertion/testObj))
|
||||
(export "testProp" (func $nonNullAssertion/testProp))
|
||||
(export "testArr" (func $nonNullAssertion/testArr))
|
||||
(export "testElem" (func $nonNullAssertion/testElem))
|
||||
(export "testAll" (func $nonNullAssertion/testAll))
|
||||
(export "testAll2" (func $nonNullAssertion/testAll))
|
||||
(export "testFn" (func $nonNullAssertion/testFn))
|
||||
(export "testFn2" (func $nonNullAssertion/testFn2))
|
||||
(export "testRet" (func $nonNullAssertion/testRet))
|
||||
(export "testObjFn" (func $nonNullAssertion/testObjFn))
|
||||
(export "testObjRet" (func $nonNullAssertion/testObjRet))
|
||||
(func $nonNullAssertion/testVar (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(export "testVar" (func $assert-nonnull/testVar))
|
||||
(export "testObj" (func $assert-nonnull/testObj))
|
||||
(export "testProp" (func $assert-nonnull/testProp))
|
||||
(export "testArr" (func $assert-nonnull/testArr))
|
||||
(export "testElem" (func $assert-nonnull/testElem))
|
||||
(export "testAll" (func $assert-nonnull/testAll))
|
||||
(export "testAll2" (func $assert-nonnull/testAll))
|
||||
(export "testFn" (func $assert-nonnull/testFn))
|
||||
(export "testFn2" (func $assert-nonnull/testFn2))
|
||||
(export "testRet" (func $assert-nonnull/testRet))
|
||||
(export "testObjFn" (func $assert-nonnull/testObjFn))
|
||||
(export "testObjRet" (func $assert-nonnull/testObjRet))
|
||||
(func $assert-nonnull/testVar (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -31,7 +31,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $nonNullAssertion/testObj (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testObj (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -40,7 +40,7 @@
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testProp (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testProp (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.tee $0
|
||||
@ -50,7 +50,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/array/Array<nonNullAssertion/Foo>#__get (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/array/Array<assert-nonnull/Foo>#__get (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
local.get $0
|
||||
i32.load offset=12
|
||||
@ -81,16 +81,16 @@
|
||||
i32.load offset=4
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testArr (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testArr (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
local.get $0
|
||||
call $~lib/array/Array<nonNullAssertion/Foo>#__get
|
||||
call $~lib/array/Array<assert-nonnull/Foo>#__get
|
||||
)
|
||||
(func $~lib/array/Array<nonNullAssertion/Foo | null>#__get (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/array/Array<assert-nonnull/Foo | null>#__get (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
@ -109,9 +109,9 @@
|
||||
i32.load offset=4
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testElem (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testElem (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/array/Array<nonNullAssertion/Foo | null>#__get
|
||||
call $~lib/array/Array<assert-nonnull/Foo | null>#__get
|
||||
local.tee $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -119,14 +119,14 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $nonNullAssertion/testAll (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testAll (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
local.get $0
|
||||
call $~lib/array/Array<nonNullAssertion/Foo | null>#__get
|
||||
call $~lib/array/Array<assert-nonnull/Foo | null>#__get
|
||||
local.tee $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -141,13 +141,13 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $nonNullAssertion/testFn (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testFn (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
call_indirect (type $FUNCSIG$i)
|
||||
)
|
||||
(func $nonNullAssertion/testFn2 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testFn2 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -158,7 +158,7 @@
|
||||
local.get $0
|
||||
call_indirect (type $FUNCSIG$i)
|
||||
)
|
||||
(func $nonNullAssertion/testRet (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testRet (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
@ -170,14 +170,14 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $nonNullAssertion/testObjFn (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testObjFn (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
call_indirect (type $FUNCSIG$i)
|
||||
)
|
||||
(func $nonNullAssertion/testObjRet (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testObjRet (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
@ -1,5 +1,3 @@
|
||||
import "allocator/arena";
|
||||
|
||||
export function testVar(n: Error | null): Error {
|
||||
return n!;
|
||||
}
|
@ -9,25 +9,23 @@
|
||||
(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")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 8))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(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 $nonNullAssertion/testVar))
|
||||
(export "testObj" (func $nonNullAssertion/testObj))
|
||||
(export "testProp" (func $nonNullAssertion/testProp))
|
||||
(export "testArr" (func $nonNullAssertion/testArr))
|
||||
(export "testElem" (func $nonNullAssertion/testElem))
|
||||
(export "testAll" (func $nonNullAssertion/testAll))
|
||||
(export "testAll2" (func $nonNullAssertion/testAll2))
|
||||
(export "testFn" (func $nonNullAssertion/testFn))
|
||||
(export "testFn2" (func $nonNullAssertion/testFn2))
|
||||
(export "testRet" (func $nonNullAssertion/testRet))
|
||||
(export "testObjFn" (func $nonNullAssertion/testObjFn))
|
||||
(export "testObjRet" (func $nonNullAssertion/testObjRet))
|
||||
(func $nonNullAssertion/testVar (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(export "testVar" (func $assert-nonnull/testVar))
|
||||
(export "testObj" (func $assert-nonnull/testObj))
|
||||
(export "testProp" (func $assert-nonnull/testProp))
|
||||
(export "testArr" (func $assert-nonnull/testArr))
|
||||
(export "testElem" (func $assert-nonnull/testElem))
|
||||
(export "testAll" (func $assert-nonnull/testAll))
|
||||
(export "testAll2" (func $assert-nonnull/testAll2))
|
||||
(export "testFn" (func $assert-nonnull/testFn))
|
||||
(export "testFn2" (func $assert-nonnull/testFn2))
|
||||
(export "testRet" (func $assert-nonnull/testRet))
|
||||
(export "testObjFn" (func $assert-nonnull/testObjFn))
|
||||
(export "testObjRet" (func $assert-nonnull/testObjRet))
|
||||
(func $assert-nonnull/testVar (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
local.tee $1
|
||||
@ -37,7 +35,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testObj (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testObj (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
local.tee $1
|
||||
@ -48,7 +46,7 @@
|
||||
end
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testProp (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testProp (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
@ -59,7 +57,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $~lib/array/Array<nonNullAssertion/Foo>#__unchecked_get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/array/Array<assert-nonnull/Foo>#__unchecked_get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
local.get $1
|
||||
@ -68,7 +66,7 @@
|
||||
i32.add
|
||||
i32.load
|
||||
)
|
||||
(func $~lib/array/Array<nonNullAssertion/Foo>#__get (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/array/Array<assert-nonnull/Foo>#__get (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=12
|
||||
@ -97,9 +95,9 @@
|
||||
end
|
||||
local.get $0
|
||||
local.get $1
|
||||
call $~lib/array/Array<nonNullAssertion/Foo>#__unchecked_get
|
||||
call $~lib/array/Array<assert-nonnull/Foo>#__unchecked_get
|
||||
)
|
||||
(func $nonNullAssertion/testArr (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testArr (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
local.tee $1
|
||||
@ -109,9 +107,9 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
call $~lib/array/Array<nonNullAssertion/Foo>#__get
|
||||
call $~lib/array/Array<assert-nonnull/Foo>#__get
|
||||
)
|
||||
(func $~lib/array/Array<nonNullAssertion/Foo | null>#__unchecked_get (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/array/Array<assert-nonnull/Foo | null>#__unchecked_get (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
local.get $1
|
||||
@ -120,7 +118,7 @@
|
||||
i32.add
|
||||
i32.load
|
||||
)
|
||||
(func $~lib/array/Array<nonNullAssertion/Foo | null>#__get (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/array/Array<assert-nonnull/Foo | null>#__get (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
@ -137,13 +135,13 @@
|
||||
end
|
||||
local.get $0
|
||||
local.get $1
|
||||
call $~lib/array/Array<nonNullAssertion/Foo | null>#__unchecked_get
|
||||
call $~lib/array/Array<assert-nonnull/Foo | null>#__unchecked_get
|
||||
)
|
||||
(func $nonNullAssertion/testElem (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testElem (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<nonNullAssertion/Foo | null>#__get
|
||||
call $~lib/array/Array<assert-nonnull/Foo | null>#__get
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $1
|
||||
@ -151,7 +149,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testAll (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testAll (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
local.tee $1
|
||||
@ -161,7 +159,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
call $~lib/array/Array<nonNullAssertion/Foo | null>#__get
|
||||
call $~lib/array/Array<assert-nonnull/Foo | null>#__get
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $1
|
||||
@ -176,7 +174,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testAll2 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testAll2 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
local.tee $1
|
||||
@ -186,7 +184,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
call $~lib/array/Array<nonNullAssertion/Foo | null>#__get
|
||||
call $~lib/array/Array<assert-nonnull/Foo | null>#__get
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $1
|
||||
@ -201,13 +199,13 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testFn (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testFn (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
call_indirect (type $FUNCSIG$i)
|
||||
)
|
||||
(func $nonNullAssertion/testFn2 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testFn2 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
@ -223,7 +221,7 @@
|
||||
local.get $2
|
||||
call_indirect (type $FUNCSIG$i)
|
||||
)
|
||||
(func $nonNullAssertion/testRet (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testRet (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
block (result i32)
|
||||
i32.const 0
|
||||
@ -238,14 +236,14 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testObjFn (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testObjFn (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
call_indirect (type $FUNCSIG$i)
|
||||
)
|
||||
(func $nonNullAssertion/testObjRet (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $assert-nonnull/testObjRet (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
block (result i32)
|
||||
i32.const 0
|
5
tests/compiler/assert.json
Normal file
5
tests/compiler/assert.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/basic-nullable.json
Normal file
5
tests/compiler/basic-nullable.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/binary.json
Normal file
5
tests/compiler/binary.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/bool.json
Normal file
5
tests/compiler/bool.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/builtins.json
Normal file
5
tests/compiler/builtins.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/call-inferred.json
Normal file
5
tests/compiler/call-inferred.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/call-optional.json
Normal file
5
tests/compiler/call-optional.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/call-super.json
Normal file
5
tests/compiler/call-super.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -106,7 +106,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -121,7 +121,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -151,7 +151,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 8
|
||||
i32.const 6
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -175,7 +175,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 17
|
||||
i32.const 15
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -187,7 +187,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 18
|
||||
i32.const 16
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -204,7 +204,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 24
|
||||
i32.const 22
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -216,7 +216,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 25
|
||||
i32.const 23
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -250,7 +250,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 40
|
||||
i32.const 38
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -262,7 +262,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 41
|
||||
i32.const 39
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -279,7 +279,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 47
|
||||
i32.const 45
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -291,7 +291,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 48
|
||||
i32.const 46
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -317,7 +317,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 58
|
||||
i32.const 56
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -341,7 +341,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 68
|
||||
i32.const 66
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -353,7 +353,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 69
|
||||
i32.const 67
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -394,7 +394,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 86
|
||||
i32.const 84
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -406,7 +406,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 87
|
||||
i32.const 85
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -447,7 +447,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 106
|
||||
i32.const 104
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -459,7 +459,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 107
|
||||
i32.const 105
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -1,5 +1,3 @@
|
||||
import "allocator/arena";
|
||||
|
||||
// both constructors present
|
||||
|
||||
class A {
|
||||
|
@ -10,9 +10,9 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 8))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 84))
|
||||
(export "memory" (memory $0))
|
||||
@ -139,7 +139,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -156,7 +156,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -189,7 +189,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 8
|
||||
i32.const 6
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -219,7 +219,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 17
|
||||
i32.const 15
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -232,7 +232,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 18
|
||||
i32.const 16
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -252,7 +252,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 24
|
||||
i32.const 22
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -265,7 +265,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 25
|
||||
i32.const 23
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -309,7 +309,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 40
|
||||
i32.const 38
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -322,7 +322,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 41
|
||||
i32.const 39
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -342,7 +342,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 47
|
||||
i32.const 45
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -355,7 +355,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 48
|
||||
i32.const 46
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -384,7 +384,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 58
|
||||
i32.const 56
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -422,7 +422,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 68
|
||||
i32.const 66
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -435,7 +435,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 69
|
||||
i32.const 67
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -487,7 +487,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 86
|
||||
i32.const 84
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -500,7 +500,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 87
|
||||
i32.const 85
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -552,7 +552,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 106
|
||||
i32.const 104
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -565,7 +565,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 56
|
||||
i32.const 107
|
||||
i32.const 105
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
1
tests/compiler/class-extends.json
Normal file
1
tests/compiler/class-extends.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
@ -4,9 +4,11 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $~lib/capabilities i32 (i32.const 2))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class-extends/test))
|
||||
(export ".capabilities" (global $~lib/capabilities))
|
||||
(func $class-extends/test (; 0 ;) (type $FUNCSIG$vi) (param $0 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
|
@ -5,9 +5,11 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/capabilities i32 (i32.const 2))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class-extends/test))
|
||||
(export ".capabilities" (global $~lib/capabilities))
|
||||
(func $class-extends/test (; 0 ;) (type $FUNCSIG$vi) (param $0 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
|
5
tests/compiler/class-overloading.json
Normal file
5
tests/compiler/class-overloading.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
1
tests/compiler/class.json
Normal file
1
tests/compiler/class.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
@ -1,14 +1,21 @@
|
||||
(module
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$v (func))
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\01\00\00\00\10\00\00\00c\00l\00a\00s\00s\00.\00t\00s")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $start)
|
||||
(data (i32.const 8) "\01\00\00\00\10")
|
||||
(data (i32.const 24) "c\00l\00a\00s\00s\00.\00t\00s")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $start $~lib/string/String~iterate)
|
||||
(global $~lib/capabilities i32 (i32.const 2))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class/test))
|
||||
(func $class/test (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(export ".capabilities" (global $~lib/capabilities))
|
||||
(func $~lib/string/String~iterate (; 0 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||
nop
|
||||
)
|
||||
(func $class/test (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
drop
|
||||
@ -29,7 +36,7 @@
|
||||
i32.store8 offset=6
|
||||
local.get $0
|
||||
)
|
||||
(func $start (; 1 ;) (type $FUNCSIG$v)
|
||||
(func $start (; 2 ;) (type $FUNCSIG$v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -1,5 +1,7 @@
|
||||
(module
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(type $FUNCSIG$fff (func (param f32 f32) (result f32)))
|
||||
(type $FUNCSIG$v (func))
|
||||
@ -8,23 +10,28 @@
|
||||
(type $FUNCSIG$fiff (func (param i32 f32 f32) (result f32)))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\01\00\00\00\10\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(data (i32.const 8) "\01\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $~lib/string/String~iterate)
|
||||
(global $class/Animal.ONE (mut i32) (i32.const 1))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 40))
|
||||
(global $~lib/capabilities i32 (i32.const 2))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class/test))
|
||||
(export ".capabilities" (global $~lib/capabilities))
|
||||
(start $start)
|
||||
(func $class/Animal.add (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/string/String~iterate (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||
(local $2 i32)
|
||||
)
|
||||
(func $class/Animal.add (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.add
|
||||
global.get $class/Animal.ONE
|
||||
i32.add
|
||||
)
|
||||
(func $class/Animal.sub<f32> (; 2 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32)
|
||||
(func $class/Animal.sub<f32> (; 3 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
f32.sub
|
||||
@ -32,14 +39,14 @@
|
||||
f32.convert_i32_s
|
||||
f32.add
|
||||
)
|
||||
(func $start:class (; 3 ;) (type $FUNCSIG$v)
|
||||
(func $start:class (; 4 ;) (type $FUNCSIG$v)
|
||||
i32.const 4
|
||||
i32.const 4
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 24
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
@ -56,14 +63,14 @@
|
||||
call $class/Animal.sub<f32>
|
||||
drop
|
||||
)
|
||||
(func $class/Animal<f64>#instanceAdd (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $class/Animal<f64>#instanceAdd (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
global.get $class/Animal.ONE
|
||||
i32.add
|
||||
)
|
||||
(func $class/Animal<f64>#instanceSub<f32> (; 5 ;) (type $FUNCSIG$fiff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32)
|
||||
(func $class/Animal<f64>#instanceSub<f32> (; 6 ;) (type $FUNCSIG$fiff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32)
|
||||
local.get $1
|
||||
local.get $2
|
||||
f32.sub
|
||||
@ -71,7 +78,7 @@
|
||||
f32.convert_i32_s
|
||||
f32.add
|
||||
)
|
||||
(func $class/test (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $class/test (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
@ -116,9 +123,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
)
|
||||
(func $start (; 7 ;) (type $FUNCSIG$v)
|
||||
(func $start (; 8 ;) (type $FUNCSIG$v)
|
||||
call $start:class
|
||||
)
|
||||
(func $null (; 8 ;) (type $FUNCSIG$v)
|
||||
(func $null (; 9 ;) (type $FUNCSIG$v)
|
||||
)
|
||||
)
|
||||
|
1
tests/compiler/closure.json
Normal file
1
tests/compiler/closure.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
@ -3,8 +3,10 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $~lib/capabilities i32 (i32.const 2))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export ".capabilities" (global $~lib/capabilities))
|
||||
(func $null (; 0 ;) (type $FUNCSIG$v)
|
||||
nop
|
||||
)
|
||||
|
@ -4,8 +4,10 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/capabilities i32 (i32.const 2))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export ".capabilities" (global $~lib/capabilities))
|
||||
(func $null (; 0 ;) (type $FUNCSIG$v)
|
||||
)
|
||||
)
|
||||
|
5
tests/compiler/comma.json
Normal file
5
tests/compiler/comma.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
1
tests/compiler/constructor.json
Normal file
1
tests/compiler/constructor.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,3 @@
|
||||
import "allocator/arena";
|
||||
|
||||
// trailing conditional allocate
|
||||
class EmptyCtor {
|
||||
constructor() {}
|
||||
|
File diff suppressed because it is too large
Load Diff
5
tests/compiler/declare.json
Normal file
5
tests/compiler/declare.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/do.json
Normal file
5
tests/compiler/do.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/empty.json
Normal file
5
tests/compiler/empty.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/enum.json
Normal file
5
tests/compiler/enum.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/export.json
Normal file
5
tests/compiler/export.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/exports.json
Normal file
5
tests/compiler/exports.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
@ -146,7 +146,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -161,7 +161,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -19,9 +19,9 @@
|
||||
(global $exports/vehicles.Car.TIRES i32 (i32.const 4))
|
||||
(global $exports/outer.inner.a i32 (i32.const 42))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 8))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 48))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
@ -192,7 +192,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -209,7 +209,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/external.json
Normal file
5
tests/compiler/external.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/for.json
Normal file
5
tests/compiler/for.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/function-expression.json
Normal file
5
tests/compiler/function-expression.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/function-types.json
Normal file
5
tests/compiler/function-types.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/function.json
Normal file
5
tests/compiler/function.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/gc.json
Normal file
5
tests/compiler/gc.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
(module
|
||||
(type $FUNCSIG$v (func))
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
|
||||
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
|
||||
(type $FUNCSIG$i (func (result i32)))
|
||||
@ -168,7 +168,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -183,7 +183,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1019,7 +1019,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 18
|
||||
i32.const 17
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1030,7 +1030,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 19
|
||||
i32.const 18
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1041,7 +1041,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 20
|
||||
i32.const 19
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1060,7 +1060,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 27
|
||||
i32.const 26
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1073,7 +1073,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 28
|
||||
i32.const 27
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1084,7 +1084,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 29
|
||||
i32.const 28
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1102,7 +1102,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 36
|
||||
i32.const 35
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1113,7 +1113,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 37
|
||||
i32.const 36
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1126,7 +1126,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 38
|
||||
i32.const 37
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -1,4 +1,3 @@
|
||||
import "allocator/arena";
|
||||
import { link_count, unlink_count, collect_count } from "./gc/_dummy";
|
||||
export { gc };
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
(module
|
||||
(type $FUNCSIG$v (func))
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
|
||||
(type $FUNCSIG$viii (func (param i32 i32 i32)))
|
||||
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
|
||||
@ -30,9 +30,9 @@
|
||||
(global $gc/_dummy/unlink_ref (mut i32) (i32.const 0))
|
||||
(global $gc/_dummy/unlink_parentRef (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 16))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $~lib/gc/gc.implemented i32 (i32.const 1))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
@ -198,7 +198,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -215,7 +215,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1212,7 +1212,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 10
|
||||
i32.const 9
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1234,7 +1234,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 18
|
||||
i32.const 17
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1246,7 +1246,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 19
|
||||
i32.const 18
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1258,7 +1258,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 20
|
||||
i32.const 19
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1278,7 +1278,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 27
|
||||
i32.const 26
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1292,7 +1292,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 28
|
||||
i32.const 27
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1304,7 +1304,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 29
|
||||
i32.const 28
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1323,7 +1323,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 36
|
||||
i32.const 35
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1335,7 +1335,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 37
|
||||
i32.const 36
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1349,7 +1349,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 38
|
||||
i32.const 37
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/gc/global-assign.json
Normal file
5
tests/compiler/gc/global-assign.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
(module
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
|
||||
(type $FUNCSIG$v (func))
|
||||
(type $FUNCSIG$i (func (result i32)))
|
||||
@ -141,7 +141,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -156,7 +156,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -184,7 +184,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -193,7 +193,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -202,7 +202,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 14
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -216,7 +216,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 19
|
||||
i32.const 18
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -225,7 +225,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 20
|
||||
i32.const 19
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -234,7 +234,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 21
|
||||
i32.const 20
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -1,4 +1,3 @@
|
||||
import "allocator/arena";
|
||||
import { register_count, link_count, unlink_count } from "./_dummy";
|
||||
|
||||
@start export function main(): void {}
|
||||
|
@ -1,9 +1,9 @@
|
||||
(module
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(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)))
|
||||
@ -24,9 +24,9 @@
|
||||
(global $gc/_dummy/unlink_ref (mut i32) (i32.const 0))
|
||||
(global $gc/_dummy/unlink_parentRef (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 16))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $gc/global-assign/global (mut i32) (i32.const 0))
|
||||
(global $gc/global-assign/globalRef (mut i32) (i32.const 0))
|
||||
@ -186,7 +186,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -203,7 +203,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -250,7 +250,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -262,7 +262,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -274,7 +274,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 14
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -289,7 +289,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 19
|
||||
i32.const 18
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -301,7 +301,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 20
|
||||
i32.const 19
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -313,7 +313,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 21
|
||||
i32.const 20
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/gc/global-init.json
Normal file
5
tests/compiler/gc/global-init.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
(module
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
|
||||
(type $FUNCSIG$v (func))
|
||||
(type $FUNCSIG$i (func (result i32)))
|
||||
@ -140,7 +140,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -155,7 +155,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -181,7 +181,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 11
|
||||
i32.const 10
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -190,7 +190,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -199,7 +199,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -213,7 +213,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 16
|
||||
i32.const 15
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -222,7 +222,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 17
|
||||
i32.const 16
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -231,7 +231,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 18
|
||||
i32.const 17
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -1,4 +1,3 @@
|
||||
import "allocator/arena";
|
||||
import { register_count, link_count, unlink_count } from "./_dummy";
|
||||
|
||||
@start export function main(): void {}
|
||||
|
@ -1,9 +1,9 @@
|
||||
(module
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(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)))
|
||||
@ -24,9 +24,9 @@
|
||||
(global $gc/_dummy/unlink_ref (mut i32) (i32.const 0))
|
||||
(global $gc/_dummy/unlink_parentRef (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 16))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $gc/global-init/global (mut i32) (i32.const 0))
|
||||
(global $~lib/started (mut i32) (i32.const 0))
|
||||
@ -185,7 +185,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -202,7 +202,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -247,7 +247,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 11
|
||||
i32.const 10
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -259,7 +259,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -271,7 +271,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -286,7 +286,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 16
|
||||
i32.const 15
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -298,7 +298,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 17
|
||||
i32.const 16
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -310,7 +310,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 112
|
||||
i32.const 18
|
||||
i32.const 17
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/gc/itcm/trace.json
Normal file
5
tests/compiler/gc/itcm/trace.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
(module
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$v (func))
|
||||
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(type $FUNCSIG$viii (func (param i32 i32 i32)))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
@ -67,12 +67,12 @@
|
||||
(table $0 10 funcref)
|
||||
(elem (i32.const 0) $null $~lib/string/String~iterate $~lib/collector/itcm/step~anonymous|0 $~lib/collector/itcm/step~anonymous|1 $~lib/collector/itcm/step~anonymous|0 $gc/itcm/trace/Ref~iterate $~lib/string/String~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~iterate)
|
||||
(global $~lib/collector/itcm/state (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/white (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/iter (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/iter (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/white (mut i32) (i32.const 0))
|
||||
(global $gc/itcm/trace/ref (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $gc/itcm/trace/arr (mut i32) (i32.const 0))
|
||||
@ -683,7 +683,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 1056
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -698,7 +698,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 1056
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2170,7 +2170,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 1056
|
||||
i32.const 113
|
||||
i32.const 117
|
||||
i32.const 8
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -1,6 +1,4 @@
|
||||
@global const GC_TRACE = true;
|
||||
|
||||
import "allocator/arena";
|
||||
import "collector/itcm";
|
||||
|
||||
import { HEADER_SIZE } from "runtime";
|
||||
|
@ -1,10 +1,10 @@
|
||||
(module
|
||||
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$vii (func (param i32 i32)))
|
||||
(type $FUNCSIG$v (func))
|
||||
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$vi (func (param i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
|
||||
(type $FUNCSIG$viii (func (param i32 i32 i32)))
|
||||
@ -42,15 +42,15 @@
|
||||
(elem (i32.const 0) $null $~lib/string/String~iterate $~lib/collector/itcm/step~anonymous|0 $~lib/collector/itcm/step~anonymous|1 $~lib/collector/itcm/step~anonymous|2 $gc/itcm/trace/Ref~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~iterate)
|
||||
(global $gc/itcm/trace/GC_TRACE i32 (i32.const 1))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 16))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/collector/itcm/state (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/white (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/iter (mut i32) (i32.const 0))
|
||||
(global $~lib/gc/gc.implemented i32 (i32.const 1))
|
||||
(global $~lib/collector/itcm/state (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/iter (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/white (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $gc/itcm/trace/ref (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808))
|
||||
@ -825,7 +825,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 1056
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -842,7 +842,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 1056
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -1235,7 +1235,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 1056
|
||||
i32.const 232
|
||||
i32.const 236
|
||||
i32.const 57
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2867,7 +2867,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 1056
|
||||
i32.const 113
|
||||
i32.const 117
|
||||
i32.const 8
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -3039,7 +3039,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 8
|
||||
i32.const 6
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -3049,7 +3049,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 9
|
||||
i32.const 7
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/gc/rc/global-assign.json
Normal file
5
tests/compiler/gc/rc/global-assign.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -143,7 +143,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -158,7 +158,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -225,7 +225,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -236,7 +236,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -247,7 +247,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 14
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -256,7 +256,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 15
|
||||
i32.const 14
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -285,7 +285,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 20
|
||||
i32.const 19
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -296,7 +296,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 21
|
||||
i32.const 20
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -307,7 +307,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 22
|
||||
i32.const 21
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -318,7 +318,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 23
|
||||
i32.const 22
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -329,7 +329,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 24
|
||||
i32.const 23
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -1,4 +1,3 @@
|
||||
import "allocator/arena";
|
||||
import { register_count, retain_count, retain_ref, release_count, release_ref } from "./_dummy";
|
||||
|
||||
@start export function main(): void {}
|
||||
|
@ -23,9 +23,9 @@
|
||||
(global $gc/rc/_dummy/release_count (mut i32) (i32.const 0))
|
||||
(global $gc/rc/_dummy/release_ref (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 16))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $gc/rc/global-assign/global (mut i32) (i32.const 0))
|
||||
(global $gc/rc/global-assign/globalRef (mut i32) (i32.const 0))
|
||||
@ -180,7 +180,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -197,7 +197,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -286,7 +286,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -298,7 +298,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -310,7 +310,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 14
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -322,7 +322,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 15
|
||||
i32.const 14
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -353,7 +353,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 20
|
||||
i32.const 19
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -365,7 +365,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 21
|
||||
i32.const 20
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -377,7 +377,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 22
|
||||
i32.const 21
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -389,7 +389,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 23
|
||||
i32.const 22
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -401,7 +401,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 24
|
||||
i32.const 23
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/gc/rc/global-init.json
Normal file
5
tests/compiler/gc/rc/global-init.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime arena"
|
||||
]
|
||||
}
|
@ -139,7 +139,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -154,7 +154,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -201,7 +201,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 11
|
||||
i32.const 10
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -212,7 +212,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -223,7 +223,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -232,7 +232,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 14
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -1,4 +1,3 @@
|
||||
import "allocator/arena";
|
||||
import { register_count, retain_count, retain_ref, release_count } from "./_dummy";
|
||||
|
||||
@start export function main(): void {}
|
||||
|
@ -22,9 +22,9 @@
|
||||
(global $gc/rc/_dummy/release_count (mut i32) (i32.const 0))
|
||||
(global $gc/rc/_dummy/release_ref (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 16))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $gc/rc/global-init/global (mut i32) (i32.const 0))
|
||||
(global $~lib/started (mut i32) (i32.const 0))
|
||||
@ -178,7 +178,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -195,7 +195,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 24
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -264,7 +264,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 11
|
||||
i32.const 10
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -276,7 +276,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 12
|
||||
i32.const 11
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -288,7 +288,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 13
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -300,7 +300,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 152
|
||||
i32.const 14
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/getter-call.json
Normal file
5
tests/compiler/getter-call.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
@ -85,7 +85,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -100,7 +100,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -10,9 +10,9 @@
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $getter-call/C#get:x~anonymous|0)
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 8))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 48))
|
||||
@ -141,7 +141,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -158,7 +158,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/getter-setter.json
Normal file
5
tests/compiler/getter-setter.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/i64-polyfill.json
Normal file
5
tests/compiler/i64-polyfill.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/if.json
Normal file
5
tests/compiler/if.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/import.json
Normal file
5
tests/compiler/import.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/infer-type.json
Normal file
5
tests/compiler/infer-type.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/inlining-blocklocals.json
Normal file
5
tests/compiler/inlining-blocklocals.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/inlining-recursive.json
Normal file
5
tests/compiler/inlining-recursive.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/inlining.json
Normal file
5
tests/compiler/inlining.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
@ -131,7 +131,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 48
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -146,7 +146,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 48
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
@ -13,9 +13,9 @@
|
||||
(global $inlining/constantGlobal i32 (i32.const 1))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 8))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 80))
|
||||
(export "memory" (memory $0))
|
||||
@ -405,7 +405,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 48
|
||||
i32.const 149
|
||||
i32.const 153
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -422,7 +422,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 48
|
||||
i32.const 151
|
||||
i32.const 155
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
|
5
tests/compiler/instanceof.json
Normal file
5
tests/compiler/instanceof.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/limits.json
Normal file
5
tests/compiler/limits.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/literals.json
Normal file
5
tests/compiler/literals.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/logical.json
Normal file
5
tests/compiler/logical.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/main.json
Normal file
5
tests/compiler/main.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/mandelbrot.json
Normal file
5
tests/compiler/mandelbrot.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
5
tests/compiler/many-locals.json
Normal file
5
tests/compiler/many-locals.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"asc_flags": [
|
||||
"--runtime none"
|
||||
]
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user