1149 1150 HeapWord* base() const { 1151 return _reserved.start(); 1152 } 1153 1154 bool is_in_reserved(const void* addr) const { 1155 return _reserved.contains(addr); 1156 } 1157 1158 G1HotCardCache* hot_card_cache() const { return _hot_card_cache; } 1159 1160 G1CardTable* card_table() const { 1161 return _card_table; 1162 } 1163 1164 // Iteration functions. 1165 1166 // Iterate over all objects, calling "cl.do_object" on each. 1167 virtual void object_iterate(ObjectClosure* cl); 1168 1169 virtual void safe_object_iterate(ObjectClosure* cl) { 1170 object_iterate(cl); 1171 } 1172 1173 // Iterate over heap regions, in address order, terminating the 1174 // iteration early if the "do_heap_region" method returns "true". 1175 void heap_region_iterate(HeapRegionClosure* blk) const; 1176 1177 // Return the region with the given index. It assumes the index is valid. 1178 inline HeapRegion* region_at(uint index) const; 1179 inline HeapRegion* region_at_or_null(uint index) const; 1180 1181 // Return the next region (by index) that is part of the same 1182 // humongous object that hr is part of. 1183 inline HeapRegion* next_region_in_humongous(HeapRegion* hr) const; 1184 1185 // Calculate the region index of the given address. Given address must be 1186 // within the heap. 1187 inline uint addr_to_region(HeapWord* addr) const; 1188 1189 inline HeapWord* bottom_addr_for_region(uint index) const; 1190 1191 // Two functions to iterate over the heap regions in parallel. Threads 1192 // compete using the HeapRegionClaimer to claim the regions before | 1149 1150 HeapWord* base() const { 1151 return _reserved.start(); 1152 } 1153 1154 bool is_in_reserved(const void* addr) const { 1155 return _reserved.contains(addr); 1156 } 1157 1158 G1HotCardCache* hot_card_cache() const { return _hot_card_cache; } 1159 1160 G1CardTable* card_table() const { 1161 return _card_table; 1162 } 1163 1164 // Iteration functions. 1165 1166 // Iterate over all objects, calling "cl.do_object" on each. 1167 virtual void object_iterate(ObjectClosure* cl); 1168 1169 // Iterate over heap regions, in address order, terminating the 1170 // iteration early if the "do_heap_region" method returns "true". 1171 void heap_region_iterate(HeapRegionClosure* blk) const; 1172 1173 // Return the region with the given index. It assumes the index is valid. 1174 inline HeapRegion* region_at(uint index) const; 1175 inline HeapRegion* region_at_or_null(uint index) const; 1176 1177 // Return the next region (by index) that is part of the same 1178 // humongous object that hr is part of. 1179 inline HeapRegion* next_region_in_humongous(HeapRegion* hr) const; 1180 1181 // Calculate the region index of the given address. Given address must be 1182 // within the heap. 1183 inline uint addr_to_region(HeapWord* addr) const; 1184 1185 inline HeapWord* bottom_addr_for_region(uint index) const; 1186 1187 // Two functions to iterate over the heap regions in parallel. Threads 1188 // compete using the HeapRegionClaimer to claim the regions before |