2624 case VerifyOption_G1UsePrevMarking: return is_obj_dead(obj); 2625 case VerifyOption_G1UseNextMarking: return is_obj_ill(obj); 2626 case VerifyOption_G1UseMarkWord: { 2627 HeapRegion* hr = _hrm.addr_to_region((HeapWord*)obj); 2628 return !obj->is_gc_marked() && !hr->is_archive(); 2629 } 2630 default: ShouldNotReachHere(); 2631 } 2632 return false; // keep some compilers happy 2633 } 2634 2635 void G1CollectedHeap::print_heap_regions() const { 2636 Log(gc, heap, region) log; 2637 if (log.is_trace()) { 2638 ResourceMark rm; 2639 print_regions_on(log.trace_stream()); 2640 } 2641 } 2642 2643 void G1CollectedHeap::print_on(outputStream* st) const { 2644 st->print(" %-20s", "garbage-first heap"); 2645 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", 2646 capacity()/K, used_unlocked()/K); 2647 st->print(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")", 2648 p2i(_hrm.reserved().start()), 2649 p2i(_hrm.reserved().start() + _hrm.length() + HeapRegion::GrainWords), 2650 p2i(_hrm.reserved().end())); 2651 st->cr(); 2652 st->print(" region size " SIZE_FORMAT "K, ", HeapRegion::GrainBytes / K); 2653 uint young_regions = young_regions_count(); 2654 st->print("%u young (" SIZE_FORMAT "K), ", young_regions, 2655 (size_t) young_regions * HeapRegion::GrainBytes / K); 2656 uint survivor_regions = survivor_regions_count(); 2657 st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions, 2658 (size_t) survivor_regions * HeapRegion::GrainBytes / K); 2659 st->cr(); 2660 MetaspaceAux::print_on(st); 2661 } 2662 2663 void G1CollectedHeap::print_regions_on(outputStream* st) const { | 2624 case VerifyOption_G1UsePrevMarking: return is_obj_dead(obj); 2625 case VerifyOption_G1UseNextMarking: return is_obj_ill(obj); 2626 case VerifyOption_G1UseMarkWord: { 2627 HeapRegion* hr = _hrm.addr_to_region((HeapWord*)obj); 2628 return !obj->is_gc_marked() && !hr->is_archive(); 2629 } 2630 default: ShouldNotReachHere(); 2631 } 2632 return false; // keep some compilers happy 2633 } 2634 2635 void G1CollectedHeap::print_heap_regions() const { 2636 Log(gc, heap, region) log; 2637 if (log.is_trace()) { 2638 ResourceMark rm; 2639 print_regions_on(log.trace_stream()); 2640 } 2641 } 2642 2643 void G1CollectedHeap::print_on(outputStream* st) const { 2644 assert_locked_or_safepoint(Heap_lock); 2645 2646 st->print(" %-20s", "garbage-first heap"); 2647 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", 2648 capacity()/K, used_unlocked()/K); 2649 st->print(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")", 2650 p2i(_hrm.reserved().start()), 2651 p2i(_hrm.reserved().start() + _hrm.length() + HeapRegion::GrainWords), 2652 p2i(_hrm.reserved().end())); 2653 st->cr(); 2654 st->print(" region size " SIZE_FORMAT "K, ", HeapRegion::GrainBytes / K); 2655 uint young_regions = young_regions_count(); 2656 st->print("%u young (" SIZE_FORMAT "K), ", young_regions, 2657 (size_t) young_regions * HeapRegion::GrainBytes / K); 2658 uint survivor_regions = survivor_regions_count(); 2659 st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions, 2660 (size_t) survivor_regions * HeapRegion::GrainBytes / K); 2661 st->cr(); 2662 MetaspaceAux::print_on(st); 2663 } 2664 2665 void G1CollectedHeap::print_regions_on(outputStream* st) const { |