use of com.oracle.svm.core.log.Log in project graal by oracle.
the class GarbageCollectorManagementFactory method promoteIndividualPinnedObjects.
private static void promoteIndividualPinnedObjects() {
final Log trace = Log.noopLog().string("[GCImpl.promoteIndividualPinnedObjects:").newline();
/* Capture the PinnedObject list and start a new one. */
final PinnedObjectImpl oldList = PinnedObjectImpl.claimPinnedObjectList();
/* Walk the list, dealing with the open PinnedObjects. */
PinnedObjectImpl rest = oldList;
while (rest != null) {
final PinnedObjectImpl first = rest;
final PinnedObjectImpl next = first.getNext();
if (first.isOpen()) {
/* Promote the chunk with the object, and put this PinnedObject on the new list. */
promotePinnedObject(first);
/* Pushing onto the new list reverses the order of the list. */
PinnedObjectImpl.pushPinnedObject(first);
}
rest = next;
}
trace.string("]").newline();
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class HeapVerifierImpl method noReferencesToForwardedObjectsVerifier.
/* Look for objects with forwarded headers. */
private boolean noReferencesToForwardedObjectsVerifier(Object obj) {
final Log trace = getTraceLog();
trace.string("[HeapVerifierImpl.noReferencesToForwardedObjectsVerifier:");
trace.string(" obj: ").object(obj);
final UnsignedWord header = ObjectHeaderImpl.readHeaderFromObjectCarefully(obj);
trace.string(" header: ").hex(header);
final Pointer objPointer = Word.objectToUntrackedPointer(obj);
trace.string(" objPointer: ").hex(objPointer);
boolean result = InteriorObjRefWalker.walkObject(obj, noReferencesToForwardedObjectsVisitor);
if (!result) {
try (Log witness = getWitnessLog()) {
witness.string("[HeapVerifierImpl.noReferencesToForwardedObjectsVerifier:").string(" cause: ").string(getCause()).string(" obj: ").object(obj).string("]").newline();
}
}
trace.string("]").newline();
return result;
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class HeapVerifierImpl method noReferencesOutsideHeap.
/**
* For debugging: look for objects with interior references to outside the heap.
*
* That includes: references that are to zapped objects, and references that aren't to the heap.
*/
private boolean noReferencesOutsideHeap(Object obj) {
final Log trace = getTraceLog();
trace.string("[HeapVerifierImpl.noReferencesToZappedObjectsVerifier:");
trace.string(" obj: ").object(obj).string(" obj.getClass: ").string(obj.getClass().getName());
final ObjectHeaderImpl ohi = ObjectHeaderImpl.getObjectHeaderImpl();
final UnsignedWord header = ObjectHeaderImpl.readHeaderFromObjectCarefully(obj);
trace.string(" header: ").hex(header).string(" objectHeader: ").string(ohi.toStringFromObject(obj));
final Pointer objPointer = Word.objectToUntrackedPointer(obj);
trace.string(" objPointer: ").hex(objPointer);
boolean result = InteriorObjRefWalker.walkObject(obj, noReferencesOutsideHeapVisitor);
if (!result) {
try (Log witness = getWitnessLog()) {
witness.string("[HeapVerifierImpl.noReferencesOutsideHeap:").string(" cause: ").string(getCause());
witness.string(" obj: ").string(obj.getClass().getName()).string("@").hex(objPointer);
witness.string(" header: ").hex(header).string(" objectHeader: ").string(ohi.toStringFromObject(obj)).string("]").newline();
}
}
trace.string(" returns: ").bool(result).string("]").newline();
return result;
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class OldGeneration method distributePinnedChunks.
private void distributePinnedChunks(boolean completeCollection) {
final Log trace = Log.noopLog().string("[OldGeneration.distributePinnedChunks:").string(" completeCollection: ").bool(completeCollection);
final Space unpinnedSpace = (completeCollection ? getFromSpace() : getToSpace());
trace.string(" unpinnedSpace: ").string(unpinnedSpace.getName());
distributePinnedAlignedChunks(getPinnedToSpace(), unpinnedSpace);
distributePinnedUnalignedChunks(getPinnedToSpace(), unpinnedSpace);
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class OldGeneration method promoteUnalignedObjectChunk.
private Object promoteUnalignedObjectChunk(Object original) {
final Log trace = Log.noopLog().string("[OldGeneration.promoteUnalignedObjectChunk:").string(" original: ").object(original);
assert ObjectHeaderImpl.getObjectHeaderImpl().isUnalignedObject(original);
final UnalignedHeapChunk.UnalignedHeader uChunk = UnalignedHeapChunk.getEnclosingUnalignedHeapChunk(original);
final Space originalSpace = uChunk.getSpace();
trace.string(" originalSpace: ").string(originalSpace.getName());
if (shouldPromoteFrom(originalSpace)) {
trace.string(" promoting");
/*
* Since the object does not move when an UnalignedChunk is promoted, there is no need
* to return a possible copy.
*/
if (HeapOptions.TraceObjectPromotion.getValue()) {
final Log promotionTrace = Log.log().string("[OldGeneration.promoteUnalignedObjectChunk:").string(" original: ").object(original);
final UnsignedWord size = LayoutEncoding.getSizeFromObject(original);
promotionTrace.string(" size: ").unsigned(size).string("]").newline();
}
getToSpace().promoteUnalignedHeapChunk(uChunk);
} else {
trace.string(" not promoting");
}
trace.string(" returns: ").object(original);
if (trace.isEnabled()) {
final UnalignedHeapChunk.UnalignedHeader resultChunk = UnalignedHeapChunk.getEnclosingUnalignedHeapChunk(original);
final Space resultSpace = resultChunk.getSpace();
trace.string(" resultSpace: ").string(resultSpace.getName());
}
trace.string("]").newline();
return original;
}
Aggregations