< prev index next >

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

Print this page

        

*** 969,983 **** size_t word_size = curr_range.word_size(); HeapWord* last_address = curr_range.last(); size_t commits = 0; guarantee(reserved.contains(start_address) && reserved.contains(last_address), ! err_msg("MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]", ! p2i(start_address), p2i(last_address))); guarantee(start_address > prev_last_addr, ! err_msg("Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT , ! p2i(start_address), p2i(prev_last_addr))); prev_last_addr = last_address; // Check for ranges that start in the same G1 region in which the previous // range ended, and adjust the start address so we don't try to allocate // the same region again. If the current range is entirely within that --- 969,983 ---- size_t word_size = curr_range.word_size(); HeapWord* last_address = curr_range.last(); size_t commits = 0; guarantee(reserved.contains(start_address) && reserved.contains(last_address), ! "MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]", ! p2i(start_address), p2i(last_address)); guarantee(start_address > prev_last_addr, ! "Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT , ! p2i(start_address), p2i(prev_last_addr)); prev_last_addr = last_address; // Check for ranges that start in the same G1 region in which the previous // range ended, and adjust the start address so we don't try to allocate // the same region again. If the current range is entirely within that
*** 1015,1025 **** HeapRegion* last_region = _hrm.addr_to_region(last_address); prev_last_region = last_region; while (curr_region != NULL) { assert(curr_region->is_empty() && !curr_region->is_pinned(), ! err_msg("Region already in use (index %u)", curr_region->hrm_index())); _hr_printer.alloc(curr_region, G1HRPrinter::Archive); curr_region->set_allocation_context(AllocationContext::system()); curr_region->set_archive(); _old_set.add(curr_region); if (curr_region != last_region) { --- 1015,1025 ---- HeapRegion* last_region = _hrm.addr_to_region(last_address); prev_last_region = last_region; while (curr_region != NULL) { assert(curr_region->is_empty() && !curr_region->is_pinned(), ! "Region already in use (index %u)", curr_region->hrm_index()); _hr_printer.alloc(curr_region, G1HRPrinter::Archive); curr_region->set_allocation_context(AllocationContext::system()); curr_region->set_archive(); _old_set.add(curr_region); if (curr_region != last_region) {
*** 1053,1067 **** for (size_t i = 0; i < count; i++) { HeapWord* start_address = ranges[i].start(); HeapWord* last_address = ranges[i].last(); assert(reserved.contains(start_address) && reserved.contains(last_address), ! err_msg("MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]", ! p2i(start_address), p2i(last_address))); assert(start_address > prev_last_addr, ! err_msg("Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT , ! p2i(start_address), p2i(prev_last_addr))); HeapRegion* start_region = _hrm.addr_to_region(start_address); HeapRegion* last_region = _hrm.addr_to_region(last_address); HeapWord* bottom_address = start_region->bottom(); --- 1053,1067 ---- for (size_t i = 0; i < count; i++) { HeapWord* start_address = ranges[i].start(); HeapWord* last_address = ranges[i].last(); assert(reserved.contains(start_address) && reserved.contains(last_address), ! "MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]", ! p2i(start_address), p2i(last_address)); assert(start_address > prev_last_addr, ! "Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT , ! p2i(start_address), p2i(prev_last_addr)); HeapRegion* start_region = _hrm.addr_to_region(start_address); HeapRegion* last_region = _hrm.addr_to_region(last_address); HeapWord* bottom_address = start_region->bottom();
*** 1074,1084 **** // Verify that the regions were all marked as archive regions by // alloc_archive_regions. HeapRegion* curr_region = start_region; while (curr_region != NULL) { guarantee(curr_region->is_archive(), ! err_msg("Expected archive region at index %u", curr_region->hrm_index())); if (curr_region != last_region) { curr_region = _hrm.next_region_in_heap(curr_region); } else { curr_region = NULL; } --- 1074,1084 ---- // Verify that the regions were all marked as archive regions by // alloc_archive_regions. HeapRegion* curr_region = start_region; while (curr_region != NULL) { guarantee(curr_region->is_archive(), ! "Expected archive region at index %u", curr_region->hrm_index()); if (curr_region != last_region) { curr_region = _hrm.next_region_in_heap(curr_region); } else { curr_region = NULL; }
*** 1137,1151 **** for (size_t i = 0; i < count; i++) { HeapWord* start_address = ranges[i].start(); HeapWord* last_address = ranges[i].last(); assert(reserved.contains(start_address) && reserved.contains(last_address), ! err_msg("MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]", ! p2i(start_address), p2i(last_address))); assert(start_address > prev_last_addr, ! err_msg("Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT , ! p2i(start_address), p2i(prev_last_addr))); size_used += ranges[i].byte_size(); prev_last_addr = last_address; HeapRegion* start_region = _hrm.addr_to_region(start_address); HeapRegion* last_region = _hrm.addr_to_region(last_address); --- 1137,1151 ---- for (size_t i = 0; i < count; i++) { HeapWord* start_address = ranges[i].start(); HeapWord* last_address = ranges[i].last(); assert(reserved.contains(start_address) && reserved.contains(last_address), ! "MemRegion outside of heap [" PTR_FORMAT ", " PTR_FORMAT "]", ! p2i(start_address), p2i(last_address)); assert(start_address > prev_last_addr, ! "Ranges not in ascending order: " PTR_FORMAT " <= " PTR_FORMAT , ! p2i(start_address), p2i(prev_last_addr)); size_used += ranges[i].byte_size(); prev_last_addr = last_address; HeapRegion* start_region = _hrm.addr_to_region(start_address); HeapRegion* last_region = _hrm.addr_to_region(last_address);
*** 1166,1176 **** // After verifying that each region was marked as an archive region by // alloc_archive_regions, set it free and empty and uncommit it. HeapRegion* curr_region = start_region; while (curr_region != NULL) { guarantee(curr_region->is_archive(), ! err_msg("Expected archive region at index %u", curr_region->hrm_index())); uint curr_index = curr_region->hrm_index(); _old_set.remove(curr_region); curr_region->set_free(); curr_region->set_top(curr_region->bottom()); if (curr_region != last_region) { --- 1166,1176 ---- // After verifying that each region was marked as an archive region by // alloc_archive_regions, set it free and empty and uncommit it. HeapRegion* curr_region = start_region; while (curr_region != NULL) { guarantee(curr_region->is_archive(), ! "Expected archive region at index %u", curr_region->hrm_index()); uint curr_index = curr_region->hrm_index(); _old_set.remove(curr_region); curr_region->set_free(); curr_region->set_top(curr_region->bottom()); if (curr_region != last_region) {
*** 1753,1765 **** size_t maximum_desired_capacity = (size_t) maximum_desired_capacity_d; // This assert only makes sense here, before we adjust them // with respect to the min and max heap size. assert(minimum_desired_capacity <= maximum_desired_capacity, ! err_msg("minimum_desired_capacity = " SIZE_FORMAT ", " "maximum_desired_capacity = " SIZE_FORMAT, ! minimum_desired_capacity, maximum_desired_capacity)); // Should not be greater than the heap max size. No need to adjust // it with respect to the heap min size as it's a lower bound (i.e., // we'll try to make the capacity larger than it, not smaller). minimum_desired_capacity = MIN2(minimum_desired_capacity, max_heap_size); --- 1753,1765 ---- size_t maximum_desired_capacity = (size_t) maximum_desired_capacity_d; // This assert only makes sense here, before we adjust them // with respect to the min and max heap size. assert(minimum_desired_capacity <= maximum_desired_capacity, ! "minimum_desired_capacity = " SIZE_FORMAT ", " "maximum_desired_capacity = " SIZE_FORMAT, ! minimum_desired_capacity, maximum_desired_capacity); // Should not be greater than the heap max size. No need to adjust // it with respect to the heap min size as it's a lower bound (i.e., // we'll try to make the capacity larger than it, not smaller). minimum_desired_capacity = MIN2(minimum_desired_capacity, max_heap_size);
*** 2537,2548 **** #endif // !PRODUCT void G1CollectedHeap::increment_old_marking_cycles_started() { assert(_old_marking_cycles_started == _old_marking_cycles_completed || _old_marking_cycles_started == _old_marking_cycles_completed + 1, ! err_msg("Wrong marking cycle count (started: %d, completed: %d)", ! _old_marking_cycles_started, _old_marking_cycles_completed)); _old_marking_cycles_started++; } void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) { --- 2537,2548 ---- #endif // !PRODUCT void G1CollectedHeap::increment_old_marking_cycles_started() { assert(_old_marking_cycles_started == _old_marking_cycles_completed || _old_marking_cycles_started == _old_marking_cycles_completed + 1, ! "Wrong marking cycle count (started: %d, completed: %d)", ! _old_marking_cycles_started, _old_marking_cycles_completed); _old_marking_cycles_started++; } void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) {
*** 2562,2582 **** // This is the case for the inner caller, i.e. a Full GC. assert(concurrent || (_old_marking_cycles_started == _old_marking_cycles_completed + 1) || (_old_marking_cycles_started == _old_marking_cycles_completed + 2), ! err_msg("for inner caller (Full GC): _old_marking_cycles_started = %u " "is inconsistent with _old_marking_cycles_completed = %u", ! _old_marking_cycles_started, _old_marking_cycles_completed)); // This is the case for the outer caller, i.e. the concurrent cycle. assert(!concurrent || (_old_marking_cycles_started == _old_marking_cycles_completed + 1), ! err_msg("for outer caller (concurrent cycle): " "_old_marking_cycles_started = %u " "is inconsistent with _old_marking_cycles_completed = %u", ! _old_marking_cycles_started, _old_marking_cycles_completed)); _old_marking_cycles_completed += 1; // We need to clear the "in_progress" flag in the CM thread before // we wake up any waiters (especially when ExplicitInvokesConcurrent --- 2562,2582 ---- // This is the case for the inner caller, i.e. a Full GC. assert(concurrent || (_old_marking_cycles_started == _old_marking_cycles_completed + 1) || (_old_marking_cycles_started == _old_marking_cycles_completed + 2), ! "for inner caller (Full GC): _old_marking_cycles_started = %u " "is inconsistent with _old_marking_cycles_completed = %u", ! _old_marking_cycles_started, _old_marking_cycles_completed); // This is the case for the outer caller, i.e. the concurrent cycle. assert(!concurrent || (_old_marking_cycles_started == _old_marking_cycles_completed + 1), ! "for outer caller (concurrent cycle): " "_old_marking_cycles_started = %u " "is inconsistent with _old_marking_cycles_completed = %u", ! _old_marking_cycles_started, _old_marking_cycles_completed); _old_marking_cycles_completed += 1; // We need to clear the "in_progress" flag in the CM thread before // we wake up any waiters (especially when ExplicitInvokesConcurrent
*** 3122,3132 **** k->oops_do(_oop_closure); _young_ref_counter_closure.reset_count(); k->oops_do(&_young_ref_counter_closure); if (_young_ref_counter_closure.count() > 0) { ! guarantee(k->has_modified_oops(), err_msg("Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k))); } } }; class VerifyLivenessOopClosure: public OopClosure { --- 3122,3132 ---- k->oops_do(_oop_closure); _young_ref_counter_closure.reset_count(); k->oops_do(&_young_ref_counter_closure); if (_young_ref_counter_closure.count() > 0) { ! guarantee(k->has_modified_oops(), "Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k)); } } }; class VerifyLivenessOopClosure: public OopClosure {
*** 3192,3203 **** void do_oop( oop *p) { do_oop_work(p); } template <class T> void do_oop_work(T *p) { oop obj = oopDesc::load_decode_heap_oop(p); guarantee(obj == NULL || G1MarkSweep::in_archive_range(obj), ! err_msg("Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT, ! p2i(p), p2i(obj))); } }; class VerifyArchiveRegionClosure: public ObjectClosure { public: --- 3192,3203 ---- void do_oop( oop *p) { do_oop_work(p); } template <class T> void do_oop_work(T *p) { oop obj = oopDesc::load_decode_heap_oop(p); guarantee(obj == NULL || G1MarkSweep::in_archive_range(obj), ! "Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT, ! p2i(p), p2i(obj)); } }; class VerifyArchiveRegionClosure: public ObjectClosure { public:
*** 4707,4721 **** } } ~G1StringSymbolTableUnlinkTask() { guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size, ! err_msg("claim value %d after unlink less than initial string table size %d", ! StringTable::parallel_claimed_index(), _initial_string_table_size)); guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, ! err_msg("claim value %d after unlink less than initial symbol table size %d", ! SymbolTable::parallel_claimed_index(), _initial_symbol_table_size)); if (G1TraceStringSymbolTableScrubbing) { gclog_or_tty->print_cr("Cleaned string and symbol table, " "strings: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed, " "symbols: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed", --- 4707,4721 ---- } } ~G1StringSymbolTableUnlinkTask() { guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size, ! "claim value %d after unlink less than initial string table size %d", ! StringTable::parallel_claimed_index(), _initial_string_table_size); guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, ! "claim value %d after unlink less than initial symbol table size %d", ! SymbolTable::parallel_claimed_index(), _initial_symbol_table_size); if (G1TraceStringSymbolTableScrubbing) { gclog_or_tty->print_cr("Cleaned string and symbol table, " "strings: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed, " "symbols: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed",
*** 5111,5121 **** assert( obj->is_forwarded(), "invariant" ); *p = obj->forwardee(); } else { assert(!obj->is_forwarded(), "invariant" ); assert(cset_state.is_humongous(), ! err_msg("Only allowed InCSet state is IsHumongous, but is %d", cset_state.value())); _g1->set_humongous_is_live(obj); } } }; --- 5111,5121 ---- assert( obj->is_forwarded(), "invariant" ); *p = obj->forwardee(); } else { assert(!obj->is_forwarded(), "invariant" ); assert(cset_state.is_humongous(), ! "Only allowed InCSet state is IsHumongous, but is %d", cset_state.value()); _g1->set_humongous_is_live(obj); } } };
*** 5165,5175 **** if (_g1h->is_in_g1_reserved(p)) { _par_scan_state->push_on_queue(p); } else { assert(!Metaspace::contains((const void*)p), ! err_msg("Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p))); _copy_non_heap_obj_cl->do_oop(p); } } } }; --- 5165,5175 ---- if (_g1h->is_in_g1_reserved(p)) { _par_scan_state->push_on_queue(p); } else { assert(!Metaspace::contains((const void*)p), ! "Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p)); _copy_non_heap_obj_cl->do_oop(p); } } } };
*** 5821,5831 **** } bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap, HeapWord* tams, HeapWord* end) { guarantee(tams <= end, ! err_msg("tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end))); HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end); if (result < end) { gclog_or_tty->cr(); gclog_or_tty->print_cr("## wrong marked address on %s bitmap: " PTR_FORMAT, bitmap_name, p2i(result)); --- 5821,5831 ---- } bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap, HeapWord* tams, HeapWord* end) { guarantee(tams <= end, ! "tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end)); HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end); if (result < end) { gclog_or_tty->cr(); gclog_or_tty->print_cr("## wrong marked address on %s bitmap: " PTR_FORMAT, bitmap_name, p2i(result));
*** 6172,6184 **** return false; } guarantee(obj->is_typeArray(), ! err_msg("Only eagerly reclaiming type arrays is supported, but the object " ! PTR_FORMAT " is not.", ! p2i(r->bottom()))); if (G1TraceEagerReclaimHumongousObjects) { gclog_or_tty->print_cr("Dead humongous region %u size " SIZE_FORMAT " start " PTR_FORMAT " length %u with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", region_idx, (size_t)obj->size() * HeapWordSize, --- 6172,6183 ---- return false; } guarantee(obj->is_typeArray(), ! "Only eagerly reclaiming type arrays is supported, but the object " ! PTR_FORMAT " is not.", p2i(r->bottom())); if (G1TraceEagerReclaimHumongousObjects) { gclog_or_tty->print_cr("Dead humongous region %u size " SIZE_FORMAT " start " PTR_FORMAT " length %u with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", region_idx, (size_t)obj->size() * HeapWordSize,
*** 6403,6414 **** _summary_bytes_used += bytes; } void G1CollectedHeap::decrease_used(size_t bytes) { assert(_summary_bytes_used >= bytes, ! err_msg("invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT, ! _summary_bytes_used, bytes)); _summary_bytes_used -= bytes; } void G1CollectedHeap::set_used(size_t bytes) { _summary_bytes_used = bytes; --- 6402,6413 ---- _summary_bytes_used += bytes; } void G1CollectedHeap::decrease_used(size_t bytes) { assert(_summary_bytes_used >= bytes, ! "invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT, ! _summary_bytes_used, bytes); _summary_bytes_used -= bytes; } void G1CollectedHeap::set_used(size_t bytes) { _summary_bytes_used = bytes;
*** 6486,6498 **** if (_archive_allocator != NULL) { _archive_allocator->clear_used(); } } assert(used_unlocked() == recalculate_used(), ! err_msg("inconsistent used_unlocked(), " "value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT, ! used_unlocked(), recalculate_used())); } void G1CollectedHeap::set_refine_cte_cl_concurrency(bool concurrent) { _refine_cte_cl->set_concurrent(concurrent); } --- 6485,6497 ---- if (_archive_allocator != NULL) { _archive_allocator->clear_used(); } } assert(used_unlocked() == recalculate_used(), ! "inconsistent used_unlocked(), " "value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT, ! used_unlocked(), recalculate_used()); } void G1CollectedHeap::set_refine_cte_cl_concurrency(bool concurrent) { _refine_cte_cl->set_concurrent(concurrent); }
*** 6629,6667 **** } if (hr->is_young()) { // TODO } else if (hr->is_starts_humongous()) { ! assert(hr->containing_set() == _humongous_set, err_msg("Heap region %u is starts humongous but not in humongous set.", hr->hrm_index())); _humongous_count.increment(1u, hr->capacity()); } else if (hr->is_empty()) { ! assert(_hrm->is_free(hr), err_msg("Heap region %u is empty but not on the free list.", hr->hrm_index())); _free_count.increment(1u, hr->capacity()); } else if (hr->is_old()) { ! assert(hr->containing_set() == _old_set, err_msg("Heap region %u is old but not in the old set.", hr->hrm_index())); _old_count.increment(1u, hr->capacity()); } else { // There are no other valid region types. Check for one invalid // one we can identify: pinned without old or humongous set. ! assert(!hr->is_pinned(), err_msg("Heap region %u is pinned but not old (archive) or humongous.", hr->hrm_index())); ShouldNotReachHere(); } return false; } void verify_counts(HeapRegionSet* old_set, HeapRegionSet* humongous_set, HeapRegionManager* free_list) { ! guarantee(old_set->length() == _old_count.length(), err_msg("Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count.length())); ! guarantee(old_set->total_capacity_bytes() == _old_count.capacity(), err_msg("Old set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, ! old_set->total_capacity_bytes(), _old_count.capacity())); ! ! guarantee(humongous_set->length() == _humongous_count.length(), err_msg("Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count.length())); ! guarantee(humongous_set->total_capacity_bytes() == _humongous_count.capacity(), err_msg("Hum set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, ! humongous_set->total_capacity_bytes(), _humongous_count.capacity())); ! ! guarantee(free_list->num_free_regions() == _free_count.length(), err_msg("Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count.length())); ! guarantee(free_list->total_capacity_bytes() == _free_count.capacity(), err_msg("Free list capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, ! free_list->total_capacity_bytes(), _free_count.capacity())); } }; void G1CollectedHeap::verify_region_sets() { assert_heap_locked_or_at_safepoint(true /* should_be_vm_thread */); --- 6628,6666 ---- } if (hr->is_young()) { // TODO } else if (hr->is_starts_humongous()) { ! assert(hr->containing_set() == _humongous_set, "Heap region %u is starts humongous but not in humongous set.", hr->hrm_index()); _humongous_count.increment(1u, hr->capacity()); } else if (hr->is_empty()) { ! assert(_hrm->is_free(hr), "Heap region %u is empty but not on the free list.", hr->hrm_index()); _free_count.increment(1u, hr->capacity()); } else if (hr->is_old()) { ! assert(hr->containing_set() == _old_set, "Heap region %u is old but not in the old set.", hr->hrm_index()); _old_count.increment(1u, hr->capacity()); } else { // There are no other valid region types. Check for one invalid // one we can identify: pinned without old or humongous set. ! assert(!hr->is_pinned(), "Heap region %u is pinned but not old (archive) or humongous.", hr->hrm_index()); ShouldNotReachHere(); } return false; } void verify_counts(HeapRegionSet* old_set, HeapRegionSet* humongous_set, HeapRegionManager* free_list) { ! guarantee(old_set->length() == _old_count.length(), "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count.length()); ! guarantee(old_set->total_capacity_bytes() == _old_count.capacity(), "Old set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, ! old_set->total_capacity_bytes(), _old_count.capacity()); ! ! guarantee(humongous_set->length() == _humongous_count.length(), "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count.length()); ! guarantee(humongous_set->total_capacity_bytes() == _humongous_count.capacity(), "Hum set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, ! humongous_set->total_capacity_bytes(), _humongous_count.capacity()); ! ! guarantee(free_list->num_free_regions() == _free_count.length(), "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count.length()); ! guarantee(free_list->total_capacity_bytes() == _free_count.capacity(), "Free list capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, ! free_list->total_capacity_bytes(), _free_count.capacity()); } }; void G1CollectedHeap::verify_region_sets() { assert_heap_locked_or_at_safepoint(true /* should_be_vm_thread */);
*** 6713,6725 **** T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); HeapRegion* hr = _g1h->heap_region_containing(obj); assert(!hr->is_continues_humongous(), ! err_msg("trying to add code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT " starting at " HR_FORMAT, ! p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()))); // HeapRegion::add_strong_code_root_locked() avoids adding duplicate entries. hr->add_strong_code_root_locked(_nm); } } --- 6712,6724 ---- T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); HeapRegion* hr = _g1h->heap_region_containing(obj); assert(!hr->is_continues_humongous(), ! "trying to add code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT " starting at " HR_FORMAT, ! p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region())); // HeapRegion::add_strong_code_root_locked() avoids adding duplicate entries. hr->add_strong_code_root_locked(_nm); } }
*** 6740,6752 **** T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); HeapRegion* hr = _g1h->heap_region_containing(obj); assert(!hr->is_continues_humongous(), ! err_msg("trying to remove code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT " starting at " HR_FORMAT, ! p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()))); hr->remove_strong_code_root(_nm); } } --- 6739,6751 ---- T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); HeapRegion* hr = _g1h->heap_region_containing(obj); assert(!hr->is_continues_humongous(), ! "trying to remove code root " PTR_FORMAT " in continuation of humongous region " HR_FORMAT " starting at " HR_FORMAT, ! p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region())); hr->remove_strong_code_root(_nm); } }
< prev index next >