18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_RUNTIME_VFRAME_HPP
26 #define SHARE_RUNTIME_VFRAME_HPP
27
28 #include "code/debugInfo.hpp"
29 #include "code/debugInfoRec.hpp"
30 #include "code/location.hpp"
31 #include "oops/oop.hpp"
32 #include "runtime/handles.inline.hpp"
33 #include "runtime/frame.hpp"
34 #include "runtime/stackValue.hpp"
35 #include "runtime/stackValueCollection.hpp"
36 #include "utilities/growableArray.hpp"
37
38 // vframes are virtual stack frames representing source level activations.
39 // A single frame may hold several source level activations in the case of
40 // optimized code. The debugging stored with the optimized code enables
41 // us to unfold a frame as a stack of vframes.
42 // A cVFrame represents an activation of a non-java method.
43
44 // The vframe inheritance hierarchy:
45 // - vframe
46 // - javaVFrame
47 // - interpretedVFrame
48 // - compiledVFrame ; (used for both compiled Java methods and native stubs)
49 // - externalVFrame
50 // - entryVFrame ; special frame created when calling Java from C
51
52 // - BasicLock
53
54 class vframe: public ResourceObj {
55 protected:
56 frame _fr; // Raw frame behind the virtual frame.
57 RegisterMap _reg_map; // Register map for the raw frame (used to handle callee-saved registers).
217 public:
218 bool is_entry_frame() const { return true; }
219
220 protected:
221 entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread);
222
223 public:
224 // casting
225 static entryVFrame* cast(vframe* vf) {
226 assert(vf == NULL || vf->is_entry_frame(), "must be entry frame");
227 return (entryVFrame*) vf;
228 }
229
230 #ifndef PRODUCT
231 public:
232 // printing
233 void print_value() const;
234 void print();
235 #endif
236 friend class vframe;
237 };
238
239
240 // A MonitorInfo is a ResourceObject that describes a the pair:
241 // 1) the owner of the monitor
242 // 2) the monitor lock
243 class MonitorInfo : public ResourceObj {
244 private:
245 Handle _owner; // the object owning the monitor
246 BasicLock* _lock;
247 Handle _owner_klass; // klass (mirror) if owner was scalar replaced
248 bool _eliminated;
249 bool _owner_is_scalar_replaced;
250 public:
251 // Constructor
252 MonitorInfo(oop owner, BasicLock* lock, bool eliminated, bool owner_is_scalar_replaced, TRAPS) {
253 if (!owner_is_scalar_replaced) {
254 _owner = Handle(THREAD, owner);
255 _owner_klass = Handle();
256 } else {
257 assert(eliminated, "monitor should be eliminated for scalar replaced object");
258 _owner = Handle();
259 _owner_klass = Handle(THREAD, owner);
260 }
261 _lock = lock;
262 _eliminated = eliminated;
263 _owner_is_scalar_replaced = owner_is_scalar_replaced;
264 }
265 // Accessors
266 oop owner() const {
267 assert(!_owner_is_scalar_replaced, "should not be called for scalar replaced object");
268 return _owner();
269 }
270 oop owner_klass() const {
271 assert(_owner_is_scalar_replaced, "should not be called for not scalar replaced object");
272 return _owner_klass();
273 }
274 BasicLock* lock() const { return _lock; }
275 bool eliminated() const { return _eliminated; }
276 bool owner_is_scalar_replaced() const { return _owner_is_scalar_replaced; }
277 };
278
279 class vframeStreamCommon : StackObj {
280 protected:
281 // common
282 frame _prev_frame;
283 frame _frame;
284 JavaThread* _thread;
285 RegisterMap _reg_map;
286 enum { interpreted_mode, compiled_mode, at_end_mode } _mode;
287
288 // For compiled_mode
289 int _decode_offset;
290 int _sender_decode_offset;
291 int _vframe_id;
292
293 // Cached information
294 Method* _method;
295 int _bci;
296
|
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_RUNTIME_VFRAME_HPP
26 #define SHARE_RUNTIME_VFRAME_HPP
27
28 #include "code/debugInfo.hpp"
29 #include "code/debugInfoRec.hpp"
30 #include "code/location.hpp"
31 #include "oops/oop.hpp"
32 #include "runtime/handles.inline.hpp"
33 #include "runtime/frame.hpp"
34 #include "runtime/stackValue.hpp"
35 #include "runtime/stackValueCollection.hpp"
36 #include "utilities/growableArray.hpp"
37
38 class MonitorInfo;
39
40 // vframes are virtual stack frames representing source level activations.
41 // A single frame may hold several source level activations in the case of
42 // optimized code. The debugging stored with the optimized code enables
43 // us to unfold a frame as a stack of vframes.
44 // A cVFrame represents an activation of a non-java method.
45
46 // The vframe inheritance hierarchy:
47 // - vframe
48 // - javaVFrame
49 // - interpretedVFrame
50 // - compiledVFrame ; (used for both compiled Java methods and native stubs)
51 // - externalVFrame
52 // - entryVFrame ; special frame created when calling Java from C
53
54 // - BasicLock
55
56 class vframe: public ResourceObj {
57 protected:
58 frame _fr; // Raw frame behind the virtual frame.
59 RegisterMap _reg_map; // Register map for the raw frame (used to handle callee-saved registers).
219 public:
220 bool is_entry_frame() const { return true; }
221
222 protected:
223 entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread);
224
225 public:
226 // casting
227 static entryVFrame* cast(vframe* vf) {
228 assert(vf == NULL || vf->is_entry_frame(), "must be entry frame");
229 return (entryVFrame*) vf;
230 }
231
232 #ifndef PRODUCT
233 public:
234 // printing
235 void print_value() const;
236 void print();
237 #endif
238 friend class vframe;
239 };
240
241 class vframeStreamCommon : StackObj {
242 protected:
243 // common
244 frame _prev_frame;
245 frame _frame;
246 JavaThread* _thread;
247 RegisterMap _reg_map;
248 enum { interpreted_mode, compiled_mode, at_end_mode } _mode;
249
250 // For compiled_mode
251 int _decode_offset;
252 int _sender_decode_offset;
253 int _vframe_id;
254
255 // Cached information
256 Method* _method;
257 int _bci;
258
|