use of com.oracle.svm.core.log.Log in project graal by oracle.
the class OldGeneration method distributePinnedAlignedChunks.
private void distributePinnedAlignedChunks(Space pinnedSpace, Space unpinnedSpace) {
final Log trace = Log.noopLog().string("[OldGeneration.distributePinnedAlignedChunks:");
AlignedHeapChunk.AlignedHeader aChunk = getPinnedFromSpace().getFirstAlignedHeapChunk();
while (aChunk.isNonNull()) {
trace.newline();
/* Set up for the next iteration. */
final AlignedHeapChunk.AlignedHeader next = aChunk.getNext();
/* Move the chunk to pinned toSpace or the unpinned space. */
getPinnedFromSpace().extractAlignedHeapChunk(aChunk);
if (aChunk.getPinned()) {
/* Clean up for the next collection. */
aChunk.setPinned(false);
trace.string(" to pinned space");
pinnedSpace.appendAlignedHeapChunk(aChunk);
} else {
trace.string(" to unpinned space");
unpinnedSpace.appendAlignedHeapChunk(aChunk);
}
/* Advance to the next chunk. */
aChunk = next;
}
trace.string("]").newline();
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class OldGeneration method promoteAlignedObject.
private Object promoteAlignedObject(Object original) {
final Log trace = Log.noopLog().string("[OldGeneration.promoteAlignedObject:").string(" original: ").object(original);
assert ObjectHeaderImpl.getObjectHeaderImpl().isAlignedObject(original);
final AlignedHeapChunk.AlignedHeader originalChunk = AlignedHeapChunk.getEnclosingAlignedHeapChunk(original);
final Space originalSpace = originalChunk.getSpace();
trace.string(" originalSpace: ").string(originalSpace.getName());
Object result = original;
if (shouldPromoteFrom(originalSpace)) {
trace.string(" promoting");
if (HeapOptions.TraceObjectPromotion.getValue()) {
final Log promotionTrace = Log.log().string("[OldGeneration.promoteAlignedObject:").string(" original: ").object(original);
final UnsignedWord size = LayoutEncoding.getSizeFromObject(original);
promotionTrace.string(" size: ").unsigned(size).string("]").newline();
}
result = getToSpace().promoteAlignedObject(original);
} else {
trace.string(" not promoting");
}
trace.string(" returns: ").object(result);
if (trace.isEnabled()) {
final AlignedHeapChunk.AlignedHeader resultChunk = AlignedHeapChunk.getEnclosingAlignedHeapChunk(result);
final Space resultSpace = resultChunk.getSpace();
trace.string(" resultSpace: ").string(resultSpace.getName());
}
trace.string("]").newline();
return result;
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class PinnedObjectImpl method claimPinnedObjectList.
/**
* Claim the entire list. Only called once during each collection, but it uses getAndSet(null)
* anyway so I do not have to worry about it.
*/
public static PinnedObjectImpl claimPinnedObjectList() {
final Log trace = Log.noopLog().string("[PinnedObject.claimPinnedObjectList:").newline();
final HeapImpl heap = HeapImpl.getHeapImpl();
final AtomicReference<PinnedObjectImpl> pinHead = heap.getPinHead();
final PinnedObjectImpl result = pinHead.getAndSet(null);
trace.string(" returns: ").object(result);
return result;
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class Space method promoteUnalignedHeapChunk.
/**
* Promote an UnalignedHeapChunk by moving it to this Space, if necessary.
*/
boolean promoteUnalignedHeapChunk(UnalignedHeapChunk.UnalignedHeader uChunk) {
final Log trace = Log.noopLog().string("[SpaceImpl.promoteCardRememberedSetUnalignedObjectChunk:");
trace.string(" uChunk: ").hex(uChunk);
final Space originalSpace = uChunk.getSpace();
final boolean promote = (this != originalSpace);
if (promote) {
originalSpace.extractUnalignedHeapChunk(uChunk);
appendUnalignedHeapChunk(uChunk);
/*
* If the original chunk is from the young space, then it doesn't have a remembered set,
* so build one.
*/
if (HeapImpl.getHeapImpl().isYoungGeneration(originalSpace)) {
trace.string(" setting up remembered set");
UnalignedHeapChunk.setUpRememberedSetOfUnalignedHeapChunk(uChunk);
}
}
trace.string(" returns: ").bool(promote).string("]").newline();
return promote;
}
use of com.oracle.svm.core.log.Log in project graal by oracle.
the class Space method appendAlignedHeapChunk.
/*
* HeapChunk list manipulation methods.
*
* There are two sets of methods, for aligned and unaligned heap chunk arguments.
*/
/**
* Append the argument AlignedHeapChunk to the doubly-linked list of AlignedHeapChunks.
*/
void appendAlignedHeapChunk(AlignedHeapChunk.AlignedHeader aChunk) {
/*
* This method is used from {@link PosixJavaThreads#detachThread(VMThread)}, so it can not
* guarantee that it is inside a VMOperation, only that there is some mutual exclusion.
*/
if (SubstrateOptions.MultiThreaded.getValue()) {
VMThreads.THREAD_MUTEX.guaranteeIsLocked("Trying to append an aligned heap chunk but no mutual exclusion.");
}
final Log trace = Log.noopLog().string("[SpaceImpl.appendAlignedHeapChunk:").newline();
if (trace.isEnabled()) {
trace.string(" before space: ").string(getName()).string(" first: ").hex(getFirstAlignedHeapChunk()).string(" last: ").hex(getLastAlignedHeapChunk()).newline();
trace.string(" before chunk: ").hex(aChunk).string(" .space: ").object(aChunk.getSpace());
trace.string(" .previous: ").hex(aChunk.getPrevious()).string(" .next: ").hex(aChunk.getNext()).newline();
}
appendAlignedHeapChunkUninterruptibly(aChunk);
getAccounting().noteAlignedHeapChunk(AlignedHeapChunk.committedObjectMemoryOfAlignedHeapChunk(aChunk));
if (trace.isEnabled()) {
trace.string(" after space: ").string(getName()).string(" first: ").hex(getFirstAlignedHeapChunk()).string(" last: ").hex(getLastAlignedHeapChunk()).newline();
trace.string(" after chunk: ").hex(aChunk).hex(aChunk).string(" space: ").string(aChunk.getSpace().getName());
trace.string(" .previous: ").hex(aChunk.getPrevious()).string(" .next: ").hex(aChunk.getNext()).newline();
trace.string("]").newline();
}
}
Aggregations