--- old/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-04-17 15:16:17.639392994 +0200 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-04-17 15:16:17.361384441 +0200 @@ -107,13 +107,20 @@ // (optional) _is_alive_non_header closure in the STW // reference processor. It is also extensively used during // reference processing during STW evacuation pauses. -class G1STWIsAliveClosure: public BoolObjectClosure { +class G1STWIsAliveClosure : public BoolObjectClosure { G1CollectedHeap* _g1h; public: G1STWIsAliveClosure(G1CollectedHeap* g1h) : _g1h(g1h) {} bool do_object_b(oop p); }; +class G1STWSubjectToDiscoveryClosure : public BoolObjectClosure { + G1CollectedHeap* _g1h; +public: + G1STWSubjectToDiscoveryClosure(G1CollectedHeap* g1h) : _g1h(g1h) {} + bool do_object_b(oop p); +}; + class G1RegionMappingChangedListener : public G1MappingChangedListener { private: void reset_from_card_cache(uint start_idx, size_t num_regions); @@ -502,9 +509,6 @@ // allocated block, or else "NULL". HeapWord* expand_and_allocate(size_t word_size); - // Preserve any referents discovered by concurrent marking that have not yet been - // copied by the STW pause. - void preserve_cm_referents(G1ParScanThreadStateSet* per_thread_states); // Process any reference objects discovered during // an incremental evacuation pause. void process_discovered_references(G1ParScanThreadStateSet* per_thread_states); @@ -893,6 +897,8 @@ // the discovered lists during reference discovery. G1STWIsAliveClosure _is_alive_closure_stw; + G1STWSubjectToDiscoveryClosure _is_subject_to_discovery_stw; + // The (concurrent marking) reference processor... ReferenceProcessor* _ref_processor_cm; @@ -904,6 +910,7 @@ // discovery. G1CMIsAliveClosure _is_alive_closure_cm; + G1CMSubjectToDiscoveryClosure _is_subject_to_discovery_cm; public: RefToScanQueue *task_queue(uint i) const;