1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Tue Aug 19 10:50:27 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp Thu Aug 21 11:47:10 2014 +0200 1.3 @@ -268,6 +268,36 @@ 1.4 return iterate(cl, mr); 1.5 } 1.6 1.7 +#define check_mark(addr) \ 1.8 + assert(_bmStartWord <= (addr) && (addr) < (_bmStartWord + _bmWordSize), \ 1.9 + "outside underlying space?"); \ 1.10 + assert(G1CollectedHeap::heap()->is_in_exact(addr), \ 1.11 + err_msg("Trying to access not available bitmap "PTR_FORMAT \ 1.12 + " corresponding to "PTR_FORMAT" (%u)", \ 1.13 + p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr))); 1.14 + 1.15 +inline void CMBitMap::mark(HeapWord* addr) { 1.16 + check_mark(addr); 1.17 + _bm.set_bit(heapWordToOffset(addr)); 1.18 +} 1.19 + 1.20 +inline void CMBitMap::clear(HeapWord* addr) { 1.21 + check_mark(addr); 1.22 + _bm.clear_bit(heapWordToOffset(addr)); 1.23 +} 1.24 + 1.25 +inline bool CMBitMap::parMark(HeapWord* addr) { 1.26 + check_mark(addr); 1.27 + return _bm.par_set_bit(heapWordToOffset(addr)); 1.28 +} 1.29 + 1.30 +inline bool CMBitMap::parClear(HeapWord* addr) { 1.31 + check_mark(addr); 1.32 + return _bm.par_clear_bit(heapWordToOffset(addr)); 1.33 +} 1.34 + 1.35 +#undef check_mark 1.36 + 1.37 inline void CMTask::push(oop obj) { 1.38 HeapWord* objAddr = (HeapWord*) obj; 1.39 assert(_g1h->is_in_g1_reserved(objAddr), "invariant");