RFR: 8369809: G1: Merge G1CollectedHeap::do_collection_pause_at_safepoint[_helper]

Albert Mingkun Yang ayang at openjdk.org
Tue Oct 14 10:53:19 UTC 2025


On Tue, 14 Oct 2025 08:59:16 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this trivial fix to merge `G1CollectedHeap::do_collection_pause_helper` with `do_collection_pause`. The helper method is only called there in this single place and does not add anything but two asserts.
> 
> Testing: gha, local compilation
> 
> Thanks,
>   Thomas

Marked as reviewed by ayang (Reviewer).

src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 2630:

> 2628: void G1CollectedHeap::do_collection_pause_at_safepoint(size_t allocation_word_size) {
> 2629:   assert_at_safepoint_on_vm_thread();
> 2630:   guarantee(!is_stw_gc_active(), "collection is not reentrant");

This can probably be an `assert` instead.

-------------

PR Review: https://git.openjdk.org/jdk/pull/27790#pullrequestreview-3334984069
PR Review Comment: https://git.openjdk.org/jdk/pull/27790#discussion_r2428719787


More information about the hotspot-gc-dev mailing list