Search in sources :

Example 1 with HotSpotTruffleCompilerRuntime

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);
            }
        }
    }
}
Also used : OptionValues(org.graalvm.compiler.options.OptionValues) HotSpotCompilationIdentifier(org.graalvm.compiler.hotspot.HotSpotCompilationIdentifier) Activation(org.graalvm.compiler.debug.DebugContext.Activation) CompiledCode(jdk.vm.ci.code.CompiledCode) DebugContext(org.graalvm.compiler.debug.DebugContext) CompilationResult(org.graalvm.compiler.code.CompilationResult) HotSpotCodeCacheProvider(jdk.vm.ci.hotspot.HotSpotCodeCacheProvider) CodeCacheProvider(jdk.vm.ci.code.CodeCacheProvider) HotSpotTruffleCompilerRuntime(org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleCompilerRuntime) HotSpotResolvedJavaMethod(jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Example 2 with HotSpotTruffleCompilerRuntime

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);
    }
}
Also used : HotSpotTruffleInstalledCode(org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleInstalledCode) HotSpotTruffleCompilerRuntime(org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleCompilerRuntime)

Aggregations

HotSpotTruffleCompilerRuntime (org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleCompilerRuntime)2 CodeCacheProvider (jdk.vm.ci.code.CodeCacheProvider)1 CompiledCode (jdk.vm.ci.code.CompiledCode)1 HotSpotCodeCacheProvider (jdk.vm.ci.hotspot.HotSpotCodeCacheProvider)1 HotSpotResolvedJavaMethod (jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod)1 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 CompilationResult (org.graalvm.compiler.code.CompilationResult)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 Activation (org.graalvm.compiler.debug.DebugContext.Activation)1 HotSpotCompilationIdentifier (org.graalvm.compiler.hotspot.HotSpotCompilationIdentifier)1 OptionValues (org.graalvm.compiler.options.OptionValues)1 HotSpotTruffleInstalledCode (org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleInstalledCode)1