[lworld] RFR: 8363846: [lworld] Make Class.isIdentityClass() non-native

Coleen Phillimore coleenp at openjdk.org
Wed Jul 23 11:44:10 UTC 2025


On Tue, 22 Jul 2025 23:39:09 GMT, Chen Liang <liach at openjdk.org> wrote:

>> 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.

Yes this is better performance because C2 now doesn't have to intrinsify this native call.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1514#discussion_r2225287655


More information about the valhalla-dev mailing list