--- old/src/hotspot/share/gc/z/zRelocationSetSelector.hpp 2020-01-21 12:41:09.830684859 +0100 +++ new/src/hotspot/share/gc/z/zRelocationSetSelector.hpp 2020-01-21 12:41:09.307674247 +0100 @@ -30,17 +30,55 @@ class ZPage; class ZRelocationSet; +class ZRelocationSetSelectorGroupStats { + friend class ZRelocationSetSelectorGroup; + +private: + size_t _npages; + size_t _total; + size_t _live; + size_t _garbage; + size_t _empty; + size_t _compacting_from; + size_t _compacting_to; + +public: + ZRelocationSetSelectorGroupStats(); + + size_t npages() const; + size_t total() const; + size_t live() const; + size_t garbage() const; + size_t empty() const; + size_t compacting_from() const; + size_t compacting_to() const; +}; + +class ZRelocationSetSelectorStats { + friend class ZRelocationSetSelector; + +private: + ZRelocationSetSelectorGroupStats _small; + ZRelocationSetSelectorGroupStats _medium; + ZRelocationSetSelectorGroupStats _large; + +public: + const ZRelocationSetSelectorGroupStats& small() const; + const ZRelocationSetSelectorGroupStats& medium() const; + const ZRelocationSetSelectorGroupStats& large() const; +}; + class ZRelocationSetSelectorGroup { private: - const char* const _name; - const size_t _page_size; - const size_t _object_size_limit; - const size_t _fragmentation_limit; - - ZArray _registered_pages; - ZPage** _sorted_pages; - size_t _nselected; - size_t _relocating; + const char* const _name; + const size_t _page_size; + const size_t _object_size_limit; + const size_t _fragmentation_limit; + + ZArray _registered_pages; + ZPage** _sorted_pages; + size_t _nselected; + ZRelocationSetSelectorGroupStats _stats; void semi_sort(); @@ -50,20 +88,21 @@ size_t object_size_limit); ~ZRelocationSetSelectorGroup(); - void register_live_page(ZPage* page, size_t garbage); + void register_live_page(ZPage* page); + void register_garbage_page(ZPage* page); void select(); ZPage* const* selected() const; size_t nselected() const; - size_t relocating() const; + + const ZRelocationSetSelectorGroupStats& stats() const; }; class ZRelocationSetSelector : public StackObj { private: ZRelocationSetSelectorGroup _small; ZRelocationSetSelectorGroup _medium; - size_t _live; - size_t _garbage; + ZRelocationSetSelectorGroup _large; public: ZRelocationSetSelector(); @@ -72,9 +111,7 @@ void register_garbage_page(ZPage* page); void select(ZRelocationSet* relocation_set); - size_t live() const; - size_t garbage() const; - size_t relocating() const; + ZRelocationSetSelectorStats stats() const; }; #endif // SHARE_GC_Z_ZRELOCATIONSETSELECTOR_HPP