annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodDataAccessor.java @ 14906:f3a5036cc13c

javadoc fixes javadoc has become stricter in jdk8
author Bernhard Urban <bernhard.urban@jku.at>
date Mon, 31 Mar 2014 20:51:09 +0200
parents 579a2a124c95
children 4ca6dc0799b6
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 /*
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 */
5548
8872bc0eebdf Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5541
diff changeset
23 package com.oracle.graal.hotspot.meta;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
24
14706
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
25 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*;
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
26
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5061
diff changeset
27 import com.oracle.graal.api.meta.*;
8610
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7530
diff changeset
28 import com.oracle.graal.api.meta.ProfilingInfo.TriState;
14706
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
29 import com.oracle.graal.graph.*;
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
30 import com.oracle.graal.hotspot.*;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
31
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
32 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
33 * 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
34 * 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
35 * , 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
36 */
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
37 public interface HotSpotMethodDataAccessor {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
38
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
39 /**
14706
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
40 * {@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
41 */
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
42 enum Tag {
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
43 No(config().dataLayoutNoTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
44 BitData(config().dataLayoutBitDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
45 CounterData(config().dataLayoutCounterDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
46 JumpData(config().dataLayoutJumpDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
47 ReceiverTypeData(config().dataLayoutReceiverTypeDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
48 VirtualCallData(config().dataLayoutVirtualCallDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
49 RetData(config().dataLayoutRetDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
50 BranchData(config().dataLayoutBranchDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
51 MultiBranchData(config().dataLayoutMultiBranchDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
52 ArgInfoData(config().dataLayoutArgInfoDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
53 CallTypeData(config().dataLayoutCallTypeDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
54 VirtualCallTypeData(config().dataLayoutVirtualCallTypeDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
55 ParametersTypeData(config().dataLayoutParametersTypeDataTag),
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
56 SpeculativeTrapData(config().dataLayoutSpeculativeTrapDataTag);
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
57
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
58 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
59
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
60 private Tag(int value) {
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
61 this.value = value;
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
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
64 public int getValue() {
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
65 return value;
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
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
68 private static HotSpotVMConfig config() {
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
69 return runtime().getConfig();
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
70 }
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 public static Tag getEnum(int value) {
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
73 for (Tag e : values()) {
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
74 if (e.value == value) {
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
75 return e;
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
76 }
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
77 }
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
78 throw GraalInternalError.shouldNotReachHere("unknown enum value " + value);
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
79 }
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
80 }
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
81
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
82 /**
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
83 * Returns the {@link Tag} stored in the LayoutData header.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
84 *
14706
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
85 * @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
86 */
14706
579a2a124c95 add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
twisti
parents: 13139
diff changeset
87 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
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 /**
9e8e92c3ff17 first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
90 * Returns the BCI stored in the LayoutData header.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
91 *
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 14706
diff changeset
92 * @return An integer &ge; 0 and &le; 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
93 */
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
94 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
95
9e8e92c3ff17 first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
96 /**
9e8e92c3ff17 first parts for inlining multiple methods, added Simplifiable to switch nodes, some documentation
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4441
diff changeset
97 * Computes the size for the specific data at the given position.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
98 *
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 14706
diff changeset
99 * @return An integer &gt; 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
100 */
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
101 int getSize(HotSpotMethodData data, int position);
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
102
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
103 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
104
9760
c76b43ed5089 Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8610
diff changeset
105 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
106
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
107 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
108
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
109 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
110
8610
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7530
diff changeset
111 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
112
5407d1dd6450 API to access nullness profiling information for instanceof, checkcast, and aastore
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7530
diff changeset
113 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
114
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
115 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
116
f9d908fb3492 added toString() to HotSpotMethodData to assist with debugging low-level profile data reading
Doug Simon <doug.simon@oracle.com>
parents: 9760
diff changeset
117 StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
118 }