annotate src/share/vm/runtime/vframe.hpp @ 107:93b6525e3b82

6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on Summary: Rewrite frame::safe_for_sender and friends to be safe for collector/analyzer Reviewed-by: dcubed, kvn
author sgoldman
date Tue, 08 Apr 2008 12:23:15 -0400
parents d3cd40645d0d
children d1605aabd0a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
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 // vframes are virtual stack frames representing source level activations.
a61af66fc99e Initial load
duke
parents:
diff changeset
26 // A single frame may hold several source level activations in the case of
a61af66fc99e Initial load
duke
parents:
diff changeset
27 // optimized code. The debugging stored with the optimized code enables
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // us to unfold a frame as a stack of vframes.
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // A cVFrame represents an activation of a non-java method.
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // The vframe inheritance hierarchy:
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // - vframe
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // - javaVFrame
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // - interpretedVFrame
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // - compiledVFrame ; (used for both compiled Java methods and native stubs)
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // - externalVFrame
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // - entryVFrame ; special frame created when calling Java from C
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // - BasicLock
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 class vframe: public ResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
43 frame _fr; // Raw frame behind the virtual frame.
a61af66fc99e Initial load
duke
parents:
diff changeset
44 RegisterMap _reg_map; // Register map for the raw frame (used to handle callee-saved registers).
a61af66fc99e Initial load
duke
parents:
diff changeset
45 JavaThread* _thread; // The thread owning the raw frame.
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
48 vframe(const frame* fr, JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
49 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // Factory method for creating vframes
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static vframe* new_vframe(const frame* f, const RegisterMap *reg_map, JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // Accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
54 frame fr() const { return _fr; }
a61af66fc99e Initial load
duke
parents:
diff changeset
55 CodeBlob* cb() const { return _fr.cb(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
56 nmethod* nm() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 assert( cb() != NULL && cb()->is_nmethod(), "usage");
a61af66fc99e Initial load
duke
parents:
diff changeset
58 return (nmethod*) cb();
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // ???? Does this need to be a copy?
a61af66fc99e Initial load
duke
parents:
diff changeset
62 frame* frame_pointer() { return &_fr; }
a61af66fc99e Initial load
duke
parents:
diff changeset
63 const RegisterMap* register_map() const { return &_reg_map; }
a61af66fc99e Initial load
duke
parents:
diff changeset
64 JavaThread* thread() const { return _thread; }
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // Returns the sender vframe
a61af66fc99e Initial load
duke
parents:
diff changeset
67 virtual vframe* sender() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // Returns the next javaVFrame on the stack (skipping all other kinds of frame)
a61af66fc99e Initial load
duke
parents:
diff changeset
70 javaVFrame *java_sender() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 // Answers if the this is the top vframe in the frame, i.e., if the sender vframe
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // is in the caller frame
a61af66fc99e Initial load
duke
parents:
diff changeset
74 virtual bool is_top() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // Returns top vframe within same frame (see is_top())
a61af66fc99e Initial load
duke
parents:
diff changeset
77 virtual vframe* top() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // Type testing operations
a61af66fc99e Initial load
duke
parents:
diff changeset
80 virtual bool is_entry_frame() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
81 virtual bool is_java_frame() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 virtual bool is_interpreted_frame() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
83 virtual bool is_compiled_frame() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // printing operations
a61af66fc99e Initial load
duke
parents:
diff changeset
87 virtual void print_value() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 virtual void print();
a61af66fc99e Initial load
duke
parents:
diff changeset
89 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
90 };
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 class javaVFrame: public vframe {
a61af66fc99e Initial load
duke
parents:
diff changeset
94 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // JVM state
a61af66fc99e Initial load
duke
parents:
diff changeset
96 virtual methodOop method() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 virtual int bci() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
98 virtual StackValueCollection* locals() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
99 virtual StackValueCollection* expressions() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // the order returned by monitors() is from oldest -> youngest#4418568
a61af66fc99e Initial load
duke
parents:
diff changeset
101 virtual GrowableArray<MonitorInfo*>* monitors() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // Debugging support via JVMTI.
a61af66fc99e Initial load
duke
parents:
diff changeset
104 // NOTE that this is not guaranteed to give correct results for compiled vframes.
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // Deoptimize first if necessary.
a61af66fc99e Initial load
duke
parents:
diff changeset
106 virtual void set_locals(StackValueCollection* values) const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 // Test operation
a61af66fc99e Initial load
duke
parents:
diff changeset
109 bool is_java_frame() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
112 javaVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread) : vframe(fr, reg_map, thread) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
113 javaVFrame(const frame* fr, JavaThread* thread) : vframe(fr, thread) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
116 // casting
a61af66fc99e Initial load
duke
parents:
diff changeset
117 static javaVFrame* cast(vframe* vf) {
a61af66fc99e Initial load
duke
parents:
diff changeset
118 assert(vf == NULL || vf->is_java_frame(), "must be java frame");
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return (javaVFrame*) vf;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 // Return an array of monitors locked by this frame in the youngest to oldest order
a61af66fc99e Initial load
duke
parents:
diff changeset
123 GrowableArray<MonitorInfo*>* locked_monitors();
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // printing used during stack dumps
a61af66fc99e Initial load
duke
parents:
diff changeset
126 void print_lock_info_on(outputStream* st, int frame_count);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 void print_lock_info(int frame_count) { print_lock_info_on(tty, frame_count); }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
130 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // printing operations
a61af66fc99e Initial load
duke
parents:
diff changeset
132 void print();
a61af66fc99e Initial load
duke
parents:
diff changeset
133 void print_value() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 void print_activation(int index) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // verify operations
a61af66fc99e Initial load
duke
parents:
diff changeset
137 virtual void verify() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // Structural compare
a61af66fc99e Initial load
duke
parents:
diff changeset
140 bool structural_compare(javaVFrame* other);
a61af66fc99e Initial load
duke
parents:
diff changeset
141 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
142 friend class vframe;
a61af66fc99e Initial load
duke
parents:
diff changeset
143 };
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 class interpretedVFrame: public javaVFrame {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
147 // JVM state
a61af66fc99e Initial load
duke
parents:
diff changeset
148 methodOop method() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
149 int bci() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
150 StackValueCollection* locals() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
151 StackValueCollection* expressions() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
152 GrowableArray<MonitorInfo*>* monitors() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 void set_locals(StackValueCollection* values) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 // Test operation
a61af66fc99e Initial load
duke
parents:
diff changeset
157 bool is_interpreted_frame() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
160 interpretedVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread) : javaVFrame(fr, reg_map, thread) {};
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // Accessors for Byte Code Pointer
a61af66fc99e Initial load
duke
parents:
diff changeset
164 u_char* bcp() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
165 void set_bcp(u_char* bcp);
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 // casting
a61af66fc99e Initial load
duke
parents:
diff changeset
168 static interpretedVFrame* cast(vframe* vf) {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 assert(vf == NULL || vf->is_interpreted_frame(), "must be interpreted frame");
a61af66fc99e Initial load
duke
parents:
diff changeset
170 return (interpretedVFrame*) vf;
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
174 static const int bcp_offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
175 intptr_t* locals_addr_at(int offset) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 // returns where the parameters starts relative to the frame pointer
a61af66fc99e Initial load
duke
parents:
diff changeset
178 int start_of_parameters() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
181 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
182 // verify operations
a61af66fc99e Initial load
duke
parents:
diff changeset
183 void verify() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
184 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
185 friend class vframe;
a61af66fc99e Initial load
duke
parents:
diff changeset
186 };
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 class externalVFrame: public vframe {
a61af66fc99e Initial load
duke
parents:
diff changeset
190 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
191 externalVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread) : vframe(fr, reg_map, thread) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
194 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
195 // printing operations
a61af66fc99e Initial load
duke
parents:
diff changeset
196 void print_value() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
197 void print();
a61af66fc99e Initial load
duke
parents:
diff changeset
198 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
199 friend class vframe;
a61af66fc99e Initial load
duke
parents:
diff changeset
200 };
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 class entryVFrame: public externalVFrame {
a61af66fc99e Initial load
duke
parents:
diff changeset
203 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
204 bool is_entry_frame() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
207 entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
210 // casting
a61af66fc99e Initial load
duke
parents:
diff changeset
211 static entryVFrame* cast(vframe* vf) {
a61af66fc99e Initial load
duke
parents:
diff changeset
212 assert(vf == NULL || vf->is_entry_frame(), "must be entry frame");
a61af66fc99e Initial load
duke
parents:
diff changeset
213 return (entryVFrame*) vf;
a61af66fc99e Initial load
duke
parents:
diff changeset
214 }
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
217 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
218 // printing
a61af66fc99e Initial load
duke
parents:
diff changeset
219 void print_value() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
220 void print();
a61af66fc99e Initial load
duke
parents:
diff changeset
221 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
222 friend class vframe;
a61af66fc99e Initial load
duke
parents:
diff changeset
223 };
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // A MonitorInfo is a ResourceObject that describes a the pair:
a61af66fc99e Initial load
duke
parents:
diff changeset
227 // 1) the owner of the monitor
a61af66fc99e Initial load
duke
parents:
diff changeset
228 // 2) the monitor lock
a61af66fc99e Initial load
duke
parents:
diff changeset
229 class MonitorInfo : public ResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
231 oop _owner; // the object owning the monitor
a61af66fc99e Initial load
duke
parents:
diff changeset
232 BasicLock* _lock;
83
d3cd40645d0d 6681646: Relocking of a scalar replaced object during deoptimization is broken
kvn
parents: 0
diff changeset
233 bool _eliminated;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
234 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
235 // Constructor
83
d3cd40645d0d 6681646: Relocking of a scalar replaced object during deoptimization is broken
kvn
parents: 0
diff changeset
236 MonitorInfo(oop owner, BasicLock* lock, bool eliminated) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
237 _owner = owner;
a61af66fc99e Initial load
duke
parents:
diff changeset
238 _lock = lock;
83
d3cd40645d0d 6681646: Relocking of a scalar replaced object during deoptimization is broken
kvn
parents: 0
diff changeset
239 _eliminated = eliminated;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
240 }
a61af66fc99e Initial load
duke
parents:
diff changeset
241 // Accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
242 oop owner() const { return _owner; }
a61af66fc99e Initial load
duke
parents:
diff changeset
243 BasicLock* lock() const { return _lock; }
83
d3cd40645d0d 6681646: Relocking of a scalar replaced object during deoptimization is broken
kvn
parents: 0
diff changeset
244 bool eliminated() const { return _eliminated; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
245 };
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 class vframeStreamCommon : StackObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
248 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
249 // common
a61af66fc99e Initial load
duke
parents:
diff changeset
250 frame _frame;
a61af66fc99e Initial load
duke
parents:
diff changeset
251 JavaThread* _thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
252 RegisterMap _reg_map;
a61af66fc99e Initial load
duke
parents:
diff changeset
253 enum { interpreted_mode, compiled_mode, at_end_mode } _mode;
a61af66fc99e Initial load
duke
parents:
diff changeset
254
a61af66fc99e Initial load
duke
parents:
diff changeset
255 int _sender_decode_offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
256
a61af66fc99e Initial load
duke
parents:
diff changeset
257 // Cached information
a61af66fc99e Initial load
duke
parents:
diff changeset
258 methodOop _method;
a61af66fc99e Initial load
duke
parents:
diff changeset
259 int _bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 // Should VM activations be ignored or not
a61af66fc99e Initial load
duke
parents:
diff changeset
262 bool _stop_at_java_call_stub;
a61af66fc99e Initial load
duke
parents:
diff changeset
263
a61af66fc99e Initial load
duke
parents:
diff changeset
264 bool fill_in_compiled_inlined_sender();
a61af66fc99e Initial load
duke
parents:
diff changeset
265 void fill_from_compiled_frame(int decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
266 void fill_from_compiled_native_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
267
a61af66fc99e Initial load
duke
parents:
diff changeset
268 void found_bad_method_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
269
a61af66fc99e Initial load
duke
parents:
diff changeset
270 void fill_from_interpreter_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
271 bool fill_from_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
272
a61af66fc99e Initial load
duke
parents:
diff changeset
273 // Helper routine for security_get_caller_frame
a61af66fc99e Initial load
duke
parents:
diff changeset
274 void skip_prefixed_method_and_wrappers();
a61af66fc99e Initial load
duke
parents:
diff changeset
275
a61af66fc99e Initial load
duke
parents:
diff changeset
276 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
277 // Constructor
a61af66fc99e Initial load
duke
parents:
diff changeset
278 vframeStreamCommon(JavaThread* thread) : _reg_map(thread, false) {
a61af66fc99e Initial load
duke
parents:
diff changeset
279 _thread = thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
280 }
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282 // Accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
283 methodOop method() const { return _method; }
a61af66fc99e Initial load
duke
parents:
diff changeset
284 int bci() const { return _bci; }
a61af66fc99e Initial load
duke
parents:
diff changeset
285 intptr_t* frame_id() const { return _frame.id(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
286 address frame_pc() const { return _frame.pc(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
287
a61af66fc99e Initial load
duke
parents:
diff changeset
288 CodeBlob* cb() const { return _frame.cb(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
289 nmethod* nm() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
290 assert( cb() != NULL && cb()->is_nmethod(), "usage");
a61af66fc99e Initial load
duke
parents:
diff changeset
291 return (nmethod*) cb();
a61af66fc99e Initial load
duke
parents:
diff changeset
292 }
a61af66fc99e Initial load
duke
parents:
diff changeset
293
a61af66fc99e Initial load
duke
parents:
diff changeset
294 // Frame type
a61af66fc99e Initial load
duke
parents:
diff changeset
295 bool is_interpreted_frame() const { return _frame.is_interpreted_frame(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
296 bool is_entry_frame() const { return _frame.is_entry_frame(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
297
a61af66fc99e Initial load
duke
parents:
diff changeset
298 // Iteration
a61af66fc99e Initial load
duke
parents:
diff changeset
299 void next() {
a61af66fc99e Initial load
duke
parents:
diff changeset
300 // handle frames with inlining
a61af66fc99e Initial load
duke
parents:
diff changeset
301 if (_mode == compiled_mode && fill_in_compiled_inlined_sender()) return;
a61af66fc99e Initial load
duke
parents:
diff changeset
302
a61af66fc99e Initial load
duke
parents:
diff changeset
303 // handle general case
a61af66fc99e Initial load
duke
parents:
diff changeset
304 do {
a61af66fc99e Initial load
duke
parents:
diff changeset
305 _frame = _frame.sender(&_reg_map);
a61af66fc99e Initial load
duke
parents:
diff changeset
306 } while (!fill_from_frame());
a61af66fc99e Initial load
duke
parents:
diff changeset
307 }
a61af66fc99e Initial load
duke
parents:
diff changeset
308
a61af66fc99e Initial load
duke
parents:
diff changeset
309 bool at_end() const { return _mode == at_end_mode; }
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 // Implements security traversal. Skips depth no. of frame including
a61af66fc99e Initial load
duke
parents:
diff changeset
312 // special security frames and prefixed native methods
a61af66fc99e Initial load
duke
parents:
diff changeset
313 void security_get_caller_frame(int depth);
a61af66fc99e Initial load
duke
parents:
diff changeset
314
a61af66fc99e Initial load
duke
parents:
diff changeset
315 // Helper routine for JVM_LatestUserDefinedLoader -- needed for 1.4
a61af66fc99e Initial load
duke
parents:
diff changeset
316 // reflection implementation
a61af66fc99e Initial load
duke
parents:
diff changeset
317 void skip_reflection_related_frames();
a61af66fc99e Initial load
duke
parents:
diff changeset
318 };
a61af66fc99e Initial load
duke
parents:
diff changeset
319
a61af66fc99e Initial load
duke
parents:
diff changeset
320 class vframeStream : public vframeStreamCommon {
a61af66fc99e Initial load
duke
parents:
diff changeset
321 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
322 // Constructors
a61af66fc99e Initial load
duke
parents:
diff changeset
323 vframeStream(JavaThread* thread, bool stop_at_java_call_stub = false)
a61af66fc99e Initial load
duke
parents:
diff changeset
324 : vframeStreamCommon(thread) {
a61af66fc99e Initial load
duke
parents:
diff changeset
325 _stop_at_java_call_stub = stop_at_java_call_stub;
a61af66fc99e Initial load
duke
parents:
diff changeset
326
a61af66fc99e Initial load
duke
parents:
diff changeset
327 if (!thread->has_last_Java_frame()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
328 _mode = at_end_mode;
a61af66fc99e Initial load
duke
parents:
diff changeset
329 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
330 }
a61af66fc99e Initial load
duke
parents:
diff changeset
331
a61af66fc99e Initial load
duke
parents:
diff changeset
332 _frame = _thread->last_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
333 while (!fill_from_frame()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
334 _frame = _frame.sender(&_reg_map);
a61af66fc99e Initial load
duke
parents:
diff changeset
335 }
a61af66fc99e Initial load
duke
parents:
diff changeset
336 }
a61af66fc99e Initial load
duke
parents:
diff changeset
337
a61af66fc99e Initial load
duke
parents:
diff changeset
338 // top_frame may not be at safepoint, start with sender
a61af66fc99e Initial load
duke
parents:
diff changeset
339 vframeStream(JavaThread* thread, frame top_frame, bool stop_at_java_call_stub = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
340 };
a61af66fc99e Initial load
duke
parents:
diff changeset
341
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 inline bool vframeStreamCommon::fill_in_compiled_inlined_sender() {
a61af66fc99e Initial load
duke
parents:
diff changeset
344 if (_sender_decode_offset == DebugInformationRecorder::serialized_null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
345 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
346 }
a61af66fc99e Initial load
duke
parents:
diff changeset
347 fill_from_compiled_frame(_sender_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
348 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
349 }
a61af66fc99e Initial load
duke
parents:
diff changeset
350
a61af66fc99e Initial load
duke
parents:
diff changeset
351
a61af66fc99e Initial load
duke
parents:
diff changeset
352 inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
353 _mode = compiled_mode;
a61af66fc99e Initial load
duke
parents:
diff changeset
354
a61af66fc99e Initial load
duke
parents:
diff changeset
355 // Range check to detect ridiculous offsets.
a61af66fc99e Initial load
duke
parents:
diff changeset
356 if (decode_offset == DebugInformationRecorder::serialized_null ||
a61af66fc99e Initial load
duke
parents:
diff changeset
357 decode_offset < 0 ||
a61af66fc99e Initial load
duke
parents:
diff changeset
358 decode_offset >= nm()->scopes_data_size()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
359 // 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
a61af66fc99e Initial load
duke
parents:
diff changeset
360 // If we attempt to read nmethod::scopes_data at serialized_null (== 0),
a61af66fc99e Initial load
duke
parents:
diff changeset
361 // or if we read some at other crazy offset,
a61af66fc99e Initial load
duke
parents:
diff changeset
362 // we will decode garbage and make wild references into the heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
363 // leading to crashes in product mode.
a61af66fc99e Initial load
duke
parents:
diff changeset
364 // (This isn't airtight, of course, since there are internal
a61af66fc99e Initial load
duke
parents:
diff changeset
365 // offsets which are also crazy.)
a61af66fc99e Initial load
duke
parents:
diff changeset
366 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
367 if (WizardMode) {
a61af66fc99e Initial load
duke
parents:
diff changeset
368 tty->print_cr("Error in fill_from_frame: pc_desc for "
a61af66fc99e Initial load
duke
parents:
diff changeset
369 INTPTR_FORMAT " not found or invalid at %d",
a61af66fc99e Initial load
duke
parents:
diff changeset
370 _frame.pc(), decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
371 nm()->print();
a61af66fc99e Initial load
duke
parents:
diff changeset
372 nm()->method()->print_codes();
a61af66fc99e Initial load
duke
parents:
diff changeset
373 nm()->print_code();
a61af66fc99e Initial load
duke
parents:
diff changeset
374 nm()->print_pcs();
a61af66fc99e Initial load
duke
parents:
diff changeset
375 }
a61af66fc99e Initial load
duke
parents:
diff changeset
376 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
377 // Provide a cheap fallback in product mode. (See comment above.)
a61af66fc99e Initial load
duke
parents:
diff changeset
378 found_bad_method_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
379 fill_from_compiled_native_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
380 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
381 }
a61af66fc99e Initial load
duke
parents:
diff changeset
382
a61af66fc99e Initial load
duke
parents:
diff changeset
383 // Decode first part of scopeDesc
a61af66fc99e Initial load
duke
parents:
diff changeset
384 DebugInfoReadStream buffer(nm(), decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
385 _sender_decode_offset = buffer.read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
386 _method = methodOop(buffer.read_oop());
a61af66fc99e Initial load
duke
parents:
diff changeset
387 _bci = buffer.read_bci();
a61af66fc99e Initial load
duke
parents:
diff changeset
388
a61af66fc99e Initial load
duke
parents:
diff changeset
389 assert(_method->is_method(), "checking type of decoded method");
a61af66fc99e Initial load
duke
parents:
diff changeset
390 }
a61af66fc99e Initial load
duke
parents:
diff changeset
391
a61af66fc99e Initial load
duke
parents:
diff changeset
392 // The native frames are handled specially. We do not rely on ScopeDesc info
a61af66fc99e Initial load
duke
parents:
diff changeset
393 // since the pc might not be exact due to the _last_native_pc trick.
a61af66fc99e Initial load
duke
parents:
diff changeset
394 inline void vframeStreamCommon::fill_from_compiled_native_frame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
395 _mode = compiled_mode;
a61af66fc99e Initial load
duke
parents:
diff changeset
396 _sender_decode_offset = DebugInformationRecorder::serialized_null;
a61af66fc99e Initial load
duke
parents:
diff changeset
397 _method = nm()->method();
a61af66fc99e Initial load
duke
parents:
diff changeset
398 _bci = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
399 }
a61af66fc99e Initial load
duke
parents:
diff changeset
400
a61af66fc99e Initial load
duke
parents:
diff changeset
401 inline bool vframeStreamCommon::fill_from_frame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
402 // Interpreted frame
a61af66fc99e Initial load
duke
parents:
diff changeset
403 if (_frame.is_interpreted_frame()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
404 fill_from_interpreter_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
405 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
406 }
a61af66fc99e Initial load
duke
parents:
diff changeset
407
a61af66fc99e Initial load
duke
parents:
diff changeset
408 // Compiled frame
a61af66fc99e Initial load
duke
parents:
diff changeset
409
a61af66fc99e Initial load
duke
parents:
diff changeset
410 if (cb() != NULL && cb()->is_nmethod()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
411 if (nm()->is_native_method()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
412 // Do not rely on scopeDesc since the pc might be unprecise due to the _last_native_pc trick.
a61af66fc99e Initial load
duke
parents:
diff changeset
413 fill_from_compiled_native_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
414 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
415 PcDesc* pc_desc = nm()->pc_desc_at(_frame.pc());
a61af66fc99e Initial load
duke
parents:
diff changeset
416 int decode_offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
417 if (pc_desc == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
418 // Should not happen, but let fill_from_compiled_frame handle it.
107
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
419
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
420 // If we are trying to walk the stack of a thread that is not
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
421 // at a safepoint (like AsyncGetCallTrace would do) then this is an
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
422 // acceptable result. [ This is assuming that safe_for_sender
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
423 // is so bullet proof that we can trust the frames it produced. ]
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
424 //
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
425 // So if we see that the thread is not safepoint safe
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
426 // then simply produce the method and a bci of zero
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
427 // and skip the possibility of decoding any inlining that
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
428 // may be present. That is far better than simply stopping (or
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
429 // asserting. If however the thread is safepoint safe this
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
430 // is the sign of a compiler bug and we'll let
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
431 // fill_from_compiled_frame handle it.
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
432
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
433
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
434 JavaThreadState state = _thread->thread_state();
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
435
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
436 // in_Java should be good enough to test safepoint safety
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
437 // if state were say in_Java_trans then we'd expect that
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
438 // the pc would have already been slightly adjusted to
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
439 // one that would produce a pcDesc since the trans state
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
440 // would be one that might in fact anticipate a safepoint
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
441
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
442 if (state == _thread_in_Java ) {
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
443 // This will get a method a zero bci and no inlining.
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
444 // Might be nice to have a unique bci to signify this
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
445 // particular case but for now zero will do.
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
446
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
447 fill_from_compiled_native_frame();
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
448
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
449 // There is something to be said for setting the mode to
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
450 // at_end_mode to prevent trying to walk further up the
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
451 // stack. There is evidence that if we walk any further
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
452 // that we could produce a bad stack chain. However until
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
453 // we see evidence that allowing this causes us to find
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
454 // frames bad enough to cause segv's or assertion failures
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
455 // we don't do it as while we may get a bad call chain the
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
456 // probability is much higher (several magnitudes) that we
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
457 // get good data.
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
458
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
459 return true;
93b6525e3b82 6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
sgoldman
parents: 83
diff changeset
460 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
461 decode_offset = DebugInformationRecorder::serialized_null;
a61af66fc99e Initial load
duke
parents:
diff changeset
462 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
463 decode_offset = pc_desc->scope_decode_offset();
a61af66fc99e Initial load
duke
parents:
diff changeset
464 }
a61af66fc99e Initial load
duke
parents:
diff changeset
465 fill_from_compiled_frame(decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
466 }
a61af66fc99e Initial load
duke
parents:
diff changeset
467 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
468 }
a61af66fc99e Initial load
duke
parents:
diff changeset
469
a61af66fc99e Initial load
duke
parents:
diff changeset
470 // End of stack?
a61af66fc99e Initial load
duke
parents:
diff changeset
471 if (_frame.is_first_frame() || (_stop_at_java_call_stub && _frame.is_entry_frame())) {
a61af66fc99e Initial load
duke
parents:
diff changeset
472 _mode = at_end_mode;
a61af66fc99e Initial load
duke
parents:
diff changeset
473 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
474 }
a61af66fc99e Initial load
duke
parents:
diff changeset
475
a61af66fc99e Initial load
duke
parents:
diff changeset
476 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
477 }
a61af66fc99e Initial load
duke
parents:
diff changeset
478
a61af66fc99e Initial load
duke
parents:
diff changeset
479
a61af66fc99e Initial load
duke
parents:
diff changeset
480 inline void vframeStreamCommon::fill_from_interpreter_frame() {
a61af66fc99e Initial load
duke
parents:
diff changeset
481 methodOop method = _frame.interpreter_frame_method();
a61af66fc99e Initial load
duke
parents:
diff changeset
482 intptr_t bcx = _frame.interpreter_frame_bcx();
a61af66fc99e Initial load
duke
parents:
diff changeset
483 int bci = method->validate_bci_from_bcx(bcx);
a61af66fc99e Initial load
duke
parents:
diff changeset
484 // 6379830 AsyncGetCallTrace sometimes feeds us wild frames.
a61af66fc99e Initial load
duke
parents:
diff changeset
485 if (bci < 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
486 found_bad_method_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
487 bci = 0; // pretend it's on the point of entering
a61af66fc99e Initial load
duke
parents:
diff changeset
488 }
a61af66fc99e Initial load
duke
parents:
diff changeset
489 _mode = interpreted_mode;
a61af66fc99e Initial load
duke
parents:
diff changeset
490 _method = method;
a61af66fc99e Initial load
duke
parents:
diff changeset
491 _bci = bci;
a61af66fc99e Initial load
duke
parents:
diff changeset
492 }