< prev index next >

src/hotspot/share/code/nmethod.hpp

Print this page
*** 31,10 ***
--- 31,11 ---
  class DepChange;
  class DirectiveSet;
  class DebugInformationRecorder;
  class JvmtiThreadState;
  class OopIterateClosure;
+ class SCCEntry;
  
  // nmethods (native methods) are the compiled code versions of Java methods.
  //
  // An nmethod contains:
  //  - header                 (the nmethod structure)

*** 72,10 ***
--- 73,13 ---
  
   private:
  
    uint64_t  _gc_epoch;
  
+   // Profiling counter used to figure out the hottest nmethods to record into CDS
+   volatile uint64_t _method_profiling_count;
+ 
    // To support simple linked-list chaining of nmethods:
    nmethod*  _osr_link;         // from InstanceKlass::osr_nmethods_head
  
    // STW two-phase nmethod root processing helpers.
    //

*** 233,10 ***
--- 237,12 ---
    // RTM state at compile time. Used during deoptimization to decide
    // whether to restart collecting RTM locking abort statistic again.
    RTMState _rtm_state;
  #endif
  
+   SCCEntry* _scc_entry;
+ 
    // These are used for compiled synchronized native methods to
    // locate the owner and stack slot for the BasicLock. They are
    // needed because there is no debug information for compiled native
    // wrappers and the oop maps are insufficient to allow
    // frame::retrieve_receiver() to work. Currently they are expected

*** 255,10 ***
--- 261,12 ---
    bool _has_flushed_dependencies;      // Used for maintenance of dependencies (CodeCache_lock)
  
    // used by jvmti to track if an event has been posted for this nmethod.
    bool _load_reported;
  
+   bool _used; // has this nmethod ever been invoked?
+ 
    // Protected by CompiledMethod_lock
    volatile signed char _state;         // {not_installed, in_use, not_used, not_entrant}
  
    int _skipped_instructions_size;
  

*** 289,10 ***
--- 297,11 ---
            OopMapSet* oop_maps,
            ExceptionHandlerTable* handler_table,
            ImplicitExceptionTable* nul_chk_table,
            AbstractCompiler* compiler,
            CompLevel comp_level
+           , SCCEntry* scc_entry
  #if INCLUDE_JVMCI
            , char* speculations = nullptr,
            int speculations_len = 0,
            JVMCINMethodData* jvmci_data = nullptr
  #endif

*** 340,10 ***
--- 349,11 ---
                                OopMapSet* oop_maps,
                                ExceptionHandlerTable* handler_table,
                                ImplicitExceptionTable* nul_chk_table,
                                AbstractCompiler* compiler,
                                CompLevel comp_level
+                               , SCCEntry* scc_entry
  #if INCLUDE_JVMCI
                                , char* speculations = nullptr,
                                int speculations_len = 0,
                                JVMCINMethodData* jvmci_data = nullptr
  #endif

*** 442,10 ***
--- 452,13 ---
    virtual void do_unloading(bool unloading_occurred);
  
    bool is_unlinked() const                        { return _is_unlinked; }
    void set_is_unlinked()                          { assert(!_is_unlinked, "already unlinked"); _is_unlinked = true; }
  
+   void inc_method_profiling_count();
+   uint64_t method_profiling_count();
+ 
  #if INCLUDE_RTM_OPT
    // rtm state accessing and manipulating
    RTMState  rtm_state() const                     { return _rtm_state; }
    void set_rtm_state(RTMState state)              { _rtm_state = state; }
  #endif

*** 455,12 ***
    }
    // Make the nmethod non entrant. The nmethod will continue to be
    // alive.  It is used when an uncommon trap happens.  Returns true
    // if this thread changed the state of the nmethod or false if
    // another thread performed the transition.
!   bool  make_not_entrant();
!   bool  make_not_used()    { return make_not_entrant(); }
  
    int get_state() const {
      return _state;
    }
  
--- 468,12 ---
    }
    // Make the nmethod non entrant. The nmethod will continue to be
    // alive.  It is used when an uncommon trap happens.  Returns true
    // if this thread changed the state of the nmethod or false if
    // another thread performed the transition.
!   bool  make_not_entrant(bool make_not_entrant = true);
!   bool  make_not_used() { return make_not_entrant(false); }
  
    int get_state() const {
      return _state;
    }
  

*** 593,10 ***
--- 606,16 ---
    void copy_scopes_pcs(PcDesc* pcs, int count);
    void copy_scopes_data(address buffer, int size);
  
    int orig_pc_offset() { return _orig_pc_offset; }
  
+   SCCEntry* scc_entry() const { return _scc_entry; }
+   bool is_scc() const { return scc_entry() != nullptr; }
+ 
+   bool     used() const { return _used; }
+   void set_used()       { _used = true; }
+ 
    // Post successful compilation
    void post_compiled_method(CompileTask* task);
  
    // jvmti support:
    void post_compiled_method_load_event(JvmtiThreadState* state = nullptr);
< prev index next >