Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20270:b7d24d2bc8be
8047323: Remove unused _copy_metadata_obj_cl in G1CopyingKeepAliveClosure
Reviewed-by: mgerdin, tschatzl
author | stefank |
---|---|
date | Wed, 25 Jun 2014 08:28:01 +0200 |
parents | 7426d8d76305 |
children | a8137787acfe |
comparison
equal
deleted
inserted
replaced
20269:9717199cb8de | 20270:b7d24d2bc8be |
---|---|
5122 // and different queues. | 5122 // and different queues. |
5123 | 5123 |
5124 class G1CopyingKeepAliveClosure: public OopClosure { | 5124 class G1CopyingKeepAliveClosure: public OopClosure { |
5125 G1CollectedHeap* _g1h; | 5125 G1CollectedHeap* _g1h; |
5126 OopClosure* _copy_non_heap_obj_cl; | 5126 OopClosure* _copy_non_heap_obj_cl; |
5127 OopsInHeapRegionClosure* _copy_metadata_obj_cl; | |
5128 G1ParScanThreadState* _par_scan_state; | 5127 G1ParScanThreadState* _par_scan_state; |
5129 | 5128 |
5130 public: | 5129 public: |
5131 G1CopyingKeepAliveClosure(G1CollectedHeap* g1h, | 5130 G1CopyingKeepAliveClosure(G1CollectedHeap* g1h, |
5132 OopClosure* non_heap_obj_cl, | 5131 OopClosure* non_heap_obj_cl, |
5133 OopsInHeapRegionClosure* metadata_obj_cl, | |
5134 G1ParScanThreadState* pss): | 5132 G1ParScanThreadState* pss): |
5135 _g1h(g1h), | 5133 _g1h(g1h), |
5136 _copy_non_heap_obj_cl(non_heap_obj_cl), | 5134 _copy_non_heap_obj_cl(non_heap_obj_cl), |
5137 _copy_metadata_obj_cl(metadata_obj_cl), | |
5138 _par_scan_state(pss) | 5135 _par_scan_state(pss) |
5139 {} | 5136 {} |
5140 | 5137 |
5141 virtual void do_oop(narrowOop* p) { do_oop_work(p); } | 5138 virtual void do_oop(narrowOop* p) { do_oop_work(p); } |
5142 virtual void do_oop( oop* p) { do_oop_work(p); } | 5139 virtual void do_oop( oop* p) { do_oop_work(p); } |
5165 | 5162 |
5166 if (_g1h->is_in_g1_reserved(p)) { | 5163 if (_g1h->is_in_g1_reserved(p)) { |
5167 _par_scan_state->push_on_queue(p); | 5164 _par_scan_state->push_on_queue(p); |
5168 } else { | 5165 } else { |
5169 assert(!Metaspace::contains((const void*)p), | 5166 assert(!Metaspace::contains((const void*)p), |
5170 err_msg("Otherwise need to call _copy_metadata_obj_cl->do_oop(p) " | 5167 err_msg("Unexpectedly found a pointer from metadata: " |
5171 PTR_FORMAT, p)); | 5168 PTR_FORMAT, p)); |
5172 _copy_non_heap_obj_cl->do_oop(p); | 5169 _copy_non_heap_obj_cl->do_oop(p); |
5173 } | 5170 } |
5174 } | 5171 } |
5175 } | 5172 } |
5260 G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, NULL); | 5257 G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, NULL); |
5261 | 5258 |
5262 pss.set_evac_failure_closure(&evac_failure_cl); | 5259 pss.set_evac_failure_closure(&evac_failure_cl); |
5263 | 5260 |
5264 G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL); | 5261 G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL); |
5265 G1ParScanMetadataClosure only_copy_metadata_cl(_g1h, &pss, NULL); | |
5266 | 5262 |
5267 G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL); | 5263 G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL); |
5268 G1ParScanAndMarkMetadataClosure copy_mark_metadata_cl(_g1h, &pss, NULL); | |
5269 | 5264 |
5270 OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl; | 5265 OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl; |
5271 OopsInHeapRegionClosure* copy_metadata_cl = &only_copy_metadata_cl; | |
5272 | 5266 |
5273 if (_g1h->g1_policy()->during_initial_mark_pause()) { | 5267 if (_g1h->g1_policy()->during_initial_mark_pause()) { |
5274 // We also need to mark copied objects. | 5268 // We also need to mark copied objects. |
5275 copy_non_heap_cl = ©_mark_non_heap_cl; | 5269 copy_non_heap_cl = ©_mark_non_heap_cl; |
5276 copy_metadata_cl = ©_mark_metadata_cl; | |
5277 } | 5270 } |
5278 | 5271 |
5279 // Keep alive closure. | 5272 // Keep alive closure. |
5280 G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, copy_metadata_cl, &pss); | 5273 G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, &pss); |
5281 | 5274 |
5282 // Complete GC closure | 5275 // Complete GC closure |
5283 G1ParEvacuateFollowersClosure drain_queue(_g1h, &pss, _task_queues, _terminator); | 5276 G1ParEvacuateFollowersClosure drain_queue(_g1h, &pss, _task_queues, _terminator); |
5284 | 5277 |
5285 // Call the reference processing task's work routine. | 5278 // Call the reference processing task's work routine. |
5369 pss.set_evac_failure_closure(&evac_failure_cl); | 5362 pss.set_evac_failure_closure(&evac_failure_cl); |
5370 | 5363 |
5371 assert(pss.queue_is_empty(), "both queue and overflow should be empty"); | 5364 assert(pss.queue_is_empty(), "both queue and overflow should be empty"); |
5372 | 5365 |
5373 G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL); | 5366 G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL); |
5374 G1ParScanMetadataClosure only_copy_metadata_cl(_g1h, &pss, NULL); | |
5375 | 5367 |
5376 G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL); | 5368 G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(_g1h, &pss, NULL); |
5377 G1ParScanAndMarkMetadataClosure copy_mark_metadata_cl(_g1h, &pss, NULL); | |
5378 | 5369 |
5379 OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl; | 5370 OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl; |
5380 OopsInHeapRegionClosure* copy_metadata_cl = &only_copy_metadata_cl; | |
5381 | 5371 |
5382 if (_g1h->g1_policy()->during_initial_mark_pause()) { | 5372 if (_g1h->g1_policy()->during_initial_mark_pause()) { |
5383 // We also need to mark copied objects. | 5373 // We also need to mark copied objects. |
5384 copy_non_heap_cl = ©_mark_non_heap_cl; | 5374 copy_non_heap_cl = ©_mark_non_heap_cl; |
5385 copy_metadata_cl = ©_mark_metadata_cl; | |
5386 } | 5375 } |
5387 | 5376 |
5388 // Is alive closure | 5377 // Is alive closure |
5389 G1AlwaysAliveClosure always_alive(_g1h); | 5378 G1AlwaysAliveClosure always_alive(_g1h); |
5390 | 5379 |
5391 // Copying keep alive closure. Applied to referent objects that need | 5380 // Copying keep alive closure. Applied to referent objects that need |
5392 // to be copied. | 5381 // to be copied. |
5393 G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, copy_metadata_cl, &pss); | 5382 G1CopyingKeepAliveClosure keep_alive(_g1h, copy_non_heap_cl, &pss); |
5394 | 5383 |
5395 ReferenceProcessor* rp = _g1h->ref_processor_cm(); | 5384 ReferenceProcessor* rp = _g1h->ref_processor_cm(); |
5396 | 5385 |
5397 uint limit = ReferenceProcessor::number_of_subclasses_of_ref() * rp->max_num_q(); | 5386 uint limit = ReferenceProcessor::number_of_subclasses_of_ref() * rp->max_num_q(); |
5398 uint stride = MIN2(MAX2(_n_workers, 1U), limit); | 5387 uint stride = MIN2(MAX2(_n_workers, 1U), limit); |
5494 pss.set_evac_failure_closure(&evac_failure_cl); | 5483 pss.set_evac_failure_closure(&evac_failure_cl); |
5495 | 5484 |
5496 assert(pss.queue_is_empty(), "pre-condition"); | 5485 assert(pss.queue_is_empty(), "pre-condition"); |
5497 | 5486 |
5498 G1ParScanExtRootClosure only_copy_non_heap_cl(this, &pss, NULL); | 5487 G1ParScanExtRootClosure only_copy_non_heap_cl(this, &pss, NULL); |
5499 G1ParScanMetadataClosure only_copy_metadata_cl(this, &pss, NULL); | |
5500 | 5488 |
5501 G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(this, &pss, NULL); | 5489 G1ParScanAndMarkExtRootClosure copy_mark_non_heap_cl(this, &pss, NULL); |
5502 G1ParScanAndMarkMetadataClosure copy_mark_metadata_cl(this, &pss, NULL); | |
5503 | 5490 |
5504 OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl; | 5491 OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl; |
5505 OopsInHeapRegionClosure* copy_metadata_cl = &only_copy_metadata_cl; | |
5506 | 5492 |
5507 if (_g1h->g1_policy()->during_initial_mark_pause()) { | 5493 if (_g1h->g1_policy()->during_initial_mark_pause()) { |
5508 // We also need to mark copied objects. | 5494 // We also need to mark copied objects. |
5509 copy_non_heap_cl = ©_mark_non_heap_cl; | 5495 copy_non_heap_cl = ©_mark_non_heap_cl; |
5510 copy_metadata_cl = ©_mark_metadata_cl; | |
5511 } | 5496 } |
5512 | 5497 |
5513 // Keep alive closure. | 5498 // Keep alive closure. |
5514 G1CopyingKeepAliveClosure keep_alive(this, copy_non_heap_cl, copy_metadata_cl, &pss); | 5499 G1CopyingKeepAliveClosure keep_alive(this, copy_non_heap_cl, &pss); |
5515 | 5500 |
5516 // Serial Complete GC closure | 5501 // Serial Complete GC closure |
5517 G1STWDrainQueueClosure drain_queue(this, &pss); | 5502 G1STWDrainQueueClosure drain_queue(this, &pss); |
5518 | 5503 |
5519 // Setup the soft refs policy... | 5504 // Setup the soft refs policy... |