annotate agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java @ 196:d1605aabd0a1 jdk7-b30

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents ba764ed4b6f2
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
196
d1605aabd0a1 6719955: Update copyright year
xdono
parents: 113
diff changeset
2 * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.runtime;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import java.io.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 import java.util.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
29 import sun.jvm.hotspot.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
30 import sun.jvm.hotspot.code.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
31 import sun.jvm.hotspot.compiler.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 import sun.jvm.hotspot.c1.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 import sun.jvm.hotspot.debugger.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 import sun.jvm.hotspot.interpreter.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 import sun.jvm.hotspot.oops.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 import sun.jvm.hotspot.types.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 import sun.jvm.hotspot.utilities.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 /** <P> A frame represents a physical stack frame (an activation).
a61af66fc99e Initial load
duke
parents:
diff changeset
40 Frames can be C or Java frames, and the Java frames can be
a61af66fc99e Initial load
duke
parents:
diff changeset
41 interpreted or compiled. In contrast, vframes represent
a61af66fc99e Initial load
duke
parents:
diff changeset
42 source-level activations, so that one physical frame can
a61af66fc99e Initial load
duke
parents:
diff changeset
43 correspond to multiple source level frames because of inlining.
a61af66fc99e Initial load
duke
parents:
diff changeset
44 </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 <P> NOTE that this is not a VMObject and does not wrap an Address
a61af66fc99e Initial load
duke
parents:
diff changeset
47 -- this is an actual port of the VM's Frame code to Java. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 <P> NOTE also that this is incomplete -- just trying to get
a61af66fc99e Initial load
duke
parents:
diff changeset
50 reading of interpreted frames working for now, so all non-core and
a61af66fc99e Initial load
duke
parents:
diff changeset
51 setter methods are removed for now. (FIXME) </P> */
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 public abstract class Frame implements Cloneable {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 /** A raw stack pointer. The accessor getSP() will return a real (usable)
a61af66fc99e Initial load
duke
parents:
diff changeset
55 stack pointer (e.g. from Thread::last_Java_sp) */
a61af66fc99e Initial load
duke
parents:
diff changeset
56 protected Address raw_sp;
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 /** Program counter (the next instruction after the call) */
a61af66fc99e Initial load
duke
parents:
diff changeset
59 protected Address pc;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 protected boolean deoptimized;
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public Frame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 deoptimized = false;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 }
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 static {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 VM.registerVMInitializedObserver(new Observer() {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 public void update(Observable o, Object data) {
a61af66fc99e Initial load
duke
parents:
diff changeset
69 initialize(VM.getVM().getTypeDataBase());
a61af66fc99e Initial load
duke
parents:
diff changeset
70 }
a61af66fc99e Initial load
duke
parents:
diff changeset
71 });
a61af66fc99e Initial load
duke
parents:
diff changeset
72 }
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 /** Size of constMethodOopDesc for computing BCI from BCP (FIXME: hack) */
a61af66fc99e Initial load
duke
parents:
diff changeset
75 private static long constMethodOopDescSize;
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 private static synchronized void initialize(TypeDataBase db) {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 Type constMethodOopType = db.lookupType("constMethodOopDesc");
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // FIXME: not sure whether alignment here is correct or how to
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // force it (round up to address size?)
a61af66fc99e Initial load
duke
parents:
diff changeset
81 constMethodOopDescSize = constMethodOopType.getSize();
a61af66fc99e Initial load
duke
parents:
diff changeset
82 }
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 protected int bcpToBci(Address bcp, ConstMethod cm) {
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // bcp will be null for interpreter native methods
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // in addition depending on where we catch the system the value can
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // be a bcp or a bci.
a61af66fc99e Initial load
duke
parents:
diff changeset
88 if (bcp == null) return 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 long bci = bcp.minus(null);
a61af66fc99e Initial load
duke
parents:
diff changeset
90 if (bci >= 0 && bci < cm.getCodeSize()) return (int) bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 return (int) (bcp.minus(cm.getHandle()) - constMethodOopDescSize);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 }
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 protected int bcpToBci(Address bcp, Method m) {
a61af66fc99e Initial load
duke
parents:
diff changeset
95 return bcpToBci(bcp, m.getConstMethod());
a61af66fc99e Initial load
duke
parents:
diff changeset
96 }
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 public abstract Object clone();
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // Accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 /** pc: Returns the pc at which this frame will continue normally.
a61af66fc99e Initial load
duke
parents:
diff changeset
103 It must point at the beginning of the next instruction to
a61af66fc99e Initial load
duke
parents:
diff changeset
104 execute. */
a61af66fc99e Initial load
duke
parents:
diff changeset
105 public Address getPC() { return pc; }
a61af66fc99e Initial load
duke
parents:
diff changeset
106 public void setPC(Address newpc) { pc = newpc; }
a61af66fc99e Initial load
duke
parents:
diff changeset
107 public boolean isDeoptimized() { return deoptimized; }
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 public abstract Address getSP();
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public abstract Address getID();
a61af66fc99e Initial load
duke
parents:
diff changeset
111 public abstract Address getFP();
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 /** testers -- platform dependent */
a61af66fc99e Initial load
duke
parents:
diff changeset
114 public abstract boolean equals(Object arg);
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 /** type testers */
a61af66fc99e Initial load
duke
parents:
diff changeset
117 public boolean isInterpretedFrame() { return VM.getVM().getInterpreter().contains(getPC()); }
a61af66fc99e Initial load
duke
parents:
diff changeset
118 public boolean isJavaFrame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 if (isInterpretedFrame()) return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 if (!VM.getVM().isCore()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 if (isCompiledFrame()) return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 }
a61af66fc99e Initial load
duke
parents:
diff changeset
123 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 }
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 /** Java frame called from C? */
a61af66fc99e Initial load
duke
parents:
diff changeset
127 public boolean isEntryFrame() { return VM.getVM().getStubRoutines().returnsToCallStub(getPC()); }
a61af66fc99e Initial load
duke
parents:
diff changeset
128 public boolean isNativeFrame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 if (!VM.getVM().isCore()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
130 CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
a61af66fc99e Initial load
duke
parents:
diff changeset
131 return (cb != null && cb.isNativeMethod());
a61af66fc99e Initial load
duke
parents:
diff changeset
132 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }
a61af66fc99e Initial load
duke
parents:
diff changeset
135 }
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 public boolean isCompiledFrame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
139 Assert.that(!VM.getVM().isCore(), "noncore builds only");
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141 CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
a61af66fc99e Initial load
duke
parents:
diff changeset
142 return (cb != null && cb.isJavaMethod());
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 public boolean isGlueFrame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 Assert.that(!VM.getVM().isCore(), "noncore builds only");
a61af66fc99e Initial load
duke
parents:
diff changeset
148 }
a61af66fc99e Initial load
duke
parents:
diff changeset
149 CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
a61af66fc99e Initial load
duke
parents:
diff changeset
150 if (cb == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
151 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
152 }
a61af66fc99e Initial load
duke
parents:
diff changeset
153 if (cb.isRuntimeStub()) return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
154 else return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
155 }
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 /** oldest frame? (has no sender) FIXME: this is modified from the
a61af66fc99e Initial load
duke
parents:
diff changeset
158 C++ code to handle the debugging situation where we try to
a61af66fc99e Initial load
duke
parents:
diff changeset
159 traverse the stack for, for example, the signal thread, and
a61af66fc99e Initial load
duke
parents:
diff changeset
160 don't find any valid Java frames. Would really like to put the
a61af66fc99e Initial load
duke
parents:
diff changeset
161 second half of the conditional in some sort of debugging-only if
a61af66fc99e Initial load
duke
parents:
diff changeset
162 statement. */
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // *** FIXME: THE CALL TO isJavaFrame() IS WAY TOO EXPENSIVE!!!!! ***
a61af66fc99e Initial load
duke
parents:
diff changeset
164 public boolean isFirstFrame() { return ((isEntryFrame() && entryFrameIsFirst()) ||
a61af66fc99e Initial load
duke
parents:
diff changeset
165 (!isJavaFrame() && !hasSenderPD())); }
a61af66fc99e Initial load
duke
parents:
diff changeset
166 /** same for Java frame */
a61af66fc99e Initial load
duke
parents:
diff changeset
167 public boolean isFirstJavaFrame() { throw new RuntimeException("not yet implemented"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 /** This is an addition for debugging purposes on platforms which
a61af66fc99e Initial load
duke
parents:
diff changeset
170 have the notion of signals. */
a61af66fc99e Initial load
duke
parents:
diff changeset
171 public abstract boolean isSignalHandlerFrameDbg();
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 /** If this is a signal handler frame (again, on a platform with a
a61af66fc99e Initial load
duke
parents:
diff changeset
174 notion of signals), get the signal number. */
a61af66fc99e Initial load
duke
parents:
diff changeset
175 public abstract int getSignalNumberDbg();
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 /** If this is a signal handler frame (again, on a platform with a
a61af66fc99e Initial load
duke
parents:
diff changeset
178 notion of signals), get the name of the signal. */
a61af66fc99e Initial load
duke
parents:
diff changeset
179 public abstract String getSignalNameDbg();
a61af66fc99e Initial load
duke
parents:
diff changeset
180
a61af66fc99e Initial load
duke
parents:
diff changeset
181 /** performs sanity checks on interpreted frames. */
a61af66fc99e Initial load
duke
parents:
diff changeset
182 public abstract boolean isInterpretedFrameValid();
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 /** tells whether this frame is marked for deoptimization */
a61af66fc99e Initial load
duke
parents:
diff changeset
185 public boolean shouldBeDeoptimized() { throw new RuntimeException("not yet implemented"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 /** tells whether this frame can be deoptimized */
a61af66fc99e Initial load
duke
parents:
diff changeset
188 public boolean canBeDeoptimized() { throw new RuntimeException("not yet implemented"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 /** returns the sending frame */
a61af66fc99e Initial load
duke
parents:
diff changeset
191 public abstract Frame sender(RegisterMap map, CodeBlob nm);
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 /** equivalent to sender(map, null) */
a61af66fc99e Initial load
duke
parents:
diff changeset
194 public Frame sender(RegisterMap map) { return sender(map, null); }
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 /** returns the sender, but skips conversion frames */
a61af66fc99e Initial load
duke
parents:
diff changeset
197 public Frame realSender(RegisterMap map) {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 if (!VM.getVM().isCore()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
199 Frame result = sender(map);
a61af66fc99e Initial load
duke
parents:
diff changeset
200 while (result.isGlueFrame()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
201 result = result.sender(map);
a61af66fc99e Initial load
duke
parents:
diff changeset
202 }
a61af66fc99e Initial load
duke
parents:
diff changeset
203 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
204 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
205 return sender(map);
a61af66fc99e Initial load
duke
parents:
diff changeset
206 }
a61af66fc99e Initial load
duke
parents:
diff changeset
207 }
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 /** Platform-dependent query indicating whether this frame has a
a61af66fc99e Initial load
duke
parents:
diff changeset
210 sender. Should return true if it is possible to call sender() at
a61af66fc99e Initial load
duke
parents:
diff changeset
211 all on this frame. (This is currently only needed for the
a61af66fc99e Initial load
duke
parents:
diff changeset
212 debugging system, if a stack trace is attempted for a Java
a61af66fc99e Initial load
duke
parents:
diff changeset
213 thread which has no Java frames, i.e., the signal thread; we
a61af66fc99e Initial load
duke
parents:
diff changeset
214 have to know to stop traversal at the bottom frame.) */
a61af66fc99e Initial load
duke
parents:
diff changeset
215 protected abstract boolean hasSenderPD();
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
218 // All frames:
a61af66fc99e Initial load
duke
parents:
diff changeset
219 // A low-level interface for vframes:
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 /** Returns the address of the requested "slot" on the stack. Slots
a61af66fc99e Initial load
duke
parents:
diff changeset
222 are as wide as addresses, so are 32 bits wide on a 32-bit
a61af66fc99e Initial load
duke
parents:
diff changeset
223 machine and 64 bits wide on a 64-bit machine. */
a61af66fc99e Initial load
duke
parents:
diff changeset
224 public Address addressOfStackSlot(int slot) { return getFP().addOffsetTo(slot * VM.getVM().getAddressSize()); }
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 /** Fetches the OopHandle at the requested slot */
a61af66fc99e Initial load
duke
parents:
diff changeset
227 public OopHandle getOopHandleAt(int slot) { return addressOfStackSlot(slot).getOopHandleAt(0); }
a61af66fc99e Initial load
duke
parents:
diff changeset
228 /** Fetches the OopHandle at the slot, adjusted for compiler frames */
a61af66fc99e Initial load
duke
parents:
diff changeset
229 // FIXME: looks like this is only used for compiled frames
a61af66fc99e Initial load
duke
parents:
diff changeset
230 // public OopHandle getOopHandleAtAdjusted(MethodOop method, int slot) { return addressOfStackSlot(slot).getOopHandleAt(0); }
a61af66fc99e Initial load
duke
parents:
diff changeset
231 // FIXME: Not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
232 // public void setOopHandleAt(int slot, OopHandle value) { addressOfStackSlot(slot).setOopHandleAt(0, value); }
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234 /** Fetches the (Java) int at the requested slot */
a61af66fc99e Initial load
duke
parents:
diff changeset
235 public int getIntAt(int slot) { return addressOfStackSlot(slot).getJIntAt(0); }
a61af66fc99e Initial load
duke
parents:
diff changeset
236 // FIXME: Not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
237 // public void setIntAt(int slot, int value) { addressOfStackSlot(slot).setJIntAt(0, value); }
a61af66fc99e Initial load
duke
parents:
diff changeset
238
a61af66fc99e Initial load
duke
parents:
diff changeset
239 /** returns the frame size in stack slots */
a61af66fc99e Initial load
duke
parents:
diff changeset
240 public abstract long frameSize();
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 /** Link (i.e., the pointer to the previous frame) */
a61af66fc99e Initial load
duke
parents:
diff changeset
243 public abstract Address getLink();
a61af66fc99e Initial load
duke
parents:
diff changeset
244 // public abstract void setLink(Address addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
245
a61af66fc99e Initial load
duke
parents:
diff changeset
246 /** Return address */
a61af66fc99e Initial load
duke
parents:
diff changeset
247 public abstract Address getSenderPC();
a61af66fc99e Initial load
duke
parents:
diff changeset
248 // FIXME: currently unimplementable
a61af66fc99e Initial load
duke
parents:
diff changeset
249 // public abstract void setSenderPC(Address addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
250
a61af66fc99e Initial load
duke
parents:
diff changeset
251 /** The frame's original SP, before any extension by an interpreted
a61af66fc99e Initial load
duke
parents:
diff changeset
252 callee; used for packing debug info into vframeArray objects and
a61af66fc99e Initial load
duke
parents:
diff changeset
253 vframeArray lookup. */
a61af66fc99e Initial load
duke
parents:
diff changeset
254 public abstract Address getUnextendedSP();
a61af66fc99e Initial load
duke
parents:
diff changeset
255
a61af66fc99e Initial load
duke
parents:
diff changeset
256 /** Returns the stack pointer of the calling frame */
a61af66fc99e Initial load
duke
parents:
diff changeset
257 public abstract Address getSenderSP();
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
260 // Interpreter frames:
a61af66fc99e Initial load
duke
parents:
diff changeset
261 //
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 public abstract Address addressOfInterpreterFrameLocals();
a61af66fc99e Initial load
duke
parents:
diff changeset
264
a61af66fc99e Initial load
duke
parents:
diff changeset
265 public Address addressOfInterpreterFrameLocal(int slot) {
a61af66fc99e Initial load
duke
parents:
diff changeset
266 return addressOfInterpreterFrameLocals().getAddressAt(0).addOffsetTo(-slot * VM.getVM().getAddressSize());
a61af66fc99e Initial load
duke
parents:
diff changeset
267 }
a61af66fc99e Initial load
duke
parents:
diff changeset
268
a61af66fc99e Initial load
duke
parents:
diff changeset
269 // FIXME: not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
270 // void interpreter_frame_set_locals(intptr_t* locs);
a61af66fc99e Initial load
duke
parents:
diff changeset
271
a61af66fc99e Initial load
duke
parents:
diff changeset
272 // NOTE that the accessor "addressOfInterpreterFrameBCX" has
a61af66fc99e Initial load
duke
parents:
diff changeset
273 // necessarily been eliminated. The byte code pointer is inherently
a61af66fc99e Initial load
duke
parents:
diff changeset
274 // an interior pointer to a Method (the bytecodes follow the
a61af66fc99e Initial load
duke
parents:
diff changeset
275 // methodOopDesc data structure) and therefore acquisition of it in
a61af66fc99e Initial load
duke
parents:
diff changeset
276 // this system can not be allowed. All accesses to interpreter frame
a61af66fc99e Initial load
duke
parents:
diff changeset
277 // byte codes are via the byte code index (BCI).
a61af66fc99e Initial load
duke
parents:
diff changeset
278
a61af66fc99e Initial load
duke
parents:
diff changeset
279 /** Byte code index. In the underlying frame, what is actually
a61af66fc99e Initial load
duke
parents:
diff changeset
280 stored is a byte code pointer (BCP), which is converted to a BCI
a61af66fc99e Initial load
duke
parents:
diff changeset
281 and back by the GC when methods are moved. In this system,
a61af66fc99e Initial load
duke
parents:
diff changeset
282 interior pointers are not allowed, so we must make the access to
a61af66fc99e Initial load
duke
parents:
diff changeset
283 the interpreter frame's BCI atomic with respect to GC. This may
a61af66fc99e Initial load
duke
parents:
diff changeset
284 mean implementation with an underlying call through native code
a61af66fc99e Initial load
duke
parents:
diff changeset
285 into the VM or a magic sequence in the compiler. (FIXME) */
a61af66fc99e Initial load
duke
parents:
diff changeset
286 public abstract int getInterpreterFrameBCI();
a61af66fc99e Initial load
duke
parents:
diff changeset
287 // FIXME: not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
288 // public abstract void setInterpreterFrameBCI(int bci);
a61af66fc99e Initial load
duke
parents:
diff changeset
289
a61af66fc99e Initial load
duke
parents:
diff changeset
290 // FIXME: elided for now
a61af66fc99e Initial load
duke
parents:
diff changeset
291 // public abstract Address addressOfInterpreterCalleeReceiver(Symbol signature);
a61af66fc99e Initial load
duke
parents:
diff changeset
292
a61af66fc99e Initial load
duke
parents:
diff changeset
293 /** Find receiver for an invoke when arguments are just pushed on
a61af66fc99e Initial load
duke
parents:
diff changeset
294 stack (i.e., callee stack-frame is not setup) */
a61af66fc99e Initial load
duke
parents:
diff changeset
295 // FIXME: elided for now
a61af66fc99e Initial load
duke
parents:
diff changeset
296 // public OopHandle getInterpreterCalleeReceiver(SymbolOop signature) { return addressOfInterpreterCalleeReceiver(signature).getOopHandleAt(0); }
a61af66fc99e Initial load
duke
parents:
diff changeset
297
a61af66fc99e Initial load
duke
parents:
diff changeset
298 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
299 // Expression stack (may go up or down, direction == 1 or -1)
a61af66fc99e Initial load
duke
parents:
diff changeset
300 //
a61af66fc99e Initial load
duke
parents:
diff changeset
301
a61af66fc99e Initial load
duke
parents:
diff changeset
302 public abstract Address addressOfInterpreterFrameExpressionStack();
a61af66fc99e Initial load
duke
parents:
diff changeset
303 public abstract int getInterpreterFrameExpressionStackDirection();
a61af66fc99e Initial load
duke
parents:
diff changeset
304 public Address addressOfInterpreterFrameExpressionStackSlot(int slot) {
a61af66fc99e Initial load
duke
parents:
diff changeset
305 return addressOfInterpreterFrameExpressionStack().addOffsetTo(-slot * VM.getVM().getAddressSize());
a61af66fc99e Initial load
duke
parents:
diff changeset
306 }
a61af66fc99e Initial load
duke
parents:
diff changeset
307
a61af66fc99e Initial load
duke
parents:
diff changeset
308 /** Top of expression stack */
a61af66fc99e Initial load
duke
parents:
diff changeset
309 public abstract Address addressOfInterpreterFrameTOS();
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 /** Expression stack from top down */
a61af66fc99e Initial load
duke
parents:
diff changeset
312 public abstract Address addressOfInterpreterFrameTOSAt(int slot);
a61af66fc99e Initial load
duke
parents:
diff changeset
313
a61af66fc99e Initial load
duke
parents:
diff changeset
314 /** FIXME: is this portable? */
a61af66fc99e Initial load
duke
parents:
diff changeset
315 public int getInterpreterFrameExpressionStackSize() {
a61af66fc99e Initial load
duke
parents:
diff changeset
316 return (int) (1 + (getInterpreterFrameExpressionStackDirection() *
a61af66fc99e Initial load
duke
parents:
diff changeset
317 (addressOfInterpreterFrameTOS().minus(addressOfInterpreterFrameExpressionStack()))));
a61af66fc99e Initial load
duke
parents:
diff changeset
318 }
a61af66fc99e Initial load
duke
parents:
diff changeset
319
a61af66fc99e Initial load
duke
parents:
diff changeset
320 public abstract Address getInterpreterFrameSenderSP();
a61af66fc99e Initial load
duke
parents:
diff changeset
321 // FIXME: not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
322 // public abstract void setInterpreterFrameSenderSP(Address senderSP);
a61af66fc99e Initial load
duke
parents:
diff changeset
323
a61af66fc99e Initial load
duke
parents:
diff changeset
324 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
325 // BasicObjectLocks:
a61af66fc99e Initial load
duke
parents:
diff changeset
326 //
a61af66fc99e Initial load
duke
parents:
diff changeset
327
a61af66fc99e Initial load
duke
parents:
diff changeset
328 public abstract BasicObjectLock interpreterFrameMonitorBegin();
a61af66fc99e Initial load
duke
parents:
diff changeset
329 public abstract BasicObjectLock interpreterFrameMonitorEnd();
a61af66fc99e Initial load
duke
parents:
diff changeset
330 /** NOTE: this returns a size in BYTES in this system! */
a61af66fc99e Initial load
duke
parents:
diff changeset
331 public abstract int interpreterFrameMonitorSize();
a61af66fc99e Initial load
duke
parents:
diff changeset
332 public BasicObjectLock nextMonitorInInterpreterFrame(BasicObjectLock cur) {
a61af66fc99e Initial load
duke
parents:
diff changeset
333 return new BasicObjectLock(cur.address().addOffsetTo(interpreterFrameMonitorSize()));
a61af66fc99e Initial load
duke
parents:
diff changeset
334 }
a61af66fc99e Initial load
duke
parents:
diff changeset
335 public BasicObjectLock previousMonitorInInterpreterFrame(BasicObjectLock cur) {
a61af66fc99e Initial load
duke
parents:
diff changeset
336 return new BasicObjectLock(cur.address().addOffsetTo(-1 * interpreterFrameMonitorSize()));
a61af66fc99e Initial load
duke
parents:
diff changeset
337 }
a61af66fc99e Initial load
duke
parents:
diff changeset
338
a61af66fc99e Initial load
duke
parents:
diff changeset
339 // interpreter_frame_monitor_begin is higher in memory than interpreter_frame_monitor_end
a61af66fc99e Initial load
duke
parents:
diff changeset
340 // Interpreter_frame_monitor_begin points to one element beyond the oldest one,
a61af66fc99e Initial load
duke
parents:
diff changeset
341 // interpreter_frame_monitor_end points to the youngest one, or if there are none,
a61af66fc99e Initial load
duke
parents:
diff changeset
342 // it points to one beyond where the first element will be.
a61af66fc99e Initial load
duke
parents:
diff changeset
343 // interpreter_frame_monitor_size reports the allocation size of a monitor in the interpreter stack.
a61af66fc99e Initial load
duke
parents:
diff changeset
344 // this value is >= BasicObjectLock::size(), and may be rounded up
a61af66fc99e Initial load
duke
parents:
diff changeset
345
a61af66fc99e Initial load
duke
parents:
diff changeset
346 // FIXME: avoiding implementing this for now if possible
a61af66fc99e Initial load
duke
parents:
diff changeset
347 // public void interpreter_frame_set_monitor_end(BasicObjectLock* value);
a61af66fc99e Initial load
duke
parents:
diff changeset
348 // public void interpreter_frame_verify_monitor(BasicObjectLock* value) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
349 //
a61af66fc99e Initial load
duke
parents:
diff changeset
350 // Tells whether the current interpreter_frame frame pointer
a61af66fc99e Initial load
duke
parents:
diff changeset
351 // corresponds to the old compiled/deoptimized fp
a61af66fc99e Initial load
duke
parents:
diff changeset
352 // The receiver used to be a top level frame
a61af66fc99e Initial load
duke
parents:
diff changeset
353 // public boolean interpreter_frame_equals_unpacked_fp(intptr_t* fp);
a61af66fc99e Initial load
duke
parents:
diff changeset
354
a61af66fc99e Initial load
duke
parents:
diff changeset
355 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
356 // Method and constant pool cache:
a61af66fc99e Initial load
duke
parents:
diff changeset
357 //
a61af66fc99e Initial load
duke
parents:
diff changeset
358
a61af66fc99e Initial load
duke
parents:
diff changeset
359 /** Current method */
a61af66fc99e Initial load
duke
parents:
diff changeset
360 public abstract Address addressOfInterpreterFrameMethod();
a61af66fc99e Initial load
duke
parents:
diff changeset
361
a61af66fc99e Initial load
duke
parents:
diff changeset
362 /** Current method */
a61af66fc99e Initial load
duke
parents:
diff changeset
363 public Method getInterpreterFrameMethod() {
a61af66fc99e Initial load
duke
parents:
diff changeset
364 return (Method) VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameMethod().getOopHandleAt(0));
a61af66fc99e Initial load
duke
parents:
diff changeset
365 }
a61af66fc99e Initial load
duke
parents:
diff changeset
366
a61af66fc99e Initial load
duke
parents:
diff changeset
367 /** Current method */
a61af66fc99e Initial load
duke
parents:
diff changeset
368 // FIXME: not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
369 // public void setInterpreterFrameMethod(Method method);
a61af66fc99e Initial load
duke
parents:
diff changeset
370
a61af66fc99e Initial load
duke
parents:
diff changeset
371 /** Constant pool cache */
a61af66fc99e Initial load
duke
parents:
diff changeset
372 public abstract Address addressOfInterpreterFrameCPCache();
a61af66fc99e Initial load
duke
parents:
diff changeset
373 /** Constant pool cache */
a61af66fc99e Initial load
duke
parents:
diff changeset
374 public ConstantPoolCache getInterpreterFrameCPCache() {
a61af66fc99e Initial load
duke
parents:
diff changeset
375 return (ConstantPoolCache) VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameCPCache().getOopHandleAt(0));
a61af66fc99e Initial load
duke
parents:
diff changeset
376 }
a61af66fc99e Initial load
duke
parents:
diff changeset
377
a61af66fc99e Initial load
duke
parents:
diff changeset
378 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
379 // Entry frames:
a61af66fc99e Initial load
duke
parents:
diff changeset
380 //
a61af66fc99e Initial load
duke
parents:
diff changeset
381
a61af66fc99e Initial load
duke
parents:
diff changeset
382 public abstract JavaCallWrapper getEntryFrameCallWrapper();
a61af66fc99e Initial load
duke
parents:
diff changeset
383
a61af66fc99e Initial load
duke
parents:
diff changeset
384 // FIXME: add
a61af66fc99e Initial load
duke
parents:
diff changeset
385 // inline intptr_t* entry_frame_argument_at(int offset) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
386
a61af66fc99e Initial load
duke
parents:
diff changeset
387
a61af66fc99e Initial load
duke
parents:
diff changeset
388 /** Tells whether there is another chunk of Delta stack above */
a61af66fc99e Initial load
duke
parents:
diff changeset
389 public boolean entryFrameIsFirst() { return (getEntryFrameCallWrapper().getLastJavaSP() == null); }
a61af66fc99e Initial load
duke
parents:
diff changeset
390
a61af66fc99e Initial load
duke
parents:
diff changeset
391 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
392 // Safepoints:
a61af66fc99e Initial load
duke
parents:
diff changeset
393 //
a61af66fc99e Initial load
duke
parents:
diff changeset
394
a61af66fc99e Initial load
duke
parents:
diff changeset
395 protected abstract Address addressOfSavedOopResult();
a61af66fc99e Initial load
duke
parents:
diff changeset
396 protected abstract Address addressOfSavedReceiver();
a61af66fc99e Initial load
duke
parents:
diff changeset
397
a61af66fc99e Initial load
duke
parents:
diff changeset
398 public OopHandle getSavedOopResult() {
a61af66fc99e Initial load
duke
parents:
diff changeset
399 return addressOfSavedOopResult().getOopHandleAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
400 }
a61af66fc99e Initial load
duke
parents:
diff changeset
401
a61af66fc99e Initial load
duke
parents:
diff changeset
402 // FIXME: not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
403 // public void setSavedOopResult(OopHandle obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
404
a61af66fc99e Initial load
duke
parents:
diff changeset
405 public OopHandle getSavedReceiver() {
a61af66fc99e Initial load
duke
parents:
diff changeset
406 return addressOfSavedReceiver().getOopHandleAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
407 }
a61af66fc99e Initial load
duke
parents:
diff changeset
408
a61af66fc99e Initial load
duke
parents:
diff changeset
409 // FIXME: not yet implementable
a61af66fc99e Initial load
duke
parents:
diff changeset
410 // public void setSavedReceiver(OopHandle obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
411
a61af66fc99e Initial load
duke
parents:
diff changeset
412 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
413 // Oop traversals:
a61af66fc99e Initial load
duke
parents:
diff changeset
414 //
a61af66fc99e Initial load
duke
parents:
diff changeset
415
a61af66fc99e Initial load
duke
parents:
diff changeset
416 public void oopsInterpretedArgumentsDo(Symbol signature, boolean isStatic, AddressVisitor f) {
a61af66fc99e Initial load
duke
parents:
diff changeset
417 ArgumentOopFinder finder = new ArgumentOopFinder(signature, isStatic, this, f);
a61af66fc99e Initial load
duke
parents:
diff changeset
418 finder.oopsDo();
a61af66fc99e Initial load
duke
parents:
diff changeset
419 }
a61af66fc99e Initial load
duke
parents:
diff changeset
420
a61af66fc99e Initial load
duke
parents:
diff changeset
421 /** Conversion from an VMReg::Name to physical stack location */
a61af66fc99e Initial load
duke
parents:
diff changeset
422 public Address oopMapRegToLocation(VMReg reg, RegisterMap regMap) {
a61af66fc99e Initial load
duke
parents:
diff changeset
423 VMReg stack0 = VM.getVM().getVMRegImplInfo().getStack0();
a61af66fc99e Initial load
duke
parents:
diff changeset
424 if (reg.lessThan(stack0)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
425 // If it is passed in a register, it got spilled in the stub frame.
a61af66fc99e Initial load
duke
parents:
diff changeset
426 return regMap.getLocation(reg);
a61af66fc99e Initial load
duke
parents:
diff changeset
427 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
428 long spOffset = VM.getVM().getAddressSize() * reg.minus(stack0);
a61af66fc99e Initial load
duke
parents:
diff changeset
429 return getUnextendedSP().addOffsetTo(spOffset);
a61af66fc99e Initial load
duke
parents:
diff changeset
430 }
a61af66fc99e Initial load
duke
parents:
diff changeset
431 }
a61af66fc99e Initial load
duke
parents:
diff changeset
432
a61af66fc99e Initial load
duke
parents:
diff changeset
433 public void oopsDo(AddressVisitor oopVisitor, RegisterMap map) {
a61af66fc99e Initial load
duke
parents:
diff changeset
434 if (isInterpretedFrame()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
435 oopsInterpretedDo(oopVisitor, map);
a61af66fc99e Initial load
duke
parents:
diff changeset
436 } else if (isEntryFrame()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
437 oopsEntryDo(oopVisitor, map);
a61af66fc99e Initial load
duke
parents:
diff changeset
438 } else if (VM.getVM().getCodeCache().contains(getPC())) {
a61af66fc99e Initial load
duke
parents:
diff changeset
439 oopsCodeBlobDo(oopVisitor, map);
a61af66fc99e Initial load
duke
parents:
diff changeset
440 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
441 Assert.that(false, "should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
442 }
a61af66fc99e Initial load
duke
parents:
diff changeset
443 }
a61af66fc99e Initial load
duke
parents:
diff changeset
444
a61af66fc99e Initial load
duke
parents:
diff changeset
445 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
446 // Printing code
a61af66fc99e Initial load
duke
parents:
diff changeset
447 //
a61af66fc99e Initial load
duke
parents:
diff changeset
448
a61af66fc99e Initial load
duke
parents:
diff changeset
449 public void printValue() {
a61af66fc99e Initial load
duke
parents:
diff changeset
450 printValueOn(System.out);
a61af66fc99e Initial load
duke
parents:
diff changeset
451 }
a61af66fc99e Initial load
duke
parents:
diff changeset
452
a61af66fc99e Initial load
duke
parents:
diff changeset
453 public void printValueOn(PrintStream tty) {
a61af66fc99e Initial load
duke
parents:
diff changeset
454 // FIXME;
a61af66fc99e Initial load
duke
parents:
diff changeset
455 }
a61af66fc99e Initial load
duke
parents:
diff changeset
456
a61af66fc99e Initial load
duke
parents:
diff changeset
457 public void print() {
a61af66fc99e Initial load
duke
parents:
diff changeset
458 printOn(System.out);
a61af66fc99e Initial load
duke
parents:
diff changeset
459 }
a61af66fc99e Initial load
duke
parents:
diff changeset
460
a61af66fc99e Initial load
duke
parents:
diff changeset
461 public void printOn(PrintStream tty) {
a61af66fc99e Initial load
duke
parents:
diff changeset
462 // FIXME;
a61af66fc99e Initial load
duke
parents:
diff changeset
463 }
a61af66fc99e Initial load
duke
parents:
diff changeset
464
a61af66fc99e Initial load
duke
parents:
diff changeset
465 public void interpreterFramePrintOn(PrintStream tty) {
a61af66fc99e Initial load
duke
parents:
diff changeset
466 // FIXME;
a61af66fc99e Initial load
duke
parents:
diff changeset
467 }
a61af66fc99e Initial load
duke
parents:
diff changeset
468
a61af66fc99e Initial load
duke
parents:
diff changeset
469 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
470 // Get/set typed locals from a frame.
a61af66fc99e Initial load
duke
parents:
diff changeset
471 // Respects platform dependent word-ordering.
a61af66fc99e Initial load
duke
parents:
diff changeset
472 //
a61af66fc99e Initial load
duke
parents:
diff changeset
473 // FIXME: avoiding implementing this for now if possible
a61af66fc99e Initial load
duke
parents:
diff changeset
474 //
a61af66fc99e Initial load
duke
parents:
diff changeset
475 // Currently these work only for interpreted frames.
a61af66fc99e Initial load
duke
parents:
diff changeset
476 // Todo: make these work for compiled frames.
a61af66fc99e Initial load
duke
parents:
diff changeset
477 //
a61af66fc99e Initial load
duke
parents:
diff changeset
478 // oop get_local_object(jint slot) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
479 // jint get_local_int (jint slot) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
480 // jlong get_local_long (jint slot) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
481 // jfloat get_local_float (jint slot) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
482 // jdouble get_local_double(jint slot) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
483 //
a61af66fc99e Initial load
duke
parents:
diff changeset
484 // void set_local_object(jint slot, oop obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
485 // void set_local_int (jint slot, jint i);
a61af66fc99e Initial load
duke
parents:
diff changeset
486 // void set_local_long (jint slot, jlong l);
a61af66fc99e Initial load
duke
parents:
diff changeset
487 // void set_local_float (jint slot, jfloat f);
a61af66fc99e Initial load
duke
parents:
diff changeset
488 // void set_local_double(jint slot, jdouble d);
a61af66fc99e Initial load
duke
parents:
diff changeset
489
a61af66fc99e Initial load
duke
parents:
diff changeset
490 // FIXME: add safepoint code, oops_do, etc.
a61af66fc99e Initial load
duke
parents:
diff changeset
491 // FIXME: NOT FINISHED
a61af66fc99e Initial load
duke
parents:
diff changeset
492
a61af66fc99e Initial load
duke
parents:
diff changeset
493
a61af66fc99e Initial load
duke
parents:
diff changeset
494
a61af66fc99e Initial load
duke
parents:
diff changeset
495
a61af66fc99e Initial load
duke
parents:
diff changeset
496
a61af66fc99e Initial load
duke
parents:
diff changeset
497 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
498 // Internals only below this point
a61af66fc99e Initial load
duke
parents:
diff changeset
499 //
a61af66fc99e Initial load
duke
parents:
diff changeset
500
a61af66fc99e Initial load
duke
parents:
diff changeset
501 // /** Helper method for better factored code in frame::sender */
a61af66fc99e Initial load
duke
parents:
diff changeset
502 // private frame sender_for_entry_frame(RegisterMap* map) { throw new RuntimeException("not yet implemented"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
503 // private frame sender_for_interpreter_frame(RegisterMap* map) { throw new RuntimeException("not yet implemented"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
504
a61af66fc99e Initial load
duke
parents:
diff changeset
505 //
a61af66fc99e Initial load
duke
parents:
diff changeset
506 // Oop iteration (FIXME: NOT FINISHED)
a61af66fc99e Initial load
duke
parents:
diff changeset
507 //
a61af66fc99e Initial load
duke
parents:
diff changeset
508
a61af66fc99e Initial load
duke
parents:
diff changeset
509
a61af66fc99e Initial load
duke
parents:
diff changeset
510 private static class InterpVisitor implements OopMapVisitor {
a61af66fc99e Initial load
duke
parents:
diff changeset
511 private AddressVisitor addressVisitor;
a61af66fc99e Initial load
duke
parents:
diff changeset
512
a61af66fc99e Initial load
duke
parents:
diff changeset
513 public InterpVisitor(AddressVisitor oopVisitor) {
a61af66fc99e Initial load
duke
parents:
diff changeset
514 setAddressVisitor(oopVisitor);
a61af66fc99e Initial load
duke
parents:
diff changeset
515 }
a61af66fc99e Initial load
duke
parents:
diff changeset
516
a61af66fc99e Initial load
duke
parents:
diff changeset
517 public void setAddressVisitor(AddressVisitor addressVisitor) {
a61af66fc99e Initial load
duke
parents:
diff changeset
518 this.addressVisitor = addressVisitor;
a61af66fc99e Initial load
duke
parents:
diff changeset
519 }
a61af66fc99e Initial load
duke
parents:
diff changeset
520
a61af66fc99e Initial load
duke
parents:
diff changeset
521 public void visitOopLocation(Address oopAddr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
522 addressVisitor.visitAddress(oopAddr);
a61af66fc99e Initial load
duke
parents:
diff changeset
523 }
a61af66fc99e Initial load
duke
parents:
diff changeset
524
a61af66fc99e Initial load
duke
parents:
diff changeset
525 public void visitDerivedOopLocation(Address baseOopAddr, Address derivedOopAddr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
526 if (VM.getVM().isClientCompiler()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
527 Assert.that(false, "should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
528 } else if (VM.getVM().isServerCompiler() &&
a61af66fc99e Initial load
duke
parents:
diff changeset
529 VM.getVM().useDerivedPointerTable()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
530 Assert.that(false, "FIXME: add derived pointer table");
a61af66fc99e Initial load
duke
parents:
diff changeset
531 }
a61af66fc99e Initial load
duke
parents:
diff changeset
532 }
a61af66fc99e Initial load
duke
parents:
diff changeset
533
a61af66fc99e Initial load
duke
parents:
diff changeset
534 public void visitValueLocation(Address valueAddr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
535 }
a61af66fc99e Initial load
duke
parents:
diff changeset
536
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
537 public void visitNarrowOopLocation(Address compOopAddr) {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
538 addressVisitor.visitCompOopAddress(compOopAddr);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
539 }
a61af66fc99e Initial load
duke
parents:
diff changeset
540 }
a61af66fc99e Initial load
duke
parents:
diff changeset
541
a61af66fc99e Initial load
duke
parents:
diff changeset
542 private void oopsInterpretedDo(AddressVisitor oopVisitor, RegisterMap map) {
a61af66fc99e Initial load
duke
parents:
diff changeset
543 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
544 Assert.that(map != null, "map must be set");
a61af66fc99e Initial load
duke
parents:
diff changeset
545 }
a61af66fc99e Initial load
duke
parents:
diff changeset
546 Method m = getInterpreterFrameMethod();
a61af66fc99e Initial load
duke
parents:
diff changeset
547 int bci = getInterpreterFrameBCI();
a61af66fc99e Initial load
duke
parents:
diff changeset
548
a61af66fc99e Initial load
duke
parents:
diff changeset
549 // FIXME: Seeing this sometimes
a61af66fc99e Initial load
duke
parents:
diff changeset
550 if (VM.getVM().isDebugging()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
551 if (bci < 0 || bci >= m.getCodeSize()) return;
a61af66fc99e Initial load
duke
parents:
diff changeset
552 }
a61af66fc99e Initial load
duke
parents:
diff changeset
553
a61af66fc99e Initial load
duke
parents:
diff changeset
554 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
555 // Assert.that(VM.getVM().getUniverse().heap().isIn(m), "method must be valid oop");
a61af66fc99e Initial load
duke
parents:
diff changeset
556 Assert.that((m.isNative() && (bci == 0)) || ((bci >= 0) && (bci < m.getCodeSize())), "invalid bci value");
a61af66fc99e Initial load
duke
parents:
diff changeset
557 }
a61af66fc99e Initial load
duke
parents:
diff changeset
558
a61af66fc99e Initial load
duke
parents:
diff changeset
559 // Handle the monitor elements in the activation
a61af66fc99e Initial load
duke
parents:
diff changeset
560 // FIXME: monitor information not yet exposed
a61af66fc99e Initial load
duke
parents:
diff changeset
561 // for (
a61af66fc99e Initial load
duke
parents:
diff changeset
562 // BasicObjectLock* current = interpreter_frame_monitor_end();
a61af66fc99e Initial load
duke
parents:
diff changeset
563 // current < interpreter_frame_monitor_begin();
a61af66fc99e Initial load
duke
parents:
diff changeset
564 // current = next_monitor_in_interpreter_frame(current)
a61af66fc99e Initial load
duke
parents:
diff changeset
565 // ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
566 //#ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
567 // interpreter_frame_verify_monitor(current);
a61af66fc99e Initial load
duke
parents:
diff changeset
568 //#endif
a61af66fc99e Initial load
duke
parents:
diff changeset
569 // current->oops_do(f);
a61af66fc99e Initial load
duke
parents:
diff changeset
570 // }
a61af66fc99e Initial load
duke
parents:
diff changeset
571
a61af66fc99e Initial load
duke
parents:
diff changeset
572 // process fixed part
a61af66fc99e Initial load
duke
parents:
diff changeset
573 oopVisitor.visitAddress(addressOfInterpreterFrameMethod());
a61af66fc99e Initial load
duke
parents:
diff changeset
574 oopVisitor.visitAddress(addressOfInterpreterFrameCPCache());
a61af66fc99e Initial load
duke
parents:
diff changeset
575
a61af66fc99e Initial load
duke
parents:
diff changeset
576 // FIXME: expose interpreterFrameMirrorOffset
a61af66fc99e Initial load
duke
parents:
diff changeset
577 // if (m.isNative() && m.isStatic()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
578 // oopVisitor.visitAddress(getFP().addOffsetTo(interpreterFrameMirrorOffset));
a61af66fc99e Initial load
duke
parents:
diff changeset
579 // }
a61af66fc99e Initial load
duke
parents:
diff changeset
580
a61af66fc99e Initial load
duke
parents:
diff changeset
581 int maxLocals = (int) (m.isNative() ? m.getSizeOfParameters() : m.getMaxLocals());
a61af66fc99e Initial load
duke
parents:
diff changeset
582 InterpreterFrameClosure blk = new InterpreterFrameClosure(this, maxLocals, (int) m.getMaxStack(), oopVisitor);
a61af66fc99e Initial load
duke
parents:
diff changeset
583
a61af66fc99e Initial load
duke
parents:
diff changeset
584 // process locals & expression stack
a61af66fc99e Initial load
duke
parents:
diff changeset
585 OopMapCacheEntry mask = m.getMaskFor(bci);
a61af66fc99e Initial load
duke
parents:
diff changeset
586 mask.iterateOop(blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
587
a61af66fc99e Initial load
duke
parents:
diff changeset
588 // process a callee's arguments if we are at a call site
a61af66fc99e Initial load
duke
parents:
diff changeset
589 // (i.e., if we are at an invoke bytecode)
a61af66fc99e Initial load
duke
parents:
diff changeset
590 if (map.getIncludeArgumentOops() && !m.isNative()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
591 BytecodeInvoke call = BytecodeInvoke.atCheck(m, bci);
a61af66fc99e Initial load
duke
parents:
diff changeset
592 if (call != null && getInterpreterFrameExpressionStackSize() > 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
593 // we are at a call site & the expression stack is not empty
a61af66fc99e Initial load
duke
parents:
diff changeset
594 // => process callee's arguments
a61af66fc99e Initial load
duke
parents:
diff changeset
595 //
a61af66fc99e Initial load
duke
parents:
diff changeset
596 // Note: The expression stack can be empty if an exception
a61af66fc99e Initial load
duke
parents:
diff changeset
597 // occured during method resolution/execution. In all
a61af66fc99e Initial load
duke
parents:
diff changeset
598 // cases we empty the expression stack completely be-
a61af66fc99e Initial load
duke
parents:
diff changeset
599 // fore handling the exception (the exception handling
a61af66fc99e Initial load
duke
parents:
diff changeset
600 // code in the interpreter calls a blocking runtime
a61af66fc99e Initial load
duke
parents:
diff changeset
601 // routine which can cause this code to be executed).
a61af66fc99e Initial load
duke
parents:
diff changeset
602 // (was bug gri 7/27/98)
a61af66fc99e Initial load
duke
parents:
diff changeset
603 oopsInterpretedArgumentsDo(call.signature(), call.isInvokestatic(), oopVisitor);
a61af66fc99e Initial load
duke
parents:
diff changeset
604 }
a61af66fc99e Initial load
duke
parents:
diff changeset
605 }
a61af66fc99e Initial load
duke
parents:
diff changeset
606 }
a61af66fc99e Initial load
duke
parents:
diff changeset
607
a61af66fc99e Initial load
duke
parents:
diff changeset
608 private void oopsEntryDo (AddressVisitor oopVisitor, RegisterMap regMap) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
609 private void oopsCodeBlobDo (AddressVisitor oopVisitor, RegisterMap regMap) {
a61af66fc99e Initial load
duke
parents:
diff changeset
610 CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
a61af66fc99e Initial load
duke
parents:
diff changeset
611 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
612 Assert.that(cb != null, "sanity check");
a61af66fc99e Initial load
duke
parents:
diff changeset
613 }
a61af66fc99e Initial load
duke
parents:
diff changeset
614 if (cb.getOopMaps() != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
615 OopMapSet.oopsDo(this, cb, regMap, oopVisitor, VM.getVM().isDebugging());
a61af66fc99e Initial load
duke
parents:
diff changeset
616
a61af66fc99e Initial load
duke
parents:
diff changeset
617 // FIXME: add in traversal of argument oops (skipping this for
a61af66fc99e Initial load
duke
parents:
diff changeset
618 // now until we have the other stuff tested)
a61af66fc99e Initial load
duke
parents:
diff changeset
619
a61af66fc99e Initial load
duke
parents:
diff changeset
620 }
a61af66fc99e Initial load
duke
parents:
diff changeset
621
a61af66fc99e Initial load
duke
parents:
diff changeset
622 // FIXME: would add this in in non-debugging system
a61af66fc99e Initial load
duke
parents:
diff changeset
623
a61af66fc99e Initial load
duke
parents:
diff changeset
624 // If we see an activation belonging to a non_entrant nmethod, we mark it.
a61af66fc99e Initial load
duke
parents:
diff changeset
625 // if (cb->is_nmethod() && ((nmethod *)cb)->is_not_entrant()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
626 // ((nmethod*)cb)->mark_as_seen_on_stack();
a61af66fc99e Initial load
duke
parents:
diff changeset
627 // }
a61af66fc99e Initial load
duke
parents:
diff changeset
628 }
a61af66fc99e Initial load
duke
parents:
diff changeset
629
a61af66fc99e Initial load
duke
parents:
diff changeset
630 // FIXME: implement the above routines, plus add
a61af66fc99e Initial load
duke
parents:
diff changeset
631 // oops_interpreted_arguments_do and oops_compiled_arguments_do
a61af66fc99e Initial load
duke
parents:
diff changeset
632 }
a61af66fc99e Initial load
duke
parents:
diff changeset
633
a61af66fc99e Initial load
duke
parents:
diff changeset
634 //
a61af66fc99e Initial load
duke
parents:
diff changeset
635 // Only used internally, to iterate through oop slots in interpreted
a61af66fc99e Initial load
duke
parents:
diff changeset
636 // frames
a61af66fc99e Initial load
duke
parents:
diff changeset
637 //
a61af66fc99e Initial load
duke
parents:
diff changeset
638 class InterpreterFrameClosure implements OffsetClosure {
a61af66fc99e Initial load
duke
parents:
diff changeset
639 // Used for debugging this code
a61af66fc99e Initial load
duke
parents:
diff changeset
640 private static final boolean DEBUG = false;
a61af66fc99e Initial load
duke
parents:
diff changeset
641
a61af66fc99e Initial load
duke
parents:
diff changeset
642 private Frame fr;
a61af66fc99e Initial load
duke
parents:
diff changeset
643 private AddressVisitor f;
a61af66fc99e Initial load
duke
parents:
diff changeset
644 private int maxLocals;
a61af66fc99e Initial load
duke
parents:
diff changeset
645 private int maxStack;
a61af66fc99e Initial load
duke
parents:
diff changeset
646
a61af66fc99e Initial load
duke
parents:
diff changeset
647 InterpreterFrameClosure(Frame fr, int maxLocals, int maxStack, AddressVisitor f) {
a61af66fc99e Initial load
duke
parents:
diff changeset
648 this.fr = fr;
a61af66fc99e Initial load
duke
parents:
diff changeset
649 this.maxLocals = maxLocals;
a61af66fc99e Initial load
duke
parents:
diff changeset
650 this.maxStack = maxStack;
a61af66fc99e Initial load
duke
parents:
diff changeset
651 this.f = f;
a61af66fc99e Initial load
duke
parents:
diff changeset
652 }
a61af66fc99e Initial load
duke
parents:
diff changeset
653
a61af66fc99e Initial load
duke
parents:
diff changeset
654 public void offsetDo(int offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
655 if (DEBUG) {
a61af66fc99e Initial load
duke
parents:
diff changeset
656 System.err.println("Visiting offset " + offset + ", maxLocals = " + maxLocals +
a61af66fc99e Initial load
duke
parents:
diff changeset
657 " for frame " + fr + ", method " +
a61af66fc99e Initial load
duke
parents:
diff changeset
658 fr.getInterpreterFrameMethod().getMethodHolder().getName().asString() +
a61af66fc99e Initial load
duke
parents:
diff changeset
659 fr.getInterpreterFrameMethod().getName().asString());
a61af66fc99e Initial load
duke
parents:
diff changeset
660 }
a61af66fc99e Initial load
duke
parents:
diff changeset
661 Address addr;
a61af66fc99e Initial load
duke
parents:
diff changeset
662 if (offset < maxLocals) {
a61af66fc99e Initial load
duke
parents:
diff changeset
663 addr = fr.addressOfInterpreterFrameLocal(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
664 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
665 Assert.that(AddressOps.gte(addr, fr.getSP()), "must be inside the frame");
a61af66fc99e Initial load
duke
parents:
diff changeset
666 }
a61af66fc99e Initial load
duke
parents:
diff changeset
667 if (DEBUG) {
a61af66fc99e Initial load
duke
parents:
diff changeset
668 System.err.println(" Visiting local at addr " + addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
669 }
a61af66fc99e Initial load
duke
parents:
diff changeset
670 f.visitAddress(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
671 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
672 addr = fr.addressOfInterpreterFrameExpressionStackSlot(offset - maxLocals);
a61af66fc99e Initial load
duke
parents:
diff changeset
673 if (DEBUG) {
a61af66fc99e Initial load
duke
parents:
diff changeset
674 System.err.println(" Address of expression stack slot: " + addr + ", TOS = " +
a61af66fc99e Initial load
duke
parents:
diff changeset
675 fr.addressOfInterpreterFrameTOS());
a61af66fc99e Initial load
duke
parents:
diff changeset
676 }
a61af66fc99e Initial load
duke
parents:
diff changeset
677 // In case of exceptions, the expression stack is invalid and the esp will be reset to express
a61af66fc99e Initial load
duke
parents:
diff changeset
678 // this condition. Therefore, we call f only if addr is 'inside' the stack (i.e., addr >= esp for Intel).
a61af66fc99e Initial load
duke
parents:
diff changeset
679 boolean inStack;
a61af66fc99e Initial load
duke
parents:
diff changeset
680 if (fr.getInterpreterFrameExpressionStackDirection() > 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
681 inStack = AddressOps.lte(addr, fr.addressOfInterpreterFrameTOS());
a61af66fc99e Initial load
duke
parents:
diff changeset
682 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
683 inStack = AddressOps.gte(addr, fr.addressOfInterpreterFrameTOS());
a61af66fc99e Initial load
duke
parents:
diff changeset
684 }
a61af66fc99e Initial load
duke
parents:
diff changeset
685 if (inStack) {
a61af66fc99e Initial load
duke
parents:
diff changeset
686 if (DEBUG) {
a61af66fc99e Initial load
duke
parents:
diff changeset
687 System.err.println(" In stack; visiting location.");
a61af66fc99e Initial load
duke
parents:
diff changeset
688 }
a61af66fc99e Initial load
duke
parents:
diff changeset
689 f.visitAddress(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
690 } else if (DEBUG) {
a61af66fc99e Initial load
duke
parents:
diff changeset
691 System.err.println(" *** WARNING: Address is out of bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
692 }
a61af66fc99e Initial load
duke
parents:
diff changeset
693 }
a61af66fc99e Initial load
duke
parents:
diff changeset
694 }
a61af66fc99e Initial load
duke
parents:
diff changeset
695 }
a61af66fc99e Initial load
duke
parents:
diff changeset
696
a61af66fc99e Initial load
duke
parents:
diff changeset
697 // Only used internally, to find arguments in interpreted frames
a61af66fc99e Initial load
duke
parents:
diff changeset
698 class ArgumentOopFinder extends SignatureInfo {
a61af66fc99e Initial load
duke
parents:
diff changeset
699 private AddressVisitor f;
a61af66fc99e Initial load
duke
parents:
diff changeset
700 private int offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
701 private boolean isStatic;
a61af66fc99e Initial load
duke
parents:
diff changeset
702 private Frame fr;
a61af66fc99e Initial load
duke
parents:
diff changeset
703
a61af66fc99e Initial load
duke
parents:
diff changeset
704 protected void set(int size, int type) {
a61af66fc99e Initial load
duke
parents:
diff changeset
705 offset -= size;
a61af66fc99e Initial load
duke
parents:
diff changeset
706 if (type == BasicType.getTObject() || type == BasicType.getTArray()) oopOffsetDo();
a61af66fc99e Initial load
duke
parents:
diff changeset
707 }
a61af66fc99e Initial load
duke
parents:
diff changeset
708
a61af66fc99e Initial load
duke
parents:
diff changeset
709 private void oopOffsetDo() {
a61af66fc99e Initial load
duke
parents:
diff changeset
710 f.visitAddress(fr.addressOfInterpreterFrameTOSAt(offset));
a61af66fc99e Initial load
duke
parents:
diff changeset
711 }
a61af66fc99e Initial load
duke
parents:
diff changeset
712
a61af66fc99e Initial load
duke
parents:
diff changeset
713 public ArgumentOopFinder(Symbol signature, boolean isStatic, Frame fr, AddressVisitor f) {
a61af66fc99e Initial load
duke
parents:
diff changeset
714 super(signature);
a61af66fc99e Initial load
duke
parents:
diff changeset
715
a61af66fc99e Initial load
duke
parents:
diff changeset
716 // compute size of arguments
a61af66fc99e Initial load
duke
parents:
diff changeset
717 int argsSize = new ArgumentSizeComputer(signature).size() + (isStatic ? 0 : 1);
a61af66fc99e Initial load
duke
parents:
diff changeset
718 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
719 Assert.that(!fr.isInterpretedFrame() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
720 argsSize <= fr.getInterpreterFrameExpressionStackSize(), "args cannot be on stack anymore");
a61af66fc99e Initial load
duke
parents:
diff changeset
721 }
a61af66fc99e Initial load
duke
parents:
diff changeset
722 // initialize ArgumentOopFinder
a61af66fc99e Initial load
duke
parents:
diff changeset
723 this.f = f;
a61af66fc99e Initial load
duke
parents:
diff changeset
724 this.fr = fr;
a61af66fc99e Initial load
duke
parents:
diff changeset
725 this.offset = argsSize;
a61af66fc99e Initial load
duke
parents:
diff changeset
726 this.isStatic = isStatic;
a61af66fc99e Initial load
duke
parents:
diff changeset
727 }
a61af66fc99e Initial load
duke
parents:
diff changeset
728
a61af66fc99e Initial load
duke
parents:
diff changeset
729 public void oopsDo() {
a61af66fc99e Initial load
duke
parents:
diff changeset
730 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
731 --offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
732 oopOffsetDo();
a61af66fc99e Initial load
duke
parents:
diff changeset
733 }
a61af66fc99e Initial load
duke
parents:
diff changeset
734 iterateParameters();
a61af66fc99e Initial load
duke
parents:
diff changeset
735 }
a61af66fc99e Initial load
duke
parents:
diff changeset
736 }