156 MemRegion committed_unique_to_self(int self, MemRegion mr) const; |
156 MemRegion committed_unique_to_self(int self, MemRegion mr) const; |
157 |
157 |
158 // Mapping from address to card marking array entry |
158 // Mapping from address to card marking array entry |
159 jbyte* byte_for(const void* p) const { |
159 jbyte* byte_for(const void* p) const { |
160 assert(_whole_heap.contains(p), |
160 assert(_whole_heap.contains(p), |
161 err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " |
161 err_msg("Attempt to access p = " PTR_FORMAT " out of bounds of " |
162 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", |
162 " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")", |
163 p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); |
163 p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); |
164 jbyte* result = &byte_map_base[uintptr_t(p) >> card_shift]; |
164 jbyte* result = &byte_map_base[uintptr_t(p) >> card_shift]; |
165 assert(result >= _byte_map && result < _byte_map + _byte_map_size, |
165 assert(result >= _byte_map && result < _byte_map + _byte_map_size, |
166 "out of bounds accessor for card marking array"); |
166 "out of bounds accessor for card marking array"); |
167 return result; |
167 return result; |
434 assert(p >= _byte_map && p < _byte_map + _byte_map_size, |
434 assert(p >= _byte_map && p < _byte_map + _byte_map_size, |
435 "out of bounds access to card marking array"); |
435 "out of bounds access to card marking array"); |
436 size_t delta = pointer_delta(p, byte_map_base, sizeof(jbyte)); |
436 size_t delta = pointer_delta(p, byte_map_base, sizeof(jbyte)); |
437 HeapWord* result = (HeapWord*) (delta << card_shift); |
437 HeapWord* result = (HeapWord*) (delta << card_shift); |
438 assert(_whole_heap.contains(result), |
438 assert(_whole_heap.contains(result), |
439 err_msg("Returning result = "PTR_FORMAT" out of bounds of " |
439 err_msg("Returning result = " PTR_FORMAT " out of bounds of " |
440 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", |
440 " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")", |
441 p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); |
441 p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); |
442 return result; |
442 return result; |
443 } |
443 } |
444 |
444 |
445 // Mapping from address to card marking array index. |
445 // Mapping from address to card marking array index. |
446 size_t index_for(void* p) { |
446 size_t index_for(void* p) { |
447 assert(_whole_heap.contains(p), |
447 assert(_whole_heap.contains(p), |
448 err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " |
448 err_msg("Attempt to access p = " PTR_FORMAT " out of bounds of " |
449 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", |
449 " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")", |
450 p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); |
450 p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()))); |
451 return byte_for(p) - _byte_map; |
451 return byte_for(p) - _byte_map; |
452 } |
452 } |
453 |
453 |
454 const jbyte* byte_for_index(const size_t card_index) const { |
454 const jbyte* byte_for_index(const size_t card_index) const { |