RFR: 8374549: Extend MetaspaceClosure to cover non-MetaspaceObj types

Vladimir Kozlov kvn at openjdk.org
Fri Jan 23 19:36:17 UTC 2026


On Fri, 23 Jan 2026 06:22:50 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/cds/cppVtables.cpp line 62:
>> 
>>> 60: 
>>> 61: // AOTGrowableArray has a vtable only when in non-product builds (due to
>>> 62: // the virtual printing functions in AnyObj).
>> 
>> Can we devirtualize it? You would need to reconstruct Vpointer in non-debug build otherwise.
>
> Since `AnyObj` doesn't carry any type information, we cannot easily devirtualize this call.
> 
> In debug builds, the vtable is updated in the production run. The vtable updates are driven by the `CPP_VTABLE_TYPES_DO` macro in cppVtables.cpp. The following have been added to this macro
> 
> 
> #ifndef PRODUCT
> 
> // AOTGrowableArray has a vtable only when in non-product builds (due to
> // the virtual printing functions in AnyObj).
> 
> using GrowableArray_ModuleEntry_ptr = AOTGrowableArray<ModuleEntry*>;
> 
> #define DEBUG_CPP_VTABLE_TYPES_DO(f) \
>   f(GrowableArray_ModuleEntry_ptr) \

Thank you, for explanation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29049#discussion_r2722561825


More information about the hotspot-dev mailing list