--- old/src/hotspot/share/gc/g1/g1FullCollector.cpp 2017-11-06 12:26:49.929778866 +0100 +++ new/src/hotspot/share/gc/g1/g1FullCollector.cpp 2017-11-06 12:26:49.673768708 +0100 @@ -74,7 +74,8 @@ _preserved_marks_set(true), _reference_processor(reference_processor), _serial_compaction_point(), - _is_alive_mutator(_reference_processor, NULL) { + _is_alive(_mark_bitmap), + _is_alive_mutator(_reference_processor, &_is_alive) { assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); _preserved_marks_set.init(_num_workers); @@ -153,25 +154,24 @@ reference_processing.execute(scope()->timer(), scope()->tracer()); // Weak oops cleanup. - G1IsAliveClosure is_alive(mark_bitmap()); { GCTraceTime(Debug, gc, phases) trace("Phase 1: Weak Processing", scope()->timer()); - WeakProcessor::weak_oops_do(&is_alive, &do_nothing_cl); + WeakProcessor::weak_oops_do(&_is_alive, &do_nothing_cl); } // Class unloading and cleanup. if (ClassUnloading) { GCTraceTime(Debug, gc, phases) debug("Phase 1: Class Unloading and Cleanup", scope()->timer()); // Unload classes and purge the SystemDictionary. - bool purged_class = SystemDictionary::do_unloading(&is_alive, scope()->timer()); - G1CollectedHeap::heap()->complete_cleaning(&is_alive, purged_class); + bool purged_class = SystemDictionary::do_unloading(&_is_alive, scope()->timer()); + G1CollectedHeap::heap()->complete_cleaning(&_is_alive, purged_class); } else { GCTraceTime(Debug, gc, phases) debug("Phase 1: String and Symbol Tables Cleanup", scope()->timer()); // If no class unloading just clean out strings and symbols. - G1CollectedHeap::heap()->partial_cleaning(&is_alive, true, true, G1StringDedup::is_enabled()); + G1CollectedHeap::heap()->partial_cleaning(&_is_alive, true, true, G1StringDedup::is_enabled()); } - scope()->tracer()->report_object_count_after_gc(&is_alive); + scope()->tracer()->report_object_count_after_gc(&_is_alive); } void G1FullCollector::prepare_compaction_common() { --- old/src/hotspot/share/gc/g1/g1FullCollector.hpp 2017-11-06 12:26:50.245791404 +0100 +++ new/src/hotspot/share/gc/g1/g1FullCollector.hpp 2017-11-06 12:26:50.005781881 +0100 @@ -27,6 +27,7 @@ #include "gc/g1/g1FullGCCompactionPoint.hpp" #include "gc/g1/g1FullGCMarker.hpp" +#include "gc/g1/g1FullGCOopClosures.hpp" #include "gc/shared/preservedMarks.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.hpp" @@ -52,6 +53,7 @@ ReferenceProcessor* _reference_processor; G1FullGCCompactionPoint _serial_compaction_point; + G1IsAliveClosure _is_alive; ReferenceProcessorIsAliveMutator _is_alive_mutator; public: