annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java @ 23765:c64c9fac1ab9

Expose decompile counts in MDO
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 28 Sep 2016 09:22:23 -0700
parents aaed278a9cf1
children 286dce1eca9b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
1 /*
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
4 *
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
8 *
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
13 * accompanied this code).
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
14 *
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
18 *
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
21 * questions.
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
22 */
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
23 package jdk.vm.ci.hotspot;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
24
22569
ec96f33a101d updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents: 22562
diff changeset
25 import static java.lang.String.format;
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
26 import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
27 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
28 import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
29 import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
4470
b7ec250cd29c fixes after merge
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4467
diff changeset
30
22569
ec96f33a101d updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents: 22562
diff changeset
31 import java.util.Arrays;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
32
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
33 import jdk.vm.ci.meta.DeoptimizationReason;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
34 import jdk.vm.ci.meta.JavaMethodProfile;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
35 import jdk.vm.ci.meta.JavaMethodProfile.ProfiledMethod;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
36 import jdk.vm.ci.meta.JavaTypeProfile;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
37 import jdk.vm.ci.meta.JavaTypeProfile.ProfiledType;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
38 import jdk.vm.ci.meta.ResolvedJavaMethod;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
39 import jdk.vm.ci.meta.ResolvedJavaType;
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22582
diff changeset
40 import jdk.vm.ci.meta.TriState;
22569
ec96f33a101d updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents: 22562
diff changeset
41 import sun.misc.Unsafe;
18567
37d88a4af2ab removed references to HotSpotGraalRuntime.unsafeReadWord()
Doug Simon <doug.simon@oracle.com>
parents: 18546
diff changeset
42
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
43 /**
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
44 * Access to a HotSpot {@code MethodData} structure (defined in methodData.hpp).
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
45 */
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
46 final class HotSpotMethodData {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
47
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
48 static final HotSpotVMConfig config = config();
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
49 static final HotSpotMethodDataAccessor NO_DATA_NO_EXCEPTION_ACCESSOR = new NoMethodData(config, config.dataLayoutNoTag, TriState.FALSE);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
50 static final HotSpotMethodDataAccessor NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR = new NoMethodData(config, config.dataLayoutNoTag, TriState.UNKNOWN);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
51
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
52 /**
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
53 * Reference to the C++ MethodData object.
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
54 */
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
55 final long metaspaceMethodData;
23757
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
56 private final HotSpotResolvedJavaMethodImpl method;
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
57
23719
a52d7039723b fixed checkstyle issues
Doug Simon <doug.simon@oracle.com>
parents: 23717
diff changeset
58 HotSpotMethodData(long metaspaceMethodData, HotSpotResolvedJavaMethodImpl method) {
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
59 this.metaspaceMethodData = metaspaceMethodData;
22454
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
60 this.method = method;
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
61 }
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
62
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
63 /**
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
64 * @return value of the MethodData::_data_size field
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
65 */
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
66 private int normalDataSize() {
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
67 return UNSAFE.getInt(metaspaceMethodData + config.methodDataDataSize);
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
68 }
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
69
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
70 /**
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
71 * Returns the size of the extra data records. This method does the same calculation as
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
72 * MethodData::extra_data_size().
16479
558cf39c646b moved toJavaName(JavaType type) from MetaUtil to be a default method in JavaType
Doug Simon <doug.simon@oracle.com>
parents: 15291
diff changeset
73 *
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
74 * @return size of extra data records
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
75 */
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
76 private int extraDataSize() {
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
77 final int extraDataBase = config.methodDataOopDataOffset + normalDataSize();
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
78 final int extraDataLimit = UNSAFE.getInt(metaspaceMethodData + config.methodDataSize);
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
79 return extraDataLimit - extraDataBase;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
80 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
81
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
82 public boolean hasNormalData() {
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
83 return normalDataSize() > 0;
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
84 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
85
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
86 public boolean hasExtraData() {
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
87 return extraDataSize() > 0;
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
88 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
89
4476
00efac2934d3 methodData bugfix
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4470
diff changeset
90 public int getExtraDataBeginOffset() {
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
91 return normalDataSize();
4476
00efac2934d3 methodData bugfix
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4470
diff changeset
92 }
00efac2934d3 methodData bugfix
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4470
diff changeset
93
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
94 public boolean isWithin(int position) {
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
95 return position >= 0 && position < normalDataSize() + extraDataSize();
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
96 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
97
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: 5534
diff changeset
98 public int getDeoptimizationCount(DeoptimizationReason reason) {
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
99 HotSpotMetaAccessProvider metaAccess = (HotSpotMetaAccessProvider) runtime().getHostJVMCIBackend().getMetaAccess();
18301
0f41072d8bbc moved use of HotSpotMetaAccessProvider to locations on the "local" side of remote compilation
Doug Simon <doug.simon@oracle.com>
parents: 18223
diff changeset
100 int reasonIndex = metaAccess.convertDeoptReason(reason);
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
101 return UNSAFE.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + reasonIndex) & 0xFF;
5114
dad1ac9dba7d finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5061
diff changeset
102 }
dad1ac9dba7d finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5061
diff changeset
103
13216
51e97f88c771 Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents: 13182
diff changeset
104 public int getOSRDeoptimizationCount(DeoptimizationReason reason) {
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
105 HotSpotMetaAccessProvider metaAccess = (HotSpotMetaAccessProvider) runtime().getHostJVMCIBackend().getMetaAccess();
18301
0f41072d8bbc moved use of HotSpotMetaAccessProvider to locations on the "local" side of remote compilation
Doug Simon <doug.simon@oracle.com>
parents: 18223
diff changeset
106 int reasonIndex = metaAccess.convertDeoptReason(reason);
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
107 return UNSAFE.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + config.deoptReasonOSROffset + reasonIndex) & 0xFF;
13216
51e97f88c771 Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents: 13182
diff changeset
108 }
51e97f88c771 Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents: 13182
diff changeset
109
23765
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
110 public int getDecompileCount() {
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
111 return UNSAFE.getInt(metaspaceMethodData + config.methodDataDecompiles);
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
112 }
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
113
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
114 public int getOverflowCompileCount() {
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
115 return UNSAFE.getInt(metaspaceMethodData + config.methodDataOverflowRecompiles);
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
116 }
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
117
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
118 public int getOverflowTrapsCount() {
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
119 return UNSAFE.getInt(metaspaceMethodData + config.methodDataOverflowTraps);
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
120 }
c64c9fac1ab9 Expose decompile counts in MDO
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23757
diff changeset
121
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
122 public HotSpotMethodDataAccessor getNormalData(int position) {
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
123 if (position >= normalDataSize()) {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
124 return null;
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
125 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
126
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
127 return getData(position);
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
128 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
129
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
130 public HotSpotMethodDataAccessor getExtraData(int position) {
13241
8b5852df0471 remove CompilerToVM.initializeMethodData
twisti
parents: 13216
diff changeset
131 if (position >= normalDataSize() + extraDataSize()) {
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
132 return null;
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
133 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
134 HotSpotMethodDataAccessor data = getData(position);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
135 if (data != null) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
136 return data;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
137 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
138 return data;
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
139 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
140
4564
8fc6920e064b avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4552
diff changeset
141 public static HotSpotMethodDataAccessor getNoDataAccessor(boolean exceptionPossiblyNotRecorded) {
8fc6920e064b avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4552
diff changeset
142 if (exceptionPossiblyNotRecorded) {
8fc6920e064b avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4552
diff changeset
143 return NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR;
8fc6920e064b avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4552
diff changeset
144 } else {
8fc6920e064b avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4552
diff changeset
145 return NO_DATA_NO_EXCEPTION_ACCESSOR;
8fc6920e064b avoid recursive inlining, escape analysis does no longer restart inlining with level 0, bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4552
diff changeset
146 }
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
147 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
148
4476
00efac2934d3 methodData bugfix
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4470
diff changeset
149 private HotSpotMethodDataAccessor getData(int position) {
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
150 assert position >= 0 : "out of bounds";
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
151 final int tag = HotSpotMethodDataAccessor.readTag(config, this, position);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
152 HotSpotMethodDataAccessor accessor = PROFILE_DATA_ACCESSORS[tag];
14706
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 14543
diff changeset
153 assert accessor == null || accessor.getTag() == tag : "wrong data accessor " + accessor + " for tag " + tag;
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 14543
diff changeset
154 return accessor;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
155 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
156
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
157 int readUnsignedByte(int position, int offsetInBytes) {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
158 long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
159 return UNSAFE.getByte(metaspaceMethodData + fullOffsetInBytes) & 0xFF;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
160 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
161
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
162 int readUnsignedShort(int position, int offsetInBytes) {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
163 long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
164 return UNSAFE.getShort(metaspaceMethodData + fullOffsetInBytes) & 0xFFFF;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
165 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
166
11212
3718acd022db fix HotSpotMethodData to read the correct values on little and big endian
twisti
parents: 9928
diff changeset
167 /**
3718acd022db fix HotSpotMethodData to read the correct values on little and big endian
twisti
parents: 9928
diff changeset
168 * Since the values are stored in cells (platform words) this method uses
18567
37d88a4af2ab removed references to HotSpotGraalRuntime.unsafeReadWord()
Doug Simon <doug.simon@oracle.com>
parents: 18546
diff changeset
169 * {@link Unsafe#getAddress} to read the right value on both little and big endian machines.
11212
3718acd022db fix HotSpotMethodData to read the correct values on little and big endian
twisti
parents: 9928
diff changeset
170 */
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
171 private long readUnsignedInt(int position, int offsetInBytes) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
172 long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
173 return UNSAFE.getAddress(metaspaceMethodData + fullOffsetInBytes) & 0xFFFFFFFFL;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
174 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
175
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
176 private int readUnsignedIntAsSignedInt(int position, int offsetInBytes) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
177 long value = readUnsignedInt(position, offsetInBytes);
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
178 return truncateLongToInt(value);
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
179 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
180
11212
3718acd022db fix HotSpotMethodData to read the correct values on little and big endian
twisti
parents: 9928
diff changeset
181 /**
3718acd022db fix HotSpotMethodData to read the correct values on little and big endian
twisti
parents: 9928
diff changeset
182 * Since the values are stored in cells (platform words) this method uses
18567
37d88a4af2ab removed references to HotSpotGraalRuntime.unsafeReadWord()
Doug Simon <doug.simon@oracle.com>
parents: 18546
diff changeset
183 * {@link Unsafe#getAddress} to read the right value on both little and big endian machines.
11212
3718acd022db fix HotSpotMethodData to read the correct values on little and big endian
twisti
parents: 9928
diff changeset
184 */
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
185 private int readInt(int position, int offsetInBytes) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
186 long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
187 return (int) UNSAFE.getAddress(metaspaceMethodData + fullOffsetInBytes);
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
188 }
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
189
22454
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
190 private HotSpotResolvedJavaMethod readMethod(int position, int offsetInBytes) {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
191 long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
22582
232c53e17ea0 added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents: 22581
diff changeset
192 return compilerToVM().getResolvedJavaMethod(null, metaspaceMethodData + fullOffsetInBytes);
22454
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
193 }
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
194
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
195 private HotSpotResolvedObjectTypeImpl readKlass(int position, int offsetInBytes) {
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
196 long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
22582
232c53e17ea0 added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents: 22581
diff changeset
197 return compilerToVM().getResolvedJavaType(null, metaspaceMethodData + fullOffsetInBytes, false);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
198 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
199
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
200 private static int truncateLongToInt(long value) {
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
201 return value > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) value;
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
202 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
203
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
204 private static int computeFullOffset(int position, int offsetInBytes) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
205 return config.methodDataOopDataOffset + position + offsetInBytes;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
206 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
207
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
208 private static int cellIndexToOffset(int cells) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
209 return config.dataLayoutHeaderSize + cellsToBytes(cells);
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
210 }
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
211
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
212 private static int cellsToBytes(int cells) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
213 return cells * config.dataLayoutCellSize;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
214 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
215
13769
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
216 /**
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
217 * Returns whether profiling ran long enough that the profile information is mature. Other
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
218 * informational data will still be valid even if the profile isn't mature.
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
219 */
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
220 public boolean isProfileMature() {
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
221 return runtime().getCompilerToVM().isMature(metaspaceMethodData);
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
222 }
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13312
diff changeset
223
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
224 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
225 public String toString() {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
226 StringBuilder sb = new StringBuilder();
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
227 String nl = String.format("%n");
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
228 String nlIndent = String.format("%n%38s", "");
23757
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
229 sb.append("Raw method data for ");
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
230 sb.append(method.format("%H.%n(%p)"));
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
231 sb.append(":");
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
232 sb.append(nl);
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
233 if (hasNormalData()) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
234 int pos = 0;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
235 HotSpotMethodDataAccessor data;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
236 while ((data = getNormalData(pos)) != null) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
237 if (pos != 0) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
238 sb.append(nl);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
239 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
240 int bci = data.getBCI(this, pos);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
241 sb.append(String.format("%-6d bci: %-6d%-20s", pos, bci, data.getClass().getSimpleName()));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
242 sb.append(data.appendTo(new StringBuilder(), this, pos).toString().replace(nl, nlIndent));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
243 pos = pos + data.getSize(this, pos);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
244 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
245 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
246
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
247 if (hasExtraData()) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
248 int pos = getExtraDataBeginOffset();
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
249 HotSpotMethodDataAccessor data;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
250 while ((data = getExtraData(pos)) != null) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
251 if (pos == getExtraDataBeginOffset()) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
252 sb.append(nl).append("--- Extra data:");
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
253 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
254 int bci = data.getBCI(this, pos);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
255 sb.append(String.format("%n%-6d bci: %-6d%-20s", pos, bci, data.getClass().getSimpleName()));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
256 sb.append(data.appendTo(new StringBuilder(), this, pos).toString().replace(nl, nlIndent));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
257 pos = pos + data.getSize(this, pos);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
258 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
259
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
260 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
261 return sb.toString();
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
262 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
263
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
264 static final int NO_DATA_SIZE = cellIndexToOffset(0);
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7391
diff changeset
265
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
266 static class NoMethodData extends HotSpotMethodDataAccessor {
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
267
8610
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7556
diff changeset
268 private final TriState exceptionSeen;
4527
a0cca63cd366 fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4526
diff changeset
269
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
270 protected NoMethodData(HotSpotVMConfig config, int tag, TriState exceptionSeen) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
271 super(config, tag, NO_DATA_SIZE);
4527
a0cca63cd366 fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4526
diff changeset
272 this.exceptionSeen = exceptionSeen;
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
273 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
274
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
275 @Override
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
276 public int getBCI(HotSpotMethodData data, int position) {
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
277 return -1;
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
278 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
279
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
280 @Override
8610
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7556
diff changeset
281 public TriState getExceptionSeen(HotSpotMethodData data, int position) {
4527
a0cca63cd366 fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4526
diff changeset
282 return exceptionSeen;
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
283 }
13164
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
284
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
285 @Override
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
286 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
287 return sb;
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
288 }
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
289 }
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
290
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
291 static final int BIT_DATA_SIZE = cellIndexToOffset(0);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
292 static final int BIT_DATA_NULL_SEEN_FLAG = 1 << config.bitDataNullSeenFlag;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
293
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
294 static class BitData extends HotSpotMethodDataAccessor {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
295
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
296 private BitData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
297 super(config, tag, BIT_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
298 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
299
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
300 protected BitData(HotSpotVMConfig config, int tag, int staticSize) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
301 super(config, tag, staticSize);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
302 }
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
303
8610
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7556
diff changeset
304 @Override
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7556
diff changeset
305 public TriState getNullSeen(HotSpotMethodData data, int position) {
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7556
diff changeset
306 return TriState.get((getFlags(data, position) & BIT_DATA_NULL_SEEN_FLAG) != 0);
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
307 }
13164
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
308
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
309 @Override
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
310 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
311 return sb.append(format("exception_seen(%s)", getExceptionSeen(data, pos)));
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
312 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
313 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
314
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
315 static final int COUNTER_DATA_SIZE = cellIndexToOffset(1);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
316 static final int COUNTER_DATA_COUNT_OFFSET = cellIndexToOffset(config.methodDataCountOffset);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
317
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
318 static class CounterData extends BitData {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
319
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
320 CounterData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
321 super(config, tag, COUNTER_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
322 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
323
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
324 protected CounterData(HotSpotVMConfig config, int tag, int staticSize) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
325 super(config, tag, staticSize);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
326 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
327
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
328 @Override
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
329 public int getExecutionCount(HotSpotMethodData data, int position) {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
330 return getCounterValue(data, position);
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
331 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
332
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
333 protected int getCounterValue(HotSpotMethodData data, int position) {
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
334 return data.readUnsignedIntAsSignedInt(position, COUNTER_DATA_COUNT_OFFSET);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
335 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
336
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
337 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
338 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
13312
323d99404728 added missing exception_seen and null_seen info info when formatting some profile data as strings
Doug Simon <doug.simon@oracle.com>
parents: 13259
diff changeset
339 return sb.append(format("count(%d) null_seen(%s) exception_seen(%s)", getCounterValue(data, pos), getNullSeen(data, pos), getExceptionSeen(data, pos)));
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
340 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
341 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
342
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
343 static final int JUMP_DATA_SIZE = cellIndexToOffset(2);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
344 static final int TAKEN_COUNT_OFFSET = cellIndexToOffset(config.jumpDataTakenOffset);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
345 static final int TAKEN_DISPLACEMENT_OFFSET = cellIndexToOffset(config.jumpDataDisplacementOffset);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
346
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
347 static class JumpData extends HotSpotMethodDataAccessor {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
348
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
349 JumpData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
350 super(config, tag, JUMP_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
351 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
352
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
353 protected JumpData(HotSpotVMConfig config, int tag, int staticSize) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
354 super(config, tag, staticSize);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
355 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
356
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
357 @Override
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
358 public double getBranchTakenProbability(HotSpotMethodData data, int position) {
5039
f3d2447db2d9 added detection for endless recompilation
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4564
diff changeset
359 return getExecutionCount(data, position) != 0 ? 1 : 0;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
360 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
361
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
362 @Override
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
363 public int getExecutionCount(HotSpotMethodData data, int position) {
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
364 return data.readUnsignedIntAsSignedInt(position, TAKEN_COUNT_OFFSET);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
365 }
4452
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
366
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
367 public int getTakenDisplacement(HotSpotMethodData data, int position) {
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
368 return data.readInt(position, TAKEN_DISPLACEMENT_OFFSET);
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
369 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
370
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
371 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
372 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
13164
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
373 return sb.append(format("taken(%d) displacement(%d)", getExecutionCount(data, pos), getTakenDisplacement(data, pos)));
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
374 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
375 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
376
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
377 static class RawItemProfile<T> {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
378 final int entries;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
379 final T[] items;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
380 final long[] counts;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
381 final long totalCount;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
382
23297
4b58c92e939b remove redundant modifiers
Manuel Rigger <rigger.manuel@gmail.com>
parents: 22672
diff changeset
383 RawItemProfile(int entries, T[] items, long[] counts, long totalCount) {
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
384 this.entries = entries;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
385 this.items = items;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
386 this.counts = counts;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
387 this.totalCount = totalCount;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
388 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
389 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
390
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
391 static final int TYPE_DATA_ROW_SIZE = cellsToBytes(config.receiverTypeDataReceiverTypeRowCellCount);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
392
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
393 static final int NONPROFILED_COUNT_OFFSET = cellIndexToOffset(config.receiverTypeDataNonprofiledCountOffset);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
394 static final int TYPE_DATA_FIRST_TYPE_OFFSET = cellIndexToOffset(config.receiverTypeDataReceiver0Offset);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
395 static final int TYPE_DATA_FIRST_TYPE_COUNT_OFFSET = cellIndexToOffset(config.receiverTypeDataCount0Offset);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
396
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
397 abstract static class AbstractTypeData extends CounterData {
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
398
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
399 protected AbstractTypeData(HotSpotVMConfig config, int tag, int staticSize) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
400 super(config, tag, staticSize);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
401 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
402
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
403 @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: 5534
diff changeset
404 public JavaTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
405 return createTypeProfile(getNullSeen(data, position), getRawTypeProfile(data, position));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
406 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
407
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
408 private RawItemProfile<ResolvedJavaType> getRawTypeProfile(HotSpotMethodData data, int position) {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
409 int typeProfileWidth = config.typeProfileWidth;
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
410
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: 5534
diff changeset
411 ResolvedJavaType[] types = new ResolvedJavaType[typeProfileWidth];
5335
439ca5ecc7dc types profiles are now sorted in descending order of each profiled type's probability
Doug Simon <doug.simon@oracle.com>
parents: 5321
diff changeset
412 long[] counts = new long[typeProfileWidth];
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
413 long totalCount = 0;
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
414 int entries = 0;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
415
16616
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
416 outer: for (int i = 0; i < typeProfileWidth; i++) {
22454
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
417 HotSpotResolvedObjectTypeImpl receiverKlass = data.readKlass(position, getTypeOffset(i));
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
418 if (receiverKlass != null) {
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
419 HotSpotResolvedObjectTypeImpl klass = receiverKlass;
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
420 long count = data.readUnsignedInt(position, getTypeCountOffset(i));
16616
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
421 /*
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
422 * Because of races in the profile collection machinery it's possible for a
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
423 * class to appear multiple times so merge them to make the profile look
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
424 * rational.
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
425 */
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
426 for (int j = 0; j < entries; j++) {
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
427 if (types[j].equals(klass)) {
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
428 totalCount += count;
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
429 counts[j] += count;
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
430 continue outer;
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
431 }
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
432 }
29404eec7ced eliminate duplicate entries from profile data
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16480
diff changeset
433 types[entries] = klass;
4447
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
434 totalCount += count;
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
435 counts[entries] = count;
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
436 entries++;
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
437 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
438 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
439
4456
f4c82dd4619e inlining bugfixes and cleanup
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4455
diff changeset
440 totalCount += getTypesNotRecordedExecutionCount(data, position);
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
441 return new RawItemProfile<>(entries, types, counts, totalCount);
4447
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
442 }
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
443
7154
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
444 protected abstract long getTypesNotRecordedExecutionCount(HotSpotMethodData data, int position);
4456
f4c82dd4619e inlining bugfixes and cleanup
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4455
diff changeset
445
23757
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
446 public int getNonprofiledCount(HotSpotMethodData data, int position) {
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
447 return data.readUnsignedIntAsSignedInt(position, NONPROFILED_COUNT_OFFSET);
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
448 }
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
449
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
450 private JavaTypeProfile createTypeProfile(TriState nullSeen, RawItemProfile<ResolvedJavaType> profile) {
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
451 if (profile.entries <= 0 || profile.totalCount <= 0) {
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
452 return null;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
453 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
454
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
455 ProfiledType[] ptypes = new ProfiledType[profile.entries];
4456
f4c82dd4619e inlining bugfixes and cleanup
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4455
diff changeset
456 double totalProbability = 0.0;
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
457 for (int i = 0; i < profile.entries; i++) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
458 double p = profile.counts[i];
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
459 p = p / profile.totalCount;
4456
f4c82dd4619e inlining bugfixes and cleanup
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4455
diff changeset
460 totalProbability += p;
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
461 ptypes[i] = new ProfiledType(profile.items[i], p);
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
462 }
4456
f4c82dd4619e inlining bugfixes and cleanup
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4455
diff changeset
463
5335
439ca5ecc7dc types profiles are now sorted in descending order of each profiled type's probability
Doug Simon <doug.simon@oracle.com>
parents: 5321
diff changeset
464 Arrays.sort(ptypes);
439ca5ecc7dc types profiles are now sorted in descending order of each profiled type's probability
Doug Simon <doug.simon@oracle.com>
parents: 5321
diff changeset
465
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
466 double notRecordedTypeProbability = profile.entries < config.typeProfileWidth ? 0.0 : Math.min(1.0, Math.max(0.0, 1.0 - totalProbability));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
467 assert notRecordedTypeProbability == 0 || profile.entries == config.typeProfileWidth;
8659
bc7bb895e359 incorporated null-seen information into JavaTypeProfile
Doug Simon <doug.simon@oracle.com>
parents: 8616
diff changeset
468 return new JavaTypeProfile(nullSeen, notRecordedTypeProbability, ptypes);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
469 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
470
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
471 private static int getTypeOffset(int row) {
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
472 return TYPE_DATA_FIRST_TYPE_OFFSET + row * TYPE_DATA_ROW_SIZE;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
473 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
474
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
475 protected static int getTypeCountOffset(int row) {
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
476 return TYPE_DATA_FIRST_TYPE_COUNT_OFFSET + row * TYPE_DATA_ROW_SIZE;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
477 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
478
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
479 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
480 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
481 RawItemProfile<ResolvedJavaType> profile = getRawTypeProfile(data, pos);
13164
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
482 TriState nullSeen = getNullSeen(data, pos);
13312
323d99404728 added missing exception_seen and null_seen info info when formatting some profile data as strings
Doug Simon <doug.simon@oracle.com>
parents: 13259
diff changeset
483 TriState exceptionSeen = getExceptionSeen(data, pos);
323d99404728 added missing exception_seen and null_seen info info when formatting some profile data as strings
Doug Simon <doug.simon@oracle.com>
parents: 13259
diff changeset
484 sb.append(format("count(%d) null_seen(%s) exception_seen(%s) nonprofiled_count(%d) entries(%d)", getCounterValue(data, pos), nullSeen, exceptionSeen,
23757
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
485 getNonprofiledCount(data, pos), profile.entries));
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
486 for (int i = 0; i < profile.entries; i++) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
487 long count = profile.counts[i];
16479
558cf39c646b moved toJavaName(JavaType type) from MetaUtil to be a default method in JavaType
Doug Simon <doug.simon@oracle.com>
parents: 15291
diff changeset
488 sb.append(format("%n %s (%d, %4.2f)", profile.items[i].toJavaName(), count, (double) count / profile.totalCount));
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
489 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
490 return sb;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
491 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
492 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
493
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
494 static final int TYPE_CHECK_DATA_SIZE = cellIndexToOffset(2) + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
495
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
496 static class ReceiverTypeData extends AbstractTypeData {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
497
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
498 ReceiverTypeData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
499 super(config, tag, TYPE_CHECK_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
500 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
501
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
502 protected ReceiverTypeData(HotSpotVMConfig config, int tag, int staticSize) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
503 super(config, tag, staticSize);
22572
c3b49e9d0f48 HotSpotMethodData shouldn't hardcode constants
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
504 }
c3b49e9d0f48 HotSpotMethodData shouldn't hardcode constants
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
505
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
506 @Override
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
507 public int getExecutionCount(HotSpotMethodData data, int position) {
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
508 return -1;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
509 }
7154
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
510
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
511 @Override
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
512 protected long getTypesNotRecordedExecutionCount(HotSpotMethodData data, int position) {
23757
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
513 return getNonprofiledCount(data, position);
7154
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
514 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
515 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
516
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
517 static final int VIRTUAL_CALL_DATA_SIZE = cellIndexToOffset(2) + TYPE_DATA_ROW_SIZE * (config.typeProfileWidth + config.methodProfileWidth);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
518 static final int VIRTUAL_CALL_DATA_FIRST_METHOD_OFFSET = TYPE_DATA_FIRST_TYPE_OFFSET + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
519 static final int VIRTUAL_CALL_DATA_FIRST_METHOD_COUNT_OFFSET = TYPE_DATA_FIRST_TYPE_COUNT_OFFSET + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
520
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
521 static class VirtualCallData extends ReceiverTypeData {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
522
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
523 VirtualCallData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
524 super(config, tag, VIRTUAL_CALL_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
525 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
526
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
527 protected VirtualCallData(HotSpotVMConfig config, int tag, int staticSize) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
528 super(config, tag, staticSize);
22573
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
529 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
530
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
531 @Override
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
532 public int getExecutionCount(HotSpotMethodData data, int position) {
14706
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 14543
diff changeset
533 final int typeProfileWidth = config.typeProfileWidth;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
534
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
535 long total = 0;
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
536 for (int i = 0; i < typeProfileWidth; i++) {
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
537 total += data.readUnsignedInt(position, getTypeCountOffset(i));
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
538 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
539
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
540 total += getCounterValue(data, position);
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
541 return truncateLongToInt(total);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
542 }
7154
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
543
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
544 @Override
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
545 protected long getTypesNotRecordedExecutionCount(HotSpotMethodData data, int position) {
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
546 return getCounterValue(data, position);
5d0bb7d52783 changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
547 }
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
548
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
549 private static long getMethodsNotRecordedExecutionCount(HotSpotMethodData data, int position) {
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
550 return data.readUnsignedIntAsSignedInt(position, NONPROFILED_COUNT_OFFSET);
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
551 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
552
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
553 @Override
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
554 public JavaMethodProfile getMethodProfile(HotSpotMethodData data, int position) {
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
555 return createMethodProfile(getRawMethodProfile(data, position));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
556 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
557
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
558 private RawItemProfile<ResolvedJavaMethod> getRawMethodProfile(HotSpotMethodData data, int position) {
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
559 int profileWidth = config.methodProfileWidth;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
560
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
561 ResolvedJavaMethod[] methods = new ResolvedJavaMethod[profileWidth];
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
562 long[] counts = new long[profileWidth];
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
563 long totalCount = 0;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
564 int entries = 0;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
565
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
566 for (int i = 0; i < profileWidth; i++) {
22454
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
567 HotSpotResolvedJavaMethod method = data.readMethod(position, getMethodOffset(i));
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
568 if (method != null) {
76af33d4d504 Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22054
diff changeset
569 methods[entries] = method;
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
570 long count = data.readUnsignedInt(position, getMethodCountOffset(i));
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
571 totalCount += count;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
572 counts[entries] = count;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
573
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
574 entries++;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
575 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
576 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
577
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
578 totalCount += getMethodsNotRecordedExecutionCount(data, position);
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
579 return new RawItemProfile<>(entries, methods, counts, totalCount);
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
580 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
581
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
582 private JavaMethodProfile createMethodProfile(RawItemProfile<ResolvedJavaMethod> profile) {
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
583 if (profile.entries <= 0 || profile.totalCount <= 0) {
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
584 return null;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
585 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
586
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
587 ProfiledMethod[] pmethods = new ProfiledMethod[profile.entries];
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
588 double totalProbability = 0.0;
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
589 for (int i = 0; i < profile.entries; i++) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
590 double p = profile.counts[i];
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
591 p = p / profile.totalCount;
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
592 totalProbability += p;
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
593 pmethods[i] = new ProfiledMethod(profile.items[i], p);
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
594 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
595
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
596 Arrays.sort(pmethods);
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
597
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
598 double notRecordedMethodProbability = profile.entries < config.methodProfileWidth ? 0.0 : Math.min(1.0, Math.max(0.0, 1.0 - totalProbability));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
599 assert notRecordedMethodProbability == 0 || profile.entries == config.methodProfileWidth;
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
600 return new JavaMethodProfile(notRecordedMethodProbability, pmethods);
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
601 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
602
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
603 private static int getMethodOffset(int row) {
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
604 return VIRTUAL_CALL_DATA_FIRST_METHOD_OFFSET + row * TYPE_DATA_ROW_SIZE;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
605 }
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
606
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
607 private static int getMethodCountOffset(int row) {
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
608 return VIRTUAL_CALL_DATA_FIRST_METHOD_COUNT_OFFSET + row * TYPE_DATA_ROW_SIZE;
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9289
diff changeset
609 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
610
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
611 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
612 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
613 RawItemProfile<ResolvedJavaMethod> profile = getRawMethodProfile(data, pos);
13164
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
614 super.appendTo(sb.append(format("exception_seen(%s) ", getExceptionSeen(data, pos))), data, pos).append(format("%nmethod_entries(%d)", profile.entries));
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
615 for (int i = 0; i < profile.entries; i++) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
616 long count = profile.counts[i];
16480
10c12d09a8d2 moved format(String format, JavaMethod method) from MetaUtil to be a default method in JavaMethod
Doug Simon <doug.simon@oracle.com>
parents: 16479
diff changeset
617 sb.append(format("%n %s (%d, %4.2f)", profile.items[i].format("%H.%n(%p)"), count, (double) count / profile.totalCount));
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
618 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
619 return sb;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
620 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
621 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
622
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
623 static class VirtualCallTypeData extends VirtualCallData {
22573
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
624
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
625 VirtualCallTypeData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
626 super(config, tag, 0);
22573
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
627 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
628
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
629 @Override
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
630 protected int getDynamicSize(HotSpotMethodData data, int position) {
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
631 assert staticSize == 0;
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
632 return HotSpotJVMCIRuntime.runtime().compilerToVm.methodDataProfileDataSize(data.metaspaceMethodData, position);
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
633 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
634 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
635
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
636 static final int RET_DATA_ROW_SIZE = cellsToBytes(3);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
637 static final int RET_DATA_SIZE = cellIndexToOffset(1) + RET_DATA_ROW_SIZE * config.bciProfileWidth;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
638
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
639 static class RetData extends CounterData {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
640
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
641 RetData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
642 super(config, tag, RET_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
643 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
644 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
645
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
646 static final int BRANCH_DATA_SIZE = cellIndexToOffset(3);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
647 static final int NOT_TAKEN_COUNT_OFFSET = cellIndexToOffset(config.branchDataNotTakenOffset);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
648
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
649 static class BranchData extends JumpData {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
650
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
651 BranchData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
652 super(config, tag, BRANCH_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
653 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
654
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
655 @Override
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
656 public double getBranchTakenProbability(HotSpotMethodData data, int position) {
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
657 long takenCount = data.readUnsignedInt(position, TAKEN_COUNT_OFFSET);
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
658 long notTakenCount = data.readUnsignedInt(position, NOT_TAKEN_COUNT_OFFSET);
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
659 long total = takenCount + notTakenCount;
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
660
9928
a9311ec68721 Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9864
diff changeset
661 return total <= 0 ? -1 : takenCount / (double) total;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
662 }
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
663
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
664 @Override
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
665 public int getExecutionCount(HotSpotMethodData data, int position) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
666 long count = data.readUnsignedInt(position, TAKEN_COUNT_OFFSET) + data.readUnsignedInt(position, NOT_TAKEN_COUNT_OFFSET);
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
667 return truncateLongToInt(count);
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
668 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
669
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
670 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
671 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
672 long taken = data.readUnsignedInt(pos, TAKEN_COUNT_OFFSET);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
673 long notTaken = data.readUnsignedInt(pos, NOT_TAKEN_COUNT_OFFSET);
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
674 double takenProbability = getBranchTakenProbability(data, pos);
13164
70e6bb85d802 cleaned up HotSpotMethodData tracing a little and enabled it when -Dgraal.traceMethodDataFilter=true
Doug Simon <doug.simon@oracle.com>
parents: 13139
diff changeset
675 return sb.append(format("taken(%d, %4.2f) not_taken(%d, %4.2f) displacement(%d)", taken, takenProbability, notTaken, 1.0D - takenProbability, getTakenDisplacement(data, pos)));
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
676 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
677 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
678
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
679 static final int ARRAY_DATA_LENGTH_OFFSET = cellIndexToOffset(config.arrayDataArrayLenOffset);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
680 static final int ARRAY_DATA_START_OFFSET = cellIndexToOffset(config.arrayDataArrayStartOffset);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
681
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
682 static class ArrayData extends HotSpotMethodDataAccessor {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
683
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
684 ArrayData(HotSpotVMConfig config, int tag, int staticSize) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
685 super(config, tag, staticSize);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
686 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
687
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
688 @Override
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
689 protected int getDynamicSize(HotSpotMethodData data, int position) {
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
690 return cellsToBytes(getLength(data, position));
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
691 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
692
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
693 protected static int getLength(HotSpotMethodData data, int position) {
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
694 return data.readInt(position, ARRAY_DATA_LENGTH_OFFSET);
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
695 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
696
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
697 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
698 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
699 return sb.append(format("length(%d)", getLength(data, pos)));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
700 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
701 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
702
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
703 static final int MULTI_BRANCH_DATA_SIZE = cellIndexToOffset(1);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
704 static final int MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS = config.multiBranchDataPerCaseCellCount;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
705 static final int MULTI_BRANCH_DATA_ROW_SIZE = cellsToBytes(MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
706 static final int MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(0);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
707 static final int MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(1);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
708
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
709 static class MultiBranchData extends ArrayData {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
710
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
711 MultiBranchData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
712 super(config, tag, MULTI_BRANCH_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
713 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
714
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
715 @Override
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
716 public double[] getSwitchProbabilities(HotSpotMethodData data, int position) {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
717 int arrayLength = getLength(data, position);
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
718 assert arrayLength > 0 : "switch must have at least the default case";
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
719 assert arrayLength % MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS == 0 : "array must have full rows";
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
720
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
721 int length = arrayLength / MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS;
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
722 long totalCount = 0;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
723 double[] result = new double[length];
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
724
4447
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
725 // default case is first in HotSpot but last for the compiler
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
726 long count = readCount(data, position, 0);
4446
48756b901156 bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4444
diff changeset
727 totalCount += count;
48756b901156 bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4444
diff changeset
728 result[length - 1] = count;
48756b901156 bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4444
diff changeset
729
48756b901156 bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4444
diff changeset
730 for (int i = 1; i < length; i++) {
4447
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
731 count = readCount(data, position, i);
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
732 totalCount += count;
4446
48756b901156 bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4444
diff changeset
733 result[i - 1] = count;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
734 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
735
9928
a9311ec68721 Avoid graph caching if immature or no profiling information was used for graph building.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9864
diff changeset
736 if (totalCount <= 0) {
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
737 return null;
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
738 } else {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
739 for (int i = 0; i < length; i++) {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
740 result[i] = result[i] / totalCount;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
741 }
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
742 return result;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
743 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
744 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
745
4447
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
746 private static long readCount(HotSpotMethodData data, int position, int i) {
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
747 int offset;
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
748 long count;
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
749 offset = getCountOffset(i);
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
750 count = data.readUnsignedInt(position, offset);
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
751 return count;
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
752 }
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
753
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
754 @Override
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
755 public int getExecutionCount(HotSpotMethodData data, int position) {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
756 int arrayLength = getLength(data, position);
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
757 assert arrayLength > 0 : "switch must have at least the default case";
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
758 assert arrayLength % MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS == 0 : "array must have full rows";
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
759
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
760 int length = arrayLength / MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS;
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
761 long totalCount = 0;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
762 for (int i = 0; i < length; i++) {
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
763 int offset = getCountOffset(i);
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
764 totalCount += data.readUnsignedInt(position, offset);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
765 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
766
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
767 return truncateLongToInt(totalCount);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
768 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
769
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
770 private static int getCountOffset(int index) {
4444
7d9469b37f1f bugfixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
771 return MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET + index * MULTI_BRANCH_DATA_ROW_SIZE;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
772 }
4452
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
773
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
774 private static int getDisplacementOffset(int index) {
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
775 return MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET + index * MULTI_BRANCH_DATA_ROW_SIZE;
b225da954a32 inlining of multiple trival methods at one call site works
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4448
diff changeset
776 }
13139
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
777
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
778 @Override
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
779 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
780 int entries = getLength(data, pos) / MULTI_BRANCH_DATA_ROW_SIZE_IN_CELLS;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
781 sb.append(format("entries(%d)", entries));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
782 for (int i = 0; i < entries; i++) {
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
783 sb.append(format("%n %d: count(%d) displacement(%d)", i, data.readUnsignedInt(pos, getCountOffset(i)), data.readUnsignedInt(pos, getDisplacementOffset(i))));
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
784 }
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
785 return sb;
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
786 }
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
787 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
788
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
789 static final int ARG_INFO_DATA_SIZE = cellIndexToOffset(1);
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
790
23700
9e1235406b59 [Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23297
diff changeset
791 static class ArgInfoData extends ArrayData {
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
792
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
793 ArgInfoData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
794 super(config, tag, ARG_INFO_DATA_SIZE);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
795 }
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
796 }
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
797
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
798 static class UnknownProfileData extends HotSpotMethodDataAccessor {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
799 UnknownProfileData(HotSpotVMConfig config, int tag) {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
800 super(config, tag, 0);
22573
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
801 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
802
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
803 @Override
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
804 protected int getDynamicSize(HotSpotMethodData data, int position) {
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
805 assert staticSize == 0;
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
806 return HotSpotJVMCIRuntime.runtime().compilerToVm.methodDataProfileDataSize(data.metaspaceMethodData, position);
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
807 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
808
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
809 @Override
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
810 public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
23757
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
811 sb.append("unknown profile data with tag: " + tag);
aaed278a9cf1 Fix logic for printing HotSpotMethodData
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 23719
diff changeset
812 return sb;
22573
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
813 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
814 }
be44a5efeaff HotSpotMethodData must handle profile data when TypeProfileLevel is non-zero
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22572
diff changeset
815
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
816 public void setCompiledIRSize(int size) {
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
817 UNSAFE.putInt(metaspaceMethodData + config.methodDataIRSizeOffset, size);
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
818 }
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
819
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
820 public int getCompiledIRSize() {
22542
15579668ec3a renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents: 22541
diff changeset
821 return UNSAFE.getInt(metaspaceMethodData + config.methodDataIRSizeOffset);
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
822 }
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
823
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
824 // sorted by tag
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
825 // @formatter:off
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
826 static final HotSpotMethodDataAccessor[] PROFILE_DATA_ACCESSORS = {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
827 null,
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
828 new BitData(config, config.dataLayoutBitDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
829 new CounterData(config, config.dataLayoutCounterDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
830 new JumpData(config, config.dataLayoutJumpDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
831 new ReceiverTypeData(config, config.dataLayoutReceiverTypeDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
832 new VirtualCallData(config, config.dataLayoutVirtualCallDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
833 new RetData(config, config.dataLayoutRetDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
834 new BranchData(config, config.dataLayoutBranchDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
835 new MultiBranchData(config, config.dataLayoutMultiBranchDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
836 new ArgInfoData(config, config.dataLayoutArgInfoDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
837 new UnknownProfileData(config, config.dataLayoutCallTypeDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
838 new VirtualCallTypeData(config, config.dataLayoutVirtualCallTypeDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
839 new UnknownProfileData(config, config.dataLayoutParametersTypeDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
840 new UnknownProfileData(config, config.dataLayoutSpeculativeTrapDataTag),
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
841 };
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
842
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
843 private static boolean checkAccessorTags() {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
844 int expectedTag = 0;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
845 for (HotSpotMethodDataAccessor accessor : PROFILE_DATA_ACCESSORS) {
23719
a52d7039723b fixed checkstyle issues
Doug Simon <doug.simon@oracle.com>
parents: 23717
diff changeset
846 if (expectedTag == 0) {
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
847 assert accessor == null;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
848 } else {
23719
a52d7039723b fixed checkstyle issues
Doug Simon <doug.simon@oracle.com>
parents: 23717
diff changeset
849 assert accessor.tag == expectedTag : expectedTag + " != " + accessor.tag + " " + accessor;
23717
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
850 }
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
851 expectedTag++;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
852 }
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
853 return true;
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
854 }
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
855
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
856 static {
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
857 assert checkAccessorTags();
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
858 }
41fa89f93355 removed jdk.vm.ci.hotspot.HotSpotMethodDataAccessor.Tag (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents: 23700
diff changeset
859 // @formatter:on
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
860 }