APISonar


com.oracle.svm.core.log.Log.log

> com > oracle > svm > core > log > Log > log
com APIs oracle APIs svm APIs core APIs log APIs Log APIs log APIs

Example 1
private static void logException(Throwable exception) {
        Log.log().string(exception.getClass().getName());
        if (!NoAllocationVerifier.isActive()) {
            String detail = exception.getMessage();
            if (detail != null) {
                Log.log().string(": ").string(detail);
            }
        }
        Log.log().newline();
    }
Example 2
public void logRecentOperations(Log log) {
        log.string("== [Recent RuntimeCodeCache operations: ");
        recentCodeCacheOperations.foreach((context, entry) -> {
            Log.log().newline().string(entry);
        });
        log.string("]").newline();
    }
Example 3
static void FatalError(JNIEnvironment env, CCharPointer message) {
        Log log = Log.log().autoflush(true);
        log.string("Fatal error reported via JNI: ").string(message).newline();
        VMThreads.StatusSupport.setStatusIgnoreSafepoints();
        SubstrateUtil.printDiagnostics(log, KnownIntrinsics.readCallerStackPointer(), KnownIntrinsics.readReturnAddress());
        ImageSingletons.lookup(LogHandler.class).fatalError();
    }
Example 4
private static RuntimeException reportNoReferenceMap(Pointer sp, CodePointer ip, DeoptimizedFrame deoptimizedFrame, CodeInfo info) {
        Log.log().string("ip: ").hex(ip).string("  sp: ").hex(sp);
        Log.log().string("  deoptFrame: ").object(deoptimizedFrame).string("  info:");
        CodeInfoAccess.log(info, Log.log()).newline();
        throw VMError.shouldNotReachHere("No reference map information found");
    }
Example 5
public final void warnIfNotLocked(String message) {
        if (!locked) {
            Log.log().string("[VMMutex.warnIfNotlocked: ").string(message).string("]").newline();
        }
    }
Example 6
private static boolean copyAlignedObjectAssert(Object obj) {
        if (GCImpl.runtimeAssertions() && !HeapImpl.getHeapImpl().assertHubOfObject(obj)) {
            /* I am about to fail an assert, but first log some things about the object. */
            final Log failureLog = Log.log().string("[! Space.copyAlignedObjectAssert:").indent(true);
            ObjectHeaderImpl.getObjectHeaderImpl().objectHeaderToLog(obj, failureLog);
            failureLog.string(" !]").indent(false);
            return false;
        }
        return true;
    }
Example 7
private void releaseLock() {
        final Log trace = SubstrateOptions.TraceVMOperations.getValue() ? Log.log() : Log.noopLog();
        trace.string("[VMOperationControl.releaseLock: ").newline();
        final VMMutex lock = getLock();
        lock.assertIsLocked("VMOperationControl.releaseLock but not locked.");
        unsetLockOwner();
        lock.unlock();
        trace.string("  isOwner: ").bool(isLockOwner()).string("]").newline();
    }
Example 8
private static void reportTypeAssertionError(byte[] msg, Object object) {
        Log.log().string(msg).string(object == null ? "null" : object.getClass().getName()).newline();
        throw VMError.shouldNotReachHere("type assertion error");
    }
Example 9
public static void guaranteeOkayToBlock(String message) {
        /* If the system is frozen at a safepoint, then it is not okay to block. */
        if (isFrozen()) {
            Log.log().string(message).newline();
            VMError.shouldNotReachHere("Should not reach here: Not okay to block.");
        }
    }
Example 10
public static long doNotLoopTooLong(long startNanos, long loopNanos, long warningNanos, String message) {
        long result = loopNanos;
        final long waitedNanos = TimeUtils.nanoSecondsSince(loopNanos);
        if ((0 < warningNanos) && TimeUtils.nanoTimeLessThan(warningNanos, waitedNanos)) {
            Log.log().string("[TimeUtils.doNotLoopTooLong:")
                            .string("  startNanos: ").signed(startNanos)
                            .string("  warningNanos: ").signed(warningNanos).string(" < ").string(" waitedNanos: ").signed(waitedNanos)
                            .string("  reason: ").string(message)
                            .string("]").newline();
            result = System.nanoTime();
        }
        return result;
    }
Example 11
private static boolean promoteAlignedObjectSpaceAssert(Space thatSpace, AlignedHeapChunk.AlignedHeader chunk, Object object) {
        final boolean result = HeapImpl.getHeapImpl().isValidSpace(thatSpace);
        if (!result) {
            /* I am about to fail an assert, but first log some things about that Space. */
            final Log failureLog = Log.log().string("[! Space.promoteAlignedObjectAssert:");
            failureLog.string("  space: ").hex(Word.objectToUntrackedPointer(thatSpace))
                            .string("  chunk: ").hex(chunk)
                            .string("  original: ").hex(Word.objectToUntrackedPointer(object));
            failureLog.string(" !]").newline();
        }
        return result;
    }
Example 12
public static boolean maybeFatallyTooLong(long startNanos, long failureNanos, String reason) {
        if (0 < failureNanos) {
            /* If a promptness limit was set. */
            final long nanosSinceStart = TimeUtils.nanoSecondsSince(startNanos);
            if (TimeUtils.nanoTimeLessThan(failureNanos, nanosSinceStart)) {
                /* If the promptness limit was exceeded. */
                Log.log().string("[TimeUtils.maybeFatallyTooLong:")
                                .string("  startNanos: ").signed(startNanos)
                                .string("  failureNanos: ").signed(failureNanos).string(" < nanosSinceStart: ").signed(nanosSinceStart)
                                .string("  reason: ").string(reason).string("]").newline();
                return true;
            }
        }
        return false;
    }
Example 13
static boolean verifyOnlyCleanCardsOfUnalignedHeapChunk(UnalignedHeader that) {
        final Log trace = Log.noopLog().string("[UnalignedHeapChunk.verifyOnlyCleanCards:");
        trace.string("  that: ").hex(that);
        boolean result = true;
        // Iterate through the cards looking for dirty cards.
        final Pointer rememberedSetStart = getCardTableStart(that);
        final UnsignedWord objectIndex = getObjectIndex();
        if (CardTable.isDirtyEntryAtIndex(rememberedSetStart, objectIndex)) {
            result = false;
            final Log witness = Log.log().string("[UnalignedHeapChunk.verifyOnlyCleanCards:");
            witness.string("  that: ").hex(that).string("  dirty card at index: ").unsigned(objectIndex).string("]").newline();
        }
        trace.string("  returns: ").bool(result).string("]").newline();
        return result;
    }
Example 14
protected static void checkResult(int result, String functionName) {
        if (result == 0) {
            /*
             * Functions are called very early and late during our execution, so there is not much
             * we can do when they fail.
             */
            VMThreads.StatusSupport.setStatusIgnoreSafepoints();
            int lastError = WinBase.GetLastError();
            Log.log().string(functionName).string(" returned ").signed(result).string(" GetLastError returned: 0x").hex(lastError).newline();
            ImageSingletons.lookup(LogHandler.class).fatalError();
        }
    }
Example 15
protected HeapVerifierImpl() {
        /*
         * The constructor is called during native image generation, at which point there isn't a
         * Heap, so the heap field must be initialized lazily.
         */
        this.spaceVerifier = SpaceVerifierImpl.factory();
        this.cause = "Too soon to tell";
        final ReferenceToYoungObjectReferenceVisitor refToYoungObjectReferenceVisitor = new ReferenceToYoungObjectReferenceVisitor();
        this.referenceToYoungObjectVisitor = new ReferenceToYoungObjectVisitor(refToYoungObjectReferenceVisitor);
        this.witnessLog = Log.log();
    }
Example 16
private static void installMethod(SubstrateMethod method, CompilationResult result, SubstrateInstalledCodeImpl installedCode, boolean testTrampolineJumps) {
        InstalledCodeBuilder installedCodeBuilder = new InstalledCodeBuilder(method, result, installedCode, null, testTrampolineJumps);
        installedCodeBuilder.install();

        Log.log().string("Installed code for " + method.format("%H.%n(%p)") + ": " + result.getTargetCodeSize() + " bytes").newline();
    }
Example 17
private boolean verifyConstant(FrameInfoQueryResult targetFrame, ValueInfo targetValue, JavaConstant source) {
        boolean equal;
        JavaConstant target = readValue(targetValue, targetFrame);
        if (source.getJavaKind() == JavaKind.Object && target.getJavaKind() == JavaKind.Object) {
            // Differences in compression are irrelevant, compare only object identities
            equal = (SubstrateObjectConstant.asObject(target) == SubstrateObjectConstant.asObject(source));
        } else {
            equal = source.equals(target);
        }
        if (!equal) {
            Log.log().string("source: ").string(source.toString()).string("  target: ").string(target.toString()).newline();
        }
        return equal;
    }
Example 18
private static RuntimeException unknownFrameEncountered(JavaStackWalk walk, Pointer sp, DeoptimizedFrame deoptFrame) {
        Log.log().string("Stack walk must walk only frames of known code:")
                        .string("  startSP=").hex(walk.getStartSP()).string("  startIP=").hex(walk.getStartIP())
                        .string("  sp=").hex(sp).string("  ip=").hex(walk.getPossiblyStaleIP()).string((deoptFrame != null) ? " (possibly before deopt)" : "")
                        .string("  deoptFrame=").object(deoptFrame)
                        .newline();
        throw VMError.shouldNotReachHere("Stack walk must walk only frames of known code");
    }