RFR: 8293187: Store initialized Enum classes in AOTCache [v9]
Ioi Lam
iklam at openjdk.org
Mon Sep 23 17:44:41 UTC 2024
On Thu, 19 Sep 2024 18:35:22 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fixed typo
>
> src/hotspot/share/cds/aotClassInitializer.cpp line 41:
>
>> 39: } else if (ik->name()->equals("jdk/internal/constant/PrimitiveClassDescImpl") ||
>> 40: ik->name()->equals("jdk/internal/constant/ReferenceClassDescImpl") ||
>> 41: ik->name()->equals("java/lang/constant/ConstantDescs")) {
>
> Why not intern these strings as Symbols so you can test for == ?
In subsequent PRs, more classes are added here in a somewhat ad-hoc fashion (in order to match the behavior of the Java code in the core library). Yes, this is not ideal but we don't have a clean solution yet. Hopefully we will come up with a better design later in Project Leyden.
For the time being, as this list may need to be updated from time to time (as core lib is being updated), and some of the classes are used only in here, I am hesitant to add their names to vmSymbols.hpp.
This function is called only when the AOT cache is dumped, and called once per class, so performance shouldn't matter.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20958#discussion_r1771845584
More information about the hotspot-dev
mailing list