changeset 9733:416f83a07c39

8144505: Change G1ParCopyHelper to inherit OopClosure Reviewed-by: mgerdin, stefank
author sjohanss
date Fri, 11 Dec 2015 17:49:40 +0100
parents 754cfdb6fa55
children 601ef5feffd2
files src/share/vm/gc/g1/g1OopClosures.cpp src/share/vm/gc/g1/g1OopClosures.hpp src/share/vm/gc/g1/g1OopClosures.inline.hpp
diffstat 3 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/g1/g1OopClosures.cpp	Fri Dec 11 13:18:10 2015 +0000
+++ b/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/src/share/vm/gc/g1/g1OopClosures.hpp	Fri Dec 11 13:18:10 2015 +0000
+++ b/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/src/share/vm/gc/g1/g1OopClosures.inline.hpp	Fri Dec 11 13:18:10 2015 +0000
+++ b/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)) {