src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Print this page
@@ -952,10 +952,11 @@
COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:");
+ prepare_for_verify();
Universe::verify(false);
}
NOT_PRODUCT(ref_processor()->verify_no_references_recorded());
reset_gc_time_stamp();
@@ -2117,19 +2118,11 @@
VerifyRegionClosure(bool allow_dirty, bool par = false)
: _allow_dirty(allow_dirty), _par(par) {}
bool doHeapRegion(HeapRegion* r) {
guarantee(_par || r->claim_value() == HeapRegion::InitialClaimValue,
"Should be unclaimed at verify points.");
- if (r->isHumongous()) {
- if (r->startsHumongous()) {
- // Verify the single H object.
- oop(r->bottom())->verify();
- size_t word_sz = oop(r->bottom())->size();
- guarantee(r->top() == r->bottom() + word_sz,
- "Only one object in a humongous region");
- }
- } else {
+ if (!r->isHumongous() || (r->isHumongous() && r->startsHumongous())) {
VerifyObjsInRegionClosure not_dead_yet_cl(r);
r->verify(_allow_dirty);
r->object_iterate(¬_dead_yet_cl);
guarantee(r->max_live_bytes() >= not_dead_yet_cl.live_bytes(),
"More live objects than counted in last complete marking.");
@@ -2177,10 +2170,11 @@
G1ParVerifyTask(G1CollectedHeap* g1h, bool allow_dirty) :
AbstractGangTask("Parallel verify task"),
_g1h(g1h), _allow_dirty(allow_dirty) { }
void work(int worker_i) {
+ HandleMark hm;
VerifyRegionClosure blk(_allow_dirty, true);
_g1h->heap_region_par_iterate_chunked(&blk, worker_i,
HeapRegion::ParVerifyClaimValue);
}
};
@@ -2695,10 +2689,11 @@
assert(regions_accounted_for(), "Region leakage.");
if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:");
+ prepare_for_verify();
Universe::verify(false);
}
if (was_enabled) ref_processor()->enable_discovery();
@@ -3656,12 +3651,14 @@
DirtyCardQueue& dirty_card_queue() { return _dcq; }
CardTableModRefBS* ctbs() { return _ct_bs; }
void immediate_rs_update(HeapRegion* from, oop* p, int tid) {
+ if (!from->is_survivor()) {
_g1_rem->par_write_ref(from, p, tid);
}
+ }
void deferred_rs_update(HeapRegion* from, oop* p, int tid) {
// If the new value of the field points to the same region or
// is the to-space, we don't need to include it in the Rset updates.
if (!from->is_in_reserved(*p) && !from->is_survivor()) {