61 } |
61 } |
62 |
62 |
63 // Returns the total number of collection set candidate old regions added. |
63 // Returns the total number of collection set candidate old regions added. |
64 uint num_regions() { return _num_regions; } |
64 uint num_regions() { return _num_regions; } |
65 |
65 |
66 // Return the candidate region at the cursor position to be considered for collection without |
66 uint cur_idx() const { return _front_idx; } |
67 // removing it. |
67 |
68 HeapRegion* peek_front() { |
68 HeapRegion* at(uint idx) const { |
69 HeapRegion* res = NULL; |
69 HeapRegion* res = NULL; |
70 if (_front_idx < _num_regions) { |
70 if (idx < _num_regions) { |
71 res = _regions[_front_idx]; |
71 res = _regions[idx]; |
72 assert(res != NULL, "Unexpected NULL HeapRegion at index %u", _front_idx); |
72 assert(res != NULL, "Unexpected NULL HeapRegion at index %u", idx); |
73 } |
73 } |
74 return res; |
74 return res; |
75 } |
75 } |
76 |
76 |
77 // Remove the given region from the candidates set and move the cursor to the next one. |
77 void remove(uint num_regions); |
78 HeapRegion* pop_front(); |
|
79 |
|
80 // Add the given HeapRegion to the front of the collection set candidate set again. |
|
81 void push_front(HeapRegion* hr); |
|
82 |
78 |
83 // Iterate over all remaining collection set candidate regions. |
79 // Iterate over all remaining collection set candidate regions. |
84 void iterate(HeapRegionClosure* cl); |
80 void iterate(HeapRegionClosure* cl); |
85 |
81 |
86 // Return the number of candidate regions remaining. |
82 // Return the number of candidate regions remaining. |