comparison src/share/vm/gc_implementation/g1/g1RemSet.cpp @ 637:25e146966e7c

6817419: G1: Enable extensive verification for humongous regions Summary: Enabled full verification for humongous regions. Also made sure that the VerifyAfterGC works with deferred updates and G1HRRSFlushLogBuffersOnVerify. Reviewed-by: tonyp
author iveresov
date Mon, 16 Mar 2009 08:01:32 -0700
parents 87fa6e083d82
children 2a5da27ccae9
comparison
equal deleted inserted replaced
636:6c4cea9bfa11 637:25e146966e7c
714 {} 714 {}
715 715
716 bool doHeapRegion(HeapRegion* r) { 716 bool doHeapRegion(HeapRegion* r) {
717 if (!r->in_collection_set() && 717 if (!r->in_collection_set() &&
718 !r->continuesHumongous() && 718 !r->continuesHumongous() &&
719 !r->is_young() && 719 !r->is_young()) {
720 !r->is_survivor()) {
721 _update_rs_oop_cl.set_from(r); 720 _update_rs_oop_cl.set_from(r);
722 UpdateRSObjectClosure update_rs_obj_cl(&_update_rs_oop_cl); 721 UpdateRSObjectClosure update_rs_obj_cl(&_update_rs_oop_cl);
723 722
724 // For each run of dirty card in the region: 723 // For each run of dirty card in the region:
725 // 1) Clear the cards. 724 // 1) Clear the cards.
852 // as a result, it is possible for other threads to actually 851 // as a result, it is possible for other threads to actually
853 // allocate objects in the region (after the acquire the lock) 852 // allocate objects in the region (after the acquire the lock)
854 // before all the cards on the region are dirtied. This is unlikely, 853 // before all the cards on the region are dirtied. This is unlikely,
855 // and it doesn't happen often, but it can happen. So, the extra 854 // and it doesn't happen often, but it can happen. So, the extra
856 // check below filters out those cards. 855 // check below filters out those cards.
857 if (r->is_young() || r->is_survivor()) { 856 if (r->is_young()) {
858 return; 857 return;
859 } 858 }
860 // While we are processing RSet buffers during the collection, we 859 // While we are processing RSet buffers during the collection, we
861 // actually don't want to scan any cards on the collection set, 860 // actually don't want to scan any cards on the collection set,
862 // since we don't want to update remebered sets with entries that 861 // since we don't want to update remebered sets with entries that
1023 HeapRegionRemSet::n_coarsenings()); 1022 HeapRegionRemSet::n_coarsenings());
1024 1023
1025 } 1024 }
1026 } 1025 }
1027 void HRInto_G1RemSet::prepare_for_verify() { 1026 void HRInto_G1RemSet::prepare_for_verify() {
1028 if (G1HRRSFlushLogBuffersOnVerify && VerifyBeforeGC && !_g1->full_collection()) { 1027 if (G1HRRSFlushLogBuffersOnVerify &&
1028 (VerifyBeforeGC || VerifyAfterGC)
1029 && !_g1->full_collection()) {
1029 cleanupHRRS(); 1030 cleanupHRRS();
1030 _g1->set_refine_cte_cl_concurrency(false); 1031 _g1->set_refine_cte_cl_concurrency(false);
1031 if (SafepointSynchronize::is_at_safepoint()) { 1032 if (SafepointSynchronize::is_at_safepoint()) {
1032 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); 1033 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
1033 dcqs.concatenate_logs(); 1034 dcqs.concatenate_logs();
1034 } 1035 }
1035 bool cg1r_use_cache = _cg1r->use_cache(); 1036 bool cg1r_use_cache = _cg1r->use_cache();
1036 _cg1r->set_use_cache(false); 1037 _cg1r->set_use_cache(false);
1037 updateRS(0); 1038 updateRS(0);
1038 _cg1r->set_use_cache(cg1r_use_cache); 1039 _cg1r->set_use_cache(cg1r_use_cache);
1039 } 1040
1040 } 1041 assert(JavaThread::dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed");
1042 }
1043 }