--- old/src/hotspot/share/gc/parallel/adjoiningGenerationsForHeteroHeap.hpp 2018-10-03 14:40:21.621881800 -0700 +++ new/src/hotspot/share/gc/parallel/adjoiningGenerationsForHeteroHeap.hpp 2018-10-03 14:40:20.578710400 -0700 @@ -38,27 +38,27 @@ return _total_size_limit; } - // HeteroVirtualSpaces creates non-overlapping virtual spaces. - // low() manages memory in nv-dimm and is meant for old generation. - // high() manages memory in dram and is meant for young generation. + // HeteroVirtualSpaces creates non-overlapping virtual spaces. Here _low and _high do not share a reserved space, i.e. there is no boundary + // separating the two virtual spaces. class HeteroVirtualSpaces : public AdjoiningVirtualSpaces { - PSVirtualSpace* _young_vs; - PSVirtualSpace* _old_vs; - size_t _min_old_byte_size; size_t _min_young_byte_size; size_t _max_old_byte_size; size_t _max_young_byte_size; size_t _max_total_size; + // Internally we access the virtual spaces using these methods. It increases readability, since we were not really + // dealing with adjoining virtual spaces separated by a boundary as is the case in base class. + // Externally they are accessed using low() and high() methods of base class. + PSVirtualSpace* young_vs() { return high(); } + PSVirtualSpace* old_vs() { return low(); } + public: HeteroVirtualSpaces(ReservedSpace rs, size_t min_old_byte_size, size_t min_young_byte_size, size_t max_total_size, size_t alignment); - PSVirtualSpace* high() { return _young_vs; } - PSVirtualSpace* low() { return _old_vs; } // Increase old generation size and decrease young generation size by same amount bool adjust_boundary_up(size_t size_in_bytes); // Increase young generation size and decrease old generation size by same amount