This commit is contained in:
dcode
2019-03-27 14:43:35 +01:00
parent 3146f8f9e0
commit bb1609c9ea
91 changed files with 6426 additions and 11009 deletions

View File

@ -4,7 +4,7 @@
@inline
const TRACE = false;
import { ITERATEROOTS, HEADER_SIZE } from "../runtime";
import { iterateRoots, HEADER_SIZE } from "../runtime";
/** Collector states. */
const enum State {
@ -141,7 +141,7 @@ function step(): void {
}
case State.IDLE: {
if (TRACE) trace("gc~step/IDLE");
ITERATEROOTS((ref: usize): void => {
iterateRoots((ref: usize): void => {
var obj = refToObj(ref);
if (obj.color == white) obj.makeGray();
});
@ -165,7 +165,7 @@ function step(): void {
obj.hookFn(objToRef(obj));
} else {
if (TRACE) trace("gc~step/MARK finish");
ITERATEROOTS((ref: usize): void => {
iterateRoots((ref: usize): void => {
var obj = refToObj(ref);
if (obj.color == white) obj.makeGray();
});