src/share/vm/gc_implementation/g1/heapRegionManager.hpp

Print this page
rev 6923 : imported patch 8054819-rename-heapregionseq

*** 20,31 **** * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP ! #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP #include "gc_implementation/g1/g1BiasedArray.hpp" #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp" #include "gc_implementation/g1/heapRegionSet.hpp" --- 20,31 ---- * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONMANAGER_HPP ! #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONMANAGER_HPP #include "gc_implementation/g1/g1BiasedArray.hpp" #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp" #include "gc_implementation/g1/heapRegionSet.hpp"
*** 62,72 **** // * _allocated_heapregions_length (not exposed outside this class) is the // number of regions+1 for which we have HeapRegions. // * max_length() returns the maximum number of regions the heap can have. // ! class HeapRegionSeq: public CHeapObj<mtGC> { friend class VMStructs; G1HeapRegionTable _regions; G1RegionToSpaceMapper* _heap_mapper; --- 62,72 ---- // * _allocated_heapregions_length (not exposed outside this class) is the // number of regions+1 for which we have HeapRegions. // * max_length() returns the maximum number of regions the heap can have. // ! class HeapRegionManager: public CHeapObj<mtGC> { friend class VMStructs; G1HeapRegionTable _regions; G1RegionToSpaceMapper* _heap_mapper;
*** 102,112 **** // Calculate the starting region for each worker during parallel iteration so // that they do not all start from the same region. uint start_region_for_worker(uint worker_i, uint num_workers, uint num_regions) const; // Find a contiguous set of empty or uncommitted regions of length num and return ! // the index of the first region or G1_NO_HRS_INDEX if the search was unsuccessful. // If only_empty is true, only empty regions are considered. // Searches from bottom to top of the heap, doing a first-fit. uint find_contiguous(size_t num, bool only_empty); // Finds the next sequence of unavailable regions starting from start_idx. Returns the // length of the sequence found. If this result is zero, no such sequence could be found, --- 102,112 ---- // Calculate the starting region for each worker during parallel iteration so // that they do not all start from the same region. uint start_region_for_worker(uint worker_i, uint num_workers, uint num_regions) const; // Find a contiguous set of empty or uncommitted regions of length num and return ! // the index of the first region or G1_NO_HRM_INDEX if the search was unsuccessful. // If only_empty is true, only empty regions are considered. // Searches from bottom to top of the heap, doing a first-fit. uint find_contiguous(size_t num, bool only_empty); // Finds the next sequence of unavailable regions starting from start_idx. Returns the // length of the sequence found. If this result is zero, no such sequence could be found,
*** 115,135 **** // Finds the next sequence of empty regions starting from start_idx, going backwards in // the heap. Returns the length of the sequence found. If this value is zero, no // 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; // Allocate a new HeapRegion for the given index. ! HeapRegion* new_heap_region(uint hrs_index); #ifdef ASSERT public: bool is_free(HeapRegion* hr) const; #endif // Returns whether the given region is available for allocation. bool is_available(uint region) const; public: // Empty constructor, we'll initialize it with the initialize() method. ! HeapRegionSeq() : _regions(), _heap_mapper(NULL), _num_committed(0), _next_bitmap_mapper(NULL), _prev_bitmap_mapper(NULL), _bot_mapper(NULL), _allocated_heapregions_length(0), _available_map(), _free_list("Free list", new MasterFreeRegionListMtSafeChecker()) { } --- 115,135 ---- // Finds the next sequence of empty regions starting from start_idx, going backwards in // the heap. Returns the length of the sequence found. If this value is zero, no // 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; // Allocate a new HeapRegion for the given index. ! HeapRegion* new_heap_region(uint hrm_index); #ifdef ASSERT public: bool is_free(HeapRegion* hr) const; #endif // Returns whether the given region is available for allocation. bool is_available(uint region) const; public: // Empty constructor, we'll initialize it with the initialize() method. ! HeapRegionManager() : _regions(), _heap_mapper(NULL), _num_committed(0), _next_bitmap_mapper(NULL), _prev_bitmap_mapper(NULL), _bot_mapper(NULL), _allocated_heapregions_length(0), _available_map(), _free_list("Free list", new MasterFreeRegionListMtSafeChecker()) { }
*** 165,175 **** HeapRegion* allocate_free_region(bool is_old) { HeapRegion* hr = _free_list.remove_region(is_old); if (hr != NULL) { assert(hr->next() == NULL, "Single region should not have next"); ! assert(is_available(hr->hrs_index()), "Must be committed"); } return hr; } inline void allocate_free_regions_starting_at(uint first, uint num_regions); --- 165,175 ---- HeapRegion* allocate_free_region(bool is_old) { HeapRegion* hr = _free_list.remove_region(is_old); if (hr != NULL) { assert(hr->next() == NULL, "Single region should not have next"); ! assert(is_available(hr->hrm_index()), "Must be committed"); } return hr; } inline void allocate_free_regions_starting_at(uint first, uint num_regions);
*** 209,222 **** // for allocation. Returns the number of regions that were committed to achieve // this. uint expand_at(uint start, uint num_regions); // Find a contiguous set of empty regions of length num. Returns the start index of ! // that set, or G1_NO_HRS_INDEX. uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); } // Find a contiguous set of empty or unavailable regions of length num. Returns the ! // start index of that set, or G1_NO_HRS_INDEX. uint find_contiguous_empty_or_unavailable(size_t num) { return find_contiguous(num, false); } HeapRegion* next_region_in_heap(const HeapRegion* r) const; // Apply blk->doHeapRegion() on all committed regions in address order, --- 209,222 ---- // for allocation. Returns the number of regions that were committed to achieve // this. uint expand_at(uint start, uint num_regions); // Find a contiguous set of empty regions of length num. Returns the start index of ! // that set, or G1_NO_HRM_INDEX. uint find_contiguous_only_empty(size_t num) { return find_contiguous(num, true); } // Find a contiguous set of empty or unavailable regions of length num. Returns the ! // start index of that set, or G1_NO_HRM_INDEX. uint find_contiguous_empty_or_unavailable(size_t num) { return find_contiguous(num, false); } HeapRegion* next_region_in_heap(const HeapRegion* r) const; // Apply blk->doHeapRegion() on all committed regions in address order,
*** 233,239 **** // Do some sanity checking. void verify_optional() PRODUCT_RETURN; }; ! #endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP --- 233,239 ---- // Do some sanity checking. void verify_optional() PRODUCT_RETURN; }; ! #endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONMANAGER_HPP