RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

Coleen Phillimore coleenp at openjdk.org
Wed Feb 19 17:16:06 UTC 2025


On Wed, 19 Feb 2025 15:42:54 GMT, Chen Liang <liach at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/Class.java line 1009:
>> 
>>> 1007:     private transient Object classData; // Set by VM
>>> 1008:     private transient Object[] signers; // Read by VM, mutable
>>> 1009:     private final transient char modifiers;  // Set by the VM
>> 
>> Why the change of type here?
>
> This is to improve the layout so the introduction of a boolean field does not increase the size of a Class object.

I changed modifiers to u2 so that we won't have an alignment gap with the bool isPrimitiveType flag.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23572#discussion_r1962060783


More information about the core-libs-dev mailing list