< prev index next >

src/hotspot/share/runtime/vframe.hpp

Print this page
rev 60253 : imported patch 8249192-coleenp-review


  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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/frame.hpp"
  33 #include "runtime/stackValue.hpp"
  34 #include "runtime/stackValueCollection.hpp"
  35 #include "utilities/growableArray.hpp"
  36 


  37 // vframes are virtual stack frames representing source level activations.
  38 // A single frame may hold several source level activations in the case of
  39 // optimized code. The debugging stored with the optimized code enables
  40 // us to unfold a frame as a stack of vframes.
  41 // A cVFrame represents an activation of a non-java method.
  42 
  43 // The vframe inheritance hierarchy:
  44 // - vframe
  45 //   - javaVFrame
  46 //     - interpretedVFrame
  47 //     - compiledVFrame     ; (used for both compiled Java methods and native stubs)
  48 //   - externalVFrame
  49 //     - entryVFrame        ; special frame created when calling Java from C
  50 
  51 // - BasicLock
  52 
  53 class vframe: public ResourceObj {
  54  protected:
  55   frame        _fr;      // Raw frame behind the virtual frame.
  56   RegisterMap  _reg_map; // Register map for the raw frame (used to handle callee-saved registers).


 216  public:
 217   bool is_entry_frame() const { return true; }
 218 
 219  protected:
 220   entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread);
 221 
 222  public:
 223   // casting
 224   static entryVFrame* cast(vframe* vf) {
 225     assert(vf == NULL || vf->is_entry_frame(), "must be entry frame");
 226     return (entryVFrame*) vf;
 227   }
 228 
 229 #ifndef PRODUCT
 230  public:
 231   // printing
 232   void print_value() const;
 233   void print();
 234 #endif
 235   friend class vframe;
 236 };
 237 
 238 
 239 // A MonitorInfo is a ResourceObject that describes a the pair:
 240 // 1) the owner of the monitor
 241 // 2) the monitor lock
 242 class MonitorInfo : public ResourceObj {
 243  private:
 244   oop        _owner; // the object owning the monitor
 245   BasicLock* _lock;
 246   oop        _owner_klass; // klass (mirror) if owner was scalar replaced
 247   bool       _eliminated;
 248   bool       _owner_is_scalar_replaced;
 249  public:
 250   // Constructor
 251   MonitorInfo(oop owner, BasicLock* lock, bool eliminated, bool owner_is_scalar_replaced) {
 252     if (!owner_is_scalar_replaced) {
 253       _owner = owner;
 254       _owner_klass = NULL;
 255     } else {
 256       assert(eliminated, "monitor should be eliminated for scalar replaced object");
 257       _owner = NULL;
 258       _owner_klass = owner;
 259     }
 260     _lock  = lock;
 261     _eliminated = eliminated;
 262     _owner_is_scalar_replaced = owner_is_scalar_replaced;
 263   }
 264   // Accessors
 265   oop        owner() const {
 266     assert(!_owner_is_scalar_replaced, "should not be called for scalar replaced object");
 267     return _owner;
 268   }
 269   oop   owner_klass() const {
 270     assert(_owner_is_scalar_replaced, "should not be called for not scalar replaced object");
 271     return _owner_klass;
 272   }
 273   BasicLock* lock()  const { return _lock;  }
 274   bool eliminated()  const { return _eliminated; }
 275   bool owner_is_scalar_replaced()  const { return _owner_is_scalar_replaced; }
 276 };
 277 
 278 class vframeStreamCommon : StackObj {
 279  protected:
 280   // common
 281   frame        _prev_frame;
 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;
 295 




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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 


< prev index next >