< prev index next >

src/hotspot/share/gc/serial/defNewGeneration.cpp

CLD claiming v2

119 
120 void CLDScanClosure::do_cld(ClassLoaderData* cld) {                                                                                  
121   NOT_PRODUCT(ResourceMark rm);                                                                                                      
122   log_develop_trace(gc, scavenge)("CLDScanClosure::do_cld " PTR_FORMAT ", %s, dirty: %s",                                            
123                                   p2i(cld),                                                                                          
124                                   cld->loader_name_and_id(),                                                                         
125                                   cld->has_modified_oops() ? "true" : "false");                                                      
126 
127   // If the cld has not been dirtied we know that there's                                                                            
128   // no references into  the young gen and we can skip it.                                                                           
129   if (cld->has_modified_oops()) {                                                                                                    
130     if (_accumulate_modified_oops) {                                                                                                 
131       cld->accumulate_modified_oops();                                                                                               
132     }                                                                                                                                
133 
134     // Tell the closure which CLD is being scanned so that it can be dirtied                                                         
135     // if oops are left pointing into the young gen.                                                                                 
136     _scavenge_closure->set_scanned_cld(cld);                                                                                         
137 
138     // Clean the cld since we're going to scavenge all the metadata.                                                                 
139     cld->oops_do(_scavenge_closure, ClassLoaderData::_claim_value_none, /*clear_modified_oops*/true);                                
140 
141     _scavenge_closure->set_scanned_cld(NULL);                                                                                        
142   }                                                                                                                                  
143 }                                                                                                                                    
144 
145 ScanWeakRefClosure::ScanWeakRefClosure(DefNewGeneration* g) :                                                                        
146   _g(g)                                                                                                                              
147 {                                                                                                                                    
148   _boundary = _g->reserved().end();                                                                                                  
149 }                                                                                                                                    
150 
151 DefNewGeneration::DefNewGeneration(ReservedSpace rs,                                                                                 
152                                    size_t initial_size,                                                                              
153                                    const char* policy)                                                                               
154   : Generation(rs, initial_size),                                                                                                    
155     _preserved_marks_set(false /* in_c_heap */),                                                                                     
156     _promo_failure_drain_in_progress(false),                                                                                         
157     _should_allocate_from_space(false)                                                                                               
158 {                                                                                                                                    

119 
120 void CLDScanClosure::do_cld(ClassLoaderData* cld) {
121   NOT_PRODUCT(ResourceMark rm);
122   log_develop_trace(gc, scavenge)("CLDScanClosure::do_cld " PTR_FORMAT ", %s, dirty: %s",
123                                   p2i(cld),
124                                   cld->loader_name_and_id(),
125                                   cld->has_modified_oops() ? "true" : "false");
126 
127   // If the cld has not been dirtied we know that there's
128   // no references into  the young gen and we can skip it.
129   if (cld->has_modified_oops()) {
130     if (_accumulate_modified_oops) {
131       cld->accumulate_modified_oops();
132     }
133 
134     // Tell the closure which CLD is being scanned so that it can be dirtied
135     // if oops are left pointing into the young gen.
136     _scavenge_closure->set_scanned_cld(cld);
137 
138     // Clean the cld since we're going to scavenge all the metadata.
139     cld->oops_do(_scavenge_closure, ClassLoaderData::_claim_none, /*clear_modified_oops*/true);
140 
141     _scavenge_closure->set_scanned_cld(NULL);
142   }
143 }
144 
145 ScanWeakRefClosure::ScanWeakRefClosure(DefNewGeneration* g) :
146   _g(g)
147 {
148   _boundary = _g->reserved().end();
149 }
150 
151 DefNewGeneration::DefNewGeneration(ReservedSpace rs,
152                                    size_t initial_size,
153                                    const char* policy)
154   : Generation(rs, initial_size),
155     _preserved_marks_set(false /* in_c_heap */),
156     _promo_failure_drain_in_progress(false),
157     _should_allocate_from_space(false)
158 {
< prev index next >