Mercurial > hg > graal-jvmci-8
comparison jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/services/HotSpotJVMCICompilerFactory.java @ 23679:b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 15 Jun 2016 00:00:41 +0200 |
parents | 24505bf61633 |
children |
comparison
equal
deleted
inserted
replaced
23678:e86a0b0ba969 | 23679:b5557b757040 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package jdk.vm.ci.hotspot.services; | 23 package jdk.vm.ci.hotspot.services; |
24 | 24 |
25 import jdk.vm.ci.hotspot.HotSpotVMConfig; | |
26 import jdk.vm.ci.runtime.services.JVMCICompilerFactory; | 25 import jdk.vm.ci.runtime.services.JVMCICompilerFactory; |
27 | 26 |
28 /** | 27 /** |
29 * HotSpot extensions to {@link JVMCICompilerFactory}. | 28 * HotSpot extensions to {@link JVMCICompilerFactory}. |
30 */ | 29 */ |
40 */ | 39 */ |
41 public String[] getTrivialPrefixes() { | 40 public String[] getTrivialPrefixes() { |
42 return null; | 41 return null; |
43 } | 42 } |
44 | 43 |
44 public enum CompilationLevelAdjustment { | |
45 /** | |
46 * No adjustment. | |
47 */ | |
48 None, | |
49 | |
50 /** | |
51 * Adjust based on declaring class of method. | |
52 */ | |
53 ByHolder, | |
54 | |
55 /** | |
56 * Adjust based on declaring class, name and signature of method. | |
57 */ | |
58 ByFullSignature | |
59 } | |
60 | |
45 /** | 61 /** |
46 * Determines if this object may want to adjust the compilation level for a method that is being | 62 * Determines if this object may want to adjust the compilation level for a method that is being |
47 * scheduled by the VM for compilation. The legal return values and their meanings are: | 63 * scheduled by the VM for compilation. |
48 * <ul> | |
49 * <li>0 - no adjustment</li> | |
50 * <li>1 - adjust based on declaring class of method</li> | |
51 * <li>2 - adjust based on declaring class, name and signature of method</li> | |
52 * </ul> | |
53 */ | 64 */ |
54 public int getCompilationLevelAdjustment(HotSpotVMConfig config) { | 65 public CompilationLevelAdjustment getCompilationLevelAdjustment() { |
55 return config.compLevelAdjustmentNone; | 66 return CompilationLevelAdjustment.None; |
67 } | |
68 | |
69 public enum CompilationLevel { | |
70 None, | |
71 Simple, | |
72 LimitedProfile, | |
73 FullProfile, | |
74 FullOptimization | |
56 } | 75 } |
57 | 76 |
58 /** | 77 /** |
59 * Potentially modifies the compilation level currently selected by the VM compilation policy | 78 * Potentially modifies the compilation level currently selected by the VM compilation policy |
60 * for a method. | 79 * for a method. |
61 * | 80 * |
62 * @param config object for reading HotSpot {@code CompLevel} enum values | |
63 * @param declaringClass the class in which the method is declared | 81 * @param declaringClass the class in which the method is declared |
64 * @param name the name of the method or {@code null} depending on the value that was returned | 82 * @param name the name of the method or {@code null} depending on the value that was returned |
65 * by {@link #getCompilationLevelAdjustment(HotSpotVMConfig)} | 83 * by {@link #getCompilationLevelAdjustment()} |
66 * @param signature the signature of the method or {@code null} depending on the value that was | 84 * @param signature the signature of the method or {@code null} depending on the value that was |
67 * returned by {@link #getCompilationLevelAdjustment(HotSpotVMConfig)} | 85 * returned by {@link #getCompilationLevelAdjustment()} |
68 * @param isOsr specifies if the compilation being scheduled in an OSR compilation | 86 * @param isOsr specifies if the compilation being scheduled in an OSR compilation |
69 * @param level the compilation level currently selected by the VM compilation policy | 87 * @param level the compilation level currently selected by the VM compilation policy |
70 * @return the compilation level to use for the compilation being scheduled (must be a valid | 88 * @return the compilation level to use for the compilation being scheduled (must be a valid |
71 * {@code CompLevel} enum value) | 89 * {@code CompLevel} enum value) |
72 */ | 90 */ |
73 public int adjustCompilationLevel(HotSpotVMConfig config, Class<?> declaringClass, String name, String signature, boolean isOsr, int level) { | 91 public CompilationLevel adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, CompilationLevel level) { |
74 throw new InternalError("Should not reach here"); | 92 throw new InternalError("Should not reach here"); |
75 } | 93 } |
76 } | 94 } |