8198420: Remove unused extension point AllocationContextStats
authorsjohanss
Fri, 23 Feb 2018 09:38:33 +0100
changeset 49054 fa4c8865a4ff
parent 49053 0b61efd5a439
child 49055 7bc026a83546
8198420: Remove unused extension point AllocationContextStats Reviewed-by: ehelin, tschatzl
src/hotspot/share/gc/g1/g1AllocationContext.hpp
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
src/hotspot/share/gc/g1/g1CollectedHeap.hpp
src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp
src/hotspot/share/gc/g1/g1CollectedHeap_ext.cpp
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
src/hotspot/share/gc/shared/collectedHeap.hpp
src/hotspot/share/gc/shared/gcCause.cpp
src/hotspot/share/gc/shared/gcCause.hpp
src/hotspot/share/memory/universe.cpp
src/hotspot/share/memory/universe.hpp
src/hotspot/share/memory/universe.inline.hpp
src/hotspot/share/runtime/serviceThread.cpp
src/hotspot/share/services/allocationContextService.hpp
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java
--- a/src/hotspot/share/gc/g1/g1AllocationContext.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1AllocationContext.hpp	Fri Feb 23 09:38:33 2018 +0100
@@ -41,12 +41,4 @@
   }
 };
 
-class AllocationContextStats: public StackObj {
-public:
-  inline void clear() { }
-  inline void update(bool full_gc) { }
-  inline void update_after_mark() { }
-  inline bool available() { return false; }
-};
-
 #endif // SHARE_VM_GC_G1_G1ALLOCATIONCONTEXT_HPP
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Feb 23 09:38:33 2018 +0100
@@ -1995,7 +1995,6 @@
   switch (cause) {
     case GCCause::_java_lang_system_gc:                 return ExplicitGCInvokesConcurrent;
     case GCCause::_dcmd_gc_run:                         return ExplicitGCInvokesConcurrent;
-    case GCCause::_update_allocation_context_stats_inc: return true;
     case GCCause::_wb_conc_mark:                        return true;
     default :                                           return false;
   }
@@ -2548,8 +2547,6 @@
   resize_all_tlabs();
   g1_policy()->phase_times()->record_resize_tlab_time_ms((os::elapsedTime() - start) * 1000.0);
 
-  allocation_context_stats().update(full);
-
   MemoryService::track_memory_usage();
   // We have just completed a GC. Update the soft reference
   // policy with the new heap occupancy
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Fri Feb 23 09:38:33 2018 +0100
@@ -225,9 +225,6 @@
   // Class that handles archive allocation ranges.
   G1ArchiveAllocator* _archive_allocator;
 
-  // Statistics for each allocation context
-  AllocationContextStats _allocation_context_stats;
-
   // GC allocation statistics policy for survivors.
   G1EvacStats _survivor_evac_stats;
 
@@ -280,8 +277,7 @@
   // (b) cause == _g1_humongous_allocation
   // (c) cause == _java_lang_system_gc and +ExplicitGCInvokesConcurrent.
   // (d) cause == _dcmd_gc_run and +ExplicitGCInvokesConcurrent.
-  // (e) cause == _update_allocation_context_stats_inc
-  // (f) cause == _wb_conc_mark
+  // (e) cause == _wb_conc_mark
   bool should_do_concurrent_full_gc(GCCause::Cause cause);
 
   // indicates whether we are in young or mixed GC mode
@@ -583,8 +579,6 @@
   // Determines PLAB size for a given destination.
   inline size_t desired_plab_sz(InCSetState dest);
 
-  inline AllocationContextStats& allocation_context_stats();
-
   // Do anything common to GC's.
   void gc_prologue(bool full);
   void gc_epilogue(bool full);
@@ -1132,11 +1126,6 @@
   // "CollectedHeap" supports.
   virtual void collect(GCCause::Cause cause);
 
-  virtual bool copy_allocation_context_stats(const jint* contexts,
-                                             jlong* totals,
-                                             jbyte* accuracy,
-                                             jint len);
-
   // True iff an evacuation has failed in the most-recent collection.
   bool evacuation_failed() { return _evacuation_failed; }
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Fri Feb 23 09:38:33 2018 +0100
@@ -57,10 +57,6 @@
 
 // Inline functions for G1CollectedHeap
 
-inline AllocationContextStats& G1CollectedHeap::allocation_context_stats() {
-  return _allocation_context_stats;
-}
-
 // Return the region with the given index. It assumes the index is valid.
 inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm.at(index); }
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap_ext.cpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap_ext.cpp	Fri Feb 23 09:38:33 2018 +0100
@@ -30,13 +30,6 @@
 
 class STWGCTimer;
 
-bool G1CollectedHeap::copy_allocation_context_stats(const jint* contexts,
-                                                    jlong* totals,
-                                                    jbyte* accuracy,
-                                                    jint len) {
-  return false;
-}
-
 G1Policy* G1CollectedHeap::create_g1_policy(STWGCTimer* gc_timer) {
   return new G1DefaultPolicy(gc_timer);
 }
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Fri Feb 23 09:38:33 2018 +0100
@@ -1276,7 +1276,6 @@
   // We reclaimed old regions so we should calculate the sizes to make
   // sure we update the old gen/space data.
   g1h->g1mm()->update_sizes();
-  g1h->allocation_context_stats().update_after_mark();
 }
 
 void G1ConcurrentMark::complete_cleanup() {
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp	Fri Feb 23 09:38:33 2018 +0100
@@ -607,20 +607,6 @@
     return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt);
   }
 #endif
-
- public:
-  // Copy the current allocation context statistics for the specified contexts.
-  // For each context in contexts, set the corresponding entries in the totals
-  // and accuracy arrays to the current values held by the statistics.  Each
-  // array should be of length len.
-  // Returns true if there are more stats available.
-  virtual bool copy_allocation_context_stats(const jint* contexts,
-                                             jlong* totals,
-                                             jbyte* accuracy,
-                                             jint len) {
-    return false;
-  }
-
 };
 
 // Class to set and reset the GC cause for a CollectedHeap.
--- a/src/hotspot/share/gc/shared/gcCause.cpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/shared/gcCause.cpp	Fri Feb 23 09:38:33 2018 +0100
@@ -60,10 +60,6 @@
     case _wb_full_gc:
       return "WhiteBox Initiated Full GC";
 
-    case _update_allocation_context_stats_inc:
-    case _update_allocation_context_stats_full:
-      return "Update Allocation Context Stats";
-
     case _no_gc:
       return "No GC";
 
--- a/src/hotspot/share/gc/shared/gcCause.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/gc/shared/gcCause.hpp	Fri Feb 23 09:38:33 2018 +0100
@@ -52,8 +52,6 @@
     _wb_young_gc,
     _wb_conc_mark,
     _wb_full_gc,
-    _update_allocation_context_stats_inc,
-    _update_allocation_context_stats_full,
 
     /* implementation independent, but reserved for GC use */
     _no_gc,
--- a/src/hotspot/share/memory/universe.cpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/memory/universe.cpp	Fri Feb 23 09:38:33 2018 +0100
@@ -134,7 +134,6 @@
 oop Universe::_arithmetic_exception_instance          = NULL;
 oop Universe::_virtual_machine_error_instance         = NULL;
 oop Universe::_vm_exception                           = NULL;
-oop Universe::_allocation_context_notification_obj    = NULL;
 oop Universe::_reference_pending_list                 = NULL;
 
 Array<int>* Universe::_the_empty_int_array            = NULL;
@@ -213,7 +212,6 @@
   f->do_oop((oop*)&_main_thread_group);
   f->do_oop((oop*)&_system_thread_group);
   f->do_oop((oop*)&_vm_exception);
-  f->do_oop((oop*)&_allocation_context_notification_obj);
   f->do_oop((oop*)&_reference_pending_list);
   debug_only(f->do_oop((oop*)&_fullgc_alot_dummy_array);)
 }
--- a/src/hotspot/share/memory/universe.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/memory/universe.hpp	Fri Feb 23 09:38:33 2018 +0100
@@ -181,8 +181,6 @@
   // the vm thread.
   static oop          _vm_exception;
 
-  static oop          _allocation_context_notification_obj;
-
   // References waiting to be transferred to the ReferenceHandler
   static oop          _reference_pending_list;
 
@@ -334,9 +332,6 @@
   static oop          virtual_machine_error_instance() { return _virtual_machine_error_instance; }
   static oop          vm_exception()                  { return _vm_exception; }
 
-  static inline oop   allocation_context_notification_obj();
-  static inline void  set_allocation_context_notification_obj(oop obj);
-
   // Reference pending list manipulation.  Access is protected by
   // Heap_lock.  The getter, setter and predicate require the caller
   // owns the lock.  Swap is used by parallel non-concurrent reference
--- a/src/hotspot/share/memory/universe.inline.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/memory/universe.inline.hpp	Fri Feb 23 09:38:33 2018 +0100
@@ -41,12 +41,4 @@
   return type == T_DOUBLE || type == T_LONG;
 }
 
-inline oop Universe::allocation_context_notification_obj() {
-  return _allocation_context_notification_obj;
-}
-
-inline void Universe::set_allocation_context_notification_obj(oop obj) {
-  _allocation_context_notification_obj = obj;
-}
-
 #endif // SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP
--- a/src/hotspot/share/runtime/serviceThread.cpp	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/hotspot/share/runtime/serviceThread.cpp	Fri Feb 23 09:38:33 2018 +0100
@@ -29,7 +29,6 @@
 #include "runtime/mutexLocker.hpp"
 #include "runtime/os.hpp"
 #include "prims/jvmtiImpl.hpp"
-#include "services/allocationContextService.hpp"
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticFramework.hpp"
 #include "services/gcNotifier.hpp"
@@ -105,8 +104,7 @@
       while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) &&
              !(has_jvmti_events = JvmtiDeferredEventQueue::has_events()) &&
               !(has_gc_notification_event = GCNotifier::has_event()) &&
-              !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification()) &&
-             !(acs_notify = AllocationContextService::should_notify())) {
+              !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification())) {
         // wait until one of the sensors has pending requests, or there is a
         // pending JVMTI event or JMX GC notification to post
         Service_lock->wait(Mutex::_no_safepoint_check_flag);
@@ -132,10 +130,6 @@
     if(has_dcmd_notification_event) {
       DCmdFactory::send_notification(CHECK);
     }
-
-    if (acs_notify) {
-      AllocationContextService::notify(CHECK);
-    }
   }
 }
 
--- a/src/hotspot/share/services/allocationContextService.hpp	Thu Feb 22 14:16:18 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_SERVICES_ALLOCATION_CONTEXT_SERVICE_HPP
-#define SHARE_VM_SERVICES_ALLOCATION_CONTEXT_SERVICE_HPP
-
-#include "utilities/exceptions.hpp"
-
-class AllocationContextService: public AllStatic {
-public:
-  static inline bool should_notify();
-  static inline void notify(TRAPS);
-};
-
-bool AllocationContextService::should_notify() { return false; }
-void AllocationContextService::notify(TRAPS) { }
-
-#endif // SHARE_VM_SERVICES_ALLOCATION_CONTEXT_SERVICE_HPP
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java	Thu Feb 22 14:16:18 2018 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java	Fri Feb 23 09:38:33 2018 +0100
@@ -38,8 +38,6 @@
   _wb_young_gc ("WhiteBox Initiated Young GC"),
   _wb_conc_mark ("WhiteBox Initiated Concurrent Mark"),
   _wb_full_gc ("WhiteBox Initiated Full GC"),
-  _update_allocation_context_stats_inc ("Update Allocation Context Stats"),
-  _update_allocation_context_stats_full ("Update Allocation Context Stats"),
 
   _no_gc ("No GC"),
   _no_cause_specified ("Unknown GCCause"),