< 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,13 +26,13 @@
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;
+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,11 +45,11 @@
throw new JVMCIError("no JVMCI compiler selected");
}
@Override
public String getCompilerName() {
- return "<none>";
+ return "null";
}
@Override
public JVMCICompiler createCompiler(JVMCIRuntime runtime) {
return this;
@@ -71,23 +71,27 @@
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) {
- Services.exportJVMCITo(f.getClass());
+ ReflectionAccessJDK.openJVMCITo(f.getClass());
factory = f;
} else {
// Multiple factories seen - cancel auto selection
factory = null;
break;
< prev index next >