80
81 void increment_allocated_length() {
82 assert(_allocated_length < max_length(), "pre-condition");
83 _allocated_length++;
84 }
85
86 void increment_length() {
87 assert(length() < max_length(), "pre-condition");
88 _committed_length++;
89 }
90
91 void decrement_length() {
92 assert(length() > 0, "pre-condition");
93 _committed_length--;
94 }
95
96 HeapWord* heap_bottom() const { return _regions.bottom_address_mapped(); }
97 HeapWord* heap_end() const {return _regions.end_address_mapped(); }
98
99 public:
100 // Empty contructor, we'll initialize it with the initialize() method.
101 HeapRegionSeq() : _regions(), _committed_length(0), _next_search_index(0), _allocated_length(0) { }
102
103 void initialize(HeapWord* bottom, HeapWord* end);
104
105 // Return the HeapRegion at the given index. Assume that the index
106 // is valid.
107 inline HeapRegion* at(uint index) const;
108
109 // If addr is within the committed space return its corresponding
110 // HeapRegion, otherwise return NULL.
111 inline HeapRegion* addr_to_region(HeapWord* addr) const;
112
113 // Return the HeapRegion that corresponds to the given
114 // address. Assume the address is valid.
115 inline HeapRegion* addr_to_region_unsafe(HeapWord* addr) const;
116
117 // Return the number of regions that have been committed in the heap.
118 uint length() const { return _committed_length; }
119
120 // Return the maximum number of regions in the heap.
|
80
81 void increment_allocated_length() {
82 assert(_allocated_length < max_length(), "pre-condition");
83 _allocated_length++;
84 }
85
86 void increment_length() {
87 assert(length() < max_length(), "pre-condition");
88 _committed_length++;
89 }
90
91 void decrement_length() {
92 assert(length() > 0, "pre-condition");
93 _committed_length--;
94 }
95
96 HeapWord* heap_bottom() const { return _regions.bottom_address_mapped(); }
97 HeapWord* heap_end() const {return _regions.end_address_mapped(); }
98
99 public:
100 // Empty constructor, we'll initialize it with the initialize() method.
101 HeapRegionSeq() : _regions(), _committed_length(0), _next_search_index(0), _allocated_length(0) { }
102
103 void initialize(HeapWord* bottom, HeapWord* end);
104
105 // Return the HeapRegion at the given index. Assume that the index
106 // is valid.
107 inline HeapRegion* at(uint index) const;
108
109 // If addr is within the committed space return its corresponding
110 // HeapRegion, otherwise return NULL.
111 inline HeapRegion* addr_to_region(HeapWord* addr) const;
112
113 // Return the HeapRegion that corresponds to the given
114 // address. Assume the address is valid.
115 inline HeapRegion* addr_to_region_unsafe(HeapWord* addr) const;
116
117 // Return the number of regions that have been committed in the heap.
118 uint length() const { return _committed_length; }
119
120 // Return the maximum number of regions in the heap.
|