RFR: 8377172: Change datatype of CodeEntryAlignment to uint
Leo Korinth
lkorinth at openjdk.org
Mon Feb 9 21:27:05 UTC 2026
The main idea of this change is to remove an implicitly narrowing conversion to int from intx (`int code_alignment()`).
CodeEntryAlignment is constrained to not be bigger than CodeCacheSegmentSize that is itself constrained to be in the range(1, 1024). The data type should really be a uint16_t as its allowed range is [16-1024], but we have no such support for VM flags. uint will do, and will simplify the code greatly (five less casts, six if we count the implicit narrowing cast).
Also add explicit range on the flag.
This change is inspired by my change 8376892: Allow conversion warnings in subsets of the code base.
Completed test tier 1-3.
-------------
Commit messages:
- OptoLoopAlignment and InteriorEntryAlignment should be unsigned.
- 8377172: Change datatype of CodeEntryAlignment to uint
Changes: https://git.openjdk.org/jdk/pull/29637/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29637&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8377172
Stats: 36 lines in 16 files changed: 3 ins; 2 del; 31 mod
Patch: https://git.openjdk.org/jdk/pull/29637.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29637/head:pull/29637
PR: https://git.openjdk.org/jdk/pull/29637
More information about the hotspot-dev
mailing list