annotate graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/BytecodeFrame.java @ 21706:4c00096fc415

moved CodeCacheProvider.disassemble(...) from API to CFGPrinterObserver
author Doug Simon <doug.simon@oracle.com>
date Wed, 03 Jun 2015 16:52:41 +0200
parents f5b549811bac
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
18189
e75eb4720d4e Introduce new JavaValue interface for use in debug info.
Roland Schatz <roland.schatz@oracle.com>
parents: 16888
diff changeset
2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
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: 21411
diff changeset
23 package com.oracle.jvmci.code;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
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: 21411
diff changeset
25 import com.oracle.jvmci.meta.Kind;
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: 21411
diff changeset
26 import com.oracle.jvmci.meta.ResolvedJavaMethod;
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: 21411
diff changeset
27 import com.oracle.jvmci.meta.Value;
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
28 import java.util.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
31 * Represents the Java bytecode frame state(s) at a given position including {@link Value locations}
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
32 * where to find the local variables, operand stack values and locked objects of the bytecode
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
33 * frame(s).
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 */
21411
082417ac43e4 removed com.oracle.graal.hotspot.server and uses of Serializable it depended upon (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21063
diff changeset
35 public class BytecodeFrame extends BytecodePosition {
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
36
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
37 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
38 * An array of values representing how to reconstruct the state of the Java frame. This is array
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
39 * is partitioned as follows:
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 * <p>
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 13970
diff changeset
41 * <table summary="" border="1" cellpadding="5" frame="void" rules="all">
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
42 * <tr>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
43 * <th>Start index (inclusive)</th>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
44 * <th>End index (exclusive)</th>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
45 * <th>Description</th>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
46 * </tr>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
47 * <tr>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
48 * <td>0</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
49 * <td>numLocals</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
50 * <td>Local variables</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
51 * </tr>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
52 * <tr>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
53 * <td>numLocals</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
54 * <td>numLocals + numStack</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
55 * <td>Operand stack</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
56 * </tr>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
57 * <tr>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
58 * <td>numLocals + numStack</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
59 * <td>values.length</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
60 * <td>Locked objects</td>
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
61 * </tr>
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 * </table>
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 * <p>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
64 * Note that the number of locals and the number of stack slots may be smaller than the maximum
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
65 * number of locals and stack slots as specified in the compiled method.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 */
19662
f595e97626fd Use Value instead of JavaValue in BytecodeFrame and VirtualObject
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19608
diff changeset
67 public final Value[] values;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 * The number of locals in the values array.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72 public final int numLocals;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
73
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
74 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
75 * The number of stack slots in the values array.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
76 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77 public final int numStack;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80 * The number of locks in the values array.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 public final int numLocks;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83
9900
f6a792c8e3ec added documentation for BytecodeFrame.rethrowException
Doug Simon <doug.simon@oracle.com>
parents: 7660
diff changeset
84 /**
f6a792c8e3ec added documentation for BytecodeFrame.rethrowException
Doug Simon <doug.simon@oracle.com>
parents: 7660
diff changeset
85 * True if this is a position inside an exception handler before the exception object has been
19779
143d65ef196f minor javadoc fix
Doug Simon <doug.simon@oracle.com>
parents: 18913
diff changeset
86 * consumed. In this case, {@link #numStack} {@code == 1} and {@link #getStackValue(int)
9900
f6a792c8e3ec added documentation for BytecodeFrame.rethrowException
Doug Simon <doug.simon@oracle.com>
parents: 7660
diff changeset
87 * getStackValue(0)} is the location of the exception object. If deoptimization happens at this
f6a792c8e3ec added documentation for BytecodeFrame.rethrowException
Doug Simon <doug.simon@oracle.com>
parents: 7660
diff changeset
88 * position, the interpreter will rethrow the exception instead of executing the bytecode
f6a792c8e3ec added documentation for BytecodeFrame.rethrowException
Doug Simon <doug.simon@oracle.com>
parents: 7660
diff changeset
89 * instruction at this position.
f6a792c8e3ec added documentation for BytecodeFrame.rethrowException
Doug Simon <doug.simon@oracle.com>
parents: 7660
diff changeset
90 */
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 public final boolean rethrowException;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92
4678
a03f3fd16b22 Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4199
diff changeset
93 public final boolean duringCall;
a03f3fd16b22 Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4199
diff changeset
94
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95 /**
15263
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
96 * This BCI should be used for frame states that are built for code with no meaningful BCI.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
97 */
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
98 public static final int UNKNOWN_BCI = -5;
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
99
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
100 /**
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
101 * The BCI for exception unwind. This is synthetic code and has no representation in bytecode.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
102 * In contrast with {@link #AFTER_EXCEPTION_BCI}, at this point, if the method is synchronized,
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
103 * the monitor is still held.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
104 */
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
105 public static final int UNWIND_BCI = -1;
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
106
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
107 /**
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
108 * The BCI for the state before starting to execute a method. Note that if the method is
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
109 * synchronized, the monitor is not yet held.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
110 */
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
111 public static final int BEFORE_BCI = -2;
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
112
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
113 /**
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
114 * The BCI for the state after finishing the execution of a method and returning normally. Note
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
115 * that if the method was synchronized the monitor is already released.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
116 */
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
117 public static final int AFTER_BCI = -3;
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
118
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
119 /**
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
120 * The BCI for exception unwind. This is synthetic code and has no representation in bytecode.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
121 * In contrast with {@link #UNWIND_BCI}, at this point, if the method is synchronized, the
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
122 * monitor is already released.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
123 */
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
124 public static final int AFTER_EXCEPTION_BCI = -4;
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
125
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
126 /**
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
127 * This BCI should be used for states that cannot be the target of a deoptimization, like
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
128 * snippet frame states.
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
129 */
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
130 public static final int INVALID_FRAMESTATE_BCI = -6;
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
131
0b25b81414c9 Move various bci constants from FrameState (gral.nodes) to BytecodeFrame (graal.api.code)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14906
diff changeset
132 /**
21063
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
133 * Determines if a given BCI matches one of the placeholder BCI constants defined in this class.
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
134 */
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
135 public static boolean isPlaceholderBci(int bci) {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
136 return bci < 0;
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
137 }
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
138
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
139 /**
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
140 * Gets the name of a given placeholder BCI.
21046
d35d2ac04970 weakened check used by an assertion in the FrameStateAssignmentPhase
Doug Simon <doug.simon@oracle.com>
parents: 19783
diff changeset
141 */
21063
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
142 public static String getPlaceholderBciName(int bci) {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
143 assert isPlaceholderBci(bci);
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
144 if (bci == BytecodeFrame.AFTER_BCI) {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
145 return "AFTER_BCI";
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
146 } else if (bci == BytecodeFrame.AFTER_EXCEPTION_BCI) {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
147 return "AFTER_EXCEPTION_BCI";
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
148 } else if (bci == BytecodeFrame.INVALID_FRAMESTATE_BCI) {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
149 return "INVALID_FRAMESTATE_BCI";
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
150 } else if (bci == BytecodeFrame.BEFORE_BCI) {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
151 return "BEFORE_BCI";
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
152 } else if (bci == BytecodeFrame.UNKNOWN_BCI) {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
153 return "UNKNOWN_BCI";
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
154 } else {
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
155 assert bci == BytecodeFrame.UNWIND_BCI;
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
156 return "UNWIND_BCI";
ae5710f20011 renamed BytecodeFrame.isSyntheticBci to isPlaceholderBci and added getPlaceholderBciName
Doug Simon <doug.simon@oracle.com>
parents: 21046
diff changeset
157 }
21046
d35d2ac04970 weakened check used by an assertion in the FrameStateAssignmentPhase
Doug Simon <doug.simon@oracle.com>
parents: 19783
diff changeset
158 }
d35d2ac04970 weakened check used by an assertion in the FrameStateAssignmentPhase
Doug Simon <doug.simon@oracle.com>
parents: 19783
diff changeset
159
d35d2ac04970 weakened check used by an assertion in the FrameStateAssignmentPhase
Doug Simon <doug.simon@oracle.com>
parents: 19783
diff changeset
160 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
161 * Creates a new frame object.
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 13970
diff changeset
162 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163 * @param caller the caller frame (which may be {@code null})
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
164 * @param method the method
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
165 * @param bci a BCI within the method
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
166 * @param rethrowException specifies if the VM should re-throw the pending exception when
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5552
diff changeset
167 * deopt'ing using this frame
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
168 * @param values the frame state {@link #values}
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169 * @param numLocals the number of local variables
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
170 * @param numStack the depth of the stack
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
171 * @param numLocks the number of locked objects
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
172 */
19662
f595e97626fd Use Value instead of JavaValue in BytecodeFrame and VirtualObject
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19608
diff changeset
173 public BytecodeFrame(BytecodeFrame caller, ResolvedJavaMethod method, int bci, boolean rethrowException, boolean duringCall, Value[] values, int numLocals, int numStack, int numLocks) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
174 super(caller, method, bci);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
175 assert values != null;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
176 this.rethrowException = rethrowException;
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 4678
diff changeset
177 this.duringCall = duringCall;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
178 this.values = values;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
179 this.numLocals = numLocals;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
180 this.numStack = numStack;
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 4678
diff changeset
181 this.numLocks = numLocks;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
182 assert !rethrowException || numStack == 1 : "must have exception on top of the stack";
13929
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
183 }
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
184
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
185 /**
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
186 * Ensure that the frame state is formatted as expected by the JVM, with null or Illegal in the
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
187 * slot following a double word item. This should really be checked in FrameState itself but
13970
bbf84e85b775 Move BytecodeFrame validation into the HotSpot backend
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13929
diff changeset
188 * because of Word type rewriting and alternative backends that can't be done.
13929
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
189 */
19732
6a3832494e24 Check for derived pointers before passing BytecodeFrame into HotSpot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19662
diff changeset
190 public boolean validateFormat(boolean derivedOk) {
16888
8f4150982bc3 validateFormat should validate caller too
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15263
diff changeset
191 if (caller() != null) {
19732
6a3832494e24 Check for derived pointers before passing BytecodeFrame into HotSpot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19662
diff changeset
192 caller().validateFormat(derivedOk);
16888
8f4150982bc3 validateFormat should validate caller too
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15263
diff changeset
193 }
13929
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
194 for (int i = 0; i < numLocals + numStack; i++) {
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
195 if (values[i] != null) {
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
196 Kind kind = values[i].getKind();
18913
51680f58e681 Clean up in Kind class. Introduce Kind#getSlotCount and Kind#needsTwoSlots methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18342
diff changeset
197 if (kind.needsTwoSlots()) {
13929
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
198 assert values.length > i + 1 : String.format("missing second word %s", this);
19608
3349fe56e6e9 Small change to BytecodeFrame validation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18913
diff changeset
199 assert values[i + 1] == null || values[i + 1].getKind() == Kind.Illegal : this;
13929
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
200 }
19732
6a3832494e24 Check for derived pointers before passing BytecodeFrame into HotSpot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19662
diff changeset
201 assert derivedOk || ValueUtil.isIllegal(values[i]) || !values[i].getLIRKind().isDerivedReference() : "Unexpected derived value: " + values[i];
13929
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
202 }
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
203 }
f191cac04605 add assert to check format of debug info
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 9900
diff changeset
204 return true;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
207 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
208 * Gets the value representing the specified local variable.
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 13970
diff changeset
209 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
210 * @param i the local variable index
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 * @return the value that can be used to reconstruct the local's current value
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
212 */
19662
f595e97626fd Use Value instead of JavaValue in BytecodeFrame and VirtualObject
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19608
diff changeset
213 public Value getLocalValue(int i) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
214 return values[i];
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
215 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
216
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
217 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
218 * Gets the value representing the specified stack slot.
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 13970
diff changeset
219 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
220 * @param i the stack index
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
221 * @return the value that can be used to reconstruct the stack slot's current value
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
222 */
19662
f595e97626fd Use Value instead of JavaValue in BytecodeFrame and VirtualObject
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19608
diff changeset
223 public Value getStackValue(int i) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
224 return values[i + numLocals];
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
225 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
226
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
227 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
228 * Gets the value representing the specified lock.
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 13970
diff changeset
229 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
230 * @param i the lock index
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
231 * @return the value that can be used to reconstruct the lock's current value
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
232 */
19662
f595e97626fd Use Value instead of JavaValue in BytecodeFrame and VirtualObject
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19608
diff changeset
233 public Value getLockValue(int i) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
234 return values[i + numLocals + numStack];
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
235 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
236
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
237 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
238 * Gets the caller of this frame.
14906
f3a5036cc13c javadoc fixes
Bernhard Urban <bernhard.urban@jku.at>
parents: 13970
diff changeset
239 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
240 * @return {@code null} if this frame has no caller
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
241 */
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5541
diff changeset
242 public BytecodeFrame caller() {
5552
69a8969dbf40 Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5547
diff changeset
243 return (BytecodeFrame) getCaller();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
244 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
245
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
246 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
247 public boolean equals(Object obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
248 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
249 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
250 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
251 if (obj instanceof BytecodeFrame && super.equals(obj)) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
252 BytecodeFrame that = (BytecodeFrame) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
253 // @formatter:off
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
254 if (this.duringCall == that.duringCall &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
255 this.rethrowException == that.rethrowException &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
256 this.numLocals == that.numLocals &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
257 this.numLocks == that.numLocks &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
258 this.numStack == that.numStack &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
259 Arrays.equals(this.values, that.values)) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
260 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
261 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
262 // @formatter:off
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
263 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
264 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
265 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
266 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
267
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18189
diff changeset
268 @Override
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
269 public String toString() {
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5541
diff changeset
270 return CodeUtil.append(new StringBuilder(100), this).toString();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
271 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
272 }