From 3561ed137143031862bd923af20d003de6aaf6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20H=C3=BCbner?= Date: Fri, 31 Oct 2025 14:26:22 +0100 Subject: [PATCH 1/2] Relegate preload logs to info. --- .../share/classfile/classFileParser.cpp | 6 +-- .../share/classfile/systemDictionary.cpp | 6 +-- src/hotspot/share/oops/instanceKlass.cpp | 4 +- .../inlinetypes/PreloadCircularityTest.java | 44 +++++++++---------- .../inlinetypes/ValuePreloadTest.java | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 056b2aaf9c1..9336ea25feb 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -6227,7 +6227,7 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st _loader_data->class_loader()), false, THREAD); if (HAS_PENDING_EXCEPTION) { - log_warning(class, preload)("Preloading of class %s during loading of class %s " + log_info(class, preload)("Preloading of class %s during loading of class %s " "(cause: null-free non-static field) failed: %s", s->as_C_string(), _class_name->as_C_string(), PENDING_EXCEPTION->klass()->name()->as_C_string()); @@ -6260,12 +6260,12 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st name->as_C_string(), _class_name->as_C_string()); } else { // Non value class are allowed by the current spec, but it could be an indication of an issue so let's log a warning - log_warning(class, preload)("Preloading of class %s during loading of class %s " + log_info(class, preload)("Preloading of class %s during loading of class %s " "(cause: field type in LoadableDescriptors attribute) but loaded class is not a value class", name->as_C_string(), _class_name->as_C_string()); } } else { - log_warning(class, preload)("Preloading of class %s during loading of class %s " + log_info(class, preload)("Preloading of class %s during loading of class %s " "(cause: field type in LoadableDescriptors attribute) failed : %s", name->as_C_string(), _class_name->as_C_string(), PENDING_EXCEPTION->klass()->name()->as_C_string()); diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index c5d76fc9066..ca627948823 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1112,7 +1112,7 @@ bool SystemDictionary::preload_from_null_free_field(InstanceKlass* ik, Handle cl InstanceKlass* real_k = SystemDictionary::resolve_with_circularity_detection(ik->name(), name, class_loader, false, CHECK_false); if (HAS_PENDING_EXCEPTION) { - log_warning(class, preload)("Preloading of class %s during loading of class %s " + log_info(class, preload)("Preloading of class %s during loading of class %s " "(cause: null-free non-static field) failed: %s", name->as_C_string(), ik->name()->as_C_string(), PENDING_EXCEPTION->klass()->name()->as_C_string()); @@ -1122,7 +1122,7 @@ bool SystemDictionary::preload_from_null_free_field(InstanceKlass* ik, Handle cl InstanceKlass* k = ik->get_inline_type_field_klass_or_null(field_index); if (real_k != k) { // oops, the app has substituted a different version of k! Does not fail fatally - log_warning(class, preload)("Preloading of class %s during loading of shared class %s " + log_info(class, preload)("Preloading of class %s during loading of shared class %s " "(cause: null-free non-static field) failed : " "app substituted a different version of %s", name->as_C_string(), ik->name()->as_C_string(), @@ -1156,7 +1156,7 @@ void SystemDictionary::try_preload_from_loadable_descriptors(InstanceKlass* ik, InstanceKlass* k = ik->get_inline_type_field_klass_or_null(field_index); if (real_k != k) { // oops, the app has substituted a different version of k! - log_warning(class, preload)("Preloading of class %s during loading of shared class %s " + log_info(class, preload)("Preloading of class %s during loading of shared class %s " "(cause: field type in LoadableDescriptors attribute) failed : " "app substituted a different version of %s", name->as_C_string(), ik->name()->as_C_string(), diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index ec29367d42f..bbfcbf80a6f 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -989,12 +989,12 @@ static void load_classes_from_loadable_descriptors_attribute(InstanceKlass *ik, if (!klass->is_inline_klass()) { // Non value class are allowed by the current spec, but it could be an indication // of an issue so let's log a warning - log_warning(class, preload)("Preloading of class %s during linking of class %s " + log_info(class, preload)("Preloading of class %s during linking of class %s " "(cause: LoadableDescriptors attribute) but loaded class is not a value class", class_name->as_C_string(), ik->name()->as_C_string()); } } else { - log_warning(class, preload)("Preloading of class %s during linking of class %s " + log_info(class, preload)("Preloading of class %s during linking of class %s " "(cause: LoadableDescriptors attribute) failed", class_name->as_C_string(), ik->name()->as_C_string()); } diff --git a/test/hotspot/jtreg/runtime/valhalla/inlinetypes/PreloadCircularityTest.java b/test/hotspot/jtreg/runtime/valhalla/inlinetypes/PreloadCircularityTest.java index 463eaeddfdd..8e23673eabf 100644 --- a/test/hotspot/jtreg/runtime/valhalla/inlinetypes/PreloadCircularityTest.java +++ b/test/hotspot/jtreg/runtime/valhalla/inlinetypes/PreloadCircularityTest.java @@ -126,9 +126,9 @@ void test_2() throws Exception { out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class2b during loading of class PreloadCircularityTest$Class2a. Cause: a null-free non-static field is declared with this type"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class2c during loading of class PreloadCircularityTest$Class2b. Cause: a null-free non-static field is declared with this type"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class2b during loading of class PreloadCircularityTest$Class2c. Cause: a null-free non-static field is declared with this type"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class2b during loading of class PreloadCircularityTest$Class2c (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class2c during loading of class PreloadCircularityTest$Class2b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class2b during loading of class PreloadCircularityTest$Class2a (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class2b during loading of class PreloadCircularityTest$Class2c (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class2c during loading of class PreloadCircularityTest$Class2b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class2b during loading of class PreloadCircularityTest$Class2a (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); } static value class Class3a { @@ -153,9 +153,9 @@ void test_3() throws Exception { out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3a. Cause: a null-free non-static field is declared with this type"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3c during loading of class PreloadCircularityTest$Class3b. Cause: a null-free non-static field is declared with this type"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3c. Cause: field type in LoadableDescriptors attribute"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3c (cause: field type in LoadableDescriptors attribute) failed : java/lang/ClassCircularityError"); - out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class3c during loading of class PreloadCircularityTest$Class3b (cause: null-free non-static field) succeeded"); - out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3a (cause: null-free non-static field) succeeded"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3c (cause: field type in LoadableDescriptors attribute) failed : java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3c during loading of class PreloadCircularityTest$Class3b (cause: null-free non-static field) succeeded"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3a (cause: null-free non-static field) succeeded"); } static value class Class4a { @@ -175,8 +175,8 @@ void test_4() throws Exception { out.shouldHaveExitValue(1); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class4b during loading of class PreloadCircularityTest$Class4a. Cause: a null-free non-static field is declared with this type"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class4a during loading of class PreloadCircularityTest$Class4b. Cause: a null-free non-static field is declared with this type"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class4a during loading of class PreloadCircularityTest$Class4b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class4b during loading of class PreloadCircularityTest$Class4a (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class4a during loading of class PreloadCircularityTest$Class4b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class4b during loading of class PreloadCircularityTest$Class4a (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); } static value class Class5a { @@ -209,17 +209,17 @@ void test_5() throws Exception { out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5a. Cause: field type in LoadableDescriptors attribute"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5d during loading of class PreloadCircularityTest$Class5b. Cause: a null-free non-static field is declared with this type"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5d. Cause: a null-free non-static field is declared with this type"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5d (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class5d during loading of class PreloadCircularityTest$Class5b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5a (cause: field type in LoadableDescriptors attribute) failed : java/lang/ClassCircularityError"); - out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class5c during loading of class PreloadCircularityTest$Class5a. Cause: a null-free non-static field is declared with this type"); - out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5c. Cause: field type in LoadableDescriptors attribute"); - out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class5d during loading of class PreloadCircularityTest$Class5b. Cause: a null-free non-static field is declared with this type"); - out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5d. Cause: a null-free non-static field is declared with this type"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5d (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class5d during loading of class PreloadCircularityTest$Class5b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5c (cause: field type in LoadableDescriptors attribute) failed : java/lang/ClassCircularityError"); - out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class5c during loading of class PreloadCircularityTest$Class5a (cause: null-free non-static field) succeeded"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5d (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5d during loading of class PreloadCircularityTest$Class5b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5a (cause: field type in LoadableDescriptors attribute) failed : java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5c during loading of class PreloadCircularityTest$Class5a. Cause: a null-free non-static field is declared with this type"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5c. Cause: field type in LoadableDescriptors attribute"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5d during loading of class PreloadCircularityTest$Class5b. Cause: a null-free non-static field is declared with this type"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5d. Cause: a null-free non-static field is declared with this type"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5d (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5d during loading of class PreloadCircularityTest$Class5b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5c (cause: field type in LoadableDescriptors attribute) failed : java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5c during loading of class PreloadCircularityTest$Class5a (cause: null-free non-static field) succeeded"); } static value class Class6a { @@ -254,9 +254,9 @@ void test_6() throws Exception { out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class6c during loading of class PreloadCircularityTest$Class6b (cause: field type in LoadableDescriptors attribute) succeeded"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class6d during loading of class PreloadCircularityTest$Class6b. Cause: a null-free non-static field is declared with this type"); out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class6b during loading of class PreloadCircularityTest$Class6d. Cause: a null-free non-static field is declared with this type"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class6b during loading of class PreloadCircularityTest$Class6d (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class6d during loading of class PreloadCircularityTest$Class6b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); - out.shouldContain("[warning][class,preload] Preloading of class PreloadCircularityTest$Class6b during loading of class PreloadCircularityTest$Class6a (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class6b during loading of class PreloadCircularityTest$Class6d (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class6d during loading of class PreloadCircularityTest$Class6b (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); + out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class6b during loading of class PreloadCircularityTest$Class6a (cause: null-free non-static field) failed: java/lang/ClassCircularityError"); } static value class Class7a { diff --git a/test/hotspot/jtreg/runtime/valhalla/inlinetypes/ValuePreloadTest.java b/test/hotspot/jtreg/runtime/valhalla/inlinetypes/ValuePreloadTest.java index 3cbbbb1eb42..af4a30c4782 100644 --- a/test/hotspot/jtreg/runtime/valhalla/inlinetypes/ValuePreloadTest.java +++ b/test/hotspot/jtreg/runtime/valhalla/inlinetypes/ValuePreloadTest.java @@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception { checkFor(pb, "[info][class,preload] Preloading of class PreloadValue0 during loading of class ValuePreloadClient0. Cause: field type in LoadableDescriptors attribute"); pb = exec("-Xlog:class+preload","ValuePreloadClient1"); - checkFor(pb, "[warning][class,preload] Preloading of class PreloadValue1 during linking of class ValuePreloadClient1 (cause: LoadableDescriptors attribute) failed"); + checkFor(pb, "[info][class,preload] Preloading of class PreloadValue1 during linking of class ValuePreloadClient1 (cause: LoadableDescriptors attribute) failed"); pb = exec("-Xlog:class+preload", "PreloadShared"); // Class java/time/LocalDate is already preloaded, so the LoadableDescriptor attribute does not trigger it From 86dd4bcbdff5440f6cdd52d67d200028d848b492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20H=C3=BCbner?= Date: Mon, 3 Nov 2025 10:31:52 +0100 Subject: [PATCH 2/2] Forgot to update a test. --- .../valhalla/inlinetypes/TestUnresolvedInlineClass.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestUnresolvedInlineClass.java b/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestUnresolvedInlineClass.java index f64a6439d8b..2f9384fcac1 100644 --- a/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestUnresolvedInlineClass.java +++ b/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestUnresolvedInlineClass.java @@ -55,7 +55,7 @@ static public void main(String[] args) throws Exception { } // Run test in new VM instance - String[] arg = {"--enable-preview", "-XX:+InlineTypePassFieldsAsArgs", "compiler.valhalla.inlinetypes.TestUnresolvedInlineClass", "run"}; + String[] arg = {"--enable-preview", "-Xlog:class+preload=info", "-XX:+InlineTypePassFieldsAsArgs", "compiler.valhalla.inlinetypes.TestUnresolvedInlineClass", "run"}; OutputAnalyzer oa = ProcessTools.executeTestJava(arg); // Verify that a warning is printed