RFR: 8367476: Shenandoah: Remove use of CollectedHeap::_soft_ref_policy
Albert Mingkun Yang
ayang at openjdk.org
Fri Sep 12 11:05:12 UTC 2025
On Fri, 12 Sep 2025 00:19:05 GMT, Francesco Andreuzzi <fandreuzzi at openjdk.org> wrote:
> Similarly to what was done in #26496 and #26648, the usages of `CollectedHeap::_soft_ref_policy` in Shenandoah can be replaced with an earlier call to `ShenandoahReferenceProcessor::set_soft_reference_policy`.
>
> This is the last usage of `CollectedHeap::_soft_ref_policy`, so it can be removed.
>
> Passes tier(1,2,3)_gc_shenandoah.
src/hotspot/share/gc/shared/collectedHeap.hpp line 239:
> 237: return cause == GCCause::_metadata_GC_clear_soft_refs ||
> 238: cause == GCCause::_wb_full_gc;
> 239: }
I feel that it makes more sense to have this in `GCCause`.
src/hotspot/share/gc/shared/collectedHeap.hpp line 241:
> 239: }
> 240:
> 241: inline bool should_clear_all_soft_refs() const {
I suggest inlining this method.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27239#discussion_r2343856579
PR Review Comment: https://git.openjdk.org/jdk/pull/27239#discussion_r2343858970
More information about the hotspot-gc-dev
mailing list