RFR: 8373056: Shenandoah: Remove unnecessary use of ShenandoahAllocRequest.type()
Xiaolong Peng
xpeng at openjdk.org
Wed Dec 3 23:24:29 UTC 2025
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 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
- [ ] hotspot_gc_shenandoah
- [ ] GHA
-------------
Commit messages:
- Remove direct use of alloc type from ShenandoahHeapRegion::adjust_alloc_metadata
- Revert log change
- Remove unnecessary use of ShenandoahAllocRequest.type()
Changes: https://git.openjdk.org/jdk/pull/28649/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28649&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8373056
Stats: 79 lines in 6 files changed: 12 ins; 20 del; 47 mod
Patch: https://git.openjdk.org/jdk/pull/28649.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28649/head:pull/28649
PR: https://git.openjdk.org/jdk/pull/28649
More information about the shenandoah-dev
mailing list