On Mon, 9 Mar 2026 07:53:21 GMT, David Holmes <[email protected]> wrote:
>> This PR adds a new JNI `IsValueObject` method so that native code can query
>> is an object is an instance of a value class.
>>
>> This will require a bump of the JNI version number once we are out of
>> preview.
>>
>> Added a simple functional test.
>>
>> Manually tested with -Xcheck:jni as well
>>
>> tiers 1-3 sanity testing
>>
>> Thanks
>
> David Holmes has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Fix typo in probe
Thanks for the work! The test and change looks good, I left a question to make
sure that we are considering the correct semantics.
src/hotspot/share/prims/jni.cpp line 3180:
> 3178: HOTSPOT_JNI_ISVALUEOBJECT_ENTRY(env, obj);
> 3179: oop o = JNIHandles::resolve(obj);
> 3180: if (o != nullptr && o->klass()->is_inline_klass()) {
What should the semantics of `ISVALUEOBJECT` be for abstract value classes?
These are instance klasses. The more conventional way to check is the absence
of `ACC_IDENTITY`, and from that one can decide whether to check for
concreteness or if identityless is sufficient.
-------------
PR Review:
https://git.openjdk.org/valhalla/pull/2203#pullrequestreview-3921894548
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2203#discussion_r2911286754