RFR: 8317269: Store old classes in linked state in AOT cache [v5]
Coleen Phillimore
coleenp at openjdk.org
Thu Sep 4 19:15:49 UTC 2025
On Mon, 1 Sep 2025 00:57:33 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> src/hotspot/share/classfile/systemDictionaryShared.cpp line 542:
>>
>>> 540: }
>>> 541:
>>> 542: Klass* SystemDictionaryShared::find_verification_dependency_bottom_class(InstanceKlass* k, Symbol* dependency_class_name) {
>>
>> Why don't you have this return InstanceKlasss so that the callers don't have to check the same thing. What you want is the bottom InstanceKlass so for [Lfoo; - you want foo. Since class foo is the thing you care about. Maybe the comment about why you return nullptr from check_verification_dependency_exclusion() could be here instead.
>>
>> These names are a bit repetative, can you just call this find_bottom_instance_klass() and maybe it could be used for other things too.
>
> The problem is if `k` is the ObjArrayKlass of `[[I`, then `k->bottom_klass()` is `[I`, which is not an InstanceKlass. If we change the return type to `InstanceKlass*`, then we would have to return `nullptr`. However, that would make it more difficult to explain the following case (I've updated the comments):
>
>
> bool SystemDictionaryShared::check_verification_dependency_exclusion(InstanceKlass* k, Symbol* dependency_class_name) {
> Klass* dependency_bottom_class = find_verification_dependency_bottom_class(k, dependency_class_name);
> if (dependency_bottom_class == nullptr) {
> // Dependency_class_name has not yet been loaded. This happens when the new verifier was checking
> // if dependency_class_name is assignable to an interface, and found the answer without resolving
> // dependency_class_name.
> //
> // Since this class is not even loaded, it surely cannot be excluded.
> return false;
> }
This doesn't seem bad. You could say "Not loaded or bottom class is not an instanceKlass." Do you need to say what the verifier was doing here?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26754#discussion_r2323224309
More information about the hotspot-dev
mailing list