RFR: 8373056: Shenandoah: Remove unnecessary use of ShenandoahAllocRequest.type() [v2]

William Kemper wkemper at openjdk.org
Thu Dec 4 00:41:00 UTC 2025


On Wed, 3 Dec 2025 23:30:21 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:

>> Follow up on the feedback/comments on PR https://github.com/openjdk/jdk/pull/28521 for bug [JDK-8372566](https://bugs.openjdk.org/browse/JDK-8372566), we should avoid using ShenandoahAllocRequest.type() directly if possible, in most of cases we don't need to directly use alloc type, the inline member methods provided by ShenandoahAllocRequest should be sufficient.
>> 
>> In the PR, I have removed most of the places where ShenandoahAllocRequest.type() directly used, there will be only one place left after the change:
>> * ShenandoahFreeSet::allocate (This one will be removed with PR https://github.com/openjdk/jdk/pull/26171)
>> 
>> Also did small code rearrangement for ShenandoahOldGeneration::configure_plab_for_current_thread 
>> 
>> ### Test
>> - [x] hotspot_gc_shenandoah
>> - [ ] GHA
>
> Xiaolong Peng has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Merge branch 'openjdk:master' into JDK-8373056
>  - Remove direct use of alloc type from ShenandoahHeapRegion::adjust_alloc_metadata
>  - Revert log change
>  - Remove unnecessary use of ShenandoahAllocRequest.type()

Looks good. Left a minor nit about a now stale comment.

src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp line 198:

> 196: void
> 197: ShenandoahOldGeneration::configure_plab_for_current_thread(const ShenandoahAllocRequest &req) {
> 198:   // Note: Even when a mutator is performing a promotion outside a LAB, we use a 'shared_gc' request.

Is this comment vestigial now? This method doesn't handle shared allocations anymore.

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

Changes requested by wkemper (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28649#pullrequestreview-3537426868
PR Review Comment: https://git.openjdk.org/jdk/pull/28649#discussion_r2587024810


More information about the shenandoah-dev mailing list