< prev index next >

src/hotspot/share/code/nmethod.hpp

Print this page
@@ -32,10 +32,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)

@@ -73,10 +74,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.
    //

@@ -235,10 +239,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

@@ -257,10 +263,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;
  

@@ -291,10 +299,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

@@ -342,10 +351,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

@@ -444,10 +454,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

@@ -457,12 +470,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(); }
+   bool  make_not_entrant(bool make_not_entrant = true);
+   bool  make_not_used() { return make_not_entrant(false); }
  
    int get_state() const {
      return _state;
    }
  

@@ -595,10 +608,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);

@@ -620,11 +639,11 @@
    void print(outputStream* st)          const;
    void print_code();
  
  #if defined(SUPPORT_DATA_STRUCTS)
    // print output in opt build for disassembler library
-   void print_relocations()                        PRODUCT_RETURN;
+   void print_relocations_on(outputStream* st)     PRODUCT_RETURN;
    void print_pcs_on(outputStream* st);
    void print_scopes() { print_scopes_on(tty); }
    void print_scopes_on(outputStream* st)          PRODUCT_RETURN;
    void print_value_on(outputStream* st) const;
    void print_handler_table();
< prev index next >