--- old/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-11-19 14:04:33.096038400 -0800 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-11-19 14:04:32.123917600 -0800 @@ -43,6 +43,7 @@ #include "gc/g1/g1SurvivorRegions.hpp" #include "gc/g1/g1YCTypes.hpp" #include "gc/g1/heapRegionManager.hpp" +#include "gc/g1/heterogeneousHeapRegionManager.hpp" #include "gc/g1/heapRegionSet.hpp" #include "gc/shared/barrierSet.hpp" #include "gc/shared/collectedHeap.hpp" @@ -194,7 +195,10 @@ G1RegionMappingChangedListener _listener; // The sequence of all heap regions in the heap. - HeapRegionManager _hrm; + HeapRegionManager* _hrm; + + // is the heap on heterogenous memory? + bool _is_hetero_heap; // Manages all allocations with regions except humongous object allocations. G1Allocator* _allocator; @@ -952,10 +956,15 @@ // The current policy object for the collector. G1Policy* g1_policy() const { return _g1_policy; } + HeapRegionManager* hrm() const { return _hrm; } + + bool is_hetero_heap() const { return _is_hetero_heap; } + const G1CollectionSet* collection_set() const { return &_collection_set; } G1CollectionSet* collection_set() { return &_collection_set; } virtual CollectorPolicy* collector_policy() const; + virtual G1CollectorPolicy* g1_collector_policy() const; virtual SoftRefPolicy* soft_ref_policy(); @@ -1004,7 +1013,7 @@ // But G1CollectedHeap doesn't yet support this. virtual bool is_maximal_no_gc() const { - return _hrm.available() == 0; + return _hrm->available() == 0; } // Returns whether there are any regions left in the heap for allocation. @@ -1013,16 +1022,19 @@ } // The current number of regions in the heap. - uint num_regions() const { return _hrm.length(); } + uint num_regions() const { return _hrm->length(); } // The max number of regions in the heap. - uint max_regions() const { return _hrm.max_length(); } + uint max_regions() const { return _hrm->max_length(); } + + // Max number of regions that can be comitted. + uint max_expandable_regions() const { return _hrm->max_expandable_length(); } // The number of regions that are completely free. - uint num_free_regions() const { return _hrm.num_free_regions(); } + uint num_free_regions() const { return _hrm->num_free_regions(); } MemoryUsage get_auxiliary_data_memory_usage() const { - return _hrm.get_auxiliary_data_memory_usage(); + return _hrm->get_auxiliary_data_memory_usage(); } // The number of regions that are not completely free. @@ -1030,7 +1042,7 @@ #ifdef ASSERT bool is_on_master_free_list(HeapRegion* hr) { - return _hrm.is_free(hr); + return _hrm->is_free(hr); } #endif // ASSERT @@ -1087,13 +1099,13 @@ // Return "TRUE" iff the given object address is in the reserved // region of g1. bool is_in_g1_reserved(const void* p) const { - return _hrm.reserved().contains(p); + return _hrm->reserved().contains(p); } // Returns a MemRegion that corresponds to the space that has been // reserved for the heap MemRegion g1_reserved() const { - return _hrm.reserved(); + return _hrm->reserved(); } virtual bool is_in_closed_subset(const void* p) const; @@ -1219,6 +1231,9 @@ // Print the maximum heap capacity. virtual size_t max_capacity() const; + // Return the size of reserved memory. Returns different value than max_capacity() when AllocateOldGenAt is used. + virtual size_t max_reserved_capacity() const; + virtual jlong millis_since_last_gc();