--- old/src/hotspot/share/gc/z/zStat.cpp 2020-01-21 12:40:47.071223081 +0100 +++ new/src/hotspot/share/gc/z/zStat.cpp 2020-01-21 12:40:46.504211576 +0100 @@ -1128,53 +1128,33 @@ // // Stat relocation // -ZStatRelocation::Group ZStatRelocation::_small; -ZStatRelocation::Group ZStatRelocation::_medium; -ZStatRelocation::Group ZStatRelocation::_large; -bool ZStatRelocation::_success; - -void ZStatRelocation::set_at_select_relocation_set(const ZRelocationSetSelectorGroupStats& small, - const ZRelocationSetSelectorGroupStats& medium, - const ZRelocationSetSelectorGroupStats& large) { - _small._npages = small.npages(); - _small._total = small.total(); - _small._empty = small.empty(); - _small._compacting_from = small.compacting_from(); - _small._compacting_to = small.compacting_to(); - - _medium._npages = medium.npages(); - _medium._total = medium.total(); - _medium._empty = medium.empty(); - _medium._compacting_from = medium.compacting_from(); - _medium._compacting_to = medium.compacting_to(); - - _large._npages = large.npages(); - _large._total = large.total(); - _large._empty = large.empty(); - _large._compacting_from = large.compacting_from(); - _large._compacting_to = large.compacting_to(); +ZRelocationSetSelectorStats ZStatRelocation::_stats; +bool ZStatRelocation::_success; + +void ZStatRelocation::set_at_select_relocation_set(const ZRelocationSetSelectorStats& stats) { + _stats = stats; } void ZStatRelocation::set_at_relocate_end(bool success) { _success = success; } -void ZStatRelocation::print(const char* name, const ZStatRelocation::Group& group) { - const size_t total = _small._total + _medium._total + _large._total; +void ZStatRelocation::print(const char* name, const ZRelocationSetSelectorGroupStats& group) { + const size_t total = _stats.small().total() + _stats.medium().total() + _stats.large().total(); log_info(gc, reloc)("%s Pages: " SIZE_FORMAT " / " ZSIZE_FMT ", Empty: " ZSIZE_FMT ", Compacting: " ZSIZE_FMT "->" ZSIZE_FMT, name, - group._npages, - ZSIZE_ARGS_WITH_MAX(group._total, total), - ZSIZE_ARGS_WITH_MAX(group._empty, total), - ZSIZE_ARGS_WITH_MAX(group._compacting_from, total), - ZSIZE_ARGS_WITH_MAX(group._compacting_to, total)); + group.npages(), + ZSIZE_ARGS_WITH_MAX(group.total(), total), + ZSIZE_ARGS_WITH_MAX(group.empty(), total), + ZSIZE_ARGS_WITH_MAX(group.compacting_from(), total), + ZSIZE_ARGS_WITH_MAX(group.compacting_to(), total)); } void ZStatRelocation::print() { - print("Small", _small); - print("Medium", _medium); - print("Large", _large); + print("Small", _stats.small()); + print("Medium", _stats.medium()); + print("Large", _stats.large()); log_info(gc, reloc)("Relocation: %s", _success ? "Successful" : "Incomplete"); } @@ -1312,12 +1292,9 @@ _at_mark_end.free = free(used); } -void ZStatHeap::set_at_select_relocation_set(const ZRelocationSetSelectorGroupStats& small, - const ZRelocationSetSelectorGroupStats& medium, - const ZRelocationSetSelectorGroupStats& large, - size_t reclaimed) { - const size_t live = small.live() + medium.live() + large.live(); - const size_t garbage = small.garbage() + medium.garbage() + large.garbage(); +void ZStatHeap::set_at_select_relocation_set(const ZRelocationSetSelectorStats& stats, size_t reclaimed) { + const size_t live = stats.small().live() + stats.medium().live() + stats.large().live(); + const size_t garbage = stats.small().garbage() + stats.medium().garbage() + stats.large().garbage(); _at_mark_end.live = live; _at_mark_end.garbage = garbage;