8204538: Split ScanClosure and ScanClosureWithParBarrier
authorstefank
Thu, 07 Jun 2018 10:11:36 +0200
changeset 50621 4216de02077e
parent 50620 2b7714a592a1
child 50622 21b96ce2ed10
8204538: Split ScanClosure and ScanClosureWithParBarrier Reviewed-by: eosterlund, tschatzl, kbarrett
src/hotspot/share/gc/cms/parNewGeneration.cpp
src/hotspot/share/gc/cms/parNewGeneration.hpp
src/hotspot/share/gc/shared/genOopClosures.hpp
--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp	Mon Jun 18 18:49:34 2018 -0700
+++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp	Thu Jun 07 10:11:36 2018 +0200
@@ -816,7 +816,7 @@
 
 ScanClosureWithParBarrier::
 ScanClosureWithParBarrier(ParNewGeneration* g, bool gc_barrier) :
-  ScanClosure(g, gc_barrier)
+  OopsInClassLoaderDataOrGenClosure(g), _g(g), _boundary(g->reserved().end()), _gc_barrier(gc_barrier)
 { }
 
 template <typename OopClosureType1, typename OopClosureType2>
--- a/src/hotspot/share/gc/cms/parNewGeneration.hpp	Mon Jun 18 18:49:34 2018 -0700
+++ b/src/hotspot/share/gc/cms/parNewGeneration.hpp	Thu Jun 07 10:11:36 2018 +0200
@@ -275,9 +275,14 @@
 
 // Closure for scanning ParNewGeneration.
 // Same as ScanClosure, except does parallel GC barrier.
-class ScanClosureWithParBarrier: public ScanClosure {
- protected:
+class ScanClosureWithParBarrier: public OopsInClassLoaderDataOrGenClosure {
+ private:
+  ParNewGeneration* _g;
+  HeapWord*         _boundary;
+  bool              _gc_barrier;
+
   template <class T> void do_oop_work(T* p);
+
  public:
   ScanClosureWithParBarrier(ParNewGeneration* g, bool gc_barrier);
   virtual void do_oop(oop* p);
--- a/src/hotspot/share/gc/shared/genOopClosures.hpp	Mon Jun 18 18:49:34 2018 -0700
+++ b/src/hotspot/share/gc/shared/genOopClosures.hpp	Thu Jun 07 10:11:36 2018 +0200
@@ -101,7 +101,7 @@
 // This closure will perform barrier store calls for ALL
 // pointers in scanned oops.
 class ScanClosure: public OopsInClassLoaderDataOrGenClosure {
- protected:
+ private:
   DefNewGeneration* _g;
   HeapWord*         _boundary;
   bool              _gc_barrier;