1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Sun Mar 15 22:03:38 2009 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Mar 16 08:01:32 2009 -0700 1.3 @@ -961,6 +961,7 @@ 1.4 if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { 1.5 HandleMark hm; // Discard invalid handles created during verification 1.6 gclog_or_tty->print(" VerifyAfterGC:"); 1.7 + prepare_for_verify(); 1.8 Universe::verify(false); 1.9 } 1.10 NOT_PRODUCT(ref_processor()->verify_no_references_recorded()); 1.11 @@ -2135,15 +2136,7 @@ 1.12 bool doHeapRegion(HeapRegion* r) { 1.13 guarantee(_par || r->claim_value() == HeapRegion::InitialClaimValue, 1.14 "Should be unclaimed at verify points."); 1.15 - if (r->isHumongous()) { 1.16 - if (r->startsHumongous()) { 1.17 - // Verify the single H object. 1.18 - oop(r->bottom())->verify(); 1.19 - size_t word_sz = oop(r->bottom())->size(); 1.20 - guarantee(r->top() == r->bottom() + word_sz, 1.21 - "Only one object in a humongous region"); 1.22 - } 1.23 - } else { 1.24 + if (!r->continuesHumongous()) { 1.25 VerifyObjsInRegionClosure not_dead_yet_cl(r); 1.26 r->verify(_allow_dirty); 1.27 r->object_iterate(¬_dead_yet_cl); 1.28 @@ -2195,6 +2188,7 @@ 1.29 _g1h(g1h), _allow_dirty(allow_dirty) { } 1.30 1.31 void work(int worker_i) { 1.32 + HandleMark hm; 1.33 VerifyRegionClosure blk(_allow_dirty, true); 1.34 _g1h->heap_region_par_iterate_chunked(&blk, worker_i, 1.35 HeapRegion::ParVerifyClaimValue); 1.36 @@ -2713,6 +2707,7 @@ 1.37 if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { 1.38 HandleMark hm; // Discard invalid handles created during verification 1.39 gclog_or_tty->print(" VerifyAfterGC:"); 1.40 + prepare_for_verify(); 1.41 Universe::verify(false); 1.42 } 1.43 1.44 @@ -2844,6 +2839,12 @@ 1.45 while (_gc_alloc_region_list != NULL) { 1.46 HeapRegion* r = _gc_alloc_region_list; 1.47 assert(r->is_gc_alloc_region(), "Invariant."); 1.48 + // We need HeapRegion::oops_on_card_seq_iterate_careful() to work on 1.49 + // newly allocated data in order to be able to apply deferred updates 1.50 + // before the GC is done for verification purposes (i.e to allow 1.51 + // G1HRRSFlushLogBuffersOnVerify). It's safe thing to do after the 1.52 + // collection. 1.53 + r->ContiguousSpace::set_saved_mark(); 1.54 _gc_alloc_region_list = r->next_gc_alloc_region(); 1.55 r->set_next_gc_alloc_region(NULL); 1.56 r->set_is_gc_alloc_region(false); 1.57 @@ -3738,7 +3739,9 @@ 1.58 CardTableModRefBS* ctbs() { return _ct_bs; } 1.59 1.60 void immediate_rs_update(HeapRegion* from, oop* p, int tid) { 1.61 - _g1_rem->par_write_ref(from, p, tid); 1.62 + if (!from->is_survivor()) { 1.63 + _g1_rem->par_write_ref(from, p, tid); 1.64 + } 1.65 } 1.66 1.67 void deferred_rs_update(HeapRegion* from, oop* p, int tid) {