< prev index next >

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java

Print this page

        

@@ -44,19 +44,13 @@
      * to perform a compilation. This allows the reflective parts of the JVMCI API to be used
      * without requiring a compiler implementation to be available.
      */
     private static class DummyCompilerFactory implements JVMCICompilerFactory, JVMCICompiler {
 
-        private final String reason;
-
-        DummyCompilerFactory(String reason) {
-            this.reason = reason;
-        }
-
         @Override
         public HotSpotCompilationRequestResult compileMethod(CompilationRequest request) {
-            throw new JVMCIError("no JVMCI compiler selected: " + reason);
+            throw new JVMCIError("no JVMCI compiler selected");
         }
 
         @Override
         public String getCompilerName() {
             return "null";

@@ -83,14 +77,12 @@
     static JVMCICompilerFactory getCompilerFactory() {
         if (compilerFactory == null) {
             JVMCICompilerFactory factory = null;
             String compilerName = Option.Compiler.getString();
             if (compilerName != null) {
-                if (compilerName.isEmpty()) {
-                    factory = new DummyCompilerFactory(" empty \"\" is specified");
-                } else if (compilerName.equals("null")) {
-                    factory = new DummyCompilerFactory("\"null\" is specified");
+                if (compilerName.isEmpty() || compilerName.equals("null")) {
+                    factory = new DummyCompilerFactory();
                 } else {
                     for (JVMCICompilerFactory f : getJVMCICompilerFactories()) {
                         if (f.getCompilerName().equals(compilerName)) {
                             factory = f;
                         }

@@ -99,24 +91,22 @@
                         throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
                     }
                 }
             } else {
                 // Auto select a single available compiler
-                String reason = "default compiler is not found";
                 for (JVMCICompilerFactory f : getJVMCICompilerFactories()) {
                     if (factory == null) {
                         openJVMCITo(f.getClass().getModule());
                         factory = f;
                     } else {
                         // Multiple factories seen - cancel auto selection
-                        reason = "multiple factories seen: \"" + factory.getCompilerName() + "\" and \"" + f.getCompilerName() + "\"";
                         factory = null;
                         break;
                     }
                 }
                 if (factory == null) {
-                    factory = new DummyCompilerFactory(reason);
+                    factory = new DummyCompilerFactory();
                 }
             }
             factory.onSelection();
             compilerFactory = factory;
         }
< prev index next >