1.1 --- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp Mon Nov 15 16:25:14 2010 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp Tue Nov 16 14:07:33 2010 -0800 1.3 @@ -116,7 +116,6 @@ 1.4 : _g1(g1), _conc_refine_cards(0), 1.5 _ct_bs(ct_bs), _g1p(_g1->g1_policy()), 1.6 _cg1r(g1->concurrent_g1_refine()), 1.7 - _traversal_in_progress(false), 1.8 _cset_rs_update_cl(NULL), 1.9 _cards_scanned(NULL), _total_cards_scanned(0) 1.10 { 1.11 @@ -512,8 +511,6 @@ 1.12 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); 1.13 dcqs.concatenate_logs(); 1.14 1.15 - assert(!_traversal_in_progress, "Invariant between iterations."); 1.16 - set_traversal(true); 1.17 if (ParallelGCThreads > 0) { 1.18 _seq_task->set_n_threads((int)n_workers()); 1.19 } 1.20 @@ -539,9 +536,6 @@ 1.21 // through the oops which coincide with that card. It scans the reference 1.22 // fields in each oop; when it finds an oop that points into the collection 1.23 // set, the RSet for the region containing the referenced object is updated. 1.24 -// Note: _par_traversal_in_progress in the G1RemSet must be FALSE; otherwise 1.25 -// the UpdateRSetImmediate closure will cause cards to be enqueued on to 1.26 -// the DCQS that we're iterating over, causing an infinite loop. 1.27 class UpdateRSetCardTableEntryIntoCSetClosure: public CardTableEntryClosure { 1.28 G1CollectedHeap* _g1; 1.29 CardTableModRefBS* _ct_bs; 1.30 @@ -611,8 +605,6 @@ 1.31 // Set all cards back to clean. 1.32 _g1->cleanUpCardTable(); 1.33 1.34 - set_traversal(false); 1.35 - 1.36 DirtyCardQueueSet& into_cset_dcqs = _g1->into_cset_dirty_card_queue_set(); 1.37 int into_cset_n_buffers = into_cset_dcqs.completed_buffers_num(); 1.38 1.39 @@ -645,21 +637,8 @@ 1.40 assert(_g1->into_cset_dirty_card_queue_set().completed_buffers_num() == 0, 1.41 "all buffers should be freed"); 1.42 _g1->into_cset_dirty_card_queue_set().clear_n_completed_buffers(); 1.43 - 1.44 - assert(!_traversal_in_progress, "Invariant between iterations."); 1.45 } 1.46 1.47 -class UpdateRSObjectClosure: public ObjectClosure { 1.48 - UpdateRSOopClosure* _update_rs_oop_cl; 1.49 -public: 1.50 - UpdateRSObjectClosure(UpdateRSOopClosure* update_rs_oop_cl) : 1.51 - _update_rs_oop_cl(update_rs_oop_cl) {} 1.52 - void do_object(oop obj) { 1.53 - obj->oop_iterate(_update_rs_oop_cl); 1.54 - } 1.55 - 1.56 -}; 1.57 - 1.58 class ScrubRSClosure: public HeapRegionClosure { 1.59 G1CollectedHeap* _g1h; 1.60 BitMap* _region_bm; 1.61 @@ -749,7 +728,12 @@ 1.62 ct_freq_note_card(_ct_bs->index_for(start)); 1.63 #endif 1.64 1.65 - UpdateRSOopClosure update_rs_oop_cl(this, worker_i); 1.66 + assert(!check_for_refs_into_cset || _cset_rs_update_cl[worker_i] != NULL, "sanity"); 1.67 + UpdateRSOrPushRefOopClosure update_rs_oop_cl(_g1, 1.68 + _g1->g1_rem_set(), 1.69 + _cset_rs_update_cl[worker_i], 1.70 + check_for_refs_into_cset, 1.71 + worker_i); 1.72 update_rs_oop_cl.set_from(r); 1.73 1.74 TriggerClosure trigger_cl;