changeset 46258:d26ebd7e2f10

8142749: HeapRegion::_predicted_bytes_to_copy is unused and can be removed Reviewed-by: tschatzl, drwhite Contributed-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
author fzhinkin
date Mon, 30 May 2016 14:42:50 +0300
parents 3e95288ce4ca
children 73749cb53dc0 5de61384fba6
files hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp hotspot/src/share/vm/gc/g1/heapRegion.cpp hotspot/src/share/vm/gc/g1/heapRegion.hpp
diffstat 3 files changed, 10 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp	Wed Feb 01 17:56:22 2017 -0500
+++ b/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp	Mon May 30 14:42:50 2016 +0300
@@ -216,14 +216,14 @@
   }
 
   bool doHeapRegion(HeapRegion *hr) {
-    bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
-    bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
-
     assert(!hr->is_pinned(), "Unexpected pinned region at index %u", hr->hrm_index());
     assert(hr->in_collection_set(), "bad CS");
 
     if (_hrclaimer->claim_region(hr->hrm_index())) {
       if (hr->evacuation_failed()) {
+        bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
+        bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
+
         hr->note_self_forwarding_removal_start(during_initial_mark,
                                                during_conc_mark);
         _g1h->verifier()->check_bitmaps("Self-Forwarding Ptr Removal", hr);
@@ -234,9 +234,7 @@
 
         hr->rem_set()->clean_strong_code_roots(hr);
 
-        hr->note_self_forwarding_removal_end(during_initial_mark,
-                                             during_conc_mark,
-                                             live_bytes);
+        hr->note_self_forwarding_removal_end(live_bytes);
       }
     }
     return false;
--- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp	Wed Feb 01 17:56:22 2017 -0500
+++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp	Mon May 30 14:42:50 2016 +0300
@@ -290,8 +290,7 @@
     _containing_set(NULL),
 #endif // ASSERT
      _young_index_in_cset(-1), _surv_rate_group(NULL), _age_index(-1),
-    _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0),
-    _predicted_bytes_to_copy(0)
+    _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
 {
   _rem_set = new HeapRegionRemSet(bot, this);
 
@@ -343,9 +342,7 @@
   }
 }
 
-void HeapRegion::note_self_forwarding_removal_end(bool during_initial_mark,
-                                                  bool during_conc_mark,
-                                                  size_t marked_bytes) {
+void HeapRegion::note_self_forwarding_removal_end(size_t marked_bytes) {
   assert(marked_bytes <= used(),
          "marked: " SIZE_FORMAT " used: " SIZE_FORMAT, marked_bytes, used());
   _prev_top_at_mark_start = top();
@@ -483,7 +480,6 @@
 
 class VerifyStrongCodeRootOopClosure: public OopClosure {
   const HeapRegion* _hr;
-  nmethod* _nm;
   bool _failures;
   bool _has_oops_in_region;
 
@@ -510,7 +506,7 @@
   }
 
 public:
-  VerifyStrongCodeRootOopClosure(const HeapRegion* hr, nmethod* nm):
+  VerifyStrongCodeRootOopClosure(const HeapRegion* hr):
     _hr(hr), _failures(false), _has_oops_in_region(false) {}
 
   void do_oop(narrowOop* p) { do_oop_work(p); }
@@ -536,7 +532,7 @@
                               p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
         _failures = true;
       } else {
-        VerifyStrongCodeRootOopClosure oop_cl(_hr, nm);
+        VerifyStrongCodeRootOopClosure oop_cl(_hr);
         nm->oops_do(&oop_cl);
         if (!oop_cl.has_oops_in_region()) {
           log_error(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " PTR_FORMAT " in its strong code roots with no pointers into region",
@@ -728,7 +724,6 @@
     Log(gc, verify) log;
     if (!oopDesc::is_null(heap_oop)) {
       oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
-      bool failed = false;
       HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
       HeapRegion* to = _g1h->heap_region_containing(obj);
       if (from != NULL && to != NULL &&
@@ -763,7 +758,7 @@
           log.error("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field);
           log.error("----------");
           _failures = true;
-          if (!failed) _n_failures++;
+          _n_failures++;
         }
       }
     }
--- a/hotspot/src/share/vm/gc/g1/heapRegion.hpp	Wed Feb 01 17:56:22 2017 -0500
+++ b/hotspot/src/share/vm/gc/g1/heapRegion.hpp	Mon May 30 14:42:50 2016 +0300
@@ -311,10 +311,6 @@
   // for the collection set.
   double _predicted_elapsed_time_ms;
 
-  // The predicted number of bytes to copy that was added to
-  // the total value for the collection set.
-  size_t _predicted_bytes_to_copy;
-
  public:
   HeapRegion(uint hrm_index,
              G1BlockOffsetTable* bot,
@@ -554,9 +550,7 @@
 
   // Notify the region that we have finished processing self-forwarded
   // objects during evac failure handling.
-  void note_self_forwarding_removal_end(bool during_initial_mark,
-                                        bool during_conc_mark,
-                                        size_t marked_bytes);
+  void note_self_forwarding_removal_end(size_t marked_bytes);
 
   // Returns "false" iff no object in the region was allocated when the
   // last mark phase ended.
@@ -671,7 +665,6 @@
 
   size_t recorded_rs_length() const        { return _recorded_rs_length; }
   double predicted_elapsed_time_ms() const { return _predicted_elapsed_time_ms; }
-  size_t predicted_bytes_to_copy() const   { return _predicted_bytes_to_copy; }
 
   void set_recorded_rs_length(size_t rs_length) {
     _recorded_rs_length = rs_length;
@@ -681,10 +674,6 @@
     _predicted_elapsed_time_ms = ms;
   }
 
-  void set_predicted_bytes_to_copy(size_t bytes) {
-    _predicted_bytes_to_copy = bytes;
-  }
-
   virtual CompactibleSpace* next_compaction_space() const;
 
   virtual void reset_after_compaction();