src/hotspot/share/gc/shared/referenceProcessor.hpp
changeset 50097 ed8a43d83fcc
parent 50071 758deedaae84
child 50277 f84ae8aa5d88
--- a/src/hotspot/share/gc/shared/referenceProcessor.hpp	Mon May 14 11:47:03 2018 +0200
+++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp	Mon May 14 11:47:03 2018 +0200
@@ -279,15 +279,15 @@
                       OopClosure*        keep_alive,
                       VoidClosure*       complete_gc);
 
-  // "Preclean" all the discovered reference lists
-  // by removing references with strongly reachable referents.
+  // "Preclean" all the discovered reference lists by removing references that
+  // are active (e.g. due to the mutator calling enqueue()) or with NULL or
+  // strongly reachable referents.
   // The first argument is a predicate on an oop that indicates
-  // its (strong) reachability and the second is a closure that
+  // its (strong) reachability and the fourth is a closure that
   // may be used to incrementalize or abort the precleaning process.
   // The caller is responsible for taking care of potential
   // interference with concurrent operations on these lists
-  // (or predicates involved) by other threads. Currently
-  // only used by the CMS collector.
+  // (or predicates involved) by other threads.
   void preclean_discovered_references(BoolObjectClosure* is_alive,
                                       OopClosure*        keep_alive,
                                       VoidClosure*       complete_gc,
@@ -298,15 +298,17 @@
   // occupying the i / _num_queues slot.
   const char* list_name(uint i);
 
-  // "Preclean" the given discovered reference list
-  // by removing references with strongly reachable referents.
-  // Currently used in support of CMS only.
-  void preclean_discovered_reflist(DiscoveredList&    refs_list,
+private:
+  // "Preclean" the given discovered reference list by removing references with
+  // the attributes mentioned in preclean_discovered_references().
+  // Supports both normal and fine grain yielding.
+  // Returns whether the operation should be aborted.
+  bool preclean_discovered_reflist(DiscoveredList&    refs_list,
                                    BoolObjectClosure* is_alive,
                                    OopClosure*        keep_alive,
                                    VoidClosure*       complete_gc,
                                    YieldClosure*      yield);
-private:
+
   // round-robin mod _num_queues (not: _not_ mod _max_num_queues)
   uint next_id() {
     uint id = _next_id;
@@ -323,7 +325,8 @@
 
   void clear_discovered_references(DiscoveredList& refs_list);
 
-  void log_reflist_counts(DiscoveredList ref_lists[], uint active_length, size_t total_count) PRODUCT_RETURN;
+  void log_reflist(const char* prefix, DiscoveredList list[], uint num_active_queues);
+  void log_reflist_counts(DiscoveredList ref_lists[], uint num_active_queues) PRODUCT_RETURN;
 
   // Balances reference queues.
   void balance_queues(DiscoveredList ref_lists[]);