< prev index next >

src/hotspot/share/code/nmethod.hpp

Print this page




  73 
  74   // Determines whether this nmethod is unloaded when the
  75   // referent in _jvmci_installed_code is cleared. This
  76   // will be false if the referent is initialized to a
  77   // HotSpotNMethod object whose isDefault field is true.
  78   // That is, installed code other than a "default"
  79   // HotSpotNMethod causes nmethod unloading.
  80   // This field is ignored once _jvmci_installed_code is NULL.
  81   bool _jvmci_installed_code_triggers_invalidation;
  82 #endif
  83 
  84   // To support simple linked-list chaining of nmethods:
  85   nmethod*  _osr_link;         // from InstanceKlass::osr_nmethods_head
  86 
  87   static nmethod* volatile _oops_do_mark_nmethods;
  88   nmethod*        volatile _oops_do_mark_link;
  89 
  90   // offsets for entry points
  91   address _entry_point;                      // entry point with class check
  92   address _verified_entry_point;             // entry point without class check

  93   address _osr_entry_point;                  // entry point for on stack replacement
  94 
  95   // Offsets for different nmethod parts
  96   int  _exception_offset;
  97   // Offset of the unwind handler if it exists
  98   int _unwind_handler_offset;
  99 
 100   int _consts_offset;
 101   int _stub_offset;
 102   int _oops_offset;                       // offset to where embedded oop table begins (inside data)
 103   int _metadata_offset;                   // embedded meta data table
 104   int _scopes_data_offset;
 105   int _scopes_pcs_offset;
 106   int _dependencies_offset;
 107   int _handler_table_offset;
 108   int _nul_chk_table_offset;
 109   int _nmethod_end_offset;
 110 
 111   int code_offset() const { return (address) code_begin() - header_begin(); }
 112 


 300   int dependencies_size () const                  { return            dependencies_end () -            dependencies_begin (); }
 301 
 302   int     oops_count() const { assert(oops_size() % oopSize == 0, "");  return (oops_size() / oopSize) + 1; }
 303   int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
 304 
 305   int total_size        () const;
 306 
 307   void dec_hotness_counter()        { _hotness_counter--; }
 308   void set_hotness_counter(int val) { _hotness_counter = val; }
 309   int  hotness_counter() const      { return _hotness_counter; }
 310 
 311   // Containment
 312   bool oops_contains         (oop*    addr) const { return oops_begin         () <= addr && addr < oops_end         (); }
 313   bool metadata_contains     (Metadata** addr) const   { return metadata_begin     () <= addr && addr < metadata_end     (); }
 314   bool scopes_data_contains  (address addr) const { return scopes_data_begin  () <= addr && addr < scopes_data_end  (); }
 315   bool scopes_pcs_contains   (PcDesc* addr) const { return scopes_pcs_begin   () <= addr && addr < scopes_pcs_end   (); }
 316 
 317   // entry points
 318   address entry_point() const                     { return _entry_point;             } // normal entry point
 319   address verified_entry_point() const            { return _verified_entry_point;    } // if klass is correct

 320 
 321   // flag accessing and manipulation
 322   bool  is_not_installed() const                  { return _state == not_installed; }
 323   bool  is_in_use() const                         { return _state <= in_use; }
 324   bool  is_alive() const                          { return _state < zombie; }
 325   bool  is_not_entrant() const                    { return _state == not_entrant; }
 326   bool  is_zombie() const                         { return _state == zombie; }
 327   bool  is_unloaded() const                       { return _state == unloaded; }
 328 
 329   void clear_unloading_state();
 330   virtual bool is_unloading();
 331   virtual void do_unloading(bool unloading_occurred);
 332 
 333 #if INCLUDE_RTM_OPT
 334   // rtm state accessing and manipulating
 335   RTMState  rtm_state() const                     { return _rtm_state; }
 336   void set_rtm_state(RTMState state)              { _rtm_state = state; }
 337 #endif
 338 
 339   void make_in_use()                              { _state = in_use; }




  73 
  74   // Determines whether this nmethod is unloaded when the
  75   // referent in _jvmci_installed_code is cleared. This
  76   // will be false if the referent is initialized to a
  77   // HotSpotNMethod object whose isDefault field is true.
  78   // That is, installed code other than a "default"
  79   // HotSpotNMethod causes nmethod unloading.
  80   // This field is ignored once _jvmci_installed_code is NULL.
  81   bool _jvmci_installed_code_triggers_invalidation;
  82 #endif
  83 
  84   // To support simple linked-list chaining of nmethods:
  85   nmethod*  _osr_link;         // from InstanceKlass::osr_nmethods_head
  86 
  87   static nmethod* volatile _oops_do_mark_nmethods;
  88   nmethod*        volatile _oops_do_mark_link;
  89 
  90   // offsets for entry points
  91   address _entry_point;                      // entry point with class check
  92   address _verified_entry_point;             // entry point without class check
  93   address _verified_value_entry_point;       // value type entry point without class check
  94   address _osr_entry_point;                  // entry point for on stack replacement
  95 
  96   // Offsets for different nmethod parts
  97   int  _exception_offset;
  98   // Offset of the unwind handler if it exists
  99   int _unwind_handler_offset;
 100 
 101   int _consts_offset;
 102   int _stub_offset;
 103   int _oops_offset;                       // offset to where embedded oop table begins (inside data)
 104   int _metadata_offset;                   // embedded meta data table
 105   int _scopes_data_offset;
 106   int _scopes_pcs_offset;
 107   int _dependencies_offset;
 108   int _handler_table_offset;
 109   int _nul_chk_table_offset;
 110   int _nmethod_end_offset;
 111 
 112   int code_offset() const { return (address) code_begin() - header_begin(); }
 113 


 301   int dependencies_size () const                  { return            dependencies_end () -            dependencies_begin (); }
 302 
 303   int     oops_count() const { assert(oops_size() % oopSize == 0, "");  return (oops_size() / oopSize) + 1; }
 304   int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
 305 
 306   int total_size        () const;
 307 
 308   void dec_hotness_counter()        { _hotness_counter--; }
 309   void set_hotness_counter(int val) { _hotness_counter = val; }
 310   int  hotness_counter() const      { return _hotness_counter; }
 311 
 312   // Containment
 313   bool oops_contains         (oop*    addr) const { return oops_begin         () <= addr && addr < oops_end         (); }
 314   bool metadata_contains     (Metadata** addr) const   { return metadata_begin     () <= addr && addr < metadata_end     (); }
 315   bool scopes_data_contains  (address addr) const { return scopes_data_begin  () <= addr && addr < scopes_data_end  (); }
 316   bool scopes_pcs_contains   (PcDesc* addr) const { return scopes_pcs_begin   () <= addr && addr < scopes_pcs_end   (); }
 317 
 318   // entry points
 319   address entry_point() const                     { return _entry_point;             } // normal entry point
 320   address verified_entry_point() const            { return _verified_entry_point;    } // if klass is correct
 321   address verified_value_entry_point() const      { return _verified_value_entry_point; } // pass value type args as oops
 322 
 323   // flag accessing and manipulation
 324   bool  is_not_installed() const                  { return _state == not_installed; }
 325   bool  is_in_use() const                         { return _state <= in_use; }
 326   bool  is_alive() const                          { return _state < zombie; }
 327   bool  is_not_entrant() const                    { return _state == not_entrant; }
 328   bool  is_zombie() const                         { return _state == zombie; }
 329   bool  is_unloaded() const                       { return _state == unloaded; }
 330 
 331   void clear_unloading_state();
 332   virtual bool is_unloading();
 333   virtual void do_unloading(bool unloading_occurred);
 334 
 335 #if INCLUDE_RTM_OPT
 336   // rtm state accessing and manipulating
 337   RTMState  rtm_state() const                     { return _rtm_state; }
 338   void set_rtm_state(RTMState state)              { _rtm_state = state; }
 339 #endif
 340 
 341   void make_in_use()                              { _state = in_use; }


< prev index next >