RFR: 8350550: Preload classes from AOT cache during VM bootstrap [v3]
Dan Heidinga
heidinga at openjdk.org
Fri Aug 22 18:35:48 UTC 2025
On Fri, 22 Aug 2025 18:28:19 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> src/hotspot/share/cds/aotOopChecker.cpp line 52:
>>
>>> 50: // Make sure we are not caching objects with assumptions that can be violated in
>>> 51: // the production run.
>>> 52: void AOTOopChecker::check(oop obj) {
>>
>> Should this also return a `bool` to indicate if the oop failed the check? It would make it easier to bail out in the caller if the oop was bad.
>
> The bail out and error logging needs to be done inside this function (as there might be more than one reason why `obj` is unsafe).
>
> This is an unrecoverable error -- the caller has already found a bad oop. We cannot just throw away this oop because there are other states that point to this oop.
The existing error handling - to log and bail out - are 100% right. We're not throwing an exception so the caller still needs to unwind itself as well and a `return false;` after the `MetaspaceShared::unrecoverable_writing_error();` makes it more obvious how the caller should handle it - it too should bail as early as it can
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26375#discussion_r2294404235
More information about the hotspot-dev
mailing list