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

Coleen Phillimore coleenp at openjdk.org
Tue Feb 18 23:49:54 UTC 2025


On Tue, 11 Feb 2025 20:56:39 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> Class.isInterface() can check modifier flags, Class.isArray() can check whether component mirror is non-null and Class.isPrimitive() needs a new final transient boolean in java.lang.Class that the JVM code initializes.
> Tested with tier1-4 and performance tests.

I had a look at Wrapper.forPrimitiveType() and it's not an intrinsic so I don't really know how hot it is.  It's a comparison, vs getting a field out of Class<?>.  Not sure how to measure it.  So I can't address it in this change.

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

PR Comment: https://git.openjdk.org/jdk/pull/23572#issuecomment-2659396480


More information about the core-libs-dev mailing list