Search in sources :

Example 1 with TruffleCompiler

use of org.graalvm.compiler.truffle.common.TruffleCompiler in project graal by oracle.

the class GraalTestTVMCI method finishWarmup.

@SuppressWarnings("try")
@Override
public void finishWarmup(OptimizedCallTarget callTarget, String testName) {
    OptionValues options = TruffleCompilerOptions.getOptions();
    DebugContext debug = DebugContext.create(options, DebugHandlersFactory.LOADER);
    TruffleCompiler compiler = truffleRuntime.getTruffleCompiler();
    TruffleInlining inliningDecision = new TruffleInlining(callTarget, new DefaultInliningPolicy());
    try (DebugContext.Scope s = debug.scope("TruffleCompilation", new TruffleDebugJavaMethod(callTarget))) {
        compiler.doCompile(debug, null, options, callTarget, inliningDecision, null, null);
    } catch (Throwable e) {
        throw debug.handle(e);
    }
}
Also used : OptionValues(org.graalvm.compiler.options.OptionValues) TruffleDebugJavaMethod(org.graalvm.compiler.truffle.common.TruffleDebugJavaMethod) TruffleCompiler(org.graalvm.compiler.truffle.common.TruffleCompiler) DebugContext(org.graalvm.compiler.debug.DebugContext)

Example 2 with TruffleCompiler

use of org.graalvm.compiler.truffle.common.TruffleCompiler in project graal by oracle.

the class GraalTruffleRuntime method shutdown.

private void shutdown() {
    getListener().onShutdown();
    TruffleCompiler tcp = truffleCompiler;
    if (tcp != null) {
        tcp.shutdown();
    }
}
Also used : TruffleCompiler(org.graalvm.compiler.truffle.common.TruffleCompiler)

Example 3 with TruffleCompiler

use of org.graalvm.compiler.truffle.common.TruffleCompiler in project graal by oracle.

the class GraalTruffleRuntime method doCompile.

@SuppressWarnings("try")
protected void doCompile(OptionValues options, OptimizedCallTarget callTarget, Cancellable task) {
    listeners.onCompilationStarted(callTarget);
    TruffleCompiler compiler = getTruffleCompiler();
    TruffleInlining inlining = new TruffleInlining(callTarget, new DefaultInliningPolicy());
    CompilationIdentifier compilationId = compiler.getCompilationIdentifier(callTarget);
    try (DebugContext debug = compilationId != null ? compiler.openDebugContext(options, compilationId, callTarget) : null) {
        try (Scope s = debug != null ? debug.scope("Truffle", new TruffleDebugJavaMethod(callTarget)) : null) {
            maybeDumpTruffleTree(debug, options, callTarget, inlining);
            compiler.doCompile(debug, compilationId, options, callTarget, inlining, task, listeners.isEmpty() ? null : listeners);
        } catch (RuntimeException | Error e) {
            throw e;
        } catch (Throwable e) {
            throw new InternalError(e);
        }
    }
    dequeueInlinedCallSites(inlining, callTarget);
}
Also used : CompilationIdentifier(org.graalvm.compiler.core.common.CompilationIdentifier) TruffleOptionsOverrideScope(org.graalvm.compiler.truffle.common.TruffleCompilerOptions.TruffleOptionsOverrideScope) Scope(org.graalvm.compiler.debug.DebugContext.Scope) TruffleDebugJavaMethod(org.graalvm.compiler.truffle.common.TruffleDebugJavaMethod) GraalError(org.graalvm.compiler.debug.GraalError) ServiceConfigurationError(java.util.ServiceConfigurationError) TruffleCompiler(org.graalvm.compiler.truffle.common.TruffleCompiler) DebugContext(org.graalvm.compiler.debug.DebugContext)

Aggregations

TruffleCompiler (org.graalvm.compiler.truffle.common.TruffleCompiler)3 DebugContext (org.graalvm.compiler.debug.DebugContext)2 TruffleDebugJavaMethod (org.graalvm.compiler.truffle.common.TruffleDebugJavaMethod)2 ServiceConfigurationError (java.util.ServiceConfigurationError)1 CompilationIdentifier (org.graalvm.compiler.core.common.CompilationIdentifier)1 Scope (org.graalvm.compiler.debug.DebugContext.Scope)1 GraalError (org.graalvm.compiler.debug.GraalError)1 OptionValues (org.graalvm.compiler.options.OptionValues)1 TruffleOptionsOverrideScope (org.graalvm.compiler.truffle.common.TruffleCompilerOptions.TruffleOptionsOverrideScope)1