RFR: 8297914: Remove java_lang_Class::process_archived_mirror() [v2]
Ioi Lam
iklam at openjdk.org
Fri Jan 13 19:00:44 UTC 2023
On Fri, 13 Jan 2023 18:39:02 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with three additional commits since the last revision:
>>
>> - review comments from @ashu-mehra and @dholmes-ora
>> - fixed repo
>> - tmp
>
> src/hotspot/share/oops/objArrayKlass.cpp line 442:
>
>> 440: }
>> 441: }
>> 442: #endif
>
> When will the above function be called?
>
> From `ClassLoaderData::free_deallocate_list()`
>
>
> // Cast them so they can be used by the template function.
> if (m->is_method()) {
> MetadataFactory::free_metadata(this, (Method*)m);
> } else if (m->is_constantPool()) {
> MetadataFactory::free_metadata(this, (ConstantPool*)m);
> } else if (m->is_klass()) {
> MetadataFactory::free_metadata(this, (InstanceKlass*)m);
> } else {
> ShouldNotReachHere();
> }
>
> `free_metadata` will call `deallocate_contents` but I don't see how it will call the` ObjectArrayKlass` version.
Thanks for finding this. `<T>::free_deallocate_list` is called only by the template function `MetadataFactory::free_metadata`. I removed `ObjArrayKlass::deallocate_contents()` and HotSpot still builds. This means nobody uses `free_metadata` with the `ObjArrayKlass` type.
-------------
PR: https://git.openjdk.org/jdk/pull/11853
More information about the hotspot-dev
mailing list