comparison src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp @ 20542:0fcaab91d485

8055816: Remove dead code in g1BlockOffsetTable Reviewed-by: tschatzl, mgerdin
author brutisso
date Fri, 10 Oct 2014 15:45:45 +0200
parents 1f1d373cd044
children
comparison
equal deleted inserted replaced
20541:e3ed86fc15ed 20542:0fcaab91d485
87 const size_t end = i + num_cards; 87 const size_t end = i + num_cards;
88 for (; i < end; i++) { 88 for (; i < end; i++) {
89 _offset_array[i] = offset; 89 _offset_array[i] = offset;
90 } 90 }
91 } 91 }
92 }
93
94 void G1BlockOffsetSharedArray::check_offset_array(size_t index, HeapWord* high, HeapWord* low) const {
95 check_index(index, "index out of range");
96 assert(high >= low, "addresses out of order");
97 check_offset(pointer_delta(high, low), "offset too large");
98 assert(_offset_array[index] == pointer_delta(high, low), "Wrong offset");
99 } 92 }
100 93
101 // Variant of index_for that does not check the index for validity. 94 // Variant of index_for that does not check the index for validity.
102 inline size_t G1BlockOffsetSharedArray::index_for_raw(const void* p) const { 95 inline size_t G1BlockOffsetSharedArray::index_for_raw(const void* p) const {
103 return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> LogN; 96 return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> LogN;
191 } 184 }
192 assert(q <= addr, "wrong order for current and arg"); 185 assert(q <= addr, "wrong order for current and arg");
193 return q; 186 return q;
194 } 187 }
195 188
196 //////////////////////////////////////////////////////////////////////////
197 // BlockOffsetArrayNonContigSpace inlines
198 //////////////////////////////////////////////////////////////////////////
199 inline void G1BlockOffsetArray::freed(HeapWord* blk_start, HeapWord* blk_end) {
200 // Verify that the BOT shows [blk_start, blk_end) to be one block.
201 verify_single_block(blk_start, blk_end);
202 // adjust _unallocated_block upward or downward
203 // as appropriate
204 if (BlockOffsetArrayUseUnallocatedBlock) {
205 assert(_unallocated_block <= _end,
206 "Inconsistent value for _unallocated_block");
207 if (blk_end >= _unallocated_block && blk_start <= _unallocated_block) {
208 // CMS-specific note: a block abutting _unallocated_block to
209 // its left is being freed, a new block is being added or
210 // we are resetting following a compaction
211 _unallocated_block = blk_start;
212 }
213 }
214 }
215
216 inline void G1BlockOffsetArray::freed(HeapWord* blk, size_t size) {
217 freed(blk, blk + size);
218 }
219
220 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP 189 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP