< prev index next >
src/hotspot/share/gc/g1/heapRegionManager.hpp
Print this page
rev 52611 : webrev.00
rev 52613 : webrev.01
*** 69,92 ****
class HeapRegionManager: public CHeapObj<mtGC> {
friend class VMStructs;
friend class HeapRegionClaimer;
- protected:
- G1HeapRegionTable _regions;
- G1RegionToSpaceMapper* _heap_mapper;
- private:
G1RegionToSpaceMapper* _prev_bitmap_mapper;
G1RegionToSpaceMapper* _next_bitmap_mapper;
G1RegionToSpaceMapper* _bot_mapper;
G1RegionToSpaceMapper* _cardtable_mapper;
G1RegionToSpaceMapper* _card_counts_mapper;
- protected:
- FreeRegionList _free_list;
- private:
-
// Each bit in this bitmap indicates that the corresponding region is available
// for allocation.
CHeapBitMap _available_map;
// The number of regions committed in the heap.
--- 69,84 ----
*** 96,109 ****
uint _allocated_heapregions_length;
HeapWord* heap_bottom() const { return _regions.bottom_address_mapped(); }
HeapWord* heap_end() const {return _regions.end_address_mapped(); }
- protected:
- void make_regions_available(uint index, uint num_regions = 1, WorkGang* pretouch_gang = NULL);
- void uncommit_regions(uint index, size_t num_regions = 1);
- private:
// Pass down commit calls to the VirtualSpace.
void commit_regions(uint index, size_t num_regions = 1, WorkGang* pretouch_gang = NULL);
// Notify other data structures about change in the heap layout.
void update_committed_space(HeapWord* old_end, HeapWord* new_end);
--- 88,97 ----
*** 119,146 ****
uint find_unavailable_from_idx(uint start_idx, uint* res_idx) const;
// 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;
#ifdef ASSERT
public:
bool is_free(HeapRegion* hr) const;
#endif
- protected:
- // Allocate a new HeapRegion for the given index.
- HeapRegion* new_heap_region(uint hrm_index);
public:
// Empty constructor, we'll initialize it with the initialize() method.
HeapRegionManager();
void initialize(G1RegionToSpaceMapper* heap_storage,
G1RegionToSpaceMapper* prev_bitmap,
G1RegionToSpaceMapper* next_bitmap,
G1RegionToSpaceMapper* bot,
G1RegionToSpaceMapper* cardtable,
G1RegionToSpaceMapper* card_counts);
// Return the "dummy" region used for G1AllocRegion. This is currently a hardwired
// new HeapRegion that owns HeapRegion at index 0. Since at the moment we commit
// the heap from the lowest address, this region (and its associated data
// structures) are available and we do not need to check further.
virtual HeapRegion* get_dummy_region() { return new_heap_region(0); }
--- 107,147 ----
uint find_unavailable_from_idx(uint start_idx, uint* res_idx) const;
// 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;
+
+ protected:
+ G1HeapRegionTable _regions;
+ G1RegionToSpaceMapper* _heap_mapper;
+ FreeRegionList _free_list;
+ void make_regions_available(uint index, uint num_regions = 1, WorkGang* pretouch_gang = NULL);
+ void uncommit_regions(uint index, size_t num_regions = 1);
+ // 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
public:
// Empty constructor, we'll initialize it with the initialize() method.
HeapRegionManager();
+ static HeapRegionManager* create_manager(G1CollectedHeap* heap, CollectorPolicy* policy);
+
void initialize(G1RegionToSpaceMapper* heap_storage,
G1RegionToSpaceMapper* prev_bitmap,
G1RegionToSpaceMapper* next_bitmap,
G1RegionToSpaceMapper* bot,
G1RegionToSpaceMapper* cardtable,
G1RegionToSpaceMapper* card_counts);
+ // Prepare heap regions before and after full collection.
+ // Nothing to be done in this class.
+ virtual void prepare_for_full_collection_start() {}
+ virtual void prepare_for_full_collection_end() {}
+
// Return the "dummy" region used for G1AllocRegion. This is currently a hardwired
// new HeapRegion that owns HeapRegion at index 0. Since at the moment we commit
// the heap from the lowest address, this region (and its associated data
// structures) are available and we do not need to check further.
virtual HeapRegion* get_dummy_region() { return new_heap_region(0); }
< prev index next >