8222105: Add "use_" prefix to G1Policy::adaptive_young_list_length
authortschatzl
Mon, 08 Apr 2019 21:01:17 +0200
changeset 54466 58751415d5f8
parent 54465 c4f16445675a
child 54467 0c5d713cf43f
8222105: Add "use_" prefix to G1Policy::adaptive_young_list_length Summary: Improve naming of G1Policy::adaptive_young_list_length to improve readability. Reviewed-by: kbarrett
src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp
src/hotspot/share/gc/g1/g1Policy.cpp
src/hotspot/share/gc/g1/g1Policy.hpp
src/hotspot/share/gc/g1/g1YoungGenSizer.cpp
src/hotspot/share/gc/g1/g1YoungGenSizer.hpp
src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Mon Apr 08 20:37:52 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Mon Apr 08 21:01:17 2019 +0200
@@ -127,7 +127,7 @@
 }
 
 void G1ConcurrentMarkThread::delay_to_keep_mmu(G1Policy* g1_policy, bool remark) {
-  if (g1_policy->adaptive_young_list_length()) {
+  if (g1_policy->use_adaptive_young_list_length()) {
     jlong sleep_time_ms = mmu_sleep_time(g1_policy, remark);
     if (!_cm->has_aborted() && sleep_time_ms > 0) {
       os::sleep(this, sleep_time_ms, false);
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Mon Apr 08 20:37:52 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Mon Apr 08 21:01:17 2019 +0200
@@ -105,7 +105,7 @@
 
   assert(Heap_lock->owned_by_self(), "Locking discipline.");
 
-  if (!adaptive_young_list_length()) {
+  if (!use_adaptive_young_list_length()) {
     _young_list_fixed_length = _young_gen_sizer->min_desired_young_length();
   }
   _young_gen_sizer->adjust_max_new_size(_g1h->max_expandable_regions());
@@ -195,7 +195,7 @@
 
 uint G1Policy::calculate_young_list_desired_min_length(uint base_min_length) const {
   uint desired_min_length = 0;
-  if (adaptive_young_list_length()) {
+  if (use_adaptive_young_list_length()) {
     if (_analytics->num_alloc_rate_ms() > 3) {
       double now_sec = os::elapsedTime();
       double when_ms = _mmu_tracker->when_max_gc_sec(now_sec) * 1000.0;
@@ -252,7 +252,7 @@
   uint desired_max_length = calculate_young_list_desired_max_length();
 
   uint young_list_target_length = 0;
-  if (adaptive_young_list_length()) {
+  if (use_adaptive_young_list_length()) {
     if (collector_state()->in_young_only_phase()) {
       young_list_target_length =
                         calculate_young_list_target_length(rs_lengths,
@@ -304,7 +304,7 @@
                                                     uint base_min_length,
                                                     uint desired_min_length,
                                                     uint desired_max_length) const {
-  assert(adaptive_young_list_length(), "pre-condition");
+  assert(use_adaptive_young_list_length(), "pre-condition");
   assert(collector_state()->in_young_only_phase(), "only call this for young GCs");
 
   // In case some edge-condition makes the desired max length too small...
@@ -414,7 +414,7 @@
 }
 
 void G1Policy::revise_young_list_target_length_if_necessary(size_t rs_lengths) {
-  guarantee( adaptive_young_list_length(), "should not call this otherwise" );
+  guarantee(use_adaptive_young_list_length(), "should not call this otherwise" );
 
   if (rs_lengths > _rs_lengths_prediction) {
     // add 10% to avoid having to recalculate often
@@ -430,7 +430,7 @@
 }
 
 void G1Policy::update_rs_lengths_prediction(size_t prediction) {
-  if (collector_state()->in_young_only_phase() && adaptive_young_list_length()) {
+  if (collector_state()->in_young_only_phase() && use_adaptive_young_list_length()) {
     _rs_lengths_prediction = prediction;
   }
 }
@@ -910,8 +910,8 @@
   return young_list_length < young_list_max_length;
 }
 
-bool G1Policy::adaptive_young_list_length() const {
-  return _young_gen_sizer->adaptive_young_list_length();
+bool G1Policy::use_adaptive_young_list_length() const {
+  return _young_gen_sizer->use_adaptive_young_list_length();
 }
 
 size_t G1Policy::desired_survivor_size(uint max_regions) const {
@@ -1211,7 +1211,7 @@
   const uint min_old_cset_length = calc_min_old_cset_length();
   const uint max_old_cset_length = MAX2(min_old_cset_length, calc_max_old_cset_length());
   const uint max_optional_regions = max_old_cset_length - min_old_cset_length;
-  bool check_time_remaining = adaptive_young_list_length();
+  bool check_time_remaining = use_adaptive_young_list_length();
 
   uint candidate_idx = candidates->cur_idx();
 
--- a/src/hotspot/share/gc/g1/g1Policy.hpp	Mon Apr 08 20:37:52 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.hpp	Mon Apr 08 21:01:17 2019 +0200
@@ -399,7 +399,7 @@
     return _young_list_max_length;
   }
 
-  bool adaptive_young_list_length() const;
+  bool use_adaptive_young_list_length() const;
 
   void transfer_survivors_to_cset(const G1SurvivorRegions* survivors);
 
--- a/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp	Mon Apr 08 20:37:52 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp	Mon Apr 08 21:01:17 2019 +0200
@@ -30,14 +30,14 @@
 #include "logging/log.hpp"
 
 G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults),
-  _adaptive_size(true), _min_desired_young_length(0), _max_desired_young_length(0) {
+  _use_adaptive_sizing(true), _min_desired_young_length(0), _max_desired_young_length(0) {
 
   if (FLAG_IS_CMDLINE(NewRatio)) {
     if (FLAG_IS_CMDLINE(NewSize) || FLAG_IS_CMDLINE(MaxNewSize)) {
       log_warning(gc, ergo)("-XX:NewSize and -XX:MaxNewSize override -XX:NewRatio");
     } else {
       _sizer_kind = SizerNewRatio;
-      _adaptive_size = false;
+      _use_adaptive_sizing = false;
       return;
     }
   }
@@ -59,7 +59,7 @@
                              MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
                                   1U);
       _sizer_kind = SizerMaxAndNewSize;
-      _adaptive_size = _min_desired_young_length != _max_desired_young_length;
+      _use_adaptive_sizing = _min_desired_young_length != _max_desired_young_length;
     } else {
       _sizer_kind = SizerNewSizeOnly;
     }
--- a/src/hotspot/share/gc/g1/g1YoungGenSizer.hpp	Mon Apr 08 20:37:52 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1YoungGenSizer.hpp	Mon Apr 08 21:01:17 2019 +0200
@@ -77,7 +77,7 @@
 
   // False when using a fixed young generation size due to command-line options,
   // true otherwise.
-  bool _adaptive_size;
+  bool _use_adaptive_sizing;
 
   uint calculate_default_min_length(uint new_number_of_heap_regions);
   uint calculate_default_max_length(uint new_number_of_heap_regions);
@@ -104,8 +104,8 @@
     return _max_desired_young_length;
   }
 
-  bool adaptive_young_list_length() const {
-    return _adaptive_size;
+  bool use_adaptive_young_list_length() const {
+    return _use_adaptive_sizing;
   }
 
   static G1YoungGenSizer* create_gen_sizer(G1CollectorPolicy* policy);
--- a/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp	Mon Apr 08 20:37:52 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp	Mon Apr 08 21:01:17 2019 +0200
@@ -165,7 +165,7 @@
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
   G1Policy* policy = g1h->policy();
 
-  if (policy->adaptive_young_list_length()) {
+  if (policy->use_adaptive_young_list_length()) {
     G1YoungRemSetSamplingClosure cl(&sts);
 
     G1CollectionSet* g1cs = g1h->collection_set();