use of org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleCompilerRuntime in project graal by oracle.
the class HotSpotTruffleCompilerImpl method installTruffleCallBoundaryMethods.
/**
* @see #compileTruffleCallBoundaryMethod
*/
@Override
@SuppressWarnings("try")
public void installTruffleCallBoundaryMethods() {
HotSpotTruffleCompilerRuntime runtime = (HotSpotTruffleCompilerRuntime) TruffleCompilerRuntime.getRuntime();
for (ResolvedJavaMethod method : runtime.getTruffleCallBoundaryMethods()) {
HotSpotCompilationIdentifier compilationId = (HotSpotCompilationIdentifier) backend.getCompilationIdentifier(method);
OptionValues options = getOptions();
try (DebugContext debug = DebugStubsAndSnippets.getValue(options) ? hotspotGraalRuntime.openDebugContext(options, compilationId, method, getDebugHandlerFactories()) : DebugContext.DISABLED;
Activation a = debug.activate();
DebugContext.Scope d = debug.scope("InstallingTruffleStub")) {
CompilationResult compResult = compileTruffleCallBoundaryMethod(method, compilationId, debug);
CodeCacheProvider codeCache = providers.getCodeCache();
try (DebugContext.Scope s = debug.scope("CodeInstall", codeCache, method, compResult)) {
CompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(codeCache, method, compilationId.getRequest(), compResult);
codeCache.setDefaultCode(method, compiledCode);
} catch (Throwable e) {
throw debug.handle(e);
}
}
}
}
use of org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleCompilerRuntime in project graal by oracle.
the class HotSpotTruffleCompilerImpl method afterCodeInstallation.
@Override
protected void afterCodeInstallation(InstalledCode installedCode) {
if (installedCode instanceof HotSpotTruffleInstalledCode) {
HotSpotTruffleCompilerRuntime runtime = (HotSpotTruffleCompilerRuntime) TruffleCompilerRuntime.getRuntime();
HotSpotTruffleInstalledCode hotspotTruffleInstalledCode = (HotSpotTruffleInstalledCode) installedCode;
runtime.onCodeInstallation(hotspotTruffleInstalledCode);
}
}
Aggregations