< prev index next >

src/hotspot/share/code/nmethod.hpp

Print this page
rev 56251 : imported patch 8226705-v1
rev 56252 : imported patch 8226705-v2


 102   int _speculations_offset;
 103   int _jvmci_data_offset;
 104 #endif
 105   int _nmethod_end_offset;
 106 
 107   int code_offset() const { return (address) code_begin() - header_begin(); }
 108 
 109   // location in frame (offset for sp) that deopt can store the original
 110   // pc during a deopt.
 111   int _orig_pc_offset;
 112 
 113   int _compile_id;                           // which compilation made this nmethod
 114   int _comp_level;                           // compilation level
 115 
 116   // protected by CodeCache_lock
 117   bool _has_flushed_dependencies;            // Used for maintenance of dependencies (CodeCache_lock)
 118 
 119   // used by jvmti to track if an unload event has been posted for this nmethod.
 120   bool _unload_reported;
 121 
 122   // Protected by Patching_lock
 123   volatile signed char _state;               // {not_installed, in_use, not_entrant, zombie, unloaded}
 124 
 125 #ifdef ASSERT
 126   bool _oops_are_stale;  // indicates that it's no longer safe to access oops section
 127 #endif
 128 
 129 #if INCLUDE_RTM_OPT
 130   // RTM state at compile time. Used during deoptimization to decide
 131   // whether to restart collecting RTM locking abort statistic again.
 132   RTMState _rtm_state;
 133 #endif
 134 
 135   // Nmethod Flushing lock. If non-zero, then the nmethod is not removed
 136   // and is not made into a zombie. However, once the nmethod is made into
 137   // a zombie, it will be locked one final time if CompiledMethodUnload
 138   // event processing needs to be done.
 139   volatile jint _lock_count;
 140 
 141   // not_entrant method removal. Each mark_sweep pass will update
 142   // this mark to current sweep invocation count if it is seen on the


 340   address verified_entry_point() const            { return _verified_entry_point;    } // if klass is correct
 341 
 342   // flag accessing and manipulation
 343   bool  is_not_installed() const                  { return _state == not_installed; }
 344   bool  is_in_use() const                         { return _state <= in_use; }
 345   bool  is_alive() const                          { return _state < unloaded; }
 346   bool  is_not_entrant() const                    { return _state == not_entrant; }
 347   bool  is_zombie() const                         { return _state == zombie; }
 348   bool  is_unloaded() const                       { return _state == unloaded; }
 349 
 350   void clear_unloading_state();
 351   virtual bool is_unloading();
 352   virtual void do_unloading(bool unloading_occurred);
 353 
 354 #if INCLUDE_RTM_OPT
 355   // rtm state accessing and manipulating
 356   RTMState  rtm_state() const                     { return _rtm_state; }
 357   void set_rtm_state(RTMState state)              { _rtm_state = state; }
 358 #endif
 359 
 360   void make_in_use()                              { _state = in_use; }


 361   // Make the nmethod non entrant. The nmethod will continue to be
 362   // alive.  It is used when an uncommon trap happens.  Returns true
 363   // if this thread changed the state of the nmethod or false if
 364   // another thread performed the transition.
 365   bool  make_not_entrant() {
 366     assert(!method()->is_method_handle_intrinsic(), "Cannot make MH intrinsic not entrant");
 367     return make_not_entrant_or_zombie(not_entrant);
 368   }
 369   bool  make_not_used()    { return make_not_entrant(); }
 370   bool  make_zombie()      { return make_not_entrant_or_zombie(zombie); }
 371 
 372   // used by jvmti to track if the unload event has been reported
 373   bool  unload_reported()                         { return _unload_reported; }
 374   void  set_unload_reported()                     { _unload_reported = true; }
 375 
 376   int get_state() const {
 377     return _state;
 378   }
 379 
 380   void  make_unloaded();
 381 
 382   bool has_dependencies()                         { return dependencies_size() != 0; }
 383   void print_dependencies()                       PRODUCT_RETURN;
 384   void flush_dependencies(bool delete_immediately);
 385   bool has_flushed_dependencies()                 { return _has_flushed_dependencies; }
 386   void set_has_flushed_dependencies()             {
 387     assert(!has_flushed_dependencies(), "should only happen once");
 388     _has_flushed_dependencies = 1;
 389   }
 390 
 391   int   comp_level() const                        { return _comp_level; }
 392 
 393   void unlink_from_method(bool acquire_lock);
 394 
 395   // Support for oops in scopes and relocs:
 396   // Note: index 0 is reserved for null.
 397   oop   oop_at(int index) const;
 398   oop   oop_at_phantom(int index) const; // phantom reference
 399   oop*  oop_addr_at(int index) const {  // for GC
 400     // relocation indexes are biased by 1 (because 0 is reserved)
 401     assert(index > 0 && index <= oops_count(), "must be a valid non-zero index");
 402     assert(!_oops_are_stale, "oops are stale");
 403     return &oops_begin()[index - 1];
 404   }
 405 
 406   // Support for meta data in scopes and relocs:
 407   // Note: index 0 is reserved for null.
 408   Metadata*     metadata_at(int index) const      { return index == 0 ? NULL: *metadata_addr_at(index); }
 409   Metadata**  metadata_addr_at(int index) const {  // for GC
 410     // relocation indexes are biased by 1 (because 0 is reserved)
 411     assert(index > 0 && index <= metadata_count(), "must be a valid non-zero index");
 412     return &metadata_begin()[index - 1];
 413   }




 102   int _speculations_offset;
 103   int _jvmci_data_offset;
 104 #endif
 105   int _nmethod_end_offset;
 106 
 107   int code_offset() const { return (address) code_begin() - header_begin(); }
 108 
 109   // location in frame (offset for sp) that deopt can store the original
 110   // pc during a deopt.
 111   int _orig_pc_offset;
 112 
 113   int _compile_id;                           // which compilation made this nmethod
 114   int _comp_level;                           // compilation level
 115 
 116   // protected by CodeCache_lock
 117   bool _has_flushed_dependencies;            // Used for maintenance of dependencies (CodeCache_lock)
 118 
 119   // used by jvmti to track if an unload event has been posted for this nmethod.
 120   bool _unload_reported;
 121 
 122   // Protected by CompiledMethod_lock
 123   volatile signed char _state;               // {not_installed, in_use, not_entrant, zombie, unloaded}
 124 
 125 #ifdef ASSERT
 126   bool _oops_are_stale;  // indicates that it's no longer safe to access oops section
 127 #endif
 128 
 129 #if INCLUDE_RTM_OPT
 130   // RTM state at compile time. Used during deoptimization to decide
 131   // whether to restart collecting RTM locking abort statistic again.
 132   RTMState _rtm_state;
 133 #endif
 134 
 135   // Nmethod Flushing lock. If non-zero, then the nmethod is not removed
 136   // and is not made into a zombie. However, once the nmethod is made into
 137   // a zombie, it will be locked one final time if CompiledMethodUnload
 138   // event processing needs to be done.
 139   volatile jint _lock_count;
 140 
 141   // not_entrant method removal. Each mark_sweep pass will update
 142   // this mark to current sweep invocation count if it is seen on the


 340   address verified_entry_point() const            { return _verified_entry_point;    } // if klass is correct
 341 
 342   // flag accessing and manipulation
 343   bool  is_not_installed() const                  { return _state == not_installed; }
 344   bool  is_in_use() const                         { return _state <= in_use; }
 345   bool  is_alive() const                          { return _state < unloaded; }
 346   bool  is_not_entrant() const                    { return _state == not_entrant; }
 347   bool  is_zombie() const                         { return _state == zombie; }
 348   bool  is_unloaded() const                       { return _state == unloaded; }
 349 
 350   void clear_unloading_state();
 351   virtual bool is_unloading();
 352   virtual void do_unloading(bool unloading_occurred);
 353 
 354 #if INCLUDE_RTM_OPT
 355   // rtm state accessing and manipulating
 356   RTMState  rtm_state() const                     { return _rtm_state; }
 357   void set_rtm_state(RTMState state)              { _rtm_state = state; }
 358 #endif
 359 
 360   bool make_in_use() {
 361     return try_transition(in_use);
 362   }
 363   // Make the nmethod non entrant. The nmethod will continue to be
 364   // alive.  It is used when an uncommon trap happens.  Returns true
 365   // if this thread changed the state of the nmethod or false if
 366   // another thread performed the transition.
 367   bool  make_not_entrant() {
 368     assert(!method()->is_method_handle_intrinsic(), "Cannot make MH intrinsic not entrant");
 369     return make_not_entrant_or_zombie(not_entrant);
 370   }
 371   bool  make_not_used()    { return make_not_entrant(); }
 372   bool  make_zombie()      { return make_not_entrant_or_zombie(zombie); }
 373 
 374   // used by jvmti to track if the unload event has been reported
 375   bool  unload_reported()                         { return _unload_reported; }
 376   void  set_unload_reported()                     { _unload_reported = true; }
 377 
 378   int get_state() const {
 379     return _state;
 380   }
 381 
 382   void  make_unloaded();
 383 
 384   bool has_dependencies()                         { return dependencies_size() != 0; }
 385   void print_dependencies()                       PRODUCT_RETURN;
 386   void flush_dependencies(bool delete_immediately);
 387   bool has_flushed_dependencies()                 { return _has_flushed_dependencies; }
 388   void set_has_flushed_dependencies()             {
 389     assert(!has_flushed_dependencies(), "should only happen once");
 390     _has_flushed_dependencies = 1;
 391   }
 392 
 393   int   comp_level() const                        { return _comp_level; }
 394 
 395   void unlink_from_method();
 396 
 397   // Support for oops in scopes and relocs:
 398   // Note: index 0 is reserved for null.
 399   oop   oop_at(int index) const;
 400   oop   oop_at_phantom(int index) const; // phantom reference
 401   oop*  oop_addr_at(int index) const {  // for GC
 402     // relocation indexes are biased by 1 (because 0 is reserved)
 403     assert(index > 0 && index <= oops_count(), "must be a valid non-zero index");
 404     assert(!_oops_are_stale, "oops are stale");
 405     return &oops_begin()[index - 1];
 406   }
 407 
 408   // Support for meta data in scopes and relocs:
 409   // Note: index 0 is reserved for null.
 410   Metadata*     metadata_at(int index) const      { return index == 0 ? NULL: *metadata_addr_at(index); }
 411   Metadata**  metadata_addr_at(int index) const {  // for GC
 412     // relocation indexes are biased by 1 (because 0 is reserved)
 413     assert(index > 0 && index <= metadata_count(), "must be a valid non-zero index");
 414     return &metadata_begin()[index - 1];
 415   }


< prev index next >