RFR: 8346567: Make Class.getModifiers() non-native [v5]
Chen Liang
liach at openjdk.org
Thu Feb 6 16:20:21 UTC 2025
On Thu, 6 Feb 2025 12:08:59 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> If Class had other fields smaller than `int`, would be consider making this something like `char` to save space (allowing all the sub-word fields to be compacted)?
>
> I thought of doing this since I made modifiers u2 in the Hotspot code just previously, but all the Java code refers to this as an int. And I didn't see other fields to compact it with. Maybe if access_flags are moved we could make them both char (not short since they're unsigned). It feels weird to not have unsigned short to my C++ eyes.
>From a Java perspective, using `char` for the field is completely fine; this field is only accessed via `getModifiers` and not set by Java code, so the automatic widening conversion can handle it all.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22652#discussion_r1945021458
More information about the serviceability-dev
mailing list