< prev index next >
src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java
Print this page
*** 26,38 ****
import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
import jdk.vm.ci.runtime.JVMCICompiler;
import jdk.vm.ci.runtime.JVMCICompilerFactory;
import jdk.vm.ci.runtime.JVMCIRuntime;
- import jdk.vm.ci.services.JVMCIServiceLocator;
import jdk.vm.ci.services.JVMCIPermission;
! import jdk.vm.ci.services.Services;
final class HotSpotJVMCICompilerConfig {
/**
* This factory allows JVMCI initialization to succeed but raises an error if the VM asks JVMCI
--- 26,38 ----
import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
import jdk.vm.ci.runtime.JVMCICompiler;
import jdk.vm.ci.runtime.JVMCICompilerFactory;
import jdk.vm.ci.runtime.JVMCIRuntime;
import jdk.vm.ci.services.JVMCIPermission;
! import jdk.vm.ci.services.JVMCIServiceLocator;
! import jdk.vm.ci.services.internal.ReflectionAccessJDK;
final class HotSpotJVMCICompilerConfig {
/**
* This factory allows JVMCI initialization to succeed but raises an error if the VM asks JVMCI
*** 45,55 ****
throw new JVMCIError("no JVMCI compiler selected");
}
@Override
public String getCompilerName() {
! return "<none>";
}
@Override
public JVMCICompiler createCompiler(JVMCIRuntime runtime) {
return this;
--- 45,55 ----
throw new JVMCIError("no JVMCI compiler selected");
}
@Override
public String getCompilerName() {
! return "null";
}
@Override
public JVMCICompiler createCompiler(JVMCIRuntime runtime) {
return this;
*** 71,93 ****
static JVMCICompilerFactory getCompilerFactory() {
if (compilerFactory == null) {
JVMCICompilerFactory factory = null;
String compilerName = Option.Compiler.getString();
if (compilerName != null) {
for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
if (f.getCompilerName().equals(compilerName)) {
factory = f;
}
}
if (factory == null) {
throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
}
} else {
// Auto select a single available compiler
for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
if (factory == null) {
! Services.exportJVMCITo(f.getClass());
factory = f;
} else {
// Multiple factories seen - cancel auto selection
factory = null;
break;
--- 71,97 ----
static JVMCICompilerFactory getCompilerFactory() {
if (compilerFactory == null) {
JVMCICompilerFactory factory = null;
String compilerName = Option.Compiler.getString();
if (compilerName != null) {
+ if (compilerName.isEmpty() || compilerName.equals("null")) {
+ factory = new DummyCompilerFactory();
+ } else {
for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
if (f.getCompilerName().equals(compilerName)) {
factory = f;
}
}
if (factory == null) {
throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
}
+ }
} else {
// Auto select a single available compiler
for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
if (factory == null) {
! ReflectionAccessJDK.openJVMCITo(f.getClass());
factory = f;
} else {
// Multiple factories seen - cancel auto selection
factory = null;
break;
< prev index next >