8144505: Change G1ParCopyHelper to inherit OopClosure
authorsjohanss
Fri, 11 Dec 2015 17:49:40 +0100
changeset 35067 0fa08ea22241
parent 35066 cd4ac076bf7f
child 35068 b0d5016aecc7
8144505: Change G1ParCopyHelper to inherit OopClosure Reviewed-by: mgerdin, stefank
hotspot/src/share/vm/gc/g1/g1OopClosures.cpp
hotspot/src/share/vm/gc/g1/g1OopClosures.hpp
hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp	Fri Dec 11 13:18:10 2015 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp	Fri Dec 11 17:49:40 2015 +0100
@@ -31,7 +31,8 @@
 #include "utilities/stack.inline.hpp"
 
 G1ParCopyHelper::G1ParCopyHelper(G1CollectedHeap* g1,  G1ParScanThreadState* par_scan_state) :
-  G1ParClosureSuper(g1, par_scan_state),
+  _g1(g1),
+  _par_scan_state(par_scan_state),
   _worker_id(par_scan_state->worker_id()),
   _scanned_klass(NULL),
   _cm(_g1->concurrent_mark())
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Fri Dec 11 13:18:10 2015 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Fri Dec 11 17:49:40 2015 +0100
@@ -86,8 +86,10 @@
 };
 
 // Add back base class for metadata
-class G1ParCopyHelper : public G1ParClosureSuper {
+class G1ParCopyHelper : public OopClosure {
 protected:
+  G1CollectedHeap* _g1;
+  G1ParScanThreadState* _par_scan_state;
   uint _worker_id;              // Cache value from par_scan_state.
   Klass* _scanned_klass;
   ConcurrentMark* _cm;
@@ -125,13 +127,11 @@
 class G1ParCopyClosure : public G1ParCopyHelper {
 public:
   G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) :
-      G1ParCopyHelper(g1, par_scan_state) {
-    assert(ref_processor() == NULL, "sanity");
-  }
+      G1ParCopyHelper(g1, par_scan_state) { }
 
-  template <class T> void do_oop_nv(T* p);
-  virtual void do_oop(oop* p)       { do_oop_nv(p); }
-  virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
+  template <class T> void do_oop_work(T* p);
+  virtual void do_oop(oop* p)       { do_oop_work(p); }
+  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
 };
 
 class G1KlassScanClosure : public KlassClosure {
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp	Fri Dec 11 13:18:10 2015 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp	Fri Dec 11 17:49:40 2015 +0100
@@ -256,7 +256,7 @@
 
 template <G1Barrier barrier, G1Mark do_mark_object, bool use_ext>
 template <class T>
-void G1ParCopyClosure<barrier, do_mark_object, use_ext>::do_oop_nv(T* p) {
+void G1ParCopyClosure<barrier, do_mark_object, use_ext>::do_oop_work(T* p) {
   T heap_oop = oopDesc::load_heap_oop(p);
 
   if (oopDesc::is_null(heap_oop)) {