< 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 


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

 317 
 318   // flag accessing and manipulation
 319   bool  is_not_installed() const                  { return _state == not_installed; }
 320   bool  is_in_use() const                         { return _state <= in_use; }
 321   bool  is_alive() const                          { return _state < zombie; }
 322   bool  is_not_entrant() const                    { return _state == not_entrant; }
 323   bool  is_zombie() const                         { return _state == zombie; }
 324   bool  is_unloaded() const                       { return _state == unloaded; }
 325 
 326 #if INCLUDE_RTM_OPT
 327   // rtm state accessing and manipulating
 328   RTMState  rtm_state() const                     { return _rtm_state; }
 329   void set_rtm_state(RTMState state)              { _rtm_state = state; }
 330 #endif
 331 
 332   void make_in_use()                              { _state = in_use; }
 333   // Make the nmethod non entrant. The nmethod will continue to be
 334   // alive.  It is used when an uncommon trap happens.  Returns true
 335   // if this thread changed the state of the nmethod or false if
 336   // another thread performed the transition.




  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 


 298   int dependencies_size () const                  { return            dependencies_end () -            dependencies_begin (); }
 299 
 300   int     oops_count() const { assert(oops_size() % oopSize == 0, "");  return (oops_size() / oopSize) + 1; }
 301   int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
 302 
 303   int total_size        () const;
 304 
 305   void dec_hotness_counter()        { _hotness_counter--; }
 306   void set_hotness_counter(int val) { _hotness_counter = val; }
 307   int  hotness_counter() const      { return _hotness_counter; }
 308 
 309   // Containment
 310   bool oops_contains         (oop*    addr) const { return oops_begin         () <= addr && addr < oops_end         (); }
 311   bool metadata_contains     (Metadata** addr) const   { return metadata_begin     () <= addr && addr < metadata_end     (); }
 312   bool scopes_data_contains  (address addr) const { return scopes_data_begin  () <= addr && addr < scopes_data_end  (); }
 313   bool scopes_pcs_contains   (PcDesc* addr) const { return scopes_pcs_begin   () <= addr && addr < scopes_pcs_end   (); }
 314 
 315   // entry points
 316   address entry_point() const                     { return _entry_point;             } // normal entry point
 317   address verified_entry_point() const            { return _verified_entry_point;    } // if klass is correct
 318   address verified_value_entry_point() const      { return _verified_value_entry_point; } // pass value type args as oops
 319 
 320   // flag accessing and manipulation
 321   bool  is_not_installed() const                  { return _state == not_installed; }
 322   bool  is_in_use() const                         { return _state <= in_use; }
 323   bool  is_alive() const                          { return _state < zombie; }
 324   bool  is_not_entrant() const                    { return _state == not_entrant; }
 325   bool  is_zombie() const                         { return _state == zombie; }
 326   bool  is_unloaded() const                       { return _state == unloaded; }
 327 
 328 #if INCLUDE_RTM_OPT
 329   // rtm state accessing and manipulating
 330   RTMState  rtm_state() const                     { return _rtm_state; }
 331   void set_rtm_state(RTMState state)              { _rtm_state = state; }
 332 #endif
 333 
 334   void make_in_use()                              { _state = in_use; }
 335   // Make the nmethod non entrant. The nmethod will continue to be
 336   // alive.  It is used when an uncommon trap happens.  Returns true
 337   // if this thread changed the state of the nmethod or false if
 338   // another thread performed the transition.


< prev index next >