src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

Print this page




 373     if (curr == NULL)
 374       gclog_or_tty->print_cr("  empty");
 375     while (curr != NULL) {
 376       gclog_or_tty->print_cr("  "HR_FORMAT", P: "PTR_FORMAT ", N: "PTR_FORMAT", age: %4d",
 377                              HR_FORMAT_PARAMS(curr),
 378                              curr->prev_top_at_mark_start(),
 379                              curr->next_top_at_mark_start(),
 380                              curr->age_in_surv_rate_group_cond());
 381       curr = curr->get_next_young_region();
 382     }
 383   }
 384 
 385   gclog_or_tty->cr();
 386 }
 387 
 388 void G1RegionMappingChangedListener::reset_from_card_cache(uint start_idx, size_t num_regions) {
 389   OtherRegionsTable::invalidate(start_idx, num_regions);
 390 }
 391 
 392 void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {


 393   reset_from_card_cache(start_idx, num_regions);
 394 }
 395 
 396 void G1CollectedHeap::push_dirty_cards_region(HeapRegion* hr)
 397 {
 398   // Claim the right to put the region on the dirty cards region list
 399   // by installing a self pointer.
 400   HeapRegion* next = hr->get_next_dirty_cards_region();
 401   if (next == NULL) {
 402     HeapRegion* res = (HeapRegion*)
 403       Atomic::cmpxchg_ptr(hr, hr->next_dirty_cards_region_addr(),
 404                           NULL);
 405     if (res == NULL) {
 406       HeapRegion* head;
 407       do {
 408         // Put the region to the dirty cards region list.
 409         head = _dirty_cards_region_list;
 410         next = (HeapRegion*)
 411           Atomic::cmpxchg_ptr(hr, &_dirty_cards_region_list, head);
 412         if (next == head) {




 373     if (curr == NULL)
 374       gclog_or_tty->print_cr("  empty");
 375     while (curr != NULL) {
 376       gclog_or_tty->print_cr("  "HR_FORMAT", P: "PTR_FORMAT ", N: "PTR_FORMAT", age: %4d",
 377                              HR_FORMAT_PARAMS(curr),
 378                              curr->prev_top_at_mark_start(),
 379                              curr->next_top_at_mark_start(),
 380                              curr->age_in_surv_rate_group_cond());
 381       curr = curr->get_next_young_region();
 382     }
 383   }
 384 
 385   gclog_or_tty->cr();
 386 }
 387 
 388 void G1RegionMappingChangedListener::reset_from_card_cache(uint start_idx, size_t num_regions) {
 389   OtherRegionsTable::invalidate(start_idx, num_regions);
 390 }
 391 
 392 void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
 393   // The from card cache is not the memory that is actually committed. So we cannot
 394   // take advantage of the zero_filled parameter.
 395   reset_from_card_cache(start_idx, num_regions);
 396 }
 397 
 398 void G1CollectedHeap::push_dirty_cards_region(HeapRegion* hr)
 399 {
 400   // Claim the right to put the region on the dirty cards region list
 401   // by installing a self pointer.
 402   HeapRegion* next = hr->get_next_dirty_cards_region();
 403   if (next == NULL) {
 404     HeapRegion* res = (HeapRegion*)
 405       Atomic::cmpxchg_ptr(hr, hr->next_dirty_cards_region_addr(),
 406                           NULL);
 407     if (res == NULL) {
 408       HeapRegion* head;
 409       do {
 410         // Put the region to the dirty cards region list.
 411         head = _dirty_cards_region_list;
 412         next = (HeapRegion*)
 413           Atomic::cmpxchg_ptr(hr, &_dirty_cards_region_list, head);
 414         if (next == head) {