8183124: Remove OopsInHeapRegionClosure
authorehelin
Wed, 28 Jun 2017 14:38:10 +0200
changeset 46590 cd27cb97655c
parent 46589 f1c04490ded1
child 46599 4e41e385eaed
8183124: Remove OopsInHeapRegionClosure Reviewed-by: sjohanss, tschatzl
hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp
hotspot/src/share/vm/gc/g1/g1OopClosures.cpp
hotspot/src/share/vm/gc/g1/g1OopClosures.hpp
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Wed Jun 28 19:12:58 2017 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Wed Jun 28 14:38:10 2017 +0200
@@ -60,7 +60,6 @@
 class HeapRegion;
 class HRRSCleanupTask;
 class GenerationSpec;
-class OopsInHeapRegionClosure;
 class G1ParScanThreadState;
 class G1ParScanThreadStateSet;
 class G1KlassScanClosure;
--- a/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp	Wed Jun 28 19:12:58 2017 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp	Wed Jun 28 14:38:10 2017 +0200
@@ -35,15 +35,16 @@
 #include "gc/g1/heapRegionRemSet.hpp"
 #include "gc/shared/preservedMarks.inline.hpp"
 
-class UpdateRSetDeferred : public OopsInHeapRegionClosure {
+class UpdateRSetDeferred : public ExtendedOopClosure {
 private:
   G1CollectedHeap* _g1;
   DirtyCardQueue *_dcq;
   G1SATBCardTableModRefBS* _ct_bs;
+  HeapRegion* _from;
 
 public:
   UpdateRSetDeferred(DirtyCardQueue* dcq) :
-    _g1(G1CollectedHeap::heap()), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
+    _g1(G1CollectedHeap::heap()), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq), _from(NULL) {}
 
   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
   virtual void do_oop(      oop* p) { do_oop_work(p); }
@@ -58,6 +59,8 @@
       }
     }
   }
+
+  void set_region(HeapRegion* from) { _from = from; }
 };
 
 class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
@@ -66,14 +69,14 @@
   G1ConcurrentMark* _cm;
   HeapRegion* _hr;
   size_t _marked_bytes;
-  OopsInHeapRegionClosure *_update_rset_cl;
+  UpdateRSetDeferred* _update_rset_cl;
   bool _during_initial_mark;
   uint _worker_id;
   HeapWord* _last_forwarded_object_end;
 
 public:
   RemoveSelfForwardPtrObjClosure(HeapRegion* hr,
-                                 OopsInHeapRegionClosure* update_rset_cl,
+                                 UpdateRSetDeferred* update_rset_cl,
                                  bool during_initial_mark,
                                  uint worker_id) :
     _g1(G1CollectedHeap::heap()),
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp	Wed Jun 28 19:12:58 2017 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp	Wed Jun 28 14:38:10 2017 +0200
@@ -39,7 +39,7 @@
 { }
 
 G1ScanClosureBase::G1ScanClosureBase(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) :
-  _g1(g1), _par_scan_state(par_scan_state)
+  _g1(g1), _par_scan_state(par_scan_state), _from(NULL)
 { }
 
 void G1KlassScanClosure::do_klass(Klass* klass) {
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Wed Jun 28 19:12:58 2017 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Wed Jun 28 14:38:10 2017 +0200
@@ -39,19 +39,11 @@
 class G1CMTask;
 class ReferenceProcessor;
 
-// A class that scans oops in a given heap region (much as OopsInGenClosure
-// scans oops in a generation.)
-class OopsInHeapRegionClosure: public ExtendedOopClosure {
-protected:
-  HeapRegion* _from;
-public:
-  void set_region(HeapRegion* from) { _from = from; }
-};
-
-class G1ScanClosureBase : public OopsInHeapRegionClosure {
+class G1ScanClosureBase : public ExtendedOopClosure {
 protected:
   G1CollectedHeap* _g1;
   G1ParScanThreadState* _par_scan_state;
+  HeapRegion* _from;
 
   G1ScanClosureBase(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state);
   ~G1ScanClosureBase() { }
@@ -64,6 +56,7 @@
 public:
   // This closure needs special handling for InstanceRefKlass.
   virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; }
+  void set_region(HeapRegion* from) { _from = from; }
 };
 
 // Used during the Update RS phase to refine remaining cards in the DCQ during garbage collection.