5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package jdk.vm.ci.hotspot;
24
25 import jdk.vm.ci.runtime.JVMCICompilerFactory;
26
27 /**
28 * HotSpot extensions to {@link JVMCICompilerFactory}.
29 */
30 public abstract class HotSpotJVMCICompilerFactory implements JVMCICompilerFactory {
31
32 /**
33 * Gets 0 or more prefixes identifying classes that should by compiled by C1 in simple mode
34 * (i.e., {@code CompLevel_simple}) when HotSpot is running with tiered compilation. The
35 * prefixes should be class or package names using "/" as the separator, e.g. "jdk/vm/ci".
36 *
37 * @return 0 or more Strings identifying packages that should by compiled by the first tier only
38 * or null if no redirection to C1 should be performed.
39 */
40 public String[] getTrivialPrefixes() {
41 return null;
42 }
43
44 public enum CompilationLevelAdjustment {
73 FullProfile,
74 FullOptimization
75 }
76
77 /**
78 * Potentially modifies the compilation level currently selected by the VM compilation policy
79 * for a method.
80 *
81 * @param declaringClass the class in which the method is declared
82 * @param name the name of the method or {@code null} depending on the value that was returned
83 * by {@link #getCompilationLevelAdjustment()}
84 * @param signature the signature of the method or {@code null} depending on the value that was
85 * returned by {@link #getCompilationLevelAdjustment()}
86 * @param isOsr specifies if the compilation being scheduled in an OSR compilation
87 * @param level the compilation level currently selected by the VM compilation policy
88 * @return the compilation level to use for the compilation being scheduled (must be a valid
89 * {@code CompLevel} enum value)
90 */
91 public CompilationLevel adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, CompilationLevel level) {
92 throw new InternalError("Should not reach here");
93 }
94 }
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package jdk.vm.ci.hotspot;
24
25 import java.util.Collections;
26 import java.util.Map;
27 import jdk.vm.ci.runtime.JVMCICompilerFactory;
28
29 /**
30 * HotSpot extensions to {@link JVMCICompilerFactory}.
31 */
32 public abstract class HotSpotJVMCICompilerFactory implements JVMCICompilerFactory {
33
34 /**
35 * Gets 0 or more prefixes identifying classes that should by compiled by C1 in simple mode
36 * (i.e., {@code CompLevel_simple}) when HotSpot is running with tiered compilation. The
37 * prefixes should be class or package names using "/" as the separator, e.g. "jdk/vm/ci".
38 *
39 * @return 0 or more Strings identifying packages that should by compiled by the first tier only
40 * or null if no redirection to C1 should be performed.
41 */
42 public String[] getTrivialPrefixes() {
43 return null;
44 }
45
46 public enum CompilationLevelAdjustment {
75 FullProfile,
76 FullOptimization
77 }
78
79 /**
80 * Potentially modifies the compilation level currently selected by the VM compilation policy
81 * for a method.
82 *
83 * @param declaringClass the class in which the method is declared
84 * @param name the name of the method or {@code null} depending on the value that was returned
85 * by {@link #getCompilationLevelAdjustment()}
86 * @param signature the signature of the method or {@code null} depending on the value that was
87 * returned by {@link #getCompilationLevelAdjustment()}
88 * @param isOsr specifies if the compilation being scheduled in an OSR compilation
89 * @param level the compilation level currently selected by the VM compilation policy
90 * @return the compilation level to use for the compilation being scheduled (must be a valid
91 * {@code CompLevel} enum value)
92 */
93 public CompilationLevel adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, CompilationLevel level) {
94 throw new InternalError("Should not reach here");
95 }
96
97 /**
98 * Provides compiler specific platform MBeans. These MBeans will be automatically
99 * exposed once the management system gets initialized.
100 *
101 * @return map from MBean names to their instances
102 */
103 public Map<String, Object> mbeans() {
104 return Collections.emptyMap();
105 }
106 }
|