From 159452e85a55745fecc58b68ead03a8d330d14dd Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 15 Oct 2025 11:25:31 +0000 Subject: [PATCH] 8369809: G1: Merge G1CollectedHeap::do_collection_pause_at_safepoint[_helper] Reviewed-by: ayang, iwalulya --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 12 ++++-------- src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 4 ---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 4337e5a3b85..c1b18a71cfb 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -2567,13 +2567,6 @@ void G1CollectedHeap::verify_after_young_collection(G1HeapVerifier::G1VerifyType phase_times()->record_verify_after_time_ms((Ticks::now() - start).seconds() * MILLIUNITS); } -void G1CollectedHeap::do_collection_pause_at_safepoint(size_t allocation_word_size) { - assert_at_safepoint_on_vm_thread(); - guarantee(!is_stw_gc_active(), "collection is not reentrant"); - - do_collection_pause_at_safepoint_helper(allocation_word_size); -} - G1HeapPrinterMark::G1HeapPrinterMark(G1CollectedHeap* g1h) : _g1h(g1h), _heap_transition(g1h) { // This summary needs to be printed before incrementing total collections. _g1h->rem_set()->print_periodic_summary_info("Before GC RS summary", @@ -2635,7 +2628,10 @@ void G1CollectedHeap::flush_region_pin_cache() { } } -void G1CollectedHeap::do_collection_pause_at_safepoint_helper(size_t allocation_word_size) { +void G1CollectedHeap::do_collection_pause_at_safepoint(size_t allocation_word_size) { + assert_at_safepoint_on_vm_thread(); + assert(!is_stw_gc_active(), "collection is not reentrant"); + ResourceMark rm; IsSTWGCActiveMark active_gc_mark; diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index 845f8a257a1..7e3f8a30285 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -769,10 +769,6 @@ private: // precondition: !is_stw_gc_active() void do_collection_pause_at_safepoint(size_t allocation_word_size = 0); - // Helper for do_collection_pause_at_safepoint, containing the guts - // of the incremental collection pause, executed by the vm thread. - void do_collection_pause_at_safepoint_helper(size_t allocation_word_size); - void verify_before_young_collection(G1HeapVerifier::G1VerifyType type); void verify_after_young_collection(G1HeapVerifier::G1VerifyType type);