Skip to content

Commit f638741

Browse files
ArrayingMrSimms
authored andcommitted
8370951: [lworld] Value record ClassCircularityError
Reviewed-by: fparain
1 parent 7b5f105 commit f638741

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6227,7 +6227,7 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
62276227
_loader_data->class_loader()),
62286228
false, THREAD);
62296229
if (HAS_PENDING_EXCEPTION) {
6230-
log_warning(class, preload)("Preloading of class %s during loading of class %s "
6230+
log_info(class, preload)("Preloading of class %s during loading of class %s "
62316231
"(cause: null-free non-static field) failed: %s",
62326232
s->as_C_string(), _class_name->as_C_string(),
62336233
PENDING_EXCEPTION->klass()->name()->as_C_string());
@@ -6260,12 +6260,12 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
62606260
name->as_C_string(), _class_name->as_C_string());
62616261
} else {
62626262
// Non value class are allowed by the current spec, but it could be an indication of an issue so let's log a warning
6263-
log_warning(class, preload)("Preloading of class %s during loading of class %s "
6263+
log_info(class, preload)("Preloading of class %s during loading of class %s "
62646264
"(cause: field type in LoadableDescriptors attribute) but loaded class is not a value class",
62656265
name->as_C_string(), _class_name->as_C_string());
62666266
}
62676267
} else {
6268-
log_warning(class, preload)("Preloading of class %s during loading of class %s "
6268+
log_info(class, preload)("Preloading of class %s during loading of class %s "
62696269
"(cause: field type in LoadableDescriptors attribute) failed : %s",
62706270
name->as_C_string(), _class_name->as_C_string(),
62716271
PENDING_EXCEPTION->klass()->name()->as_C_string());

src/hotspot/share/classfile/systemDictionary.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ bool SystemDictionary::preload_from_null_free_field(InstanceKlass* ik, Handle cl
11121112
InstanceKlass* real_k = SystemDictionary::resolve_with_circularity_detection(ik->name(), name,
11131113
class_loader, false, CHECK_false);
11141114
if (HAS_PENDING_EXCEPTION) {
1115-
log_warning(class, preload)("Preloading of class %s during loading of class %s "
1115+
log_info(class, preload)("Preloading of class %s during loading of class %s "
11161116
"(cause: null-free non-static field) failed: %s",
11171117
name->as_C_string(), ik->name()->as_C_string(),
11181118
PENDING_EXCEPTION->klass()->name()->as_C_string());
@@ -1122,7 +1122,7 @@ bool SystemDictionary::preload_from_null_free_field(InstanceKlass* ik, Handle cl
11221122
InstanceKlass* k = ik->get_inline_type_field_klass_or_null(field_index);
11231123
if (real_k != k) {
11241124
// oops, the app has substituted a different version of k! Does not fail fatally
1125-
log_warning(class, preload)("Preloading of class %s during loading of shared class %s "
1125+
log_info(class, preload)("Preloading of class %s during loading of shared class %s "
11261126
"(cause: null-free non-static field) failed : "
11271127
"app substituted a different version of %s",
11281128
name->as_C_string(), ik->name()->as_C_string(),
@@ -1156,7 +1156,7 @@ void SystemDictionary::try_preload_from_loadable_descriptors(InstanceKlass* ik,
11561156
InstanceKlass* k = ik->get_inline_type_field_klass_or_null(field_index);
11571157
if (real_k != k) {
11581158
// oops, the app has substituted a different version of k!
1159-
log_warning(class, preload)("Preloading of class %s during loading of shared class %s "
1159+
log_info(class, preload)("Preloading of class %s during loading of shared class %s "
11601160
"(cause: field type in LoadableDescriptors attribute) failed : "
11611161
"app substituted a different version of %s",
11621162
name->as_C_string(), ik->name()->as_C_string(),

src/hotspot/share/oops/instanceKlass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,12 +989,12 @@ static void load_classes_from_loadable_descriptors_attribute(InstanceKlass *ik,
989989
if (!klass->is_inline_klass()) {
990990
// Non value class are allowed by the current spec, but it could be an indication
991991
// of an issue so let's log a warning
992-
log_warning(class, preload)("Preloading of class %s during linking of class %s "
992+
log_info(class, preload)("Preloading of class %s during linking of class %s "
993993
"(cause: LoadableDescriptors attribute) but loaded class is not a value class",
994994
class_name->as_C_string(), ik->name()->as_C_string());
995995
}
996996
} else {
997-
log_warning(class, preload)("Preloading of class %s during linking of class %s "
997+
log_info(class, preload)("Preloading of class %s during linking of class %s "
998998
"(cause: LoadableDescriptors attribute) failed",
999999
class_name->as_C_string(), ik->name()->as_C_string());
10001000
}

test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestUnresolvedInlineClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static public void main(String[] args) throws Exception {
5555
}
5656

5757
// Run test in new VM instance
58-
String[] arg = {"--enable-preview", "-XX:+InlineTypePassFieldsAsArgs", "compiler.valhalla.inlinetypes.TestUnresolvedInlineClass", "run"};
58+
String[] arg = {"--enable-preview", "-Xlog:class+preload=info", "-XX:+InlineTypePassFieldsAsArgs", "compiler.valhalla.inlinetypes.TestUnresolvedInlineClass", "run"};
5959
OutputAnalyzer oa = ProcessTools.executeTestJava(arg);
6060

6161
// Verify that a warning is printed

test/hotspot/jtreg/runtime/valhalla/inlinetypes/PreloadCircularityTest.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ void test_2() throws Exception {
126126
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");
127127
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");
128128
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");
129-
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");
130-
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");
131-
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");
129+
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");
130+
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");
131+
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");
132132
}
133133

134134
static value class Class3a {
@@ -153,9 +153,9 @@ void test_3() throws Exception {
153153
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");
154154
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");
155155
out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3c. Cause: field type in LoadableDescriptors attribute");
156-
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");
157-
out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class3c during loading of class PreloadCircularityTest$Class3b (cause: null-free non-static field) succeeded");
158-
out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3a (cause: null-free non-static field) succeeded");
156+
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");
157+
out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3c during loading of class PreloadCircularityTest$Class3b (cause: null-free non-static field) succeeded");
158+
out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class3b during loading of class PreloadCircularityTest$Class3a (cause: null-free non-static field) succeeded");
159159
}
160160

161161
static value class Class4a {
@@ -175,8 +175,8 @@ void test_4() throws Exception {
175175
out.shouldHaveExitValue(1);
176176
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");
177177
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");
178-
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");
179-
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");
178+
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");
179+
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");
180180
}
181181

182182
static value class Class5a {
@@ -209,17 +209,17 @@ void test_5() throws Exception {
209209
out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5a. Cause: field type in LoadableDescriptors attribute");
210210
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");
211211
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");
212-
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");
213-
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");
214-
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");
215-
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");
216-
out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5c. Cause: field type in LoadableDescriptors attribute");
217-
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");
218-
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");
219-
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");
220-
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");
221-
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");
222-
out.shouldContain("[info ][class,preload] Preloading of class PreloadCircularityTest$Class5c during loading of class PreloadCircularityTest$Class5a (cause: null-free non-static field) succeeded");
212+
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");
213+
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");
214+
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");
215+
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");
216+
out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5b during loading of class PreloadCircularityTest$Class5c. Cause: field type in LoadableDescriptors attribute");
217+
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");
218+
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");
219+
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");
220+
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");
221+
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");
222+
out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class5c during loading of class PreloadCircularityTest$Class5a (cause: null-free non-static field) succeeded");
223223
}
224224

225225
static value class Class6a {
@@ -254,9 +254,9 @@ void test_6() throws Exception {
254254
out.shouldContain("[info][class,preload] Preloading of class PreloadCircularityTest$Class6c during loading of class PreloadCircularityTest$Class6b (cause: field type in LoadableDescriptors attribute) succeeded");
255255
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");
256256
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");
257-
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");
258-
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");
259-
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");
257+
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");
258+
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");
259+
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");
260260
}
261261

262262
static value class Class7a {

0 commit comments

Comments
 (0)