annotate graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java @ 7530:5e3d1a68664e

applied mx eclipseformat to all Java files
author Doug Simon <doug.simon@oracle.com>
date Wed, 23 Jan 2013 16:34:57 +0100
parents 2463eb24b644
children 5407d1dd6450
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 /*
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
2 * Copyright (c) 2012, 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 */
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5506
diff changeset
23 package com.oracle.graal.api.meta;
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
24
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
25 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
26 * Provides access to the profiling information of one specific method. Every accessor method
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
27 * returns the information that is available at the time of invocation. If a method is invoked
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
28 * multiple times, it may return significantly different results for every invocation as the
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
29 * profiling information may be changed by other Java threads at any time.
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
30 */
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
31 public interface ProfilingInfo {
5346
4c3d953f8131 added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents: 5114
diff changeset
32
4c3d953f8131 added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents: 5114
diff changeset
33 /**
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
34 * Represents the three possibilities that an exception was seen at a specific BCI.
5346
4c3d953f8131 added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents: 5114
diff changeset
35 */
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
36 public enum ExceptionSeen {
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
37 TRUE, FALSE, NOT_SUPPORTED;
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
38
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
39 public static ExceptionSeen get(boolean value) {
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
40 return value ? TRUE : FALSE;
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
41 }
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
42 }
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
43
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
44 /**
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
45 * Returns the length of the bytecodes associated with this profile.
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
46 */
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
47 int getCodeSize();
5346
4c3d953f8131 added mechanism (enabled by -G:PICache and -G:PiFilter) for saving/loading method profiling info to/from disk
Doug Simon <doug.simon@oracle.com>
parents: 5114
diff changeset
48
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
49 /**
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
50 * Returns an estimate of how often the branch at the given byte code was taken.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
51 *
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
52 * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or -1 if
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
53 * this information is not available.
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
54 */
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
55 double getBranchTakenProbability(int bci);
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
56
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
57 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
58 * Returns an estimate of how often the switch cases are taken at the given BCI. The default
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
59 * case is stored as the last entry.
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
60 *
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
61 * @return A double value that contains the estimated probabilities, with 0.0 meaning never and
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
62 * 1.0 meaning always, or -1 if this information is not available.
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
63 */
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
64 double[] getSwitchProbabilities(int bci);
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
65
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
66 /**
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4440
diff changeset
67 * Returns the TypeProfile for the given BCI.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
68 *
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
69 * @return Returns an JavaTypeProfile object, or null if not available.
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
70 */
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
71 JavaTypeProfile getTypeProfile(int bci);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
72
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
73 /**
4527
a0cca63cd366 fixed exceptionSeen profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4457
diff changeset
74 * Returns information if the given BCI did ever throw an exception.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
75 *
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
76 * @return {@link ExceptionSeen#TRUE} if the instruction has thrown an exception at least once,
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
77 * {@link ExceptionSeen#FALSE} if it never threw an exception, and
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
78 * {@link ExceptionSeen#NOT_SUPPORTED} if this information was not recorded.
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
79 */
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
80 ExceptionSeen getExceptionSeen(int bci);
4439
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 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
83 * Returns an estimate how often the current BCI was executed. Avoid comparing execution counts
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
84 * to each other, as the returned value highly depends on the time of invocation.
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
85 *
4440
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
86 * @return the estimated execution count or -1 if not available.
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
87 */
271220b49abc profiling info fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
88 int getExecutionCount(int bci);
5114
dad1ac9dba7d finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4551
diff changeset
89
dad1ac9dba7d finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4551
diff changeset
90 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
91 * Returns how frequently a method was deoptimized for the given deoptimization reason. This
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
92 * only indicates how often the method did fall back to the interpreter for the execution and
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
93 * does not indicate how often it was recompiled.
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
94 *
5114
dad1ac9dba7d finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4551
diff changeset
95 * @param reason the reason for which the number of deoptimizations should be queried
dad1ac9dba7d finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4551
diff changeset
96 * @return the number of times the compiled method deoptimized for the given reason.
dad1ac9dba7d finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4551
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: 5507
diff changeset
98 int getDeoptimizationCount(DeoptimizationReason reason);
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5541
diff changeset
99
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents:
diff changeset
100 }