242 // Action_verify - BOT verification. |
242 // Action_verify - BOT verification. |
243 void |
243 void |
244 BlockOffsetArray::do_block_internal(HeapWord* blk_start, |
244 BlockOffsetArray::do_block_internal(HeapWord* blk_start, |
245 HeapWord* blk_end, |
245 HeapWord* blk_end, |
246 Action action, bool reducing) { |
246 Action action, bool reducing) { |
247 assert(Universe::heap()->is_in_reserved(blk_start), |
247 assert(_sp->is_in_reserved(blk_start), |
248 "reference must be into the heap"); |
248 "reference must be into the space"); |
249 assert(Universe::heap()->is_in_reserved(blk_end-1), |
249 assert(_sp->is_in_reserved(blk_end-1), |
250 "limit must be within the heap"); |
250 "limit must be within the space"); |
251 // This is optimized to make the test fast, assuming we only rarely |
251 // This is optimized to make the test fast, assuming we only rarely |
252 // cross boundaries. |
252 // cross boundaries. |
253 uintptr_t end_ui = (uintptr_t)(blk_end - 1); |
253 uintptr_t end_ui = (uintptr_t)(blk_end - 1); |
254 uintptr_t start_ui = (uintptr_t)blk_start; |
254 uintptr_t start_ui = (uintptr_t)blk_start; |
255 // Calculate the last card boundary preceding end of blk |
255 // Calculate the last card boundary preceding end of blk |
716 "should be past threshold"); |
716 "should be past threshold"); |
717 assert(blk_start <= _next_offset_threshold, |
717 assert(blk_start <= _next_offset_threshold, |
718 "blk_start should be at or before threshold"); |
718 "blk_start should be at or before threshold"); |
719 assert(pointer_delta(_next_offset_threshold, blk_start) <= BOTConstants::N_words, |
719 assert(pointer_delta(_next_offset_threshold, blk_start) <= BOTConstants::N_words, |
720 "offset should be <= BlockOffsetSharedArray::N"); |
720 "offset should be <= BlockOffsetSharedArray::N"); |
721 assert(Universe::heap()->is_in_reserved(blk_start), |
721 assert(_sp->is_in_reserved(blk_start), |
722 "reference must be into the heap"); |
722 "reference must be into the space"); |
723 assert(Universe::heap()->is_in_reserved(blk_end-1), |
723 assert(_sp->is_in_reserved(blk_end-1), |
724 "limit must be within the heap"); |
724 "limit must be within the space"); |
725 assert(_next_offset_threshold == |
725 assert(_next_offset_threshold == |
726 _array->_reserved.start() + _next_offset_index*BOTConstants::N_words, |
726 _array->_reserved.start() + _next_offset_index*BOTConstants::N_words, |
727 "index must agree with threshold"); |
727 "index must agree with threshold"); |
728 |
728 |
729 debug_only(size_t orig_next_offset_index = _next_offset_index;) |
729 debug_only(size_t orig_next_offset_index = _next_offset_index;) |
773 } |
773 } |
774 #endif |
774 #endif |
775 } |
775 } |
776 |
776 |
777 HeapWord* BlockOffsetArrayContigSpace::initialize_threshold() { |
777 HeapWord* BlockOffsetArrayContigSpace::initialize_threshold() { |
778 assert(!Universe::heap()->is_in_reserved(_array->_offset_array), |
|
779 "just checking"); |
|
780 _next_offset_index = _array->index_for(_bottom); |
778 _next_offset_index = _array->index_for(_bottom); |
781 _next_offset_index++; |
779 _next_offset_index++; |
782 _next_offset_threshold = |
780 _next_offset_threshold = |
783 _array->address_for_index(_next_offset_index); |
781 _array->address_for_index(_next_offset_index); |
784 return _next_offset_threshold; |
782 return _next_offset_threshold; |
785 } |
783 } |
786 |
784 |
787 void BlockOffsetArrayContigSpace::zero_bottom_entry() { |
785 void BlockOffsetArrayContigSpace::zero_bottom_entry() { |
788 assert(!Universe::heap()->is_in_reserved(_array->_offset_array), |
|
789 "just checking"); |
|
790 size_t bottom_index = _array->index_for(_bottom); |
786 size_t bottom_index = _array->index_for(_bottom); |
791 _array->set_offset_array(bottom_index, 0); |
787 _array->set_offset_array(bottom_index, 0); |
792 } |
788 } |
793 |
789 |
794 size_t BlockOffsetArrayContigSpace::last_active_index() const { |
790 size_t BlockOffsetArrayContigSpace::last_active_index() const { |