diff --git a/src/hotspot/share/cds/classListWriter.cpp b/src/hotspot/share/cds/classListWriter.cpp index bd178a029d7..2a65ee51d6e 100644 --- a/src/hotspot/share/cds/classListWriter.cpp +++ b/src/hotspot/share/cds/classListWriter.cpp @@ -55,7 +55,7 @@ void ClassListWriter::write(const InstanceKlass* k, const ClassFileStream* cfs) assert(is_enabled(), "must be"); if (!ClassLoader::has_jrt_entry()) { - warning("DumpLoadedClassList and CDS are not supported in exploded build"); + log_warning(cds)("DumpLoadedClassList and CDS are not supported in exploded build"); DumpLoadedClassList = nullptr; return; } diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp index 5e241025189..8047544fe7e 100644 --- a/src/hotspot/share/cds/dynamicArchive.cpp +++ b/src/hotspot/share/cds/dynamicArchive.cpp @@ -345,7 +345,7 @@ public: void doit() { ResourceMark rm; if (AllowArchivingWithJavaAgent) { - warning("This archive was created with AllowArchivingWithJavaAgent. It should be used " + log_warning(cds)("This archive was created with AllowArchivingWithJavaAgent. It should be used " "for testing purposes only and should not be used in a production environment"); } FileMapInfo::check_nonempty_dir_in_shared_path_table(); @@ -370,7 +370,7 @@ void DynamicArchive::check_for_dynamic_dump() { vm_exit_during_initialization("-XX:+RecordDynamicDumpInfo" __THEMSG, nullptr); } else { assert(ArchiveClassesAtExit != nullptr, "sanity"); - warning("-XX:ArchiveClassesAtExit" __THEMSG); + log_warning(cds)("-XX:ArchiveClassesAtExit" __THEMSG); } #undef __THEMSG DynamicDumpSharedSpaces = false; diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 49fa58a70cb..78e526b31c1 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -1043,13 +1043,13 @@ bool FileMapInfo::validate_shared_path_table() { assert(shared_path(0)->is_modules_image(), "first shared_path must be the modules image"); if (header()->app_class_paths_start_index() > 1) { DynamicDumpSharedSpaces = false; - warning( + log_warning(cds)( "Dynamic archiving is disabled because base layer archive has appended boot classpath"); } if (header()->num_module_paths() > 0) { if (!check_module_paths()) { DynamicDumpSharedSpaces = false; - warning( + log_warning(cds)( "Dynamic archiving is disabled because base layer archive has a different module path"); } } @@ -1134,7 +1134,7 @@ void FileMapInfo::validate_non_existent_class_paths() { i++) { SharedClassPathEntry* ent = shared_path(i); if (!ent->check_non_existent()) { - warning("Archived non-system classes are disabled because the " + log_warning(cds)("Archived non-system classes are disabled because the " "file %s exists", ent->name()); header()->set_has_platform_or_app_classes(false); } @@ -2385,14 +2385,14 @@ bool FileMapInfo::map_heap_regions(int first, int max, bool is_open_archive, // Check that regions are within the java heap if (!G1CollectedHeap::heap()->check_archive_addresses(regions, num_regions)) { - log_info(cds)("UseSharedSpaces: Unable to allocate region, range is not within java heap."); + log_info(cds)("Unable to allocate region, range is not within java heap."); return false; } // allocate from java heap if (!G1CollectedHeap::heap()->alloc_archive_regions( regions, num_regions, is_open_archive)) { - log_info(cds)("UseSharedSpaces: Unable to allocate region, java heap range is already in use."); + log_info(cds)("Unable to allocate region, java heap range is already in use."); return false; } @@ -2408,7 +2408,7 @@ bool FileMapInfo::map_heap_regions(int first, int max, bool is_open_archive, if (base == nullptr || base != addr) { // dealloc the regions from java heap dealloc_heap_regions(regions, num_regions); - log_info(cds)("UseSharedSpaces: Unable to map at required address in java heap. " + log_info(cds)("Unable to map at required address in java heap. " INTPTR_FORMAT ", size = " SIZE_FORMAT " bytes", p2i(addr), regions[i].byte_size()); return false; @@ -2418,7 +2418,7 @@ bool FileMapInfo::map_heap_regions(int first, int max, bool is_open_archive, if (VerifySharedSpaces && !r->check_region_crc()) { // dealloc the regions from java heap dealloc_heap_regions(regions, num_regions); - log_info(cds)("UseSharedSpaces: mapped heap regions are corrupt"); + log_info(cds)("mapped heap regions are corrupt"); return false; } } @@ -2644,7 +2644,7 @@ bool FileMapHeader::validate() { // header data const char* prop = Arguments::get_property("java.system.class.loader"); if (prop != nullptr) { - warning("Archived non-system classes are disabled because the " + log_warning(cds)("Archived non-system classes are disabled because the " "java.system.class.loader property is specified (value = \"%s\"). " "To use archived non-system classes, this property must not be set", prop); _has_platform_or_app_classes = false; @@ -2683,7 +2683,7 @@ bool FileMapHeader::validate() { } if (_allow_archiving_with_java_agent) { - warning("This archive was created with AllowArchivingWithJavaAgent. It should be used " + log_warning(cds)("This archive was created with AllowArchivingWithJavaAgent. It should be used " "for testing purposes only and should not be used in a production environment"); } diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp index 0a49a99b15a..10f9793e60b 100644 --- a/src/hotspot/share/cds/metaspaceShared.cpp +++ b/src/hotspot/share/cds/metaspaceShared.cpp @@ -560,7 +560,7 @@ void VM_PopulateDumpSharedSpace::doit() { } if (AllowArchivingWithJavaAgent) { - warning("This archive was created with AllowArchivingWithJavaAgent. It should be used " + log_warning(cds)("This archive was created with AllowArchivingWithJavaAgent. It should be used " "for testing purposes only and should not be used in a production environment"); } @@ -941,7 +941,7 @@ void MetaspaceShared::initialize_runtime_shared_and_meta_spaces() { } else { set_shared_metaspace_range(nullptr, nullptr, nullptr); if (DynamicDumpSharedSpaces) { - warning("-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info."); + log_warning(cds)("-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info."); } UseSharedSpaces = false; // The base archive cannot be mapped. We cannot dump the dynamic shared archive. diff --git a/test/hotspot/jtreg/runtime/cds/appcds/SpecifySysLoaderProp.java b/test/hotspot/jtreg/runtime/cds/appcds/SpecifySysLoaderProp.java index 82acc8fb3cc..ed7f02569ef 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/SpecifySysLoaderProp.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/SpecifySysLoaderProp.java @@ -44,7 +44,7 @@ public class SpecifySysLoaderProp { String jarFileName = "sysloader.jar"; String appJar = TestCommon.getTestJar(jarFileName); TestCommon.testDump(appJar, TestCommon.list("ReportMyLoader")); - String warning = "VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified"; + String warning = "Archived non-system classes are disabled because the java.system.class.loader property is specified"; // (0) Baseline. Do not specify -Djava.system.class.loader diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java index 7ad4fc72179..5240202db67 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java @@ -242,7 +242,7 @@ public class ArchiveConsistency extends DynamicArchiveTestBase { "-cp", appJar, mainClass) .assertNormalExit(output -> { - output.shouldContain("VM warning: -XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded"); + output.shouldContain("-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded"); }); } } diff --git a/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java index 17a263b5e95..984fc1e730d 100644 --- a/test/lib/jdk/test/lib/cds/CDSTestUtils.java +++ b/test/lib/jdk/test/lib/cds/CDSTestUtils.java @@ -44,7 +44,7 @@ import jtreg.SkippedException; // This class contains common test utilities for testing CDS public class CDSTestUtils { public static final String MSG_RANGE_NOT_WITHIN_HEAP = - "UseSharedSpaces: Unable to allocate region, range is not within java heap."; + "Unable to allocate region, range is not within java heap."; public static final String MSG_RANGE_ALREADT_IN_USE = "Unable to allocate region, java heap range is already in use."; public static final String MSG_DYNAMIC_NOT_SUPPORTED =