RFR: 8348426: Generate binary file for -XX:AOTMode=record -XX:AOTConfiguration=file [v8]
Ashutosh Mehra
asmehra at openjdk.org
Tue Feb 25 08:28:59 UTC 2025
On Tue, 25 Feb 2025 06:04:15 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> src/hotspot/share/cds/cppVtables.cpp line 293:
>>
>>> 291: for (kind = 0; kind < _num_cloned_vtable_kinds; kind ++) {
>>> 292: if (vtable_of((Metadata*)obj) == _orig_cpp_vtptrs[kind] ||
>>> 293: vtable_of((Metadata*)obj) == _archived_cpp_vtptrs[kind]) {
>>
>> I think we should check these conditions only in the mode where applicable. That would make it easier to understand the code in future. So my suggestion is to update it as:
>>
>>
>> for (kind = 0; kind < _num_cloned_vtable_kinds; kind ++) {
>> intptr_t* vtable_ptr;
>> if (CDSConfig::is_dumping_final_static_archive()) {
>> vtable_ptr = _archived_cpp_vtptrs[kind];
>> } else {
>> vtable_ptr = _orig_cpp_vtptrs[kind];
>> }
>> if (vtable_of((Metadata*)obj) == vtable_ptr) {
>> break;
>> }
>> }
>
> During the final archive dump, we can have both archived classes from the preimage as well as dynamically loaded classes. For example, hidden classes are generated when linking lambdas.
Right, I forgot about the lambdas. Thanks for pointing it out.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23484#discussion_r1969245039
More information about the hotspot-dev
mailing list