< prev index next >

src/hotspot/share/runtime/vframe.hpp

Print this page

 33 #include "runtime/handles.hpp"
 34 #include "runtime/registerMap.hpp"
 35 #include "runtime/stackValue.hpp"
 36 #include "runtime/stackValueCollection.hpp"
 37 #include "utilities/growableArray.hpp"
 38 
 39 // vframes are virtual stack frames representing source level activations.
 40 // A single frame may hold several source level activations in the case of
 41 // optimized code. The debugging stored with the optimized code enables
 42 // us to unfold a frame as a stack of vframes.
 43 // A cVFrame represents an activation of a non-java method.
 44 
 45 // The vframe inheritance hierarchy:
 46 // - vframe
 47 //   - javaVFrame
 48 //     - interpretedVFrame
 49 //     - compiledVFrame     ; (used for both compiled Java methods and native stubs)
 50 //   - externalVFrame
 51 //     - entryVFrame        ; special frame created when calling Java from C
 52 
 53 // - BasicLock
 54 
 55 class StackFrameStream;
 56 class ContinuationEntry;
 57 
 58 class vframe: public ResourceObj {
 59  protected:
 60   frame        _fr;      // Raw frame behind the virtual frame.
 61   RegisterMap  _reg_map; // Register map for the raw frame (used to handle callee-saved registers).
 62   JavaThread*  _thread;  // The thread owning the raw frame.
 63   stackChunkHandle _chunk;
 64 
 65   vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread);
 66   vframe(const frame* fr, JavaThread* thread);
 67 
 68  public:
 69   // Factory methods for creating vframes
 70   static vframe* new_vframe(const frame* f, const RegisterMap *reg_map, JavaThread* thread);
 71   static vframe* new_vframe(StackFrameStream& fst, JavaThread* thread);
 72 
 73   // Accessors
 74   frame             fr() const { return _fr;       }

238     assert(vf == NULL || vf->is_entry_frame(), "must be entry frame");
239     return (entryVFrame*) vf;
240   }
241 
242 #ifndef PRODUCT
243  public:
244   // printing
245   void print_value() const;
246   void print();
247 #endif
248   friend class vframe;
249 };
250 
251 
252 // A MonitorInfo is a ResourceObject that describes the pair:
253 // 1) the owner of the monitor
254 // 2) the monitor lock
255 class MonitorInfo : public ResourceObj {
256  private:
257   Handle     _owner; // the object owning the monitor
258   BasicLock* _lock;
259   Handle     _owner_klass; // klass (mirror) if owner was scalar replaced
260   bool       _eliminated;
261   bool       _owner_is_scalar_replaced;
262  public:
263   // Constructor
264   MonitorInfo(oop owner, BasicLock* lock, bool eliminated, bool owner_is_scalar_replaced);
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        _frame;
283   JavaThread*  _thread;
284   RegisterMap  _reg_map;
285   enum { interpreted_mode, compiled_mode, at_end_mode } _mode;
286 
287   // For compiled_mode
288   int _decode_offset;
289   int _sender_decode_offset;
290   int _vframe_id;
291 
292   // Cached information
293   Method* _method;
294   int       _bci;

 33 #include "runtime/handles.hpp"
 34 #include "runtime/registerMap.hpp"
 35 #include "runtime/stackValue.hpp"
 36 #include "runtime/stackValueCollection.hpp"
 37 #include "utilities/growableArray.hpp"
 38 
 39 // vframes are virtual stack frames representing source level activations.
 40 // A single frame may hold several source level activations in the case of
 41 // optimized code. The debugging stored with the optimized code enables
 42 // us to unfold a frame as a stack of vframes.
 43 // A cVFrame represents an activation of a non-java method.
 44 
 45 // The vframe inheritance hierarchy:
 46 // - vframe
 47 //   - javaVFrame
 48 //     - interpretedVFrame
 49 //     - compiledVFrame     ; (used for both compiled Java methods and native stubs)
 50 //   - externalVFrame
 51 //     - entryVFrame        ; special frame created when calling Java from C
 52 


 53 class StackFrameStream;
 54 class ContinuationEntry;
 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).
 60   JavaThread*  _thread;  // The thread owning the raw frame.
 61   stackChunkHandle _chunk;
 62 
 63   vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread);
 64   vframe(const frame* fr, JavaThread* thread);
 65 
 66  public:
 67   // Factory methods for creating vframes
 68   static vframe* new_vframe(const frame* f, const RegisterMap *reg_map, JavaThread* thread);
 69   static vframe* new_vframe(StackFrameStream& fst, JavaThread* thread);
 70 
 71   // Accessors
 72   frame             fr() const { return _fr;       }

236     assert(vf == NULL || vf->is_entry_frame(), "must be entry frame");
237     return (entryVFrame*) vf;
238   }
239 
240 #ifndef PRODUCT
241  public:
242   // printing
243   void print_value() const;
244   void print();
245 #endif
246   friend class vframe;
247 };
248 
249 
250 // A MonitorInfo is a ResourceObject that describes the pair:
251 // 1) the owner of the monitor
252 // 2) the monitor lock
253 class MonitorInfo : public ResourceObj {
254  private:
255   Handle     _owner; // the object owning the monitor

256   Handle     _owner_klass; // klass (mirror) if owner was scalar replaced
257   bool       _eliminated;
258   bool       _owner_is_scalar_replaced;
259  public:
260   // Constructor
261   MonitorInfo(oop owner, bool eliminated, bool owner_is_scalar_replaced);
262   // Accessors
263   oop owner() const {
264     assert(!_owner_is_scalar_replaced, "should not be called for scalar replaced object");
265     return _owner();
266   }
267   oop owner_klass() const {
268     assert(_owner_is_scalar_replaced, "should not be called for not scalar replaced object");
269     return _owner_klass();
270   }

271   bool eliminated()  const { return _eliminated; }
272   bool owner_is_scalar_replaced()  const { return _owner_is_scalar_replaced; }
273 };
274 
275 class vframeStreamCommon : StackObj {
276  protected:
277   // common
278   frame        _frame;
279   JavaThread*  _thread;
280   RegisterMap  _reg_map;
281   enum { interpreted_mode, compiled_mode, at_end_mode } _mode;
282 
283   // For compiled_mode
284   int _decode_offset;
285   int _sender_decode_offset;
286   int _vframe_id;
287 
288   // Cached information
289   Method* _method;
290   int       _bci;
< prev index next >