mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8007772: G1: assert(!hr->isHumongous() || mr.start() == hr->bottom()) failed: the start of HeapRegion and MemRegion should be consistent for humongous regions
In do_marking_step(), we should always give up current region after scanning the object, if the region is humongous. Reviewed-by: brutisso, jwilhelm, tamao
This commit is contained in:
parent
77ebf3cbc1
commit
251a9ff39c
1 changed files with 26 additions and 17 deletions
|
@ -4062,27 +4062,36 @@ void CMTask::do_marking_step(double time_target_ms,
|
||||||
if (_cm->verbose_low()) {
|
if (_cm->verbose_low()) {
|
||||||
gclog_or_tty->print_cr("[%u] we're scanning part "
|
gclog_or_tty->print_cr("[%u] we're scanning part "
|
||||||
"["PTR_FORMAT", "PTR_FORMAT") "
|
"["PTR_FORMAT", "PTR_FORMAT") "
|
||||||
"of region "PTR_FORMAT,
|
"of region "HR_FORMAT,
|
||||||
_worker_id, _finger, _region_limit, _curr_region);
|
_worker_id, _finger, _region_limit,
|
||||||
|
HR_FORMAT_PARAMS(_curr_region));
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapRegion* hr = _g1h->heap_region_containing(mr.start());
|
assert(!_curr_region->isHumongous() || mr.start() == _curr_region->bottom(),
|
||||||
assert(!hr->isHumongous() || mr.start() == hr->bottom(),
|
"humongous regions should go around loop once only");
|
||||||
"the start of HeapRegion and MemRegion should be consistent for humongous regions");
|
|
||||||
|
|
||||||
// The special case of the bitmap of a humongous region with its first
|
// Some special cases:
|
||||||
// bit NOT marked should be avoided from (wasteful) iterating.
|
// If the memory region is empty, we can just give up the region.
|
||||||
// Note that the alternative case of the bitmap of a humongous region
|
// If the current region is humongous then we only need to check
|
||||||
// with its first bit marked is handled properly in the iterate() routine.
|
// the bitmap for the bit associated with the start of the object,
|
||||||
// Then, let's iterate over the bitmap of the part of the region that is
|
// scan the object if it's live, and give up the region.
|
||||||
// left.
|
// Otherwise, let's iterate over the bitmap of the part of the region
|
||||||
|
// that is left.
|
||||||
// If the iteration is successful, give up the region.
|
// If the iteration is successful, give up the region.
|
||||||
// Also note that the case of the bitmap of a humongous region with its
|
if (mr.is_empty()) {
|
||||||
// first bit NOT marked is considered "successful", leveraging the fact
|
giveup_current_region();
|
||||||
// that the entire bitmap consists of all 0's in such case.
|
regular_clock_call();
|
||||||
if (mr.is_empty() ||
|
} else if (_curr_region->isHumongous() && mr.start() == _curr_region->bottom()) {
|
||||||
(hr != NULL && hr->isHumongous() && !_nextMarkBitMap->isMarked(mr.start())) ||
|
if (_nextMarkBitMap->isMarked(mr.start())) {
|
||||||
_nextMarkBitMap->iterate(&bitmap_closure, mr)) {
|
// The object is marked - apply the closure
|
||||||
|
BitMap::idx_t offset = _nextMarkBitMap->heapWordToOffset(mr.start());
|
||||||
|
bitmap_closure.do_bit(offset);
|
||||||
|
}
|
||||||
|
// Even if this task aborted while scanning the humongous object
|
||||||
|
// we can (and should) give up the current region.
|
||||||
|
giveup_current_region();
|
||||||
|
regular_clock_call();
|
||||||
|
} else if (_nextMarkBitMap->iterate(&bitmap_closure, mr)) {
|
||||||
giveup_current_region();
|
giveup_current_region();
|
||||||
regular_clock_call();
|
regular_clock_call();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue