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);
}
}
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();
}
}
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);
}
Aggregations