< prev index next >

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

Print this page




 355     if (pss == NULL) {
 356       continue;
 357     }
 358 
 359     pss->flush(_surviving_young_words_total);
 360     delete pss;
 361     _states[worker_index] = NULL;
 362   }
 363   _flushed = true;
 364 }
 365 
 366 void G1ParScanThreadStateSet::record_unused_optional_region(HeapRegion* hr) {
 367   for (uint worker_index = 0; worker_index < _n_workers; ++worker_index) {
 368     G1ParScanThreadState* pss = _states[worker_index];
 369 
 370     if (pss == NULL) {
 371       continue;
 372     }
 373 
 374     size_t used_memory = pss->oops_into_optional_region(hr)->used_memory();
 375     _g1h->phase_times()->record_or_add_thread_work_item(G1GCPhaseTimes::OptScanRS, worker_index, used_memory, G1GCPhaseTimes::ScanRSUsedMemory);
 376   }
 377 }
 378 
 379 oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
 380   assert(_g1h->is_in_cset(old), "Object " PTR_FORMAT " should be in the CSet", p2i(old));
 381 
 382   oop forward_ptr = old->forward_to_atomic(old, m, memory_order_relaxed);
 383   if (forward_ptr == NULL) {
 384     // Forward-to-self succeeded. We are the "owner" of the object.
 385     HeapRegion* r = _g1h->heap_region_containing(old);
 386 
 387     if (!r->evacuation_failed()) {
 388       r->set_evacuation_failed(true);
 389      _g1h->hr_printer()->evac_failure(r);
 390     }
 391 
 392     _g1h->preserve_mark_during_evac_failure(_worker_id, old, m);
 393 
 394     G1ScanInYoungSetter x(&_scanner, r->is_young());
 395     old->oop_iterate_backwards(&_scanner);




 355     if (pss == NULL) {
 356       continue;
 357     }
 358 
 359     pss->flush(_surviving_young_words_total);
 360     delete pss;
 361     _states[worker_index] = NULL;
 362   }
 363   _flushed = true;
 364 }
 365 
 366 void G1ParScanThreadStateSet::record_unused_optional_region(HeapRegion* hr) {
 367   for (uint worker_index = 0; worker_index < _n_workers; ++worker_index) {
 368     G1ParScanThreadState* pss = _states[worker_index];
 369 
 370     if (pss == NULL) {
 371       continue;
 372     }
 373 
 374     size_t used_memory = pss->oops_into_optional_region(hr)->used_memory();
 375     _g1h->phase_times()->record_or_add_thread_work_item(G1GCPhaseTimes::OptScanRS, worker_index, used_memory, G1GCPhaseTimes::OptCSetUsedMemory);
 376   }
 377 }
 378 
 379 oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
 380   assert(_g1h->is_in_cset(old), "Object " PTR_FORMAT " should be in the CSet", p2i(old));
 381 
 382   oop forward_ptr = old->forward_to_atomic(old, m, memory_order_relaxed);
 383   if (forward_ptr == NULL) {
 384     // Forward-to-self succeeded. We are the "owner" of the object.
 385     HeapRegion* r = _g1h->heap_region_containing(old);
 386 
 387     if (!r->evacuation_failed()) {
 388       r->set_evacuation_failed(true);
 389      _g1h->hr_printer()->evac_failure(r);
 390     }
 391 
 392     _g1h->preserve_mark_during_evac_failure(_worker_id, old, m);
 393 
 394     G1ScanInYoungSetter x(&_scanner, r->is_young());
 395     old->oop_iterate_backwards(&_scanner);


< prev index next >