5252#include " gc/g1/g1HeapSizingPolicy.hpp"
5353#include " gc/g1/g1HeapTransition.hpp"
5454#include " gc/g1/g1HeapVerifier.hpp"
55+ #include " gc/g1/g1HRPrinter.hpp"
5556#include " gc/g1/g1InitLogger.hpp"
5657#include " gc/g1/g1MemoryPool.hpp"
5758#include " gc/g1/g1MonotonicArenaFreeMemoryTask.hpp"
@@ -325,7 +326,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(HeapRegion* first_hr,
325326 for (uint i = first; i <= last; ++i) {
326327 HeapRegion *hr = region_at (i);
327328 _humongous_set.add (hr);
328- _hr_printer. alloc (hr);
329+ G1HRPrinter:: alloc (hr);
329330 }
330331
331332 return new_obj;
@@ -524,7 +525,7 @@ HeapWord* G1CollectedHeap::alloc_archive_region(size_t word_size, HeapWord* pref
524525 r->set_top (top);
525526
526527 r->set_old ();
527- _hr_printer. alloc (r);
528+ G1HRPrinter:: alloc (r);
528529 _old_set.add (r);
529530 };
530531
@@ -710,26 +711,21 @@ HeapWord* G1CollectedHeap::attempt_allocation_at_safepoint(size_t word_size,
710711}
711712
712713class PostCompactionPrinterClosure : public HeapRegionClosure {
713- private:
714- G1HRPrinter* _hr_printer;
715714public:
716715 bool do_heap_region (HeapRegion* hr) {
717716 assert (!hr->is_young (), " not expecting to find young regions" );
718- _hr_printer-> post_compaction (hr);
717+ G1HRPrinter:: post_compaction (hr);
719718 return false ;
720719 }
721-
722- PostCompactionPrinterClosure (G1HRPrinter* hr_printer)
723- : _hr_printer(hr_printer) { }
724720};
725721
726722void G1CollectedHeap::print_heap_after_full_collection () {
727723 // Post collection region logging.
728724 // We should do this after we potentially resize the heap so
729725 // that all the COMMIT / UNCOMMIT events are generated before
730726 // the compaction events.
731- if (_hr_printer. is_active ()) {
732- PostCompactionPrinterClosure cl ( hr_printer ()) ;
727+ if (G1HRPrinter:: is_active ()) {
728+ PostCompactionPrinterClosure cl;
733729 heap_region_iterate (&cl);
734730 }
735731}
@@ -1152,7 +1148,6 @@ G1CollectedHeap::G1CollectedHeap() :
11521148 _monitoring_support(nullptr ),
11531149 _num_humongous_objects(0 ),
11541150 _num_humongous_reclaim_candidates(0 ),
1155- _hr_printer(),
11561151 _collector_state(),
11571152 _old_marking_cycles_started(0 ),
11581153 _old_marking_cycles_completed(0 ),
@@ -2862,7 +2857,7 @@ HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size,
28622857 node_index);
28632858 if (new_alloc_region != nullptr ) {
28642859 set_region_short_lived_locked (new_alloc_region);
2865- _hr_printer. alloc (new_alloc_region, !should_allocate);
2860+ G1HRPrinter:: alloc (new_alloc_region, !should_allocate);
28662861 _policy->remset_tracker ()->update_at_allocate (new_alloc_region);
28672862 return new_alloc_region;
28682863 }
@@ -2878,7 +2873,7 @@ void G1CollectedHeap::retire_mutator_alloc_region(HeapRegion* alloc_region,
28782873 collection_set ()->add_eden_region (alloc_region);
28792874 increase_used (allocated_bytes);
28802875 _eden.add_used_bytes (allocated_bytes);
2881- _hr_printer. retire (alloc_region);
2876+ G1HRPrinter:: retire (alloc_region);
28822877
28832878 // We update the eden sizes here, when the region is retired,
28842879 // instead of when it's allocated, since this is the point that its
@@ -2925,7 +2920,7 @@ HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size, G1HeapRegionA
29252920 }
29262921 _policy->remset_tracker ()->update_at_allocate (new_alloc_region);
29272922 register_region_with_region_attr (new_alloc_region);
2928- _hr_printer. alloc (new_alloc_region);
2923+ G1HRPrinter:: alloc (new_alloc_region);
29292924 return new_alloc_region;
29302925 }
29312926 return nullptr ;
@@ -2946,7 +2941,7 @@ void G1CollectedHeap::retire_gc_alloc_region(HeapRegion* alloc_region,
29462941 if (during_im && allocated_bytes > 0 ) {
29472942 _cm->add_root_region (alloc_region);
29482943 }
2949- _hr_printer. retire (alloc_region);
2944+ G1HRPrinter:: retire (alloc_region);
29502945}
29512946
29522947HeapRegion* G1CollectedHeap::alloc_highest_free_region () {
0 commit comments