hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp
bool
ParMarkBitMap::mark_obj(HeapWord* addr, size_t size)
{
{- -------------------------------------------
(1) BitMap::par_set_bit() で _beg_bits の該当箇所の書き換え(mark 付け)を試みる.
成功したら, _end_bits の方の該当箇所も書き換えて true をリターンする.
失敗したら false をリターンする.
---------------------------------------- -}
const idx_t beg_bit = addr_to_bit(addr);
if (_beg_bits.par_set_bit(beg_bit)) {
const idx_t end_bit = addr_to_bit(addr + size - 1);
bool end_bit_ok = _end_bits.par_set_bit(end_bit);
assert(end_bit_ok, "concurrency problem");
DEBUG_ONLY(Atomic::inc_ptr(&mark_bitmap_count));
DEBUG_ONLY(Atomic::add_ptr(size, &mark_bitmap_size));
return true;
}
return false;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.