Search in sources :

Example 1 with HotSpotSpeculationLog

use of jdk.vm.ci.hotspot.HotSpotSpeculationLog in project graal by oracle.

the class HotSpotTruffleRuntimeServices method getCompilationSpeculationLog.

/**
 * Gets a speculation log to be used for compiling {@code callTarget}.
 */
public static SpeculationLog getCompilationSpeculationLog(OptimizedCallTarget callTarget) {
    if (sharedHotSpotSpeculationLogConstructor != null) {
        HotSpotSpeculationLog log = (HotSpotSpeculationLog) callTarget.getSpeculationLog();
        try {
            SpeculationLog compilationSpeculationLog = sharedHotSpotSpeculationLogConstructor.newInstance(log);
            compilationSpeculationLog.collectFailedSpeculations();
            return compilationSpeculationLog;
        } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
            throw new InternalError(e);
        }
    }
    SpeculationLog log = callTarget.getSpeculationLog();
    if (log != null) {
        log.collectFailedSpeculations();
    }
    return log;
}
Also used : HotSpotSpeculationLog(jdk.vm.ci.hotspot.HotSpotSpeculationLog) SpeculationLog(jdk.vm.ci.meta.SpeculationLog) HotSpotSpeculationLog(jdk.vm.ci.hotspot.HotSpotSpeculationLog) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with HotSpotSpeculationLog

use of jdk.vm.ci.hotspot.HotSpotSpeculationLog in project graal by oracle.

the class TruffleFromLibGraalEntryPoints method getFailedSpeculationsAddress.

@TruffleFromLibGraal(GetFailedSpeculationsAddress)
static long getFailedSpeculationsAddress(Object compilable) {
    OptimizedCallTarget callTarget = (OptimizedCallTarget) compilable;
    HotSpotSpeculationLog log = (HotSpotSpeculationLog) callTarget.getSpeculationLog();
    return LibGraal.getFailedSpeculationsAddress(log);
}
Also used : HotSpotSpeculationLog(jdk.vm.ci.hotspot.HotSpotSpeculationLog) OptimizedCallTarget(org.graalvm.compiler.truffle.runtime.OptimizedCallTarget) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Aggregations

HotSpotSpeculationLog (jdk.vm.ci.hotspot.HotSpotSpeculationLog)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 SpeculationLog (jdk.vm.ci.meta.SpeculationLog)1 TruffleFromLibGraal (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)1 OptimizedCallTarget (org.graalvm.compiler.truffle.runtime.OptimizedCallTarget)1