195 |
195 |
196 #define check_mark(addr) \ |
196 #define check_mark(addr) \ |
197 assert(_bmStartWord <= (addr) && (addr) < (_bmStartWord + _bmWordSize), \ |
197 assert(_bmStartWord <= (addr) && (addr) < (_bmStartWord + _bmWordSize), \ |
198 "outside underlying space?"); \ |
198 "outside underlying space?"); \ |
199 assert(G1CollectedHeap::heap()->is_in_exact(addr), \ |
199 assert(G1CollectedHeap::heap()->is_in_exact(addr), \ |
200 err_msg("Trying to access not available bitmap " PTR_FORMAT \ |
200 "Trying to access not available bitmap " PTR_FORMAT \ |
201 " corresponding to " PTR_FORMAT " (%u)", \ |
201 " corresponding to " PTR_FORMAT " (%u)", \ |
202 p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr))); |
202 p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr)); |
203 |
203 |
204 inline void CMBitMap::mark(HeapWord* addr) { |
204 inline void CMBitMap::mark(HeapWord* addr) { |
205 check_mark(addr); |
205 check_mark(addr); |
206 _bm.set_bit(heapWordToOffset(addr)); |
206 _bm.set_bit(heapWordToOffset(addr)); |
207 } |
207 } |
223 |
223 |
224 #undef check_mark |
224 #undef check_mark |
225 |
225 |
226 template<typename Fn> |
226 template<typename Fn> |
227 inline void CMMarkStack::iterate(Fn fn) { |
227 inline void CMMarkStack::iterate(Fn fn) { |
228 assert(_saved_index == _index, |
228 assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index); |
229 err_msg("saved index: %d index: %d", _saved_index, _index)); |
|
230 for (int i = 0; i < _index; ++i) { |
229 for (int i = 0; i < _index; ++i) { |
231 fn(_base[i]); |
230 fn(_base[i]); |
232 } |
231 } |
233 } |
232 } |
234 |
233 |
383 } |
382 } |
384 |
383 |
385 increment_refs_reached(); |
384 increment_refs_reached(); |
386 |
385 |
387 HeapWord* objAddr = (HeapWord*) obj; |
386 HeapWord* objAddr = (HeapWord*) obj; |
388 assert(obj->is_oop_or_null(true /* ignore mark word */), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(obj))); |
387 assert(obj->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj)); |
389 if (_g1h->is_in_g1_reserved(objAddr)) { |
388 if (_g1h->is_in_g1_reserved(objAddr)) { |
390 assert(obj != NULL, "null check is implicit"); |
389 assert(obj != NULL, "null check is implicit"); |
391 if (!_nextMarkBitMap->isMarked(objAddr)) { |
390 if (!_nextMarkBitMap->isMarked(objAddr)) { |
392 // Only get the containing region if the object is not marked on the |
391 // Only get the containing region if the object is not marked on the |
393 // bitmap (otherwise, it's a waste of time since we won't do |
392 // bitmap (otherwise, it's a waste of time since we won't do |
425 // might not be in a consistent state (another thread might be in |
424 // might not be in a consistent state (another thread might be in |
426 // the process of copying it). So the best thing we can do is to |
425 // the process of copying it). So the best thing we can do is to |
427 // assert that word_size is under an upper bound which is its |
426 // assert that word_size is under an upper bound which is its |
428 // containing region's capacity. |
427 // containing region's capacity. |
429 assert(word_size * HeapWordSize <= hr->capacity(), |
428 assert(word_size * HeapWordSize <= hr->capacity(), |
430 err_msg("size: " SIZE_FORMAT " capacity: " SIZE_FORMAT " " HR_FORMAT, |
429 "size: " SIZE_FORMAT " capacity: " SIZE_FORMAT " " HR_FORMAT, |
431 word_size * HeapWordSize, hr->capacity(), |
430 word_size * HeapWordSize, hr->capacity(), |
432 HR_FORMAT_PARAMS(hr))); |
431 HR_FORMAT_PARAMS(hr)); |
433 |
432 |
434 if (addr < hr->next_top_at_mark_start()) { |
433 if (addr < hr->next_top_at_mark_start()) { |
435 if (!_nextMarkBitMap->isMarked(addr)) { |
434 if (!_nextMarkBitMap->isMarked(addr)) { |
436 par_mark_and_count(obj, word_size, hr, worker_id); |
435 par_mark_and_count(obj, word_size, hr, worker_id); |
437 } |
436 } |