RFR: 8377777: Improve logging when rejecting assets from the AOT archive [v4]
Ioi Lam
iklam at openjdk.org
Wed Feb 18 07:25:11 UTC 2026
On Fri, 13 Feb 2026 12:52:35 GMT, María Arias de Reyna Domínguez <duke at openjdk.org> wrote:
>> Restored the check `if (resolved)` when printing if a CP entry is rejected or archived. If it is not resolved, we shouldn't even bother with it.
>>
>> Also, added log messages (mostly based on surrounding comments) on `ConstantPoolCache::can_archive_resolved_method` to add information about why a method gets rejected.
>>
>> All the log messages have the same format to be able to parse them easily:
>>
>> ` log.print("%s can't be archived because $REASON.",
>> pool_holder->name()->as_C_string());`
>
> María Arias de Reyna Domínguez has updated the pull request incrementally with two additional commits since the last revision:
>
> - Adding index on CPPool for better tracking
> - Adding explanation for indy and fields
src/hotspot/share/oops/cpCache.cpp line 460:
> 458: klass_name->as_C_string(), name->as_C_string(), signature->as_C_string(),
> 459: rfi->is_resolved(Bytecodes::_getstatic) || rfi->is_resolved(Bytecodes::_putstatic) ? " *** static" : "");
> 460: if (!archived && !CDSConfig::is_dumping_preimage_static_archive()) {
Why are you checking for `!CDSConfig::is_dumping_preimage_static_archive()`?
src/hotspot/share/oops/cpCache.cpp line 467:
> 465: rfi->is_resolved(Bytecodes::_getstatic) || rfi->is_resolved(Bytecodes::_putstatic) ? " *** static" : "");
> 466: }
> 467: }
The two log lines basically print out the same info, except that one of them prints "reverted" and the other prints "...resolution is not deterministic".
I would suggest changing the format (of all the messages touched by this PR) to something like:
archived xxxxx
reverted xxxxxx (resolution not deterministic)
reverted xxxxxx (non-builtin loader)
The messages should be concise to reduce log file size.
The C++ code can generally look like this:
log.print("%s ...... %s",
(archived ? "archived" : "reverted"),
......
(archived ? "" : "(resolution not deterministic)");
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29690#discussion_r2820749065
PR Review Comment: https://git.openjdk.org/jdk/pull/29690#discussion_r2820742400
More information about the hotspot-dev
mailing list