8372253: Improve logging to show why a class was excluded from AOT Cache

Reviewed-by: asmehra, iklam
This commit is contained in:
María Arias de Reyna Domínguez 2025-11-26 06:39:31 +00:00 committed by SendaoYan
parent f3fddd6e90
commit 3ef3f259bb

View File

@ -1370,8 +1370,11 @@ bool AOTMetaspace::try_link_class(JavaThread* current, InstanceKlass* ik) {
ik->link_class(THREAD);
if (HAS_PENDING_EXCEPTION) {
ResourceMark rm(THREAD);
aot_log_warning(aot)("Preload Warning: Verification failed for %s",
ik->external_name());
oop message = java_lang_Throwable::message(current->pending_exception());
aot_log_warning(aot)("Preload Warning: Verification failed for %s because a %s was thrown: %s",
ik->external_name(),
current->pending_exception()->klass()->external_name(),
message == nullptr ? "(no message)" : java_lang_String::as_utf8_string(message));
CLEAR_PENDING_EXCEPTION;
SystemDictionaryShared::set_class_has_failed_verification(ik);
} else {