hotspot/src/share/vm/code/nmethod.hpp
changeset 36802 18b1db5a7e70
parent 36300 5b47f168b948
child 36818 b40330c06dea
equal deleted inserted replaced
36800:37014ee7264c 36802:18b1db5a7e70
   205   unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes?
   205   unsigned int _has_method_handle_invokes:1; // Has this method MethodHandle invokes?
   206   unsigned int _lazy_critical_native:1;      // Lazy JNI critical native
   206   unsigned int _lazy_critical_native:1;      // Lazy JNI critical native
   207   unsigned int _has_wide_vectors:1;          // Preserve wide vectors at safepoints
   207   unsigned int _has_wide_vectors:1;          // Preserve wide vectors at safepoints
   208 
   208 
   209   // Protected by Patching_lock
   209   // Protected by Patching_lock
   210   volatile unsigned char _state;             // {alive, not_entrant, zombie, unloaded}
   210   volatile unsigned char _state;             // {in_use, not_entrant, zombie, unloaded}
   211 
   211 
   212   volatile unsigned char _unloading_clock;   // Incremented after GC unloaded/cleaned the nmethod
   212   volatile unsigned char _unloading_clock;   // Incremented after GC unloaded/cleaned the nmethod
   213 
   213 
   214 #ifdef ASSERT
   214 #ifdef ASSERT
   215   bool _oops_are_stale;  // indicates that it's no longer safe to access oops section
   215   bool _oops_are_stale;  // indicates that it's no longer safe to access oops section
   436   // flag accessing and manipulation
   436   // flag accessing and manipulation
   437   bool  is_in_use() const                         { return _state == in_use; }
   437   bool  is_in_use() const                         { return _state == in_use; }
   438   bool  is_alive() const                          { return _state == in_use || _state == not_entrant; }
   438   bool  is_alive() const                          { return _state == in_use || _state == not_entrant; }
   439   bool  is_not_entrant() const                    { return _state == not_entrant; }
   439   bool  is_not_entrant() const                    { return _state == not_entrant; }
   440   bool  is_zombie() const                         { return _state == zombie; }
   440   bool  is_zombie() const                         { return _state == zombie; }
   441   bool  is_unloaded() const                       { return _state == unloaded;   }
   441   bool  is_unloaded() const                       { return _state == unloaded; }
       
   442 
       
   443   // returns a string version of the nmethod state
       
   444   const char* state() const {
       
   445     switch(_state) {
       
   446       case in_use:      return "in use";
       
   447       case not_entrant: return "not_entrant";
       
   448       case zombie:      return "zombie";
       
   449       case unloaded:    return "unloaded";
       
   450       default:
       
   451         fatal("unexpected nmethod state: %d", _state);
       
   452         return NULL;
       
   453     }
       
   454   }
   442 
   455 
   443 #if INCLUDE_RTM_OPT
   456 #if INCLUDE_RTM_OPT
   444   // rtm state accessing and manipulating
   457   // rtm state accessing and manipulating
   445   RTMState  rtm_state() const                     { return _rtm_state; }
   458   RTMState  rtm_state() const                     { return _rtm_state; }
   446   void set_rtm_state(RTMState state)              { _rtm_state = state; }
   459   void set_rtm_state(RTMState state)              { _rtm_state = state; }