--- old/src/hotspot/share/gc/g1/g1CollectionSet.hpp 2019-01-23 10:43:54.920659019 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectionSet.hpp 2019-01-23 10:43:54.428643546 +0100 @@ -25,7 +25,7 @@ #ifndef SHARE_GC_G1_G1COLLECTIONSET_HPP #define SHARE_GC_G1_G1COLLECTIONSET_HPP -#include "gc/g1/collectionSetChooser.hpp" +#include "gc/g1/g1CollectionSetCandidates.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" @@ -41,7 +41,8 @@ G1CollectedHeap* _g1h; G1Policy* _policy; - CollectionSetChooser* _cset_chooser; + // All old gen collection set candidate regions for the current mixed gc phase. + G1CollectionSetCandidates* _candidates; uint _eden_region_length; uint _survivor_region_length; @@ -128,8 +129,16 @@ void initialize_optional(uint max_length); void free_optional_regions(); - CollectionSetChooser* cset_chooser(); - + void clear_candidates() { + delete _candidates; + _candidates = NULL; + } + void set_candidates(G1CollectionSetCandidates* candidates) { + assert(_candidates == NULL, "Trying to replace collection set candidates."); + _candidates = candidates; + } + G1CollectionSetCandidates* candidates() { return _candidates; } + void init_region_lengths(uint eden_cset_region_length, uint survivor_cset_region_length); @@ -253,8 +262,8 @@ _current_limit(0), _prepare_failed(false), _evacuation_failed(false) { } - // The destructor returns regions to the cset-chooser and - // frees the optional structure in the cset. + // The destructor returns regions to the collection set candidates set and + // frees the optional structure in the collection set. ~G1OptionalCSet(); uint current_index() { return _current_index; }