Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java @ 22679:4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Tue, 13 Oct 2015 17:07:59 +0200 |
parents | 1bbd4a7c274b |
children | 55877421f72a |
rev | line source |
---|---|
4446 | 1 /* |
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
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 */ | |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
23 package jdk.vm.ci.hotspot; |
4446 | 24 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
25 import jdk.vm.ci.meta.DeoptimizationReason; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
26 import jdk.vm.ci.meta.JavaMethodProfile; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
27 import jdk.vm.ci.meta.JavaTypeProfile; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
28 import jdk.vm.ci.meta.ProfilingInfo; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
29 import jdk.vm.ci.meta.TriState; |
4446 | 30 |
21411
082417ac43e4
removed com.oracle.graal.hotspot.server and uses of Serializable it depended upon (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18867
diff
changeset
|
31 public final class HotSpotProfilingInfo implements ProfilingInfo, HotSpotProxified { |
4446 | 32 |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
33 // private static final DebugMetric metricInsufficentSpace = |
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
34 // Debug.metric("InsufficientSpaceForProfilingData"); |
4446 | 35 |
9928
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
36 private final HotSpotMethodData methodData; |
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
37 private final HotSpotResolvedJavaMethod method; |
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
38 |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
39 private boolean isMature; |
4446 | 40 private int position; |
41 private int hintPosition; | |
42 private int hintBCI; | |
43 private HotSpotMethodDataAccessor dataAccessor; | |
44 | |
13217
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
45 private boolean includeNormal; |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
46 private boolean includeOSR; |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
47 |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
48 public HotSpotProfilingInfo(HotSpotMethodData methodData, HotSpotResolvedJavaMethod method, boolean includeNormal, boolean includeOSR) { |
4446 | 49 this.methodData = methodData; |
9928
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
50 this.method = method; |
13217
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
51 this.includeNormal = includeNormal; |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
52 this.includeOSR = includeOSR; |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
53 this.isMature = methodData.isProfileMature(); |
4446 | 54 hintPosition = 0; |
55 hintBCI = -1; | |
56 } | |
57 | |
58 @Override | |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5719
diff
changeset
|
59 public int getCodeSize() { |
9928
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
60 return method.getCodeSize(); |
5346
4c3d953f8131
added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents:
5321
diff
changeset
|
61 } |
4c3d953f8131
added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents:
5321
diff
changeset
|
62 |
4c3d953f8131
added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents:
5321
diff
changeset
|
63 @Override |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5530
diff
changeset
|
64 public JavaTypeProfile getTypeProfile(int bci) { |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
65 if (!isMature) { |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
66 return null; |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
67 } |
4450
d585b608bd78
more efficient methodData access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4447
diff
changeset
|
68 findBCI(bci, false); |
4446 | 69 return dataAccessor.getTypeProfile(methodData, position); |
70 } | |
71 | |
72 @Override | |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
73 public JavaMethodProfile getMethodProfile(int bci) { |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
74 if (!isMature) { |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
75 return null; |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
76 } |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
77 findBCI(bci, false); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
78 return dataAccessor.getMethodProfile(methodData, position); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
79 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
80 |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
81 @Override |
4446 | 82 public double getBranchTakenProbability(int bci) { |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
83 if (!isMature) { |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
84 return -1; |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
85 } |
4450
d585b608bd78
more efficient methodData access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4447
diff
changeset
|
86 findBCI(bci, false); |
4446 | 87 return dataAccessor.getBranchTakenProbability(methodData, position); |
88 } | |
89 | |
90 @Override | |
91 public double[] getSwitchProbabilities(int bci) { | |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
92 if (!isMature) { |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
93 return null; |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
94 } |
4450
d585b608bd78
more efficient methodData access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4447
diff
changeset
|
95 findBCI(bci, false); |
4446 | 96 return dataAccessor.getSwitchProbabilities(methodData, position); |
97 } | |
98 | |
99 @Override | |
8610
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
100 public TriState getExceptionSeen(int bci) { |
4450
d585b608bd78
more efficient methodData access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4447
diff
changeset
|
101 findBCI(bci, true); |
4457
5acf4a974e4a
fixed framestate for inlining multiple methods
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4450
diff
changeset
|
102 return dataAccessor.getExceptionSeen(methodData, position); |
4446 | 103 } |
104 | |
105 @Override | |
8610
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
106 public TriState getNullSeen(int bci) { |
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
107 findBCI(bci, false); |
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
108 return dataAccessor.getNullSeen(methodData, position); |
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
109 } |
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
110 |
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
111 @Override |
4446 | 112 public int getExecutionCount(int bci) { |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
113 if (!isMature) { |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
114 return -1; |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
115 } |
4450
d585b608bd78
more efficient methodData access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4447
diff
changeset
|
116 findBCI(bci, false); |
4446 | 117 return dataAccessor.getExecutionCount(methodData, position); |
118 } | |
119 | |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5061
diff
changeset
|
120 @Override |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5530
diff
changeset
|
121 public int getDeoptimizationCount(DeoptimizationReason reason) { |
13217
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
122 int count = 0; |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
123 if (includeNormal) { |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
124 count += methodData.getDeoptimizationCount(reason); |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
125 } |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
126 if (includeOSR) { |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
127 count += methodData.getOSRDeoptimizationCount(reason); |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
128 } |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13216
diff
changeset
|
129 return count; |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5061
diff
changeset
|
130 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5061
diff
changeset
|
131 |
4450
d585b608bd78
more efficient methodData access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4447
diff
changeset
|
132 private void findBCI(int targetBCI, boolean searchExtraData) { |
4446 | 133 assert targetBCI >= 0 : "invalid BCI"; |
134 | |
135 if (methodData.hasNormalData()) { | |
136 int currentPosition = targetBCI < hintBCI ? 0 : hintPosition; | |
137 HotSpotMethodDataAccessor currentAccessor; | |
138 while ((currentAccessor = methodData.getNormalData(currentPosition)) != null) { | |
139 int currentBCI = currentAccessor.getBCI(methodData, currentPosition); | |
140 if (currentBCI == targetBCI) { | |
141 normalDataFound(currentAccessor, currentPosition, currentBCI); | |
142 return; | |
143 } else if (currentBCI > targetBCI) { | |
144 break; | |
145 } | |
146 currentPosition = currentPosition + currentAccessor.getSize(methodData, currentPosition); | |
147 } | |
148 } | |
149 | |
4527
a0cca63cd366
fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4476
diff
changeset
|
150 boolean exceptionPossiblyNotRecorded = false; |
4450
d585b608bd78
more efficient methodData access
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4447
diff
changeset
|
151 if (searchExtraData && methodData.hasExtraData()) { |
4476
00efac2934d3
methodData bugfix
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4457
diff
changeset
|
152 int currentPosition = methodData.getExtraDataBeginOffset(); |
4446 | 153 HotSpotMethodDataAccessor currentAccessor; |
154 while ((currentAccessor = methodData.getExtraData(currentPosition)) != null) { | |
155 int currentBCI = currentAccessor.getBCI(methodData, currentPosition); | |
156 if (currentBCI == targetBCI) { | |
157 extraDataFound(currentAccessor, currentPosition); | |
158 return; | |
159 } | |
160 currentPosition = currentPosition + currentAccessor.getSize(methodData, currentPosition); | |
161 } | |
4527
a0cca63cd366
fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4476
diff
changeset
|
162 |
4553
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4527
diff
changeset
|
163 if (!methodData.isWithin(currentPosition)) { |
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4527
diff
changeset
|
164 exceptionPossiblyNotRecorded = true; |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
165 // metricInsufficentSpace.increment(); |
4553
7d0d849abf80
added option to summarize debug values
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4527
diff
changeset
|
166 } |
4446 | 167 } |
168 | |
4527
a0cca63cd366
fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4476
diff
changeset
|
169 noDataFound(exceptionPossiblyNotRecorded); |
4446 | 170 } |
171 | |
172 private void normalDataFound(HotSpotMethodDataAccessor data, int pos, int bci) { | |
173 setCurrentData(data, pos); | |
174 this.hintPosition = position; | |
175 this.hintBCI = bci; | |
176 } | |
177 | |
178 private void extraDataFound(HotSpotMethodDataAccessor data, int pos) { | |
179 setCurrentData(data, pos); | |
180 } | |
181 | |
4564
8fc6920e064b
avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4561
diff
changeset
|
182 private void noDataFound(boolean exceptionPossiblyNotRecorded) { |
8fc6920e064b
avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4561
diff
changeset
|
183 HotSpotMethodDataAccessor accessor = HotSpotMethodData.getNoDataAccessor(exceptionPossiblyNotRecorded); |
4527
a0cca63cd366
fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4476
diff
changeset
|
184 setCurrentData(accessor, -1); |
4446 | 185 } |
186 | |
187 private void setCurrentData(HotSpotMethodDataAccessor dataAccessor, int position) { | |
188 this.dataAccessor = dataAccessor; | |
189 this.position = position; | |
190 } | |
5346
4c3d953f8131
added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents:
5321
diff
changeset
|
191 |
4c3d953f8131
added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents:
5321
diff
changeset
|
192 @Override |
9928
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
193 public boolean isMature() { |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
194 return isMature; |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
195 } |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
196 |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
197 public void ignoreMature() { |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
198 isMature = true; |
9928
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
199 } |
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
200 |
a9311ec68721
Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
201 @Override |
5346
4c3d953f8131
added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents:
5321
diff
changeset
|
202 public String toString() { |
16490
cac0a7d1c325
moved profileToString(ProfilingInfo info, ResolvedJavaMethod method, String sep) from MetaUtil to be a default method in ProfilingInfo
Doug Simon <doug.simon@oracle.com>
parents:
14543
diff
changeset
|
203 return "HotSpotProfilingInfo<" + this.toString(null, "; ") + ">"; |
5346
4c3d953f8131
added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents:
5321
diff
changeset
|
204 } |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
205 |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
206 @Override |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
207 public void setMature() { |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
208 isMature = true; |
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13217
diff
changeset
|
209 } |
14543
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
210 |
21552
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
211 /** |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
212 * {@code MethodData::_jvmci_ir_size} (currently) supports at most one JVMCI compiler IR type |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
213 * which will be determined by the first JVMCI compiler that calls |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
214 * {@link #setCompilerIRSize(Class, int)}. |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
215 */ |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
216 private static volatile Class<?> supportedCompilerIRType; |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
217 |
14543
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
218 @Override |
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
219 public boolean setCompilerIRSize(Class<?> irType, int size) { |
21552
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
220 if (supportedCompilerIRType == null) { |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
221 synchronized (HotSpotProfilingInfo.class) { |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
222 if (supportedCompilerIRType == null) { |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
223 supportedCompilerIRType = irType; |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
224 } |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
225 } |
14543
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
226 } |
21552
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
227 if (supportedCompilerIRType != irType) { |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
228 return false; |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
229 } |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
230 methodData.setCompiledIRSize(size); |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
231 return true; |
14543
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
232 } |
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
233 |
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
234 @Override |
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
235 public int getCompilerIRSize(Class<?> irType) { |
21552
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
236 if (irType == supportedCompilerIRType) { |
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
237 return methodData.getCompiledIRSize(); |
14543
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
238 } |
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
239 return -1; |
12eaf1a47a90
removed ResolvedJavaMethod.getCompilerStorage(); moved last compiled graph node count into profiling info (i.e. MethodData metadata)
Doug Simon <doug.simon@oracle.com>
parents:
13769
diff
changeset
|
240 } |
4446 | 241 } |