use of com.oracle.svm.core.log.Log in project graal by oracle.
the class DiscoverableReferenceProcessing method discoverDiscoverableReference.
/*
* Public methods for collectors.
*/
public static void discoverDiscoverableReference(Object object) {
final Log trace = Log.noopLog();
/* TODO: What's the cost of this type test, since o will be a concrete subtype? */
Object obj = KnownIntrinsics.convertUnknownValue(object, Object.class);
if (obj instanceof DiscoverableReference) {
/* Add this DiscoverableReference to the discovered list. */
final DiscoverableReference dr = (DiscoverableReference) obj;
trace.string("[DiscoverableReference.discoverDiscoverableReference:");
trace.string(" dr: ").object(dr).string(" referent: ").hex(DiscoverableReference.TestingBackDoor.getReferentPointer(dr)).string("]").newline();
addToDiscoveredReferences(dr);
}
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class GarbageCollectorManagementFactory method collectOperation.
/**
* The body of the VMOperation to do the collection.
*/
@SuppressWarnings("try")
private OutOfMemoryError collectOperation(String cause, UnsignedWord requestingEpoch) {
final Log trace = Log.noopLog().string("[GCImpl.collectOperation:").newline().string(" epoch: ").unsigned(getCollectionEpoch()).string(" cause: ").string(cause).string(" requestingEpoch: ").unsigned(requestingEpoch).newline();
VMOperation.guaranteeInProgress("Collection should be a VMOperation.");
/* if there has been a collection since the requesting epoch, then just return. */
if (getCollectionEpoch().aboveThan(requestingEpoch)) {
trace.string(" epoch has moved on]").newline();
return null;
}
/* Stop the mutator timer. */
mutatorTimer.close();
/* Note that a collection is in progress, or exit if one is already in progress. */
startCollectionOrExit();
/* Reset things for this collection. */
resetTimers();
incrementCollectionEpoch();
/* Flush chunks from thread-local lists to global lists. */
ThreadLocalAllocation.disableThreadLocalAllocation();
/* Report the heap before the collection. */
printGCBefore(cause);
/* Scrub the lists I maintain, before the collection. */
scrubLists();
/* Run any collection watchers before the collection. */
visitWatchersBefore();
/* Collect. */
try {
collectImpl(cause);
} catch (Throwable t) {
/* Exceptions during collections are fatal. */
throw VMError.shouldNotReachHere(t);
}
/* Check if out of memory. */
final OutOfMemoryError result = checkIfOutOfMemory();
/* Run any collection watchers after the collection. */
visitWatchersAfter();
/* Reset for the next collection. */
HeapPolicy.bytesAllocatedSinceLastCollection.set(WordFactory.zero());
/* Print the heap after the collection. */
printGCAfter(cause);
/* Note that the collection is finished. */
finishCollection();
/* Start the mutator timer. */
mutatorTimer.open();
trace.string("]").newline();
return result;
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class GarbageCollectorManagementFactory method promoteAllPinnedObjects.
@SuppressWarnings("try")
private void promoteAllPinnedObjects() {
final Log trace = Log.noopLog().string("[GCImpl.promoteAllPinnedObjects:").newline();
try (Timer ppot = promotePinnedObjectsTimer.open()) {
promoteIndividualPinnedObjects();
promotePinnedAllocatorObjects(completeCollection);
}
trace.string("]").newline();
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class GarbageCollectorManagementFactory method promotePinnedAllocatorObjects.
private static void promotePinnedAllocatorObjects(final boolean completeCollection) {
final Log trace = Log.noopLog().string("[GCImpl.promotePinnedAllocatorObjects:").newline();
final HeapImpl heap = HeapImpl.getHeapImpl();
final OldGeneration oldGeneration = heap.getOldGeneration();
oldGeneration.promotePinnedAllocatorChunks(completeCollection);
trace.string("]").newline();
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class GarbageCollectorManagementFactory method blackenBootImageRoots.
@SuppressWarnings("try")
private void blackenBootImageRoots() {
final Log trace = Log.noopLog().string("[blackenBootImageRoots:").newline();
try (Timer bbirt = blackenBootImageRootsTimer.open()) {
try (GreyToBlackObjRefVisitor.Counters gtborv = greyToBlackObjRefVisitor.openCounters()) {
/* Walk through the native image heap roots. */
Pointer cur = Word.objectToUntrackedPointer(NativeImageInfo.firstWritableReferenceObject);
final Pointer last = Word.objectToUntrackedPointer(NativeImageInfo.lastWritableReferenceObject);
while (cur.belowOrEqual(last)) {
Object obj = cur.toObject();
if (obj != null) {
greyToBlackObjectVisitor.visitObjectInline(obj);
}
cur = LayoutEncoding.getObjectEnd(obj);
}
}
}
trace.string("]").newline();
}
Aggregations