< prev index next >

src/hotspot/share/runtime/sharedRuntime.hpp

Print this page
@@ -36,10 +36,11 @@
  #include "utilities/macros.hpp"
  
  class AdapterHandlerEntry;
  class AdapterFingerPrint;
  class vframeStream;
+ class MetaspaceClosure;
  
  // Runtime is the base class for various runtime interfaces
  // (InterpreterRuntime, CompilerRuntime, etc.). It provides
  // shared functionality such as exception forwarding (C++ to
  // Java exceptions), locking/unlocking mechanisms, statistical

@@ -286,19 +287,40 @@
      assert(_cont_doYield_stub != nullptr, "oops");
      return _cont_doYield_stub;
    }
  
    // Implicit exceptions
-   static address throw_AbstractMethodError_entry()          { return _throw_AbstractMethodError_blob->entry_point(); }
-   static address throw_IncompatibleClassChangeError_entry() { return _throw_IncompatibleClassChangeError_blob->entry_point(); }
-   static address throw_NullPointerException_at_call_entry() { return _throw_NullPointerException_at_call_blob->entry_point(); }
-   static address throw_StackOverflowError_entry()           { return _throw_StackOverflowError_blob->entry_point(); }
-   static address throw_delayed_StackOverflowError_entry()   { return _throw_delayed_StackOverflowError_blob->entry_point(); }
+   static address throw_AbstractMethodError_entry()          {
+     assert(_throw_AbstractMethodError_blob != nullptr, "");
+     return _throw_AbstractMethodError_blob->entry_point();
+   }
+   static address throw_IncompatibleClassChangeError_entry() {
+     assert(_throw_IncompatibleClassChangeError_blob != nullptr, "");
+     return  _throw_IncompatibleClassChangeError_blob->entry_point();
+   }
+   static address throw_NullPointerException_at_call_entry() {
+     assert(_throw_NullPointerException_at_call_blob != nullptr, "");
+     return  _throw_NullPointerException_at_call_blob->entry_point();
+   }
+   static address throw_StackOverflowError_entry()           {
+     assert(_throw_StackOverflowError_blob != nullptr, "");
+     return _throw_StackOverflowError_blob->entry_point();
+   }
+   static address throw_delayed_StackOverflowError_entry()   {
+     assert(_throw_delayed_StackOverflowError_blob != nullptr, "");
+     return _throw_delayed_StackOverflowError_blob->entry_point();
+   }
  
  #if INCLUDE_JFR
-   static address jfr_write_checkpoint() { return _jfr_write_checkpoint_blob->entry_point(); }
-   static address jfr_return_lease()     { return _jfr_return_lease_blob->entry_point(); }
+   static address jfr_write_checkpoint() {
+     assert(_jfr_write_checkpoint_blob != nullptr, "");
+     return _jfr_write_checkpoint_blob->entry_point();
+   }
+   static address jfr_return_lease()     {
+     assert(_jfr_return_lease_blob != nullptr, "");
+     return _jfr_return_lease_blob->entry_point();
+   }
  #endif
  
    // Counters
  #ifndef PRODUCT
    static address nof_megamorphic_calls_addr() { return (address)&_nof_megamorphic_calls; }

@@ -566,10 +588,25 @@
    static address handle_wrong_method_abstract(JavaThread* current);
    static address handle_wrong_method_ic_miss(JavaThread* current);
  
    static address handle_unsafe_access(JavaThread* thread, address next_pc);
  
+  private:
+   static PerfTickCounters* _perf_resolve_opt_virtual_total_time;
+   static PerfTickCounters* _perf_resolve_virtual_total_time;
+   static PerfTickCounters* _perf_resolve_static_total_time;
+   static PerfTickCounters* _perf_handle_wrong_method_total_time;
+   static PerfTickCounters* _perf_ic_miss_total_time;
+  public:
+   static uint _ic_miss_ctr;                      // total # of IC misses
+   static uint _wrong_method_ctr;
+   static uint _resolve_static_ctr;
+   static uint _resolve_virtual_ctr;
+   static uint _resolve_opt_virtual_ctr;
+ 
+   static void print_counters_on(outputStream* st);
+ 
  #ifndef PRODUCT
  
    // Collect and print inline cache miss statistics
   private:
    enum { maxICmiss_count = 100 };

@@ -577,15 +614,10 @@
    static int     _ICmiss_count[maxICmiss_count]; // miss counts
    static address _ICmiss_at[maxICmiss_count];    // miss addresses
    static void trace_ic_miss(address at);
  
   public:
-   static uint _ic_miss_ctr;                      // total # of IC misses
-   static uint _wrong_method_ctr;
-   static uint _resolve_static_ctr;
-   static uint _resolve_virtual_ctr;
-   static uint _resolve_opt_virtual_ctr;
    static uint _implicit_null_throws;
    static uint _implicit_div0_throws;
  
    static uint _jbyte_array_copy_ctr;       // Slow-path byte array copy
    static uint _jshort_array_copy_ctr;      // Slow-path short array copy

@@ -625,13 +657,13 @@
    static address nof_inlined_calls_addr()               { return (address)&_nof_inlined_calls; }
    static address nof_static_calls_addr()                { return (address)&_nof_static_calls; }
    static address nof_inlined_static_calls_addr()        { return (address)&_nof_inlined_static_calls; }
    static address nof_interface_calls_addr()             { return (address)&_nof_interface_calls; }
    static address nof_inlined_interface_calls_addr()     { return (address)&_nof_inlined_interface_calls; }
-   static void print_call_statistics(uint64_t comp_total);
-   static void print_ic_miss_histogram();
  
+   static void print_call_statistics_on(outputStream* st);
+   static void print_ic_miss_histogram_on(outputStream* st);
  #endif // PRODUCT
  
    static void print_statistics() PRODUCT_RETURN;
  };
  

@@ -709,10 +741,11 @@
  
    // Allocate on CHeap instead of metaspace (see JDK-8331086).
    // Dummy argument is used to avoid C++ warning about using
    // deleted opearator MetaspaceObj::delete().
    void* operator new(size_t size, size_t dummy) throw() {
+     assert(size == BytesPerWord * heap_word_size(sizeof(AdapterHandlerEntry)), "should match");
      void* p = AllocateHeap(size, mtCode);
      memset(p, 0, size);
      return p;
    }
  

@@ -817,11 +850,11 @@
    static void print_handler_on(outputStream* st, const CodeBlob* b);
    static bool contains(const CodeBlob* b);
    static const char* name(AdapterFingerPrint* fingerprint);
    static uint32_t id(AdapterFingerPrint* fingerprint);
  #ifndef PRODUCT
-   static void print_statistics();
+   static void print_statistics_on(outputStream* st);
  #endif // PRODUCT
  
    static bool is_abstract_method_adapter(AdapterHandlerEntry* adapter);
  
    static AdapterBlob* link_aot_adapter_handler(AdapterHandlerEntry* handler) NOT_CDS_RETURN_(nullptr);
< prev index next >