src/hotspot/share/gc/g1/heapRegionManager.hpp
changeset 59060 fce1fa1bdc91
parent 54678 93f09ca4a7f8
child 59062 6530de931b8e
equal deleted inserted replaced
59059:27a266d5fb13 59060:fce1fa1bdc91
   106   // Finds the next sequence of empty regions starting from start_idx, going backwards in
   106   // Finds the next sequence of empty regions starting from start_idx, going backwards in
   107   // the heap. Returns the length of the sequence found. If this value is zero, no
   107   // the heap. Returns the length of the sequence found. If this value is zero, no
   108   // sequence could be found, otherwise res_idx contains the start index of this range.
   108   // sequence could be found, otherwise res_idx contains the start index of this range.
   109   uint find_empty_from_idx_reverse(uint start_idx, uint* res_idx) const;
   109   uint find_empty_from_idx_reverse(uint start_idx, uint* res_idx) const;
   110 
   110 
       
   111   // Checks the G1MemoryNodeManager to see if this region is on the preferred node.
       
   112   bool is_on_preferred_index(uint region_index, uint preferred_node_index);
       
   113 
   111 protected:
   114 protected:
   112   G1HeapRegionTable _regions;
   115   G1HeapRegionTable _regions;
   113   G1RegionToSpaceMapper* _heap_mapper;
   116   G1RegionToSpaceMapper* _heap_mapper;
   114   G1RegionToSpaceMapper* _prev_bitmap_mapper;
   117   G1RegionToSpaceMapper* _prev_bitmap_mapper;
   115   G1RegionToSpaceMapper* _next_bitmap_mapper;
   118   G1RegionToSpaceMapper* _next_bitmap_mapper;
   172   // Insert the given region list into the global free region list.
   175   // Insert the given region list into the global free region list.
   173   void insert_list_into_free_list(FreeRegionList* list) {
   176   void insert_list_into_free_list(FreeRegionList* list) {
   174     _free_list.add_ordered(list);
   177     _free_list.add_ordered(list);
   175   }
   178   }
   176 
   179 
   177   virtual HeapRegion* allocate_free_region(HeapRegionType type) {
   180   // Allocate a free region with specific node index. If fails allocate with next node index.
   178     HeapRegion* hr = _free_list.remove_region(!type.is_young());
   181   virtual HeapRegion* allocate_free_region(HeapRegionType type, uint requested_node_index);
   179 
       
   180     if (hr != NULL) {
       
   181       assert(hr->next() == NULL, "Single region should not have next");
       
   182       assert(is_available(hr->hrm_index()), "Must be committed");
       
   183     }
       
   184     return hr;
       
   185   }
       
   186 
   182 
   187   inline void allocate_free_regions_starting_at(uint first, uint num_regions);
   183   inline void allocate_free_regions_starting_at(uint first, uint num_regions);
   188 
   184 
   189   // Remove all regions from the free list.
   185   // Remove all regions from the free list.
   190   void remove_all_free_regions() {
   186   void remove_all_free_regions() {
   224 
   220 
   225   // Makes sure that the regions from start to start+num_regions-1 are available
   221   // Makes sure that the regions from start to start+num_regions-1 are available
   226   // for allocation. Returns the number of regions that were committed to achieve
   222   // for allocation. Returns the number of regions that were committed to achieve
   227   // this.
   223   // this.
   228   virtual uint expand_at(uint start, uint num_regions, WorkGang* pretouch_workers);
   224   virtual uint expand_at(uint start, uint num_regions, WorkGang* pretouch_workers);
       
   225 
       
   226   // Try to expand on the given node index.
       
   227   virtual uint expand_on_preferred_node(uint node_index);
   229 
   228 
   230   // Find a contiguous set of empty regions of length num. Returns the start index of
   229   // Find a contiguous set of empty regions of length num. Returns the start index of
   231   // that set, or G1_NO_HRM_INDEX.
   230   // that set, or G1_NO_HRM_INDEX.
   232   virtual uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); }
   231   virtual uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); }
   233   // Find a contiguous set of empty or unavailable regions of length num. Returns the
   232   // Find a contiguous set of empty or unavailable regions of length num. Returns the