< prev index next >
src/share/vm/gc/g1/heapRegion.cpp
Print this page
*** 65,75 ****
// Start filtering what we add to the remembered set. If the object is
// not considered dead, either because it is marked (in the mark bitmap)
// or it was allocated after marking finished, then we add it. Otherwise
// we can safely ignore the object.
! if (!g1h->is_obj_dead(oop(cur), _hr)) {
oop_size = oop(cur)->oop_iterate_size(_rs_scan, mr);
} else {
oop_size = _hr->block_size(cur);
}
--- 65,75 ----
// Start filtering what we add to the remembered set. If the object is
// not considered dead, either because it is marked (in the mark bitmap)
// or it was allocated after marking finished, then we add it. Otherwise
// we can safely ignore the object.
! if (!g1h->is_obj_dead(oop(cur))) {
oop_size = oop(cur)->oop_iterate_size(_rs_scan, mr);
} else {
oop_size = _hr->block_size(cur);
}
*** 79,89 ****
oop cur_oop = oop(cur);
oop_size = _hr->block_size(cur);
HeapWord* next_obj = cur + oop_size;
while (next_obj < top) {
// Keep filtering the remembered set.
! if (!g1h->is_obj_dead(cur_oop, _hr)) {
// Bottom lies entirely below top, so we can call the
// non-memRegion version of oop_iterate below.
cur_oop->oop_iterate(_rs_scan);
}
cur = next_obj;
--- 79,89 ----
oop cur_oop = oop(cur);
oop_size = _hr->block_size(cur);
HeapWord* next_obj = cur + oop_size;
while (next_obj < top) {
// Keep filtering the remembered set.
! if (!g1h->is_obj_dead(cur_oop)) {
// Bottom lies entirely below top, so we can call the
// non-memRegion version of oop_iterate below.
cur_oop->oop_iterate(_rs_scan);
}
cur = next_obj;
*** 91,101 ****
oop_size = _hr->block_size(cur);
next_obj = cur + oop_size;
}
// Last object. Need to do dead-obj filtering here too.
! if (!g1h->is_obj_dead(oop(cur), _hr)) {
oop(cur)->oop_iterate(_rs_scan, mr);
}
}
}
--- 91,101 ----
oop_size = _hr->block_size(cur);
next_obj = cur + oop_size;
}
// Last object. Need to do dead-obj filtering here too.
! if (!g1h->is_obj_dead(oop(cur))) {
oop(cur)->oop_iterate(_rs_scan, mr);
}
}
}
*** 160,171 ****
}
void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
assert(_humongous_start_region == NULL,
"we should have already filtered out humongous regions");
- assert(_end == orig_end(),
- "we should have already filtered out humongous regions");
assert(!in_collection_set(),
"Should not clear heap region %u in the collection set", hrm_index());
set_allocation_context(AllocationContext::system());
set_young_index_in_cset(-1);
--- 160,169 ----
*** 211,260 ****
double region_elapsed_time_ms =
g1p->predict_region_elapsed_time_ms(this, false /* for_young_gc */);
_gc_efficiency = (double) reclaimable_bytes() / region_elapsed_time_ms;
}
! void HeapRegion::set_starts_humongous(HeapWord* new_top, HeapWord* new_end) {
assert(!is_humongous(), "sanity / pre-condition");
- assert(end() == orig_end(),
- "Should be normal before the humongous object allocation");
assert(top() == bottom(), "should be empty");
- assert(bottom() <= new_top && new_top <= new_end, "pre-condition");
_type.set_starts_humongous();
_humongous_start_region = this;
! set_end(new_end);
! _offsets.set_for_starts_humongous(new_top);
}
void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
assert(!is_humongous(), "sanity / pre-condition");
- assert(end() == orig_end(),
- "Should be normal before the humongous object allocation");
assert(top() == bottom(), "should be empty");
assert(first_hr->is_starts_humongous(), "pre-condition");
_type.set_continues_humongous();
_humongous_start_region = first_hr;
}
void HeapRegion::clear_humongous() {
assert(is_humongous(), "pre-condition");
- if (is_starts_humongous()) {
- assert(top() <= end(), "pre-condition");
- set_end(orig_end());
- if (top() > end()) {
- // at least one "continues humongous" region after it
- set_top(end());
- }
- } else {
- // continues humongous
- assert(end() == orig_end(), "sanity");
- }
-
assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
_humongous_start_region = NULL;
}
HeapRegion::HeapRegion(uint hrm_index,
--- 209,240 ----
double region_elapsed_time_ms =
g1p->predict_region_elapsed_time_ms(this, false /* for_young_gc */);
_gc_efficiency = (double) reclaimable_bytes() / region_elapsed_time_ms;
}
! void HeapRegion::set_starts_humongous(HeapWord* obj_top) {
assert(!is_humongous(), "sanity / pre-condition");
assert(top() == bottom(), "should be empty");
_type.set_starts_humongous();
_humongous_start_region = this;
! _offsets.set_for_starts_humongous(obj_top);
}
void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
assert(!is_humongous(), "sanity / pre-condition");
assert(top() == bottom(), "should be empty");
assert(first_hr->is_starts_humongous(), "pre-condition");
_type.set_continues_humongous();
_humongous_start_region = first_hr;
}
void HeapRegion::clear_humongous() {
assert(is_humongous(), "pre-condition");
assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
_humongous_start_region = NULL;
}
HeapRegion::HeapRegion(uint hrm_index,
*** 288,302 ****
G1OffsetTableContigSpace::initialize(mr, clear_space, mangle_space);
hr_clear(false /*par*/, false /*clear_space*/);
set_top(bottom());
record_timestamp();
-
- assert(mr.end() == orig_end(),
- "Given region end address " PTR_FORMAT " should match exactly "
- "bottom plus one region size, i.e. " PTR_FORMAT,
- p2i(mr.end()), p2i(orig_end()));
}
CompactibleSpace* HeapRegion::next_compaction_space() const {
return G1CollectedHeap::heap()->next_compaction_region(this);
}
--- 268,277 ----
*** 718,728 ****
if (!_g1h->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing(obj);
if (from != NULL && to != NULL &&
from != to &&
! !to->is_pinned()) {
jbyte cv_obj = *_bs->byte_for_const(_containing_obj);
jbyte cv_field = *_bs->byte_for_const(p);
const jbyte dirty = CardTableModRefBS::dirty_card_val();
bool is_bad = !(from->is_young()
--- 693,704 ----
if (!_g1h->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing(obj);
if (from != NULL && to != NULL &&
from != to &&
! !to->is_pinned() &&
! !from->is_continues_humongous()) {
jbyte cv_obj = *_bs->byte_for_const(_containing_obj);
jbyte cv_field = *_bs->byte_for_const(p);
const jbyte dirty = CardTableModRefBS::dirty_card_val();
bool is_bad = !(from->is_young()
*** 830,848 ****
if (!is_young() && !is_empty()) {
_offsets.verify();
}
! if (p != top()) {
gclog_or_tty->print_cr("end of last object " PTR_FORMAT " "
"does not match top " PTR_FORMAT, p2i(p), p2i(top()));
*failures = true;
return;
}
HeapWord* the_end = end();
- assert(p == top(), "it should still hold");
// Do some extra BOT consistency checking for addresses in the
// range [top, end). BOT look-ups in this range should yield
// top. No point in doing that if top == end (there's nothing there).
if (p < the_end) {
// Look up top
--- 806,823 ----
if (!is_young() && !is_empty()) {
_offsets.verify();
}
! if (!is_region_humongous && p != top()) {
gclog_or_tty->print_cr("end of last object " PTR_FORMAT " "
"does not match top " PTR_FORMAT, p2i(p), p2i(top()));
*failures = true;
return;
}
HeapWord* the_end = end();
// Do some extra BOT consistency checking for addresses in the
// range [top, end). BOT look-ups in this range should yield
// top. No point in doing that if top == end (there's nothing there).
if (p < the_end) {
// Look up top
< prev index next >