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

Coleen Phillimore coleenp at openjdk.org
Thu Feb 20 23:25:57 UTC 2025


On Wed, 19 Feb 2025 21:16:51 GMT, Dean Long <dlong at openjdk.org> wrote:

>> This is a good question.  The heapwalker walks through dead mirrors so I can't assert that a null klass field matches our boolean setting but I don't know why this never asserts (can't find any instances in the bug database) but it seems like it could.  I'll use the bool field in the mirror in the assert though but not in the return since the caller likely will fetch the klass pointer next.
>
>> ... but not in the return since the caller likely will fetch the klass pointer next.
> 
> I notice that too.  Callers are using is_primitive() to short-circuit calls to as_Klass(), which means they seem to be aware of this implementation detail when maybe they shouldn't.

There are 136 callers so yes, it might be something that shouldn't be known in this many places.

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

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


More information about the core-libs-dev mailing list