src/share/vm/gc/g1/g1ConcurrentMark.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/gc/g1/g1ConcurrentMark.cpp
src/share/vm/gc/g1/g1ConcurrentMark.cpp
Print this page
*** 122,142 ****
MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_region), num_regions * HeapRegion::GrainWords);
_bm->clearRange(mr);
}
// Closure used for clearing the given mark bitmap.
! class ClearBitmapHRClosure : public HeapRegionClosure {
private:
G1ConcurrentMark* _cm;
G1CMBitMap* _bitmap;
bool _may_yield; // The closure may yield during iteration. If yielded, abort the iteration.
public:
! ClearBitmapHRClosure(G1ConcurrentMark* cm, G1CMBitMap* bitmap, bool may_yield) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) {
assert(!may_yield || cm != NULL, "CM must be non-NULL if this closure is expected to yield.");
}
! virtual bool doHeapRegion(HeapRegion* r) {
size_t const chunk_size_in_words = M / HeapWordSize;
HeapWord* cur = r->bottom();
HeapWord* const end = r->end();
--- 122,142 ----
MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_region), num_regions * HeapRegion::GrainWords);
_bm->clearRange(mr);
}
// Closure used for clearing the given mark bitmap.
! class ClearBitmapHRClosure : public AbortableHeapRegionClosure {
private:
G1ConcurrentMark* _cm;
G1CMBitMap* _bitmap;
bool _may_yield; // The closure may yield during iteration. If yielded, abort the iteration.
public:
! ClearBitmapHRClosure(G1ConcurrentMark* cm, G1CMBitMap* bitmap, bool may_yield) : AbortableHeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) {
assert(!may_yield || cm != NULL, "CM must be non-NULL if this closure is expected to yield.");
}
! virtual bool doHeapRegionAbortable(HeapRegion* r) {
size_t const chunk_size_in_words = M / HeapWordSize;
HeapWord* cur = r->bottom();
HeapWord* const end = r->end();
*** 724,741 ****
// Repeat the asserts from above.
guarantee(cmThread()->during_cycle(), "invariant");
guarantee(!g1h->collector_state()->mark_in_progress(), "invariant");
}
! class CheckBitmapClearHRClosure : public HeapRegionClosure {
G1CMBitMap* _bitmap;
bool _error;
public:
CheckBitmapClearHRClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) {
}
! virtual bool doHeapRegion(HeapRegion* r) {
// This closure can be called concurrently to the mutator, so we must make sure
// that the result of the getNextMarkedWordAddress() call is compared to the
// value passed to it as limit to detect any found bits.
// end never changes in G1.
HeapWord* end = r->end();
--- 724,741 ----
// Repeat the asserts from above.
guarantee(cmThread()->during_cycle(), "invariant");
guarantee(!g1h->collector_state()->mark_in_progress(), "invariant");
}
! class CheckBitmapClearHRClosure : public AbortableHeapRegionClosure {
G1CMBitMap* _bitmap;
bool _error;
public:
CheckBitmapClearHRClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) {
}
! virtual bool doHeapRegionAbortable(HeapRegion* r) {
// This closure can be called concurrently to the mutator, so we must make sure
// that the result of the getNextMarkedWordAddress() call is compared to the
// value passed to it as limit to detect any found bits.
// end never changes in G1.
HeapWord* end = r->end();
*** 749,761 ****
return cl.complete();
}
class NoteStartOfMarkHRClosure: public HeapRegionClosure {
public:
! bool doHeapRegion(HeapRegion* r) {
r->note_start_of_marking();
- return false;
}
};
void G1ConcurrentMark::checkpointRootsInitialPre() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
--- 749,760 ----
return cl.complete();
}
class NoteStartOfMarkHRClosure: public HeapRegionClosure {
public:
! void doHeapRegion(HeapRegion* r) {
r->note_start_of_marking();
}
};
void G1ConcurrentMark::checkpointRootsInitialPre() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
*** 1203,1213 ****
CalcLiveObjectsClosure(G1CMBitMapRO *bm, G1CollectedHeap* g1h,
BitMap* region_bm, BitMap* card_bm) :
G1CMCountDataClosureBase(g1h, region_bm, card_bm),
_bm(bm), _region_marked_bytes(0) { }
! bool doHeapRegion(HeapRegion* hr) {
HeapWord* ntams = hr->next_top_at_mark_start();
HeapWord* start = hr->bottom();
assert(start <= hr->end() && start <= ntams && ntams <= hr->end(),
"Preconditions not met - "
--- 1202,1212 ----
CalcLiveObjectsClosure(G1CMBitMapRO *bm, G1CollectedHeap* g1h,
BitMap* region_bm, BitMap* card_bm) :
G1CMCountDataClosureBase(g1h, region_bm, card_bm),
_bm(bm), _region_marked_bytes(0) { }
! void doHeapRegion(HeapRegion* hr) {
HeapWord* ntams = hr->next_top_at_mark_start();
HeapWord* start = hr->bottom();
assert(start <= hr->end() && start <= ntams && ntams <= hr->end(),
"Preconditions not met - "
*** 1279,1290 ****
}
// Set the marked bytes for the current region so that
// it can be queried by a calling verification routine
_region_marked_bytes = marked_bytes;
-
- return false;
}
size_t region_marked_bytes() const { return _region_marked_bytes; }
};
--- 1278,1287 ----
*** 1317,1334 ****
_exp_region_bm(exp_region_bm), _exp_card_bm(exp_card_bm),
_failures(0) { }
int failures() const { return _failures; }
! bool doHeapRegion(HeapRegion* hr) {
int failures = 0;
// Call the CalcLiveObjectsClosure to walk the marking bitmap for
// this region and set the corresponding bits in the expected region
// and card bitmaps.
! bool res = _calc_cl.doHeapRegion(hr);
! assert(res == false, "should be continuing");
// Verify the marked bytes for this region.
size_t exp_marked_bytes = _calc_cl.region_marked_bytes();
size_t act_marked_bytes = hr->next_marked_bytes();
--- 1314,1330 ----
_exp_region_bm(exp_region_bm), _exp_card_bm(exp_card_bm),
_failures(0) { }
int failures() const { return _failures; }
! void doHeapRegion(HeapRegion* hr) {
int failures = 0;
// Call the CalcLiveObjectsClosure to walk the marking bitmap for
// this region and set the corresponding bits in the expected region
// and card bitmaps.
! _calc_cl.doHeapRegion(hr);
// Verify the marked bytes for this region.
size_t exp_marked_bytes = _calc_cl.region_marked_bytes();
size_t act_marked_bytes = hr->next_marked_bytes();
*** 1380,1393 ****
failures += 1;
}
}
_failures += failures;
-
- // We could stop iteration over the heap when we
- // find the first violating region by returning true.
- return false;
}
};
class G1ParVerifyFinalCountTask: public AbstractGangTask {
protected:
--- 1376,1385 ----
*** 1448,1458 ****
FinalCountDataUpdateClosure(G1CollectedHeap* g1h,
BitMap* region_bm,
BitMap* card_bm) :
G1CMCountDataClosureBase(g1h, region_bm, card_bm) { }
! bool doHeapRegion(HeapRegion* hr) {
HeapWord* ntams = hr->next_top_at_mark_start();
HeapWord* top = hr->top();
assert(hr->bottom() <= ntams && ntams <= hr->end(), "Preconditions.");
--- 1440,1450 ----
FinalCountDataUpdateClosure(G1CollectedHeap* g1h,
BitMap* region_bm,
BitMap* card_bm) :
G1CMCountDataClosureBase(g1h, region_bm, card_bm) { }
! void doHeapRegion(HeapRegion* hr) {
HeapWord* ntams = hr->next_top_at_mark_start();
HeapWord* top = hr->top();
assert(hr->bottom() <= ntams && ntams <= hr->end(), "Preconditions.");
*** 1487,1498 ****
// Set the bit for the region if it contains live data
if (hr->next_marked_bytes() > 0) {
set_bit_for_region(hr);
}
-
- return false;
}
};
class G1ParFinalCountTask: public AbstractGangTask {
protected:
--- 1479,1488 ----
*** 1544,1556 ****
size_t freed_bytes() { return _freed_bytes; }
const uint old_regions_removed() { return _old_regions_removed; }
const uint humongous_regions_removed() { return _humongous_regions_removed; }
! bool doHeapRegion(HeapRegion *hr) {
if (hr->is_archive()) {
! return false;
}
// We use a claim value of zero here because all regions
// were claimed with value 1 in the FinalCount task.
_g1->reset_gc_time_stamps(hr);
hr->note_end_of_marking();
--- 1534,1546 ----
size_t freed_bytes() { return _freed_bytes; }
const uint old_regions_removed() { return _old_regions_removed; }
const uint humongous_regions_removed() { return _humongous_regions_removed; }
! void doHeapRegion(HeapRegion *hr) {
if (hr->is_archive()) {
! return;
}
// We use a claim value of zero here because all regions
// were claimed with value 1 in the FinalCount task.
_g1->reset_gc_time_stamps(hr);
hr->note_end_of_marking();
*** 1566,1577 ****
_g1->free_region(hr, _local_cleanup_list, true);
}
} else {
hr->rem_set()->do_cleanup_work(_hrrs_cleanup_task);
}
-
- return false;
}
};
class G1ParNoteEndTask: public AbstractGangTask {
friend class G1NoteEndOfConcMarkClosure;
--- 1556,1565 ----
*** 1590,1600 ****
FreeRegionList local_cleanup_list("Local Cleanup List");
HRRSCleanupTask hrrs_cleanup_task;
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list,
&hrrs_cleanup_task);
_g1h->heap_region_par_iterate(&g1_note_end, worker_id, &_hrclaimer);
- assert(g1_note_end.complete(), "Shouldn't have yielded!");
// Now update the lists
_g1h->remove_from_old_sets(g1_note_end.old_regions_removed(), g1_note_end.humongous_regions_removed());
{
MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
--- 1578,1587 ----
*** 2439,2449 ****
uint max_worker_id) :
_g1h(g1h), _cm(g1h->concurrent_mark()),
_ct_bs(barrier_set_cast<CardTableModRefBS>(g1h->barrier_set())),
_cm_card_bm(cm_card_bm), _max_worker_id(max_worker_id) { }
! bool doHeapRegion(HeapRegion* hr) {
HeapWord* start = hr->bottom();
HeapWord* limit = hr->next_top_at_mark_start();
HeapWord* end = hr->end();
assert(start <= limit && limit <= hr->top() && hr->top() <= hr->end(),
--- 2426,2436 ----
uint max_worker_id) :
_g1h(g1h), _cm(g1h->concurrent_mark()),
_ct_bs(barrier_set_cast<CardTableModRefBS>(g1h->barrier_set())),
_cm_card_bm(cm_card_bm), _max_worker_id(max_worker_id) { }
! void doHeapRegion(HeapRegion* hr) {
HeapWord* start = hr->bottom();
HeapWord* limit = hr->next_top_at_mark_start();
HeapWord* end = hr->end();
assert(start <= limit && limit <= hr->top() && hr->top() <= hr->end(),
*** 2454,2464 ****
assert(hr->next_marked_bytes() == 0, "Precondition");
if (start == limit) {
// NTAMS of this region has not been set so nothing to do.
! return false;
}
// 'start' should be in the heap.
assert(_g1h->is_in_g1_reserved(start) && _ct_bs->is_card_aligned(start), "sanity");
// 'end' *may* be just beyond the end of the heap (if hr is the last region)
--- 2441,2451 ----
assert(hr->next_marked_bytes() == 0, "Precondition");
if (start == limit) {
// NTAMS of this region has not been set so nothing to do.
! return;
}
// 'start' should be in the heap.
assert(_g1h->is_in_g1_reserved(start) && _ct_bs->is_card_aligned(start), "sanity");
// 'end' *may* be just beyond the end of the heap (if hr is the last region)
*** 2512,2524 ****
}
}
// Update the marked bytes for this region.
hr->add_to_marked_bytes(marked_bytes);
-
- // Next heap region
- return false;
}
};
class G1AggregateCountDataTask: public AbstractGangTask {
protected:
--- 2499,2508 ----
*** 3623,3633 ****
*capacity_bytes = get_hum_bytes(&_hum_capacity_bytes);
*prev_live_bytes = get_hum_bytes(&_hum_prev_live_bytes);
*next_live_bytes = get_hum_bytes(&_hum_next_live_bytes);
}
! bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
const char* type = r->get_type_str();
HeapWord* bottom = r->bottom();
HeapWord* end = r->end();
size_t capacity_bytes = r->capacity();
size_t used_bytes = r->used();
--- 3607,3617 ----
*capacity_bytes = get_hum_bytes(&_hum_capacity_bytes);
*prev_live_bytes = get_hum_bytes(&_hum_prev_live_bytes);
*next_live_bytes = get_hum_bytes(&_hum_next_live_bytes);
}
! void G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
const char* type = r->get_type_str();
HeapWord* bottom = r->bottom();
HeapWord* end = r->end();
size_t capacity_bytes = r->capacity();
size_t used_bytes = r->used();
*** 3673,3684 ****
G1PPRL_BYTE_FORMAT
G1PPRL_BYTE_FORMAT,
type, p2i(bottom), p2i(end),
used_bytes, prev_live_bytes, next_live_bytes, gc_eff,
remset_bytes, strong_code_roots_bytes);
-
- return false;
}
G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {
// add static memory usages to remembered set sizes
_total_remset_bytes += HeapRegionRemSet::fl_mem_size() + HeapRegionRemSet::static_mem_size();
--- 3657,3666 ----
src/share/vm/gc/g1/g1ConcurrentMark.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File