Search in sources :

Example 1 with ObjectReferenceWalker

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();
}
Also used : ObjectReferenceWalker(com.oracle.svm.core.heap.ObjectReferenceWalker) Log(com.oracle.svm.core.log.Log) AllocationFreeList(com.oracle.svm.core.heap.AllocationFreeList)

Aggregations

AllocationFreeList (com.oracle.svm.core.heap.AllocationFreeList)1 ObjectReferenceWalker (com.oracle.svm.core.heap.ObjectReferenceWalker)1 Log (com.oracle.svm.core.log.Log)1