Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 20542:0fcaab91d485
8055816: Remove dead code in g1BlockOffsetTable
Reviewed-by: tschatzl, mgerdin
author | brutisso |
---|---|
date | Fri, 10 Oct 2014 15:45:45 +0200 |
parents | 7baf47cb97cb |
children | e8bf410d5e23 |
comparison
equal
deleted
inserted
replaced
20541:e3ed86fc15ed | 20542:0fcaab91d485 |
---|---|
300 if (res == current) { | 300 if (res == current) { |
301 return true; | 301 return true; |
302 } | 302 } |
303 } | 303 } |
304 return false; | 304 return false; |
305 } | |
306 | |
307 HeapWord* HeapRegion::next_block_start_careful(HeapWord* addr) { | |
308 HeapWord* low = addr; | |
309 HeapWord* high = end(); | |
310 while (low < high) { | |
311 size_t diff = pointer_delta(high, low); | |
312 // Must add one below to bias toward the high amount. Otherwise, if | |
313 // "high" were at the desired value, and "low" were one less, we | |
314 // would not converge on "high". This is not symmetric, because | |
315 // we set "high" to a block start, which might be the right one, | |
316 // which we don't do for "low". | |
317 HeapWord* middle = low + (diff+1)/2; | |
318 if (middle == high) return high; | |
319 HeapWord* mid_bs = block_start_careful(middle); | |
320 if (mid_bs < addr) { | |
321 low = middle; | |
322 } else { | |
323 high = mid_bs; | |
324 } | |
325 } | |
326 assert(low == high && low >= addr, "Didn't work."); | |
327 return low; | |
328 } | 305 } |
329 | 306 |
330 HeapRegion::HeapRegion(uint hrm_index, | 307 HeapRegion::HeapRegion(uint hrm_index, |
331 G1BlockOffsetSharedArray* sharedOffsetArray, | 308 G1BlockOffsetSharedArray* sharedOffsetArray, |
332 MemRegion mr) : | 309 MemRegion mr) : |