RFR: 8372098: Move AccessFlags to InstanceKlass [v4]

Vladimir Ivanov vlivanov at openjdk.org
Tue Nov 25 01:28:47 UTC 2025


On Tue, 25 Nov 2025 01:01:17 GMT, Dean Long <dlong at openjdk.org> wrote:

>> src/hotspot/share/opto/library_call.cpp line 4100:
>> 
>>> 4098:     // Other types can report the actual _super.
>>> 4099:     // (To verify this code sequence, check the asserts in JVM_IsInterface.)
>>> 4100:     if (generate_interface_guard(kls, region) != nullptr)
>> 
>> BTW why did you decide to change the order of the checks?
>
> I noticed that too.  It is necessary for correctness now.  It is incorrect and unsafe to use generate_interface_guard() on array after this change, because an array klass is not an InstanceKlass.

Oh, that's subtle... It deserves a comment at least.

We could also change `LibraryCallKit::generate_interface_guard()` to require `kls` to be of type `TypeInstKlassPtr`, but then we would need a cast before calling it from `LibraryCallKit::inline_native_Class_query()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2558217038


More information about the graal-dev mailing list