Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 4827:2e966d967c5c
7121547: G1: High number mispredicted branches while iterating over the marking bitmap
Summary: 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
author | johnc |
---|---|
date | Fri, 13 Jan 2012 13:27:48 -0800 |
parents | 2ace1c4ee8da |
children | 851b58c26def |
comparison
equal
deleted
inserted
replaced
4788:9d4f4a1825e4 | 4827:2e966d967c5c |
---|---|
100 } | 100 } |
101 | 101 |
102 int CMBitMapRO::heapWordDiffToOffsetDiff(size_t diff) const { | 102 int CMBitMapRO::heapWordDiffToOffsetDiff(size_t diff) const { |
103 assert((diff & ((1 << _shifter) - 1)) == 0, "argument check"); | 103 assert((diff & ((1 << _shifter) - 1)) == 0, "argument check"); |
104 return (int) (diff >> _shifter); | 104 return (int) (diff >> _shifter); |
105 } | |
106 | |
107 bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) { | |
108 HeapWord* left = MAX2(_bmStartWord, mr.start()); | |
109 HeapWord* right = MIN2(_bmStartWord + _bmWordSize, mr.end()); | |
110 if (right > left) { | |
111 // Right-open interval [leftOffset, rightOffset). | |
112 return _bm.iterate(cl, heapWordToOffset(left), heapWordToOffset(right)); | |
113 } else { | |
114 return true; | |
115 } | |
116 } | 105 } |
117 | 106 |
118 void CMBitMapRO::mostly_disjoint_range_union(BitMap* from_bitmap, | 107 void CMBitMapRO::mostly_disjoint_range_union(BitMap* from_bitmap, |
119 size_t from_start_index, | 108 size_t from_start_index, |
120 HeapWord* to_start_word, | 109 HeapWord* to_start_word, |