[lworld] RFR: 8363846: [lworld] Make Class.isIdentityClass() non-native
Chen Liang
liach at openjdk.org
Tue Jul 22 23:47:08 UTC 2025
On Tue, 22 Jul 2025 21:45:18 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> This moves isIdentityClass() implementation to Class.java, and checks within the JVM that is_identity_class() doesn't check the access flags for an ArrayKlass, since AccessFlags aren't initialized in ArrayKlasses. The AccessFlags should be moved from Klass.hpp to InstanceKlass.cpp in mainline but that's a more complicated change and has several pieces.
>> Added a test.
>> Tested with tier1 locally.
>
> src/java.base/share/classes/java/lang/Class.java line 634:
>
>> 632: } else {
>> 633: return !isInterface();
>> 634: }
>
> Isn't this going to take a performance hit?
Where is the hit at?
Moving this method to Java should be friendly to both interpreter (no more jni context switch) and C2 (no more opacity). We can further simplify these to be modifier checks later on.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1514#discussion_r2224018170
More information about the valhalla-dev
mailing list