Search in sources :

Example 1 with GraalJVMCICompiler

use of org.graalvm.compiler.api.runtime.GraalJVMCICompiler in project graal by oracle.

the class Graal method initializeRuntime.

private static GraalRuntime initializeRuntime() {
    Services.initializeJVMCI();
    JVMCICompiler compiler = JVMCI.getRuntime().getCompiler();
    if (compiler instanceof GraalJVMCICompiler) {
        GraalJVMCICompiler graal = (GraalJVMCICompiler) compiler;
        return graal.getGraalRuntime();
    } else {
        return new InvalidGraalRuntime();
    }
}
Also used : GraalJVMCICompiler(org.graalvm.compiler.api.runtime.GraalJVMCICompiler) JVMCICompiler(jdk.vm.ci.runtime.JVMCICompiler) GraalJVMCICompiler(org.graalvm.compiler.api.runtime.GraalJVMCICompiler)

Example 2 with GraalJVMCICompiler

use of org.graalvm.compiler.api.runtime.GraalJVMCICompiler in project graal by oracle.

the class LambdaStableNameTest method findStableLambdaName.

private String findStableLambdaName(ResolvedJavaType type) {
    OptionValues options = new OptionValues(OptionValues.newOptionMap());
    DebugContext debug = new Builder(options, Collections.emptyList()).build();
    GraalJVMCICompiler compiler = (GraalJVMCICompiler) JVMCI.getRuntime().getCompiler();
    Providers providers = compiler.getGraalRuntime().getCapability(RuntimeProvider.class).getHostBackend().getProviders();
    final HotSpotJITClassInitializationPlugin initializationPlugin = new HotSpotJITClassInitializationPlugin();
    return LambdaUtils.findStableLambdaName(initializationPlugin, providers, type, options, debug, this);
}
Also used : GraalJVMCICompiler(org.graalvm.compiler.api.runtime.GraalJVMCICompiler) OptionValues(org.graalvm.compiler.options.OptionValues) Builder(org.graalvm.compiler.debug.DebugContext.Builder) DebugContext(org.graalvm.compiler.debug.DebugContext) Providers(org.graalvm.compiler.phases.util.Providers) HotSpotJITClassInitializationPlugin(org.graalvm.compiler.hotspot.meta.HotSpotJITClassInitializationPlugin)

Example 3 with GraalJVMCICompiler

use of org.graalvm.compiler.api.runtime.GraalJVMCICompiler in project graal by oracle.

the class HotSpotTruffleCompilerImpl method getCompiler.

private static GraalJVMCICompiler getCompiler(OptionValues options) {
    HotSpotJVMCIRuntime runtime = HotSpotJVMCIRuntime.runtime();
    if (!Options.TruffleCompilerConfiguration.hasBeenSet(options)) {
        JVMCICompiler compiler = runtime.getCompiler();
        if (compiler instanceof GraalJVMCICompiler) {
            return (GraalJVMCICompiler) compiler;
        }
    }
    CompilerConfigurationFactory compilerConfigurationFactory = CompilerConfigurationFactory.selectFactory(Options.TruffleCompilerConfiguration.getValue(options), options, runtime);
    return HotSpotGraalCompilerFactory.createCompiler("Truffle", runtime, options, compilerConfigurationFactory);
}
Also used : GraalJVMCICompiler(org.graalvm.compiler.api.runtime.GraalJVMCICompiler) CompilerConfigurationFactory(org.graalvm.compiler.hotspot.CompilerConfigurationFactory) EconomyCompilerConfigurationFactory(org.graalvm.compiler.hotspot.EconomyCompilerConfigurationFactory) HotSpotJVMCIRuntime(jdk.vm.ci.hotspot.HotSpotJVMCIRuntime) JVMCICompiler(jdk.vm.ci.runtime.JVMCICompiler) GraalJVMCICompiler(org.graalvm.compiler.api.runtime.GraalJVMCICompiler)

Aggregations

GraalJVMCICompiler (org.graalvm.compiler.api.runtime.GraalJVMCICompiler)3 JVMCICompiler (jdk.vm.ci.runtime.JVMCICompiler)2 HotSpotJVMCIRuntime (jdk.vm.ci.hotspot.HotSpotJVMCIRuntime)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 Builder (org.graalvm.compiler.debug.DebugContext.Builder)1 CompilerConfigurationFactory (org.graalvm.compiler.hotspot.CompilerConfigurationFactory)1 EconomyCompilerConfigurationFactory (org.graalvm.compiler.hotspot.EconomyCompilerConfigurationFactory)1 HotSpotJITClassInitializationPlugin (org.graalvm.compiler.hotspot.meta.HotSpotJITClassInitializationPlugin)1 OptionValues (org.graalvm.compiler.options.OptionValues)1 Providers (org.graalvm.compiler.phases.util.Providers)1