< prev index next >
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
Print this page
rev 49511 : imported patch 8200234-g1concurrentmark-refactorings
rev 49512 : imported patch 8200234-stefanj-review
rev 49515 : 8200255: Remove G1CMTask::_concurrent
Reviewed-by: sangheki, sjohanss
rev 49516 : 8200074: Remove G1ConcurrentMark::_concurrent_marking_in_progress
Reviewed-by: sjohanss, sangheki
rev 49517 : imported patch 8200305-gc,liveness-output
rev 49518 : imported patch 8200385-prev-bitmap-marks-left
rev 49519 : imported patch 8200385-stefanj-review
rev 49520 : imported patch 8178105-switch-at-remark
rev 49521 : [mq]: 8178105-stefanj-review
rev 49522 : [mq]: 8178105-stefanj-review2
*** 1023,1042 ****
_cm->update_top_at_rebuild_start(hr);
}
void distribute_marked_bytes(HeapRegion* hr, size_t marked_words) {
uint const region_idx = hr->hrm_index();
- assert(hr->is_starts_humongous(),
- "Should not have marked bytes " SIZE_FORMAT " in non-starts humongous region %u (%s)",
- marked_words, region_idx, hr->get_type_str());
uint num_regions_in_humongous = (uint)G1CollectedHeap::humongous_obj_size_in_regions(marked_words);
for (uint i = region_idx; i < (region_idx + num_regions_in_humongous); i++) {
HeapRegion* const r = _g1h->region_at(i);
size_t const words_to_add = MIN2(HeapRegion::GrainWords, marked_words);
assert(words_to_add > 0, "Out of space to distribute before end of humongous object in region %u (starts %u)", i, region_idx);
r->add_to_marked_bytes(words_to_add * HeapWordSize);
marked_words -= words_to_add;
}
assert(marked_words == 0,
SIZE_FORMAT " words left after distributing space across %u regions",
--- 1023,1041 ----
_cm->update_top_at_rebuild_start(hr);
}
void distribute_marked_bytes(HeapRegion* hr, size_t marked_words) {
uint const region_idx = hr->hrm_index();
uint num_regions_in_humongous = (uint)G1CollectedHeap::humongous_obj_size_in_regions(marked_words);
for (uint i = region_idx; i < (region_idx + num_regions_in_humongous); i++) {
HeapRegion* const r = _g1h->region_at(i);
size_t const words_to_add = MIN2(HeapRegion::GrainWords, marked_words);
assert(words_to_add > 0, "Out of space to distribute before end of humongous object in region %u (starts %u)", i, region_idx);
+ log_trace(gc, marking)("Adding " SIZE_FORMAT " words to humongous region %u (%s)",
+ words_to_add, i, r->get_type_str());
r->add_to_marked_bytes(words_to_add * HeapWordSize);
marked_words -= words_to_add;
}
assert(marked_words == 0,
SIZE_FORMAT " words left after distributing space across %u regions",
*** 1048,1066 ****
size_t marked_words = _cm->liveness(region_idx);
// The marking attributes the object's size completely to the humongous starts
// region. We need to distribute this value across the entire set of regions a
// humongous object spans.
if (hr->is_humongous()) {
if (marked_words > 0) {
- log_trace(gc, marking)("Adding " SIZE_FORMAT " words to humongous start region %u (%s), word size %d (%f)",
- marked_words, region_idx, hr->get_type_str(),
- oop(hr->bottom())->size(), (double)oop(hr->bottom())->size() / HeapRegion::GrainWords);
distribute_marked_bytes(hr, marked_words);
- } else {
- assert(marked_words == 0,
- "Asked to add " SIZE_FORMAT " words to add to continues humongous region %u (%s)",
- marked_words, region_idx, hr->get_type_str());
}
} else {
log_trace(gc, marking)("Adding " SIZE_FORMAT " words to region %u (%s)", marked_words, region_idx, hr->get_type_str());
hr->add_to_marked_bytes(marked_words * HeapWordSize);
}
--- 1047,1062 ----
size_t marked_words = _cm->liveness(region_idx);
// The marking attributes the object's size completely to the humongous starts
// region. We need to distribute this value across the entire set of regions a
// humongous object spans.
if (hr->is_humongous()) {
+ assert(hr->is_starts_humongous() || marked_words == 0,
+ "Should not have marked words " SIZE_FORMAT " in non-starts humongous region %u (%s)",
+ marked_words, region_idx, hr->get_type_str());
+
if (marked_words > 0) {
distribute_marked_bytes(hr, marked_words);
}
} else {
log_trace(gc, marking)("Adding " SIZE_FORMAT " words to region %u (%s)", marked_words, region_idx, hr->get_type_str());
hr->add_to_marked_bytes(marked_words * HeapWordSize);
}
< prev index next >