src/hotspot/share/gc/g1/heapRegionManager.hpp
changeset 59060 fce1fa1bdc91
parent 54678 93f09ca4a7f8
child 59062 6530de931b8e
--- a/src/hotspot/share/gc/g1/heapRegionManager.hpp	Wed Nov 13 13:43:06 2019 -0500
+++ b/src/hotspot/share/gc/g1/heapRegionManager.hpp	Wed Nov 13 10:49:12 2019 -0800
@@ -108,6 +108,9 @@
   // sequence could be found, otherwise res_idx contains the start index of this range.
   uint find_empty_from_idx_reverse(uint start_idx, uint* res_idx) const;
 
+  // Checks the G1MemoryNodeManager to see if this region is on the preferred node.
+  bool is_on_preferred_index(uint region_index, uint preferred_node_index);
+
 protected:
   G1HeapRegionTable _regions;
   G1RegionToSpaceMapper* _heap_mapper;
@@ -174,15 +177,8 @@
     _free_list.add_ordered(list);
   }
 
-  virtual HeapRegion* allocate_free_region(HeapRegionType type) {
-    HeapRegion* hr = _free_list.remove_region(!type.is_young());
-
-    if (hr != NULL) {
-      assert(hr->next() == NULL, "Single region should not have next");
-      assert(is_available(hr->hrm_index()), "Must be committed");
-    }
-    return hr;
-  }
+  // Allocate a free region with specific node index. If fails allocate with next node index.
+  virtual HeapRegion* allocate_free_region(HeapRegionType type, uint requested_node_index);
 
   inline void allocate_free_regions_starting_at(uint first, uint num_regions);
 
@@ -227,6 +223,9 @@
   // this.
   virtual uint expand_at(uint start, uint num_regions, WorkGang* pretouch_workers);
 
+  // Try to expand on the given node index.
+  virtual uint expand_on_preferred_node(uint node_index);
+
   // Find a contiguous set of empty regions of length num. Returns the start index of
   // that set, or G1_NO_HRM_INDEX.
   virtual uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); }