< prev index next >

src/hotspot/share/gc/g1/g1OopClosures.cpp

CLD claiming v2

34   _worker_id(par_scan_state->worker_id()),                                                                                           
35   _scanned_cld(NULL),                                                                                                                
36   _cm(_g1h->concurrent_mark())                                                                                                       
37 { }                                                                                                                                  
38 
39 G1ScanClosureBase::G1ScanClosureBase(G1CollectedHeap* g1h, G1ParScanThreadState* par_scan_state) :                                   
40   _g1h(g1h), _par_scan_state(par_scan_state), _from(NULL)                                                                            
41 { }                                                                                                                                  
42 
43 void G1CLDScanClosure::do_cld(ClassLoaderData* cld) {                                                                                
44   // If the class loader data has not been dirtied we know that there's                                                              
45   // no references into  the young gen and we can skip it.                                                                           
46   if (!_process_only_dirty || cld->has_modified_oops()) {                                                                            
47 
48     // Tell the closure that this class loader data is the CLD to scavenge                                                           
49     // and is the one to dirty if oops are left pointing into the young gen.                                                         
50     _closure->set_scanned_cld(cld);                                                                                                  
51 
52     // Clean the cld since we're going to scavenge all the metadata.                                                                 
53     // Clear modified oops only if this cld is claimed.                                                                              
54     cld->oops_do(_closure, _claim_value, /*clear_modified_oops*/true);                                                               
55 
56     _closure->set_scanned_cld(NULL);                                                                                                 
57 
58     _closure->trim_queue_partially();                                                                                                
59   }                                                                                                                                  
60   _count++;                                                                                                                          
61 }                                                                                                                                    

34   _worker_id(par_scan_state->worker_id()),
35   _scanned_cld(NULL),
36   _cm(_g1h->concurrent_mark())
37 { }
38 
39 G1ScanClosureBase::G1ScanClosureBase(G1CollectedHeap* g1h, G1ParScanThreadState* par_scan_state) :
40   _g1h(g1h), _par_scan_state(par_scan_state), _from(NULL)
41 { }
42 
43 void G1CLDScanClosure::do_cld(ClassLoaderData* cld) {
44   // If the class loader data has not been dirtied we know that there's
45   // no references into  the young gen and we can skip it.
46   if (!_process_only_dirty || cld->has_modified_oops()) {
47 
48     // Tell the closure that this class loader data is the CLD to scavenge
49     // and is the one to dirty if oops are left pointing into the young gen.
50     _closure->set_scanned_cld(cld);
51 
52     // Clean the cld since we're going to scavenge all the metadata.
53     // Clear modified oops only if this cld is claimed.
54     cld->oops_do(_closure, _claim, /*clear_modified_oops*/true);
55 
56     _closure->set_scanned_cld(NULL);
57 
58     _closure->trim_queue_partially();
59   }
60   _count++;
61 }
< prev index next >