Search in sources :

Example 11 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class Deoptimizer method logRecentDeoptimizationEvents.

public static void logRecentDeoptimizationEvents(Log log) {
    log.string("== [Recent Deoptimizer Events: ").newline();
    recentDeoptimizationEvents.foreach(log, (context, entry) -> {
        Log l = (Log) context;
        char[] chars = SubstrateUtil.getRawStringChars(entry);
        for (int i = 0; i < entry.length(); i++) {
            char c = chars[i];
            if (c == '\n') {
                l.newline();
            } else {
                l.character(c);
            }
        }
    });
    log.string("]").newline();
}
Also used : StringBuilderLog(com.oracle.svm.core.log.StringBuilderLog) Log(com.oracle.svm.core.log.Log)

Example 12 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class Space method cleanRememberedSetAlignedHeapChunks.

private void cleanRememberedSetAlignedHeapChunks() {
    final Log trace = Log.noopLog().string("[SpaceImpl.cleanAlignedHeapChunks:").string("  space: ").string(getName());
    /* Visit the aligned chunks. */
    /* TODO: Should there be a ChunkVisitor? */
    AlignedHeapChunk.AlignedHeader aChunk = getFirstAlignedHeapChunk();
    while (aChunk.isNonNull()) {
        trace.newline().string("  aChunk: ").hex(aChunk);
        AlignedHeapChunk.cleanRememberedSetOfAlignedHeapChunk(aChunk);
        aChunk = aChunk.getNext();
    }
    trace.string("]").newline();
}
Also used : Log(com.oracle.svm.core.log.Log)

Example 13 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class Space method allocateMemory.

/**
 * Allocate memory from an AlignedHeapChunk in this Space.
 *
 * This is "slow-path" memory allocation.
 */
private Pointer allocateMemory(UnsignedWord objectSize) {
    final Log trace = Log.noopLog().string("[SpaceImpl.allocateMemory:").string("  space: ").string(getName()).string("  size: ").unsigned(objectSize).newline();
    Pointer result = WordFactory.nullPointer();
    /* First try allocating in the last chunk. */
    final AlignedHeapChunk.AlignedHeader oldChunk = getLastAlignedHeapChunk();
    trace.string("  oldChunk: ").hex(oldChunk);
    if (oldChunk.isNonNull()) {
        result = AlignedHeapChunk.allocateMemory(oldChunk, objectSize);
        trace.string("  oldChunk provides: ").hex(result);
    }
    /* If oldChunk did not provide, try allocating a new chunk for the requested memory. */
    if (result.isNull()) {
        final AlignedHeapChunk.AlignedHeader newChunk = requestAlignedHeapChunk();
        trace.string("  newChunk: ").hex(newChunk);
        if (newChunk.isNonNull()) {
            /* Allocate the Object within the new chunk. */
            result = AlignedHeapChunk.allocateMemory(newChunk, objectSize);
            trace.string("  newChunk provides: ").hex(result);
        }
    }
    trace.string("  returns: ").hex(result).string("]").newline();
    return result;
}
Also used : Log(com.oracle.svm.core.log.Log) Pointer(org.graalvm.word.Pointer)

Example 14 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class SpaceVerifierImpl method verifyAlignedChunks.

private boolean verifyAlignedChunks() {
    final Log trace = HeapImpl.getHeapImpl().getHeapVerifierImpl().getTraceLog().string("[SpaceVerifierImpl.VerifierImpl.verifyAlignedChunks:");
    boolean result = true;
    AlignedHeapChunk.AlignedHeader chunk = space.getFirstAlignedHeapChunk();
    while (chunk.isNonNull()) {
        result &= AlignedHeapChunk.verifyAlignedHeapChunk(chunk);
        chunk = chunk.getNext();
    }
    trace.string("  returns: ").bool(result).string("]").newline();
    return result;
}
Also used : Log(com.oracle.svm.core.log.Log)

Example 15 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class SpaceVerifierImpl method verifyOnlyCleanUnalignedChunks.

private boolean verifyOnlyCleanUnalignedChunks() {
    final Log trace = HeapImpl.getHeapImpl().getHeapVerifierImpl().getTraceLog().string("[SpaceVerifierImpl.verifyOnlyCleanUnalignedChunks:").newline();
    boolean result = true;
    UnalignedHeapChunk.UnalignedHeader chunk = space.getFirstUnalignedHeapChunk();
    while (chunk.isNonNull()) {
        result &= UnalignedHeapChunk.verifyOnlyCleanCardsOfUnalignedHeapChunk(chunk);
        chunk = chunk.getNext();
    }
    trace.string("  returns: ").bool(result).string("]").newline();
    return result;
}
Also used : Log(com.oracle.svm.core.log.Log)

Aggregations

Log (com.oracle.svm.core.log.Log)130 Pointer (org.graalvm.word.Pointer)30 UnsignedWord (org.graalvm.word.UnsignedWord)30 IsolateThread (org.graalvm.nativeimage.IsolateThread)4 CodePointer (org.graalvm.nativeimage.c.function.CodePointer)4 Uninterruptible (com.oracle.svm.core.annotate.Uninterruptible)3 CollectionWatcher (com.oracle.svm.core.heap.CollectionWatcher)3 DiscoverableReference (com.oracle.svm.core.heap.DiscoverableReference)3 XOptions (com.oracle.svm.core.option.XOptions)3 AlwaysInline (com.oracle.svm.core.annotate.AlwaysInline)2 CEntryPointOptions (com.oracle.svm.core.c.function.CEntryPointOptions)2 KnownIntrinsics.readCallerStackPointer (com.oracle.svm.core.snippets.KnownIntrinsics.readCallerStackPointer)2 CEntryPoint (org.graalvm.nativeimage.c.function.CEntryPoint)2 RestrictHeapAccess (com.oracle.svm.core.annotate.RestrictHeapAccess)1 CodeInfoQueryResult (com.oracle.svm.core.code.CodeInfoQueryResult)1 SubstrateInstalledCode (com.oracle.svm.core.deopt.SubstrateInstalledCode)1 AlignedHeader (com.oracle.svm.core.genscavenge.AlignedHeapChunk.AlignedHeader)1 UnalignedHeader (com.oracle.svm.core.genscavenge.UnalignedHeapChunk.UnalignedHeader)1 AllocationFreeList (com.oracle.svm.core.heap.AllocationFreeList)1 NoAllocationVerifier (com.oracle.svm.core.heap.NoAllocationVerifier)1