hotspot/src/share/vm/gc/g1/g1OopClosures.hpp
changeset 46445 825b002e05ae
parent 46307 686d50172bfd
child 46519 40c9c132f961
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Mon May 08 09:45:24 2017 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Tue May 09 11:03:45 2017 +0200
@@ -56,7 +56,8 @@
   ~G1ParClosureSuper() { }
 
 public:
-  virtual bool apply_to_weak_ref_discovered_field() { return true; }
+  // This closure needs special handling for InstanceRefKlass.
+  virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; }
 };
 
 class G1ParPushHeapRSClosure : public G1ParClosureSuper {
@@ -189,8 +190,6 @@
     _from = from;
   }
 
-  bool apply_to_weak_ref_discovered_field() { return true; }
-
   bool self_forwarded(oop obj) {
     markOop m = obj->mark();
     bool result = (m->is_marked() && ((oop)m->decode_pointer() == obj));
@@ -202,6 +201,9 @@
   template <class T> inline void do_oop_nv(T* p);
   virtual inline void do_oop(narrowOop* p);
   virtual inline void do_oop(oop* p);
+
+  // This closure needs special handling for InstanceRefKlass.
+  virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; }
 };
 
 #endif // SHARE_VM_GC_G1_G1OOPCLOSURES_HPP