use of com.oracle.svm.core.heap.ObjectReferenceWalker in project graal by oracle.
the class GarbageCollectorManagementFactory method walkRegisteredObjectReferences.
@SuppressWarnings("try")
private void walkRegisteredObjectReferences() {
final Log trace = Log.noopLog().string("[walkRegisteredObjectReferences").string(":").newline();
try (Timer wrm = walkRegisteredMemoryTimer.open()) {
/*
* ObjectReferenceWalkers should be pinned, otherwise they might already be forwarded.
* Walk the list as Object so there is no type checking until I know it is safe.
*/
Object element = objectReferenceWalkerList.getFirstObject();
while (element != null) {
if (!HeapImpl.getHeapImpl().isPinned(element)) {
throw unpinnedObjectReferenceWalkerException;
}
element = ((AllocationFreeList.Element<?>) element).getNextObject();
}
/* Visit each walker. */
for (ObjectReferenceWalker walker = objectReferenceWalkerList.getFirst(); walker != null; walker = walker.getNextElement()) {
trace.string("[").string(walker.getWalkerName()).string(":");
trace.newline();
walker.walk(greyToBlackObjRefVisitor);
trace.string("]").newline();
}
}
trace.string("]").newline();
}
Aggregations