7121547: G1: High number mispredicted branches while iterating over the marking bitmap

There is a high number of mispredicted branches associated with calling BitMap::iteratate() from within CMBitMapRO::iterate(). Implement a version of CMBitMapRO::iterate() directly using inline-able routines.

Reviewed-by: tonyp, iveresov
This commit is contained in:
John Cuthbertson 2012-01-13 13:27:48 -08:00
parent 1b06646e3f
commit dac656c955
4 changed files with 56 additions and 16 deletions

View file

@ -104,17 +104,6 @@ int CMBitMapRO::heapWordDiffToOffsetDiff(size_t diff) const {
return (int) (diff >> _shifter);
}
bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
HeapWord* left = MAX2(_bmStartWord, mr.start());
HeapWord* right = MIN2(_bmStartWord + _bmWordSize, mr.end());
if (right > left) {
// Right-open interval [leftOffset, rightOffset).
return _bm.iterate(cl, heapWordToOffset(left), heapWordToOffset(right));
} else {
return true;
}
}
void CMBitMapRO::mostly_disjoint_range_union(BitMap* from_bitmap,
size_t from_start_index,
HeapWord* to_start_word,