Skip to content

Commit 83a3408

Browse files
committed
8293315: Add back logging for Placeholders
Reviewed-by: iklam
1 parent b6477fd commit 83a3408

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/hotspot/share/classfile/placeholders.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ static const char* action_to_string(PlaceholderTable::classloadAction action) {
238238
return "";
239239
}
240240

241-
inline void log(PlaceholderEntry* entry, const char* function, PlaceholderTable::classloadAction action) {
241+
inline void log(Symbol* name, PlaceholderEntry* entry, const char* function, PlaceholderTable::classloadAction action) {
242242
if (log_is_enabled(Debug, class, load, placeholders)) {
243243
LogTarget(Debug, class, load, placeholders) lt;
244244
ResourceMark rm;
245245
LogStream ls(lt);
246-
ls.print("%s %s ", function, action_to_string(action));
246+
ls.print("entry %s : %s %s ", name->as_C_string(), function, action_to_string(action));
247247
entry->print_on(&ls);
248248
}
249249
}
@@ -269,7 +269,7 @@ PlaceholderEntry* PlaceholderTable::find_and_add(Symbol* name,
269269
}
270270
}
271271
probe->add_seen_thread(thread, action);
272-
log(probe, "find_and_add", action);
272+
log(name, probe, "find_and_add", action);
273273
return probe;
274274
}
275275

@@ -293,7 +293,7 @@ void PlaceholderTable::find_and_remove(Symbol* name, ClassLoaderData* loader_dat
293293
assert_locked_or_safepoint(SystemDictionary_lock);
294294
PlaceholderEntry* probe = get_entry(name, loader_data);
295295
if (probe != NULL) {
296-
log(probe, "find_and_remove", action);
296+
log(name, probe, "find_and_remove", action);
297297
probe->remove_seen_thread(thread, action);
298298
// If no other threads using this entry, and this thread is not using this entry for other states
299299
if ((probe->superThreadQ() == NULL) && (probe->loadInstanceThreadQ() == NULL)

src/hotspot/share/classfile/systemDictionary.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,12 @@ Klass* SystemDictionary::resolve_array_class_or_null(Symbol* class_name,
365365
return k;
366366
}
367367

368-
static inline void log_circularity_error(Thread* thread, PlaceholderEntry* probe) {
368+
static inline void log_circularity_error(Symbol* name, PlaceholderEntry* probe) {
369369
LogTarget(Debug, class, load, placeholders) lt;
370370
if (lt.is_enabled()) {
371-
ResourceMark rm(thread);
371+
ResourceMark rm;
372372
LogStream ls(lt);
373-
ls.print("ClassCircularityError detected for placeholder ");
373+
ls.print("ClassCircularityError detected for placeholder entry %s", name->as_C_string());
374374
probe->print_on(&ls);
375375
ls.cr();
376376
}
@@ -442,7 +442,7 @@ InstanceKlass* SystemDictionary::resolve_super_or_fail(Symbol* class_name,
442442
// Must check ClassCircularity before checking if superclass is already loaded.
443443
PlaceholderEntry* probe = PlaceholderTable::get_entry(class_name, loader_data);
444444
if (probe && probe->check_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER)) {
445-
log_circularity_error(THREAD, probe);
445+
log_circularity_error(class_name, probe);
446446
throw_circularity_error = true;
447447
}
448448
}
@@ -562,7 +562,7 @@ InstanceKlass* SystemDictionary::handle_parallel_loading(JavaThread* current,
562562
// only need check_seen_thread once, not on each loop
563563
// 6341374 java/lang/Instrument with -Xcomp
564564
if (oldprobe->check_seen_thread(current, PlaceholderTable::LOAD_INSTANCE)) {
565-
log_circularity_error(current, oldprobe);
565+
log_circularity_error(name, oldprobe);
566566
*throw_circularity_error = true;
567567
return NULL;
568568
} else {

0 commit comments

Comments
 (0)