Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java @ 23297:4b58c92e939b
remove redundant modifiers
author | Manuel Rigger <rigger.manuel@gmail.com> |
---|---|
date | Tue, 02 Feb 2016 16:19:37 +0100 |
parents | 1bbd4a7c274b |
children | 41fa89f93355 |
rev | line source |
---|---|
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
1 /* |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
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:
22581
diff
changeset
|
23 package jdk.vm.ci.hotspot; |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
24 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22581
diff
changeset
|
25 import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22581
diff
changeset
|
26 import jdk.vm.ci.meta.JavaMethodProfile; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22581
diff
changeset
|
27 import jdk.vm.ci.meta.JavaTypeProfile; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22581
diff
changeset
|
28 import jdk.vm.ci.meta.ProfilingInfo; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22581
diff
changeset
|
29 import jdk.vm.ci.meta.TriState; |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21552
diff
changeset
|
30 |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
31 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
32 * Interface for accessor objects that encapsulate the logic for accessing the different kinds of |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
33 * data in a HotSpot methodDataOop. This interface is similar to the interface {@link ProfilingInfo} |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
34 * , but most methods require a MethodDataObject and the exact position within the methodData. |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
35 */ |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
36 public interface HotSpotMethodDataAccessor { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
37 |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
38 /** |
14706
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
39 * {@code DataLayout} tag values. |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
40 */ |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
41 enum Tag { |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
42 No(config().dataLayoutNoTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
43 BitData(config().dataLayoutBitDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
44 CounterData(config().dataLayoutCounterDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
45 JumpData(config().dataLayoutJumpDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
46 ReceiverTypeData(config().dataLayoutReceiverTypeDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
47 VirtualCallData(config().dataLayoutVirtualCallDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
48 RetData(config().dataLayoutRetDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
49 BranchData(config().dataLayoutBranchDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
50 MultiBranchData(config().dataLayoutMultiBranchDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
51 ArgInfoData(config().dataLayoutArgInfoDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
52 CallTypeData(config().dataLayoutCallTypeDataTag), |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
53 VirtualCallTypeData(config().dataLayoutVirtualCallTypeDataTag), |
18041
52b4284cb496
Merge with jdk8u20-b26
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15193
diff
changeset
|
54 ParametersTypeData(config().dataLayoutParametersTypeDataTag), |
52b4284cb496
Merge with jdk8u20-b26
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15193
diff
changeset
|
55 SpeculativeTrapData(config().dataLayoutSpeculativeTrapDataTag); |
14706
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
56 |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
57 private final int value; |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
58 |
23297
4b58c92e939b
remove redundant modifiers
Manuel Rigger <rigger.manuel@gmail.com>
parents:
22672
diff
changeset
|
59 Tag(int value) { |
14706
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
60 this.value = value; |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
61 } |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
62 |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
63 public int getValue() { |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
64 return value; |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
65 } |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
66 |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
67 public static Tag getEnum(int value) { |
19402
a306749d3e86
Lookup Tag based on index in enum value array.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18041
diff
changeset
|
68 Tag result = values()[value]; |
a306749d3e86
Lookup Tag based on index in enum value array.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18041
diff
changeset
|
69 assert value == result.value; |
a306749d3e86
Lookup Tag based on index in enum value array.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18041
diff
changeset
|
70 return result; |
14706
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
71 } |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
72 } |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
73 |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
74 /** |
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
75 * Returns the {@link Tag} stored in the LayoutData header. |
14909 | 76 * |
14706
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
77 * @return tag stored in the LayoutData header |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
78 */ |
14706
579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents:
13139
diff
changeset
|
79 Tag getTag(); |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
80 |
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
81 /** |
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
82 * Returns the BCI stored in the LayoutData header. |
14909 | 83 * |
14906 | 84 * @return An integer ≥ 0 and ≤ Short.MAX_VALUE, or -1 if not supported. |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
85 */ |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
86 int getBCI(HotSpotMethodData data, int position); |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
87 |
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
88 /** |
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
89 * Computes the size for the specific data at the given position. |
14909 | 90 * |
14906 | 91 * @return An integer > 0. |
4448
9e8e92c3ff17
first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4441
diff
changeset
|
92 */ |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
93 int getSize(HotSpotMethodData data, int position); |
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
94 |
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:
5507
diff
changeset
|
95 JavaTypeProfile getTypeProfile(HotSpotMethodData data, int position); |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
96 |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
97 JavaMethodProfile getMethodProfile(HotSpotMethodData data, int position); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8610
diff
changeset
|
98 |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
99 double getBranchTakenProbability(HotSpotMethodData data, int position); |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
100 |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
101 double[] getSwitchProbabilities(HotSpotMethodData data, int position); |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
102 |
8610
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
103 TriState getExceptionSeen(HotSpotMethodData data, int position); |
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
104 |
5407d1dd6450
API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7530
diff
changeset
|
105 TriState getNullSeen(HotSpotMethodData data, int position); |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
106 |
4440
271220b49abc
profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
107 int getExecutionCount(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:
9760
diff
changeset
|
108 |
f9d908fb3492
added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents:
9760
diff
changeset
|
109 StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos); |
4439
f7251c729b31
profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff
changeset
|
110 } |