Search in sources :

Example 1 with HotSpotVMConfigAccess

use of jdk.vm.ci.hotspot.HotSpotVMConfigAccess in project graal by oracle.

the class HotSpotTruffleRuntimeAccess method getRuntime.

@Override
public TruffleRuntime getRuntime() {
    // initialize JVMCI to make sure the TruffleCompiler option is parsed
    Services.initializeJVMCI();
    HotSpotJVMCIRuntimeProvider hsRuntime = (HotSpotJVMCIRuntimeProvider) JVMCI.getRuntime();
    HotSpotVMConfigAccess config = new HotSpotVMConfigAccess(hsRuntime.getConfigStore());
    boolean useCompiler = config.getFlag("UseCompiler", Boolean.class);
    if (!useCompiler) {
        // This happens, for example, when -Xint is given on the command line
        return new DefaultTruffleRuntime();
    }
    return new HotSpotTruffleRuntime(new LazyGraalRuntime());
}
Also used : HotSpotVMConfigAccess(jdk.vm.ci.hotspot.HotSpotVMConfigAccess) DefaultTruffleRuntime(com.oracle.truffle.api.impl.DefaultTruffleRuntime) HotSpotJVMCIRuntimeProvider(jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)

Aggregations

DefaultTruffleRuntime (com.oracle.truffle.api.impl.DefaultTruffleRuntime)1 HotSpotJVMCIRuntimeProvider (jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)1 HotSpotVMConfigAccess (jdk.vm.ci.hotspot.HotSpotVMConfigAccess)1