mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-27 16:02:16 +00:00
make it test again
This commit is contained in:
parent
0ad9d560e0
commit
4f1a971a61
@ -12,6 +12,7 @@
|
|||||||
@inline export const HEADER_SIZE: usize = (offsetof<ManagedObject>() + AL_MASK) & ~AL_MASK;
|
@inline export const HEADER_SIZE: usize = (offsetof<ManagedObject>() + AL_MASK) & ~AL_MASK;
|
||||||
|
|
||||||
import { AL_MASK, MAX_SIZE_32 } from "../internal/allocator";
|
import { AL_MASK, MAX_SIZE_32 } from "../internal/allocator";
|
||||||
|
import { __rt_iterateroots } from "../builtins";
|
||||||
|
|
||||||
/** Collector states. */
|
/** Collector states. */
|
||||||
const enum State {
|
const enum State {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { AL_MASK } from "./allocator";
|
import { AL_MASK } from "./allocator";
|
||||||
|
import { __rt_classid } from "../builtins";
|
||||||
|
|
||||||
/** Common runtime header of all objects. */
|
/** Common runtime header of all objects. */
|
||||||
@unmanaged
|
@unmanaged
|
||||||
@ -100,7 +101,7 @@ export function FREE(ref: usize): void {
|
|||||||
export function REGISTER<T>(ref: usize, parentRef: usize): void {
|
export function REGISTER<T>(ref: usize, parentRef: usize): void {
|
||||||
var header = UNREF(ref);
|
var header = UNREF(ref);
|
||||||
header.classId = __rt_classid<T>();
|
header.classId = __rt_classid<T>();
|
||||||
if (GC) __REGISTER_IMPL(ref, parentRef);
|
if (GC) __REGISTER_IMPL(ref, parentRef); // tslint:disable-line
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ArrayBuffer base class. */
|
/** ArrayBuffer base class. */
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
i32.const 0
|
i32.const 0
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.const 18
|
i32.const 18
|
||||||
i32.const 37
|
i32.const 42
|
||||||
call $~lib/env/abort
|
call $~lib/env/abort
|
||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
|
@ -15,5 +15,7 @@ var a_ref: A | null = changetype<A>(24); // global root, nullable
|
|||||||
var b_ref: B = changetype<B>(32); // global root, non-nullable
|
var b_ref: B = changetype<B>(32); // global root, non-nullable
|
||||||
|
|
||||||
var i: i32 = 0;
|
var i: i32 = 0;
|
||||||
iterateRoots((ref: usize): void => { assert(<u32>ref == ++i << 3); });
|
__rt_iterateroots((ref: usize): void => { assert(<u32>ref == ++i << 3); });
|
||||||
assert(i == 4);
|
assert(i == 4);
|
||||||
|
|
||||||
|
assert(__rt_classid<A>() != __rt_classid<B>());
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
i32.const 0
|
i32.const 0
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.const 18
|
i32.const 18
|
||||||
i32.const 37
|
i32.const 42
|
||||||
call $~lib/env/abort
|
call $~lib/env/abort
|
||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
@ -58,6 +58,18 @@
|
|||||||
call $~lib/env/abort
|
call $~lib/env/abort
|
||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
|
i32.const 43
|
||||||
|
i32.const 44
|
||||||
|
i32.ne
|
||||||
|
i32.eqz
|
||||||
|
if
|
||||||
|
i32.const 0
|
||||||
|
i32.const 8
|
||||||
|
i32.const 21
|
||||||
|
i32.const 0
|
||||||
|
call $~lib/env/abort
|
||||||
|
unreachable
|
||||||
|
end
|
||||||
)
|
)
|
||||||
(func $start (; 3 ;) (type $FUNCSIG$v)
|
(func $start (; 3 ;) (type $FUNCSIG$v)
|
||||||
call $start:std/gc-integration
|
call $start:std/gc-integration
|
||||||
|
Loading…
x
Reference in New Issue
Block a user