Skip to content

Commit f52aed6

Browse files
Delawenjerboaa
authored andcommitted
8369418: Identify owning class for KlassTrainingData in AOT map output
Reviewed-by: iklam, adinn
1 parent d5a2079 commit f52aed6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/hotspot/share/cds/aotMapLogger.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "oops/methodCounters.hpp"
3737
#include "oops/methodData.hpp"
3838
#include "oops/oop.inline.hpp"
39+
#include "oops/trainingData.hpp"
3940
#include "runtime/fieldDescriptor.inline.hpp"
4041
#include "runtime/globals_extension.hpp"
4142
#include "utilities/growableArray.hpp"
@@ -359,6 +360,9 @@ void AOTMapLogger::log_metaspace_objects_impl(address region_base, address regio
359360
case MetaspaceObj::SymbolType:
360361
log_symbol((Symbol*)src, requested_addr, type_name, bytes, current);
361362
break;
363+
case MetaspaceObj::KlassTrainingDataType:
364+
log_klass_training_data((KlassTrainingData*)src, requested_addr, type_name, bytes, current);
365+
break;
362366
default:
363367
log_debug(aot, map)(_LOG_PREFIX, p2i(requested_addr), type_name, bytes);
364368
break;
@@ -427,6 +431,16 @@ void AOTMapLogger::log_symbol(Symbol* s, address requested_addr, const char* typ
427431
log_debug(aot, map)(_LOG_PREFIX " %s", p2i(requested_addr), type_name, bytes,
428432
s->as_quoted_ascii());
429433
}
434+
void AOTMapLogger::log_klass_training_data(KlassTrainingData* ktd, address requested_addr, const char* type_name,
435+
int bytes, Thread* current) {
436+
ResourceMark rm(current);
437+
if (ktd->has_holder()) {
438+
log_debug(aot, map)(_LOG_PREFIX " %s", p2i(requested_addr), type_name, bytes,
439+
ktd->name()->as_klass_external_name());
440+
} else {
441+
log_debug(aot, map)(_LOG_PREFIX, p2i(requested_addr), type_name, bytes);
442+
}
443+
}
430444

431445
#undef _LOG_PREFIX
432446

src/hotspot/share/cds/aotMapLogger.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
class ArchiveHeapInfo;
3636
class DumpRegion;
3737
class FileMapInfo;
38+
class KlassTrainingData;
3839
class outputStream;
3940

4041
// Write detailed info to a mapfile to analyze contents of the AOT cache/CDS archive.
@@ -105,6 +106,7 @@ class AOTMapLogger : AllStatic {
105106
static void log_klass(Klass* k, address requested_addr, const char* type_name, int bytes, Thread* current);
106107
static void log_method(Method* m, address requested_addr, const char* type_name, int bytes, Thread* current);
107108
static void log_symbol(Symbol* s, address requested_addr, const char* type_name, int bytes, Thread* current);
109+
static void log_klass_training_data(KlassTrainingData* ktd, address requested_addr, const char* type_name, int bytes, Thread* current);
108110

109111

110112
#if INCLUDE_CDS_JAVA_HEAP

0 commit comments

Comments
 (0)