Skip to content

Commit 4f1a971

Browse files
committed
make it test again
1 parent 0ad9d56 commit 4f1a971

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

std/assembly/collector/itcm.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
@inline export const HEADER_SIZE: usize = (offsetof<ManagedObject>() + AL_MASK) & ~AL_MASK;
1313

1414
import { AL_MASK, MAX_SIZE_32 } from "../internal/allocator";
15+
import { __rt_iterateroots } from "../builtins";
1516

1617
/** Collector states. */
1718
const enum State {

std/assembly/internal/runtime.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AL_MASK } from "./allocator";
2+
import { __rt_classid } from "../builtins";
23

34
/** Common runtime header of all objects. */
45
@unmanaged
@@ -100,7 +101,7 @@ export function FREE(ref: usize): void {
100101
export function REGISTER<T>(ref: usize, parentRef: usize): void {
101102
var header = UNREF(ref);
102103
header.classId = __rt_classid<T>();
103-
if (GC) __REGISTER_IMPL(ref, parentRef);
104+
if (GC) __REGISTER_IMPL(ref, parentRef); // tslint:disable-line
104105
}
105106

106107
/** ArrayBuffer base class. */

tests/compiler/std/gc-integration.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
i32.const 0
2929
i32.const 8
3030
i32.const 18
31-
i32.const 37
31+
i32.const 42
3232
call $~lib/env/abort
3333
unreachable
3434
end

tests/compiler/std/gc-integration.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ var a_ref: A | null = changetype<A>(24); // global root, nullable
1515
var b_ref: B = changetype<B>(32); // global root, non-nullable
1616

1717
var i: i32 = 0;
18-
iterateRoots((ref: usize): void => { assert(<u32>ref == ++i << 3); });
18+
__rt_iterateroots((ref: usize): void => { assert(<u32>ref == ++i << 3); });
1919
assert(i == 4);
20+
21+
assert(__rt_classid<A>() != __rt_classid<B>());

tests/compiler/std/gc-integration.untouched.wat

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
i32.const 0
3535
i32.const 8
3636
i32.const 18
37-
i32.const 37
37+
i32.const 42
3838
call $~lib/env/abort
3939
unreachable
4040
end
@@ -58,6 +58,18 @@
5858
call $~lib/env/abort
5959
unreachable
6060
end
61+
i32.const 43
62+
i32.const 44
63+
i32.ne
64+
i32.eqz
65+
if
66+
i32.const 0
67+
i32.const 8
68+
i32.const 21
69+
i32.const 0
70+
call $~lib/env/abort
71+
unreachable
72+
end
6173
)
6274
(func $start (; 3 ;) (type $FUNCSIG$v)
6375
call $start:std/gc-integration

0 commit comments

Comments
 (0)