annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @ 24144:b0077339d77e

use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
author Doug Simon <doug.simon@oracle.com>
date Thu, 15 Jun 2017 12:04:08 +0200
parents 42cc0c2dd4a7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
1 /*
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
4 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
8 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
13 * accompanied this code).
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
14 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
18 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
21 * questions.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
22 */
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22623
diff changeset
23 package jdk.vm.ci.hotspot;
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
24
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
25 import java.nio.file.Path;
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
26 import java.nio.file.Paths;
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
27 import java.util.ArrayList;
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
28 import java.util.List;
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
29
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22623
diff changeset
30 import jdk.vm.ci.code.CompilationRequest;
22770
1fbfcc0334d3 JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22767
diff changeset
31 import jdk.vm.ci.code.CompilationRequestResult;
23392
b3a816d3b844 Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents: 23387
diff changeset
32 import jdk.vm.ci.common.JVMCIError;
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
33 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
22697
57646377e480 Rename Compiler to JVMCICompiler and expose it from JVMCIRuntime.
Roland Schatz <roland.schatz@oracle.com>
parents: 22672
diff changeset
34 import jdk.vm.ci.runtime.JVMCICompiler;
23785
5cf445d2acf6 Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents: 23725
diff changeset
35 import jdk.vm.ci.runtime.JVMCICompilerFactory;
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22623
diff changeset
36 import jdk.vm.ci.runtime.JVMCIRuntime;
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
37 import jdk.vm.ci.services.JVMCIPermission;
23785
5cf445d2acf6 Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents: 23725
diff changeset
38 import jdk.vm.ci.services.JVMCIServiceLocator;
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
39 import sun.misc.VM;
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
40
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
41 final class HotSpotJVMCICompilerConfig {
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
42
23725
5595ab8ba8bd documented DummyCompilerFactory
Doug Simon <doug.simon@oracle.com>
parents: 23723
diff changeset
43 /**
5595ab8ba8bd documented DummyCompilerFactory
Doug Simon <doug.simon@oracle.com>
parents: 23723
diff changeset
44 * This factory allows JVMCI initialization to succeed but raises an error if the VM asks JVMCI
5595ab8ba8bd documented DummyCompilerFactory
Doug Simon <doug.simon@oracle.com>
parents: 23723
diff changeset
45 * to perform a compilation. This allows the reflective parts of the JVMCI API to be used
5595ab8ba8bd documented DummyCompilerFactory
Doug Simon <doug.simon@oracle.com>
parents: 23723
diff changeset
46 * without requiring a compiler implementation to be available.
5595ab8ba8bd documented DummyCompilerFactory
Doug Simon <doug.simon@oracle.com>
parents: 23723
diff changeset
47 */
23785
5cf445d2acf6 Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents: 23725
diff changeset
48 private static class DummyCompilerFactory implements JVMCICompilerFactory, JVMCICompiler {
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
49
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
50 private final String reason;
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
51
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
52 DummyCompilerFactory(String reason) {
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
53 this.reason = reason;
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
54 }
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
55
22770
1fbfcc0334d3 JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22767
diff changeset
56 public CompilationRequestResult compileMethod(CompilationRequest request) {
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
57 throw new JVMCIError("No JVMCI compiler selected. " + reason);
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
58 }
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
59
23358
7eaa740eaca2 make JVMCICompilerFactory an abstract class with security checks (JDK-8155622)
Doug Simon <doug.simon@oracle.com>
parents: 23319
diff changeset
60 @Override
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
61 public String getCompilerName() {
24132
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
62 return "null";
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
63 }
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
64
23358
7eaa740eaca2 make JVMCICompilerFactory an abstract class with security checks (JDK-8155622)
Doug Simon <doug.simon@oracle.com>
parents: 23319
diff changeset
65 @Override
22697
57646377e480 Rename Compiler to JVMCICompiler and expose it from JVMCIRuntime.
Roland Schatz <roland.schatz@oracle.com>
parents: 22672
diff changeset
66 public JVMCICompiler createCompiler(JVMCIRuntime runtime) {
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
67 return this;
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
68 }
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
69 }
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
70
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
71 /**
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
72 * Factory of the selected system compiler.
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
73 */
22697
57646377e480 Rename Compiler to JVMCICompiler and expose it from JVMCIRuntime.
Roland Schatz <roland.schatz@oracle.com>
parents: 22672
diff changeset
74 private static JVMCICompilerFactory compilerFactory;
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
75
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
76 /**
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
77 * Gets the selected system compiler factory.
22437
c88c31c60755 Improved JavaDoc on HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22429
diff changeset
78 *
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
79 * @return the selected system compiler factory
23785
5cf445d2acf6 Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents: 23725
diff changeset
80 * @throws SecurityException if a security manager is present and it denies
5cf445d2acf6 Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents: 23725
diff changeset
81 * {@link JVMCIPermission} for any {@link JVMCIServiceLocator} loaded by this method
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
82 */
22697
57646377e480 Rename Compiler to JVMCICompiler and expose it from JVMCIRuntime.
Roland Schatz <roland.schatz@oracle.com>
parents: 22672
diff changeset
83 static JVMCICompilerFactory getCompilerFactory() {
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
84 if (compilerFactory == null) {
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
85 JVMCICompilerFactory factory = null;
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
86 String compilerName = Option.Compiler.getString();
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
87 if (compilerName != null) {
24132
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
88 if (compilerName.isEmpty() || compilerName.equals("null")) {
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
89 factory = new DummyCompilerFactory("Value of " + Option.Compiler.getPropertyName() + " property is \"" +
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
90 compilerName + "\" which denotes the null JVMCI compiler.");
24132
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
91 } else {
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
92 for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
93 if (f.getCompilerName().equals(compilerName)) {
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
94 factory = f;
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
95 }
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
96 }
24132
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
97 if (factory == null) {
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
98 throw new JVMCIError("JVMCI compiler \"%s\" not found", compilerName);
24132
42cc0c2dd4a7 support -DjvmciCompiler=null as a way to prevent JVMCI compiler auto-selection
Doug Simon <doug.simon@oracle.com>
parents: 23785
diff changeset
99 }
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
100 }
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
101 } else {
23723
3db9e47b477a simplified JVMCI compiler auto selection (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23721
diff changeset
102 // Auto select a single available compiler
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
103 List<String> multiple = null;
23785
5cf445d2acf6 Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents: 23725
diff changeset
104 for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
105 if (multiple != null) {
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
106 multiple.add(f.getCompilerName());
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
107 } else if (factory == null) {
23723
3db9e47b477a simplified JVMCI compiler auto selection (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23721
diff changeset
108 factory = f;
3db9e47b477a simplified JVMCI compiler auto selection (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23721
diff changeset
109 } else {
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
110 multiple = new ArrayList<>();
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
111 multiple.add(f.getCompilerName());
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
112 multiple.add(factory.getCompilerName());
23723
3db9e47b477a simplified JVMCI compiler auto selection (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23721
diff changeset
113 factory = null;
3db9e47b477a simplified JVMCI compiler auto selection (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23721
diff changeset
114 }
23721
c61554b3f6df compiler selection should work without -Djvmci.Compiler (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23392
diff changeset
115 }
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
116 if (multiple != null) {
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
117 factory = new DummyCompilerFactory("Multiple providers of " + JVMCICompilerFactory.class + " available: " +
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
118 String.join(", ", multiple) +
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
119 ". You can select one of these with the " + Option.Compiler.getPropertyName() + " property " +
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
120 "(e.g., -D" + Option.Compiler.getPropertyName() + "=" + multiple.get(0) + ").");
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
121 } else if (factory == null) {
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
122 Path jvmciDir = Paths.get(VM.getSavedProperty("java.home"), "lib", "jvmci");
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
123 factory = new DummyCompilerFactory("No providers of " + JVMCICompilerFactory.class + " found in " + jvmciDir +
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24132
diff changeset
124 " or on the class path specified by the jvmci.class.path.append property.");
23721
c61554b3f6df compiler selection should work without -Djvmci.Compiler (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23392
diff changeset
125 }
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
126 }
23723
3db9e47b477a simplified JVMCI compiler auto selection (JDK-8160730)
Doug Simon <doug.simon@oracle.com>
parents: 23721
diff changeset
127 factory.onSelection();
23319
c1935b089c01 8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents: 22770
diff changeset
128 compilerFactory = factory;
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
129 }
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
130 return compilerFactory;
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
131 }
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
132 }