469 (!res->isHumongous() && |
469 (!res->isHumongous() && |
470 (!zero_filled || |
470 (!zero_filled || |
471 res->zero_fill_state() == HeapRegion::Allocated)), |
471 res->zero_fill_state() == HeapRegion::Allocated)), |
472 "Alloc Regions must be zero filled (and non-H)"); |
472 "Alloc Regions must be zero filled (and non-H)"); |
473 } |
473 } |
474 if (res != NULL && res->is_empty()) _free_regions--; |
474 if (res != NULL) { |
475 assert(res == NULL || |
475 if (res->is_empty()) { |
476 (!res->isHumongous() && |
476 _free_regions--; |
477 (!zero_filled || |
477 } |
478 res->zero_fill_state() == HeapRegion::Allocated)), |
478 assert(!res->isHumongous() && |
479 "Non-young alloc Regions must be zero filled (and non-H)"); |
479 (!zero_filled || res->zero_fill_state() == HeapRegion::Allocated), |
480 |
480 err_msg("Non-young alloc Regions must be zero filled (and non-H):" |
481 if (G1PrintHeapRegions) { |
481 " res->isHumongous()=%d, zero_filled=%d, res->zero_fill_state()=%d", |
482 if (res != NULL) { |
482 res->isHumongous(), zero_filled, res->zero_fill_state())); |
|
483 assert(!res->is_on_unclean_list(), |
|
484 "Alloc Regions must not be on the unclean list"); |
|
485 if (G1PrintHeapRegions) { |
483 gclog_or_tty->print_cr("new alloc region %d:["PTR_FORMAT", "PTR_FORMAT"], " |
486 gclog_or_tty->print_cr("new alloc region %d:["PTR_FORMAT", "PTR_FORMAT"], " |
484 "top "PTR_FORMAT, |
487 "top "PTR_FORMAT, |
485 res->hrs_index(), res->bottom(), res->end(), res->top()); |
488 res->hrs_index(), res->bottom(), res->end(), res->top()); |
486 } |
489 } |
487 } |
490 } |
488 |
|
489 return res; |
491 return res; |
490 } |
492 } |
491 |
493 |
492 HeapRegion* G1CollectedHeap::newAllocRegionWithExpansion(int purpose, |
494 HeapRegion* G1CollectedHeap::newAllocRegionWithExpansion(int purpose, |
493 size_t word_size, |
495 size_t word_size, |
4598 } |
4600 } |
4599 |
4601 |
4600 void |
4602 void |
4601 G1CollectedHeap::put_region_on_unclean_list_locked(HeapRegion* r) { |
4603 G1CollectedHeap::put_region_on_unclean_list_locked(HeapRegion* r) { |
4602 assert(ZF_mon->owned_by_self(), "precondition."); |
4604 assert(ZF_mon->owned_by_self(), "precondition."); |
|
4605 #ifdef ASSERT |
|
4606 if (r->is_gc_alloc_region()) { |
|
4607 ResourceMark rm; |
|
4608 stringStream region_str; |
|
4609 print_on(®ion_str); |
|
4610 assert(!r->is_gc_alloc_region(), err_msg("Unexpected GC allocation region: %s", |
|
4611 region_str.as_string())); |
|
4612 } |
|
4613 #endif |
4603 _unclean_region_list.insert_before_head(r); |
4614 _unclean_region_list.insert_before_head(r); |
4604 } |
4615 } |
4605 |
4616 |
4606 void |
4617 void |
4607 G1CollectedHeap::prepend_region_list_on_unclean_list(UncleanRegionList* list) { |
4618 G1CollectedHeap::prepend_region_list_on_unclean_list(UncleanRegionList* list) { |