8356998: Convert -Xlog:cds to -Xlog:aot (step 2)

Reviewed-by: ccheung, matsaave
This commit is contained in:
Ioi Lam 2025-05-20 05:46:34 +00:00
parent 7077535c0b
commit f8d7f663c1
84 changed files with 328 additions and 304 deletions

View File

@ -162,7 +162,7 @@ define CreateCDSArchive
endif endif
ifeq ($(DEBUG_CDS_ARCHIVE), true) ifeq ($(DEBUG_CDS_ARCHIVE), true)
$1_$2_CDS_DUMP_FLAGS += -Xlog:cds+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0 $1_$2_CDS_DUMP_FLAGS += -Xlog:aot+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
endif endif
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \ $$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \

View File

@ -22,9 +22,10 @@
* *
*/ */
#include "cds/aotClassLinker.hpp"
#include "cds/aotArtifactFinder.hpp" #include "cds/aotArtifactFinder.hpp"
#include "cds/aotClassInitializer.hpp" #include "cds/aotClassInitializer.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/aotLogging.hpp"
#include "cds/aotReferenceObjSupport.hpp" #include "cds/aotReferenceObjSupport.hpp"
#include "cds/dumpTimeClassInfo.inline.hpp" #include "cds/dumpTimeClassInfo.inline.hpp"
#include "cds/heapShared.hpp" #include "cds/heapShared.hpp"
@ -155,9 +156,9 @@ void AOTArtifactFinder::find_artifacts() {
if (!info.is_excluded() && _seen_classes->get(k) == nullptr) { if (!info.is_excluded() && _seen_classes->get(k) == nullptr) {
info.set_excluded(); info.set_excluded();
info.set_has_checked_exclusion(); info.set_has_checked_exclusion();
if (log_is_enabled(Debug, cds)) { if (aot_log_is_enabled(Debug, aot)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds)("Skipping %s: %s class", k->name()->as_C_string(), aot_log_debug(aot)("Skipping %s: %s class", k->name()->as_C_string(),
k->is_hidden() ? "Unreferenced hidden" : "AOT tooling"); k->is_hidden() ? "Unreferenced hidden" : "AOT tooling");
} }
} }

View File

@ -219,7 +219,7 @@ bool AOTClassInitializer::can_archive_initialized_mirror(InstanceKlass* ik) {
// //
// Then run the following: // Then run the following:
// java -XX:AOTMode=record -XX:AOTConfiguration=jc.aotconfig com.sun.tools.javac.Main // java -XX:AOTMode=record -XX:AOTConfiguration=jc.aotconfig com.sun.tools.javac.Main
// java -XX:AOTMode=create -Xlog:cds -XX:AOTCache=jc.aot -XX:AOTConfiguration=jc.aotconfig // java -XX:AOTMode=create -Xlog:aot -XX:AOTCache=jc.aot -XX:AOTConfiguration=jc.aotconfig
// //
// You will see an error like this: // You will see an error like this:
// //
@ -350,9 +350,9 @@ bool AOTClassInitializer::is_runtime_setup_required(InstanceKlass* ik) {
void AOTClassInitializer::call_runtime_setup(JavaThread* current, InstanceKlass* ik) { void AOTClassInitializer::call_runtime_setup(JavaThread* current, InstanceKlass* ik) {
assert(ik->has_aot_initialized_mirror(), "sanity"); assert(ik->has_aot_initialized_mirror(), "sanity");
if (ik->is_runtime_setup_required()) { if (ik->is_runtime_setup_required()) {
if (log_is_enabled(Info, cds, init)) { if (log_is_enabled(Info, aot, init)) {
ResourceMark rm; ResourceMark rm;
log_info(cds, init)("Calling %s::runtimeSetup()", ik->external_name()); log_info(aot, init)("Calling %s::runtimeSetup()", ik->external_name());
} }
JavaValue result(T_VOID); JavaValue result(T_VOID);
JavaCalls::call_static(&result, ik, JavaCalls::call_static(&result, ik,
@ -375,7 +375,7 @@ void AOTClassInitializer::init_test_class(TRAPS) {
// -XX:AOTInitTestClass is NOT a general mechanism for including user-defined objects into // -XX:AOTInitTestClass is NOT a general mechanism for including user-defined objects into
// the AOT cache. Therefore, this option is NOT available in product JVM. // the AOT cache. Therefore, this option is NOT available in product JVM.
if (AOTInitTestClass != nullptr && CDSConfig::is_initing_classes_at_dump_time()) { if (AOTInitTestClass != nullptr && CDSConfig::is_initing_classes_at_dump_time()) {
log_info(cds)("Debug build only: force initialization of AOTInitTestClass %s", AOTInitTestClass); log_info(aot)("Debug build only: force initialization of AOTInitTestClass %s", AOTInitTestClass);
TempNewSymbol class_name = SymbolTable::new_symbol(AOTInitTestClass); TempNewSymbol class_name = SymbolTable::new_symbol(AOTInitTestClass);
Handle app_loader(THREAD, SystemDictionary::java_system_loader()); Handle app_loader(THREAD, SystemDictionary::java_system_loader());
Klass* k = SystemDictionary::resolve_or_null(class_name, app_loader, CHECK); Klass* k = SystemDictionary::resolve_or_null(class_name, app_loader, CHECK);

View File

@ -23,6 +23,7 @@
*/ */
#include "cds/aotClassLocation.hpp" #include "cds/aotClassLocation.hpp"
#include "cds/aotLogging.hpp"
#include "cds/archiveBuilder.hpp" #include "cds/archiveBuilder.hpp"
#include "cds/cdsConfig.hpp" #include "cds/cdsConfig.hpp"
#include "cds/dynamicArchive.hpp" #include "cds/dynamicArchive.hpp"
@ -250,7 +251,7 @@ AOTClassLocation* AOTClassLocation::allocate(JavaThread* current, const char* pa
// We allow the file to not exist, as long as it also doesn't exist during runtime. // We allow the file to not exist, as long as it also doesn't exist during runtime.
type = FileType::NOT_EXIST; type = FileType::NOT_EXIST;
} else { } else {
log_error(cds)("Unable to open file %s.", path); aot_log_error(aot)("Unable to open file %s.", path);
MetaspaceShared::unrecoverable_loading_error(); MetaspaceShared::unrecoverable_loading_error();
} }
@ -359,7 +360,7 @@ char* AOTClassLocation::get_cpattr() const {
if (found != nullptr) { if (found != nullptr) {
// Same behavior as jdk/src/share/classes/java/util/jar/Attributes.java // Same behavior as jdk/src/share/classes/java/util/jar/Attributes.java
// If duplicated entries are found, the last one is used. // If duplicated entries are found, the last one is used.
log_warning(cds)("Warning: Duplicate name in Manifest: %s.\n" log_warning(aot)("Warning: Duplicate name in Manifest: %s.\n"
"Ensure that the manifest does not have duplicate entries, and\n" "Ensure that the manifest does not have duplicate entries, and\n"
"that blank lines separate individual sections in both your\n" "that blank lines separate individual sections in both your\n"
"manifest and in the META-INF/MANIFEST.MF entry in the jar file:\n%s\n", tag, path()); "manifest and in the META-INF/MANIFEST.MF entry in the jar file:\n%s\n", tag, path());
@ -392,31 +393,31 @@ bool AOTClassLocation::check(const char* runtime_path, bool has_aot_linked_class
struct stat st; struct stat st;
if (os::stat(runtime_path, &st) != 0) { if (os::stat(runtime_path, &st) != 0) {
if (_file_type != FileType::NOT_EXIST) { if (_file_type != FileType::NOT_EXIST) {
log_warning(cds)("Required classpath entry does not exist: %s", runtime_path); aot_log_warning(aot)("Required classpath entry does not exist: %s", runtime_path);
return false; return false;
} }
} else if ((st.st_mode & S_IFMT) == S_IFDIR) { } else if ((st.st_mode & S_IFMT) == S_IFDIR) {
if (_file_type == FileType::NOT_EXIST) { if (_file_type == FileType::NOT_EXIST) {
log_warning(cds)("'%s' must not exist", runtime_path); aot_log_warning(aot)("'%s' must not exist", runtime_path);
return false; return false;
} }
if (_file_type == FileType::NORMAL) { if (_file_type == FileType::NORMAL) {
log_warning(cds)("'%s' must be a file", runtime_path); aot_log_warning(aot)("'%s' must be a file", runtime_path);
return false; return false;
} }
if (!os::dir_is_empty(runtime_path)) { if (!os::dir_is_empty(runtime_path)) {
log_warning(cds)("directory is not empty: '%s'", runtime_path); aot_log_warning(aot)("directory is not empty: '%s'", runtime_path);
return false; return false;
} }
} else { } else {
if (_file_type == FileType::NOT_EXIST) { if (_file_type == FileType::NOT_EXIST) {
log_warning(cds)("'%s' must not exist", runtime_path); aot_log_warning(aot)("'%s' must not exist", runtime_path);
if (has_aot_linked_classes) { if (has_aot_linked_classes) {
log_error(cds)("CDS archive has aot-linked classes. It cannot be used because the " aot_log_error(aot)("CDS archive has aot-linked classes. It cannot be used because the "
"file %s exists", runtime_path); "file %s exists", runtime_path);
return false; return false;
} else { } else {
log_warning(cds)("Archived non-system classes are disabled because the " aot_log_warning(aot)("Archived non-system classes are disabled because the "
"file %s exists", runtime_path); "file %s exists", runtime_path);
FileMapInfo::current_info()->set_has_platform_or_app_classes(false); FileMapInfo::current_info()->set_has_platform_or_app_classes(false);
if (DynamicArchive::is_mapped()) { if (DynamicArchive::is_mapped()) {
@ -425,13 +426,13 @@ bool AOTClassLocation::check(const char* runtime_path, bool has_aot_linked_class
} }
} }
if (_file_type == FileType::DIR) { if (_file_type == FileType::DIR) {
log_warning(cds)("'%s' must be a directory", runtime_path); aot_log_warning(aot)("'%s' must be a directory", runtime_path);
return false; return false;
} }
bool size_differs = _filesize != st.st_size; bool size_differs = _filesize != st.st_size;
bool time_differs = _check_time && (_timestamp != st.st_mtime); bool time_differs = _check_time && (_timestamp != st.st_mtime);
if (size_differs || time_differs) { if (size_differs || time_differs) {
log_warning(cds)("This file is not the one used while building the shared archive file: '%s'%s%s", aot_log_warning(aot)("This file is not the one used while building the shared archive file: '%s'%s%s",
runtime_path, runtime_path,
time_differs ? ", timestamp has changed" : "", time_differs ? ", timestamp has changed" : "",
size_differs ? ", size has changed" : ""); size_differs ? ", size has changed" : "");
@ -689,7 +690,7 @@ void AOTClassLocationConfig::check_nonempty_dirs() const {
} }
if (cs->is_dir()) { if (cs->is_dir()) {
if (!os::dir_is_empty(cs->path())) { if (!os::dir_is_empty(cs->path())) {
log_error(cds)("Error: non-empty directory '%s'", cs->path()); aot_log_error(aot)("Error: non-empty directory '%s'", cs->path());
has_nonempty_dir = true; has_nonempty_dir = true;
} }
} }
@ -714,7 +715,7 @@ bool AOTClassLocationConfig::is_valid_classpath_index(int classpath_index, Insta
const char* const file_name = ClassLoader::file_name_for_class_name(class_name, const char* const file_name = ClassLoader::file_name_for_class_name(class_name,
ik->name()->utf8_length()); ik->name()->utf8_length());
if (!zip->has_entry(current, file_name)) { if (!zip->has_entry(current, file_name)) {
log_warning(cds)("class %s cannot be archived because it was not defined from %s as claimed", aot_log_warning(aot)("class %s cannot be archived because it was not defined from %s as claimed",
class_name, zip->name()); class_name, zip->name());
return false; return false;
} }
@ -776,7 +777,7 @@ bool AOTClassLocationConfig::check_classpaths(bool is_boot_classpath, bool has_a
cs->from_cpattr() ? " (from JAR manifest ClassPath attribute)" : ""); cs->from_cpattr() ? " (from JAR manifest ClassPath attribute)" : "");
if (!cs->from_cpattr() && file_exists(effective_dumptime_path)) { if (!cs->from_cpattr() && file_exists(effective_dumptime_path)) {
if (!runtime_css.has_next()) { if (!runtime_css.has_next()) {
log_warning(cds)("%s classpath has fewer elements than expected", which); aot_log_warning(aot)("%s classpath has fewer elements than expected", which);
return false; return false;
} }
const char* runtime_path = runtime_css.get_next(); const char* runtime_path = runtime_css.get_next();
@ -784,7 +785,7 @@ bool AOTClassLocationConfig::check_classpaths(bool is_boot_classpath, bool has_a
runtime_path = runtime_css.get_next(); runtime_path = runtime_css.get_next();
} }
if (!os::same_files(effective_dumptime_path, runtime_path)) { if (!os::same_files(effective_dumptime_path, runtime_path)) {
log_warning(cds)("The name of %s classpath [%d] does not match: expected '%s', got '%s'", aot_log_warning(aot)("The name of %s classpath [%d] does not match: expected '%s', got '%s'",
which, runtime_css.current(), effective_dumptime_path, runtime_path); which, runtime_css.current(), effective_dumptime_path, runtime_path);
return false; return false;
} }
@ -800,7 +801,7 @@ bool AOTClassLocationConfig::check_classpaths(bool is_boot_classpath, bool has_a
if (is_boot_classpath && runtime_css.has_next() && (need_to_check_app_classpath() || num_module_paths() > 0)) { if (is_boot_classpath && runtime_css.has_next() && (need_to_check_app_classpath() || num_module_paths() > 0)) {
// the check passes if all the extra runtime boot classpath entries are non-existent // the check passes if all the extra runtime boot classpath entries are non-existent
if (check_paths_existence(runtime_css)) { if (check_paths_existence(runtime_css)) {
log_warning(cds)("boot classpath is longer than expected"); aot_log_warning(aot)("boot classpath is longer than expected");
return false; return false;
} }
} }
@ -869,7 +870,7 @@ bool AOTClassLocationConfig::check_module_paths(bool has_aot_linked_classes, int
while (true) { while (true) {
if (!runtime_css.has_next()) { if (!runtime_css.has_next()) {
log_warning(cds)("module path has fewer elements than expected"); aot_log_warning(aot)("module path has fewer elements than expected");
*has_extra_module_paths = true; *has_extra_module_paths = true;
return true; return true;
} }
@ -1021,11 +1022,11 @@ bool AOTClassLocationConfig::validate(bool has_aot_linked_classes, bool* has_ext
"" : " (hint: enable -Xlog:class+path=info to diagnose the failure)"; "" : " (hint: enable -Xlog:class+path=info to diagnose the failure)";
if (RequireSharedSpaces && !PrintSharedArchiveAndExit) { if (RequireSharedSpaces && !PrintSharedArchiveAndExit) {
if (CDSConfig::is_dumping_final_static_archive()) { if (CDSConfig::is_dumping_final_static_archive()) {
log_error(cds)("class path and/or module path are not compatible with the " aot_log_error(aot)("class path and/or module path are not compatible with the "
"ones specified when the AOTConfiguration file was recorded%s", hint_msg); "ones specified when the AOTConfiguration file was recorded%s", hint_msg);
vm_exit_during_initialization("Unable to use create AOT cache.", nullptr); vm_exit_during_initialization("Unable to use create AOT cache.", nullptr);
} else { } else {
log_error(cds)("%s%s", mismatch_msg, hint_msg); aot_log_error(aot)("%s%s", mismatch_msg, hint_msg);
MetaspaceShared::unrecoverable_loading_error(); MetaspaceShared::unrecoverable_loading_error();
} }
} else { } else {

View File

@ -204,7 +204,7 @@ void AOTConstantPoolResolver::preresolve_class_cp_entries(JavaThread* current, I
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; // just ignore CLEAR_PENDING_EXCEPTION; // just ignore
} else { } else {
log_trace(cds, resolve)("Resolved class [%3d] %s -> %s", cp_index, ik->external_name(), log_trace(aot, resolve)("Resolved class [%3d] %s -> %s", cp_index, ik->external_name(),
resolved_klass->external_name()); resolved_klass->external_name());
} }
} }
@ -292,12 +292,12 @@ void AOTConstantPoolResolver::maybe_resolve_fmi_ref(InstanceKlass* ik, Method* m
ShouldNotReachHere(); ShouldNotReachHere();
} }
if (log_is_enabled(Trace, cds, resolve)) { if (log_is_enabled(Trace, aot, resolve)) {
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
bool resolved = cp->is_resolved(raw_index, bc); bool resolved = cp->is_resolved(raw_index, bc);
Symbol* name = cp->name_ref_at(raw_index, bc); Symbol* name = cp->name_ref_at(raw_index, bc);
Symbol* signature = cp->signature_ref_at(raw_index, bc); Symbol* signature = cp->signature_ref_at(raw_index, bc);
log_trace(cds, resolve)("%s %s [%3d] %s -> %s.%s:%s", log_trace(aot, resolve)("%s %s [%3d] %s -> %s.%s:%s",
(resolved ? "Resolved" : "Failed to resolve"), (resolved ? "Resolved" : "Failed to resolve"),
Bytecodes::name(bc), cp_index, ik->external_name(), Bytecodes::name(bc), cp_index, ik->external_name(),
resolved_klass->external_name(), resolved_klass->external_name(),
@ -326,9 +326,9 @@ void AOTConstantPoolResolver::preresolve_indy_cp_entries(JavaThread* current, In
CLEAR_PENDING_EXCEPTION; // just ignore CLEAR_PENDING_EXCEPTION; // just ignore
} }
} }
if (log_is_enabled(Trace, cds, resolve)) { if (log_is_enabled(Trace, aot, resolve)) {
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
log_trace(cds, resolve)("%s indy [%3d] %s", log_trace(aot, resolve)("%s indy [%3d] %s",
rie->is_resolved() ? "Resolved" : "Failed to resolve", rie->is_resolved() ? "Resolved" : "Failed to resolve",
cp_index, ik->external_name()); cp_index, ik->external_name());
} }
@ -350,9 +350,9 @@ bool AOTConstantPoolResolver::check_methodtype_signature(ConstantPool* cp, Symbo
} }
if (SystemDictionaryShared::should_be_excluded(k)) { if (SystemDictionaryShared::should_be_excluded(k)) {
if (log_is_enabled(Warning, cds, resolve)) { if (log_is_enabled(Warning, aot, resolve)) {
ResourceMark rm; ResourceMark rm;
log_warning(cds, resolve)("Cannot aot-resolve Lambda proxy because %s is excluded", k->external_name()); log_warning(aot, resolve)("Cannot aot-resolve Lambda proxy because %s is excluded", k->external_name());
} }
return false; return false;
} }
@ -383,9 +383,9 @@ bool AOTConstantPoolResolver::check_lambda_metafactory_signature(ConstantPool* c
// as <clinit> can have side effects ==> exclude such cases. // as <clinit> can have side effects ==> exclude such cases.
InstanceKlass* intf = InstanceKlass::cast(k); InstanceKlass* intf = InstanceKlass::cast(k);
bool exclude = intf->interface_needs_clinit_execution_as_super(); bool exclude = intf->interface_needs_clinit_execution_as_super();
if (log_is_enabled(Debug, cds, resolve)) { if (log_is_enabled(Debug, aot, resolve)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds, resolve)("%s aot-resolve Lambda proxy of interface type %s", log_debug(aot, resolve)("%s aot-resolve Lambda proxy of interface type %s",
exclude ? "Cannot" : "Can", k->external_name()); exclude ? "Cannot" : "Can", k->external_name());
} }
return !exclude; return !exclude;
@ -399,9 +399,9 @@ bool AOTConstantPoolResolver::check_lambda_metafactory_methodtype_arg(ConstantPo
} }
Symbol* sig = cp->method_type_signature_at(mt_index); Symbol* sig = cp->method_type_signature_at(mt_index);
if (log_is_enabled(Debug, cds, resolve)) { if (log_is_enabled(Debug, aot, resolve)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds, resolve)("Checking MethodType for LambdaMetafactory BSM arg %d: %s", arg_i, sig->as_C_string()); log_debug(aot, resolve)("Checking MethodType for LambdaMetafactory BSM arg %d: %s", arg_i, sig->as_C_string());
} }
return check_methodtype_signature(cp, sig); return check_methodtype_signature(cp, sig);
@ -415,9 +415,9 @@ bool AOTConstantPoolResolver::check_lambda_metafactory_methodhandle_arg(Constant
} }
Symbol* sig = cp->method_handle_signature_ref_at(mh_index); Symbol* sig = cp->method_handle_signature_ref_at(mh_index);
if (log_is_enabled(Debug, cds, resolve)) { if (log_is_enabled(Debug, aot, resolve)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds, resolve)("Checking MethodType of MethodHandle for LambdaMetafactory BSM arg %d: %s", arg_i, sig->as_C_string()); log_debug(aot, resolve)("Checking MethodType of MethodHandle for LambdaMetafactory BSM arg %d: %s", arg_i, sig->as_C_string());
} }
return check_methodtype_signature(cp, sig); return check_methodtype_signature(cp, sig);
} }
@ -452,9 +452,9 @@ bool AOTConstantPoolResolver::is_indy_resolution_deterministic(ConstantPool* cp,
"[Ljava/lang/Object;" "[Ljava/lang/Object;"
")Ljava/lang/invoke/CallSite;")) { ")Ljava/lang/invoke/CallSite;")) {
Symbol* factory_type_sig = cp->uncached_signature_ref_at(cp_index); Symbol* factory_type_sig = cp->uncached_signature_ref_at(cp_index);
if (log_is_enabled(Debug, cds, resolve)) { if (log_is_enabled(Debug, aot, resolve)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds, resolve)("Checking StringConcatFactory callsite signature [%d]: %s", cp_index, factory_type_sig->as_C_string()); log_debug(aot, resolve)("Checking StringConcatFactory callsite signature [%d]: %s", cp_index, factory_type_sig->as_C_string());
} }
Klass* k; Klass* k;
@ -504,9 +504,9 @@ bool AOTConstantPoolResolver::is_indy_resolution_deterministic(ConstantPool* cp,
* {@code interfaceMethodType}. * {@code interfaceMethodType}.
*/ */
Symbol* factory_type_sig = cp->uncached_signature_ref_at(cp_index); Symbol* factory_type_sig = cp->uncached_signature_ref_at(cp_index);
if (log_is_enabled(Debug, cds, resolve)) { if (log_is_enabled(Debug, aot, resolve)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds, resolve)("Checking lambda callsite signature [%d]: %s", cp_index, factory_type_sig->as_C_string()); log_debug(aot, resolve)("Checking lambda callsite signature [%d]: %s", cp_index, factory_type_sig->as_C_string());
} }
if (!check_lambda_metafactory_signature(cp, factory_type_sig)) { if (!check_lambda_metafactory_signature(cp, factory_type_sig)) {

View File

@ -87,10 +87,10 @@ void AOTLinkedClassBulkLoader::exit_on_exception(JavaThread* current) {
assert(current->has_pending_exception(), "precondition"); assert(current->has_pending_exception(), "precondition");
ResourceMark rm(current); ResourceMark rm(current);
if (current->pending_exception()->is_a(vmClasses::OutOfMemoryError_klass())) { if (current->pending_exception()->is_a(vmClasses::OutOfMemoryError_klass())) {
log_error(cds)("Out of memory. Please run with a larger Java heap, current MaxHeapSize = " log_error(aot)("Out of memory. Please run with a larger Java heap, current MaxHeapSize = "
"%zuM", MaxHeapSize/M); "%zuM", MaxHeapSize/M);
} else { } else {
log_error(cds)("%s: %s", current->pending_exception()->klass()->external_name(), log_error(aot)("%s: %s", current->pending_exception()->klass()->external_name(),
java_lang_String::as_utf8_string(java_lang_Throwable::message(current->pending_exception()))); java_lang_String::as_utf8_string(java_lang_Throwable::message(current->pending_exception())));
} }
vm_exit_during_initialization("Unexpected exception when loading aot-linked classes."); vm_exit_during_initialization("Unexpected exception when loading aot-linked classes.");
@ -199,9 +199,9 @@ void AOTLinkedClassBulkLoader::load_classes_impl(AOTLinkedClassCategory class_ca
if (actual != ik) { if (actual != ik) {
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
log_error(cds)("Unable to resolve %s class from CDS archive: %s", category_name, ik->external_name()); log_error(aot)("Unable to resolve %s class from %s: %s", category_name, CDSConfig::type_of_archive_being_loaded(), ik->external_name());
log_error(cds)("Expected: " INTPTR_FORMAT ", actual: " INTPTR_FORMAT, p2i(ik), p2i(actual)); log_error(aot)("Expected: " INTPTR_FORMAT ", actual: " INTPTR_FORMAT, p2i(ik), p2i(actual));
log_error(cds)("JVMTI class retransformation is not supported when archive was generated with -XX:+AOTClassLinking."); log_error(aot)("JVMTI class retransformation is not supported when archive was generated with -XX:+AOTClassLinking.");
MetaspaceShared::unrecoverable_loading_error(); MetaspaceShared::unrecoverable_loading_error();
} }
assert(actual->is_loaded(), "must be"); assert(actual->is_loaded(), "must be");

View File

@ -1155,12 +1155,12 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
static void log_klass(Klass* k, address runtime_dest, const char* type_name, int bytes, Thread* current) { static void log_klass(Klass* k, address runtime_dest, const char* type_name, int bytes, Thread* current) {
ResourceMark rm(current); ResourceMark rm(current);
log_debug(cds, map)(_LOG_PREFIX " %s", log_debug(aot, map)(_LOG_PREFIX " %s",
p2i(runtime_dest), type_name, bytes, k->external_name()); p2i(runtime_dest), type_name, bytes, k->external_name());
} }
static void log_method(Method* m, address runtime_dest, const char* type_name, int bytes, Thread* current) { static void log_method(Method* m, address runtime_dest, const char* type_name, int bytes, Thread* current) {
ResourceMark rm(current); ResourceMark rm(current);
log_debug(cds, map)(_LOG_PREFIX " %s", log_debug(aot, map)(_LOG_PREFIX " %s",
p2i(runtime_dest), type_name, bytes, m->external_name()); p2i(runtime_dest), type_name, bytes, m->external_name());
} }
@ -1203,12 +1203,12 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
{ {
ResourceMark rm(current); ResourceMark rm(current);
Symbol* s = (Symbol*)src; Symbol* s = (Symbol*)src;
log_debug(cds, map)(_LOG_PREFIX " %s", p2i(runtime_dest), type_name, bytes, log_debug(aot, map)(_LOG_PREFIX " %s", p2i(runtime_dest), type_name, bytes,
s->as_quoted_ascii()); s->as_quoted_ascii());
} }
break; break;
default: default:
log_debug(cds, map)(_LOG_PREFIX, p2i(runtime_dest), type_name, bytes); log_debug(aot, map)(_LOG_PREFIX, p2i(runtime_dest), type_name, bytes);
break; break;
} }
@ -1218,7 +1218,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
log_as_hex(last_obj_base, last_obj_end, last_obj_base + buffer_to_runtime_delta()); log_as_hex(last_obj_base, last_obj_end, last_obj_base + buffer_to_runtime_delta());
if (last_obj_end < region_end) { if (last_obj_end < region_end) {
log_debug(cds, map)(PTR_FORMAT ": @@ Misc data %zu bytes", log_debug(aot, map)(PTR_FORMAT ": @@ Misc data %zu bytes",
p2i(last_obj_end + buffer_to_runtime_delta()), p2i(last_obj_end + buffer_to_runtime_delta()),
size_t(region_end - last_obj_end)); size_t(region_end - last_obj_end));
log_as_hex(last_obj_end, region_end, last_obj_end + buffer_to_runtime_delta()); log_as_hex(last_obj_end, region_end, last_obj_end + buffer_to_runtime_delta());
@ -1242,7 +1242,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
} else { } else {
top = requested_base + size; top = requested_base + size;
} }
log_info(cds, map)("[%-18s " PTR_FORMAT " - " PTR_FORMAT " %9zu bytes]", log_info(aot, map)("[%-18s " PTR_FORMAT " - " PTR_FORMAT " %9zu bytes]",
name, p2i(base), p2i(top), size); name, p2i(base), p2i(top), size);
} }
@ -1253,7 +1253,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
address end = address(r.end()); address end = address(r.end());
log_region("heap", start, end, ArchiveHeapWriter::buffered_addr_to_requested_addr(start)); log_region("heap", start, end, ArchiveHeapWriter::buffered_addr_to_requested_addr(start));
LogStreamHandle(Info, cds, map) st; LogStreamHandle(Info, aot, map) st;
HeapRootSegments segments = heap_info->heap_root_segments(); HeapRootSegments segments = heap_info->heap_root_segments();
assert(segments.base_offset() == 0, "Sanity"); assert(segments.base_offset() == 0, "Sanity");
@ -1362,7 +1362,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
// Print the fields of instanceOops, or the elements of arrayOops // Print the fields of instanceOops, or the elements of arrayOops
static void log_oop_details(ArchiveHeapInfo* heap_info, oop source_oop, address buffered_addr) { static void log_oop_details(ArchiveHeapInfo* heap_info, oop source_oop, address buffered_addr) {
LogStreamHandle(Trace, cds, map, oops) st; LogStreamHandle(Trace, aot, map, oops) st;
if (st.is_enabled()) { if (st.is_enabled()) {
Klass* source_klass = source_oop->klass(); Klass* source_klass = source_oop->klass();
ArchiveBuilder* builder = ArchiveBuilder::current(); ArchiveBuilder* builder = ArchiveBuilder::current();
@ -1430,7 +1430,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
} }
static void log_heap_roots() { static void log_heap_roots() {
LogStreamHandle(Trace, cds, map, oops) st; LogStreamHandle(Trace, aot, map, oops) st;
if (st.is_enabled()) { if (st.is_enabled()) {
for (int i = 0; i < HeapShared::pending_roots()->length(); i++) { for (int i = 0; i < HeapShared::pending_roots()->length(); i++) {
st.print("roots[%4d]: ", i); st.print("roots[%4d]: ", i);
@ -1491,7 +1491,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
static void log_as_hex(address base, address top, address requested_base, bool is_heap = false) { static void log_as_hex(address base, address top, address requested_base, bool is_heap = false) {
assert(top >= base, "must be"); assert(top >= base, "must be");
LogStreamHandle(Trace, cds, map) lsh; LogStreamHandle(Trace, aot, map) lsh;
if (lsh.is_enabled()) { if (lsh.is_enabled()) {
int unitsize = sizeof(address); int unitsize = sizeof(address);
if (is_heap && UseCompressedOops) { if (is_heap && UseCompressedOops) {
@ -1504,7 +1504,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
} }
static void log_header(FileMapInfo* mapinfo) { static void log_header(FileMapInfo* mapinfo) {
LogStreamHandle(Info, cds, map) lsh; LogStreamHandle(Info, aot, map) lsh;
if (lsh.is_enabled()) { if (lsh.is_enabled()) {
mapinfo->print(&lsh); mapinfo->print(&lsh);
} }
@ -1514,7 +1514,7 @@ public:
static void log(ArchiveBuilder* builder, FileMapInfo* mapinfo, static void log(ArchiveBuilder* builder, FileMapInfo* mapinfo,
ArchiveHeapInfo* heap_info, ArchiveHeapInfo* heap_info,
char* bitmap, size_t bitmap_size_in_bytes) { char* bitmap, size_t bitmap_size_in_bytes) {
log_info(cds, map)("%s CDS archive map for %s", CDSConfig::is_dumping_static_archive() ? "Static" : "Dynamic", mapinfo->full_path()); log_info(aot, map)("%s CDS archive map for %s", CDSConfig::is_dumping_static_archive() ? "Static" : "Dynamic", mapinfo->full_path());
address header = address(mapinfo->header()); address header = address(mapinfo->header());
address header_end = header + mapinfo->header()->header_size(); address header_end = header + mapinfo->header()->header_size();
@ -1538,7 +1538,7 @@ public:
} }
#endif #endif
log_info(cds, map)("[End of CDS archive map]"); log_info(aot, map)("[End of CDS archive map]");
} }
}; // end ArchiveBuilder::CDSMapLogger }; // end ArchiveBuilder::CDSMapLogger
@ -1580,7 +1580,7 @@ void ArchiveBuilder::write_archive(FileMapInfo* mapinfo, ArchiveHeapInfo* heap_i
print_stats(); print_stats();
} }
if (log_is_enabled(Info, cds, map)) { if (log_is_enabled(Info, aot, map)) {
CDSMapLogger::log(this, mapinfo, heap_info, CDSMapLogger::log(this, mapinfo, heap_info,
bitmap, bitmap_size_in_bytes); bitmap, bitmap_size_in_bytes);
} }

View File

@ -167,7 +167,7 @@ void ArchiveHeapLoader::patch_compressed_embedded_pointers(BitMapView bm,
MemRegion region) { MemRegion region) {
narrowOop dt_encoded_bottom = info->encoded_heap_region_dumptime_address(); narrowOop dt_encoded_bottom = info->encoded_heap_region_dumptime_address();
narrowOop rt_encoded_bottom = CompressedOops::encode_not_null(cast_to_oop(region.start())); narrowOop rt_encoded_bottom = CompressedOops::encode_not_null(cast_to_oop(region.start()));
log_info(cds)("patching heap embedded pointers: narrowOop 0x%8x -> 0x%8x", log_info(aot)("patching heap embedded pointers: narrowOop 0x%8x -> 0x%8x",
(uint)dt_encoded_bottom, (uint)rt_encoded_bottom); (uint)dt_encoded_bottom, (uint)rt_encoded_bottom);
// Optimization: if dumptime shift is the same as runtime shift, we can perform a // Optimization: if dumptime shift is the same as runtime shift, we can perform a
@ -175,15 +175,15 @@ void ArchiveHeapLoader::patch_compressed_embedded_pointers(BitMapView bm,
narrowOop* patching_start = (narrowOop*)region.start() + FileMapInfo::current_info()->heap_oopmap_start_pos(); narrowOop* patching_start = (narrowOop*)region.start() + FileMapInfo::current_info()->heap_oopmap_start_pos();
if (_narrow_oop_shift == CompressedOops::shift()) { if (_narrow_oop_shift == CompressedOops::shift()) {
uint32_t quick_delta = (uint32_t)rt_encoded_bottom - (uint32_t)dt_encoded_bottom; uint32_t quick_delta = (uint32_t)rt_encoded_bottom - (uint32_t)dt_encoded_bottom;
log_info(cds)("CDS heap data relocation quick delta = 0x%x", quick_delta); log_info(aot)("heap data relocation quick delta = 0x%x", quick_delta);
if (quick_delta == 0) { if (quick_delta == 0) {
log_info(cds)("CDS heap data relocation unnecessary, quick_delta = 0"); log_info(aot)("heap data relocation unnecessary, quick_delta = 0");
} else { } else {
PatchCompressedEmbeddedPointersQuick patcher(patching_start, quick_delta); PatchCompressedEmbeddedPointersQuick patcher(patching_start, quick_delta);
bm.iterate(&patcher); bm.iterate(&patcher);
} }
} else { } else {
log_info(cds)("CDS heap data quick relocation not possible"); log_info(aot)("heap data quick relocation not possible");
PatchCompressedEmbeddedPointers patcher(patching_start); PatchCompressedEmbeddedPointers patcher(patching_start);
bm.iterate(&patcher); bm.iterate(&patcher);
} }
@ -301,12 +301,12 @@ bool ArchiveHeapLoader::load_heap_region_impl(FileMapInfo* mapinfo, LoadedArchiv
if (!mapinfo->read_region(loaded_region->_region_index, (char*)load_address, r->used(), /* do_commit = */ false)) { if (!mapinfo->read_region(loaded_region->_region_index, (char*)load_address, r->used(), /* do_commit = */ false)) {
// There's no easy way to free the buffer, so we will fill it with zero later // There's no easy way to free the buffer, so we will fill it with zero later
// in fill_failed_loaded_heap(), and it will eventually be GC'ed. // in fill_failed_loaded_heap(), and it will eventually be GC'ed.
log_warning(cds)("Loading of heap region %d has failed. Archived objects are disabled", loaded_region->_region_index); log_warning(aot)("Loading of heap region %d has failed. Archived objects are disabled", loaded_region->_region_index);
_loading_failed = true; _loading_failed = true;
return false; return false;
} }
assert(r->mapped_base() == (char*)load_address, "sanity"); assert(r->mapped_base() == (char*)load_address, "sanity");
log_info(cds)("Loaded heap region #%d at base " INTPTR_FORMAT " top " INTPTR_FORMAT log_info(aot)("Loaded heap region #%d at base " INTPTR_FORMAT " top " INTPTR_FORMAT
" size %6zu delta %zd", " size %6zu delta %zd",
loaded_region->_region_index, load_address, load_address + loaded_region->_region_size, loaded_region->_region_index, load_address, load_address + loaded_region->_region_size,
loaded_region->_region_size, loaded_region->_runtime_offset); loaded_region->_region_size, loaded_region->_runtime_offset);

View File

@ -293,7 +293,7 @@ int ArchiveHeapWriter::compare_objs_by_oop_fields(HeapObjOrder* a, HeapObjOrder*
} }
void ArchiveHeapWriter::sort_source_objs() { void ArchiveHeapWriter::sort_source_objs() {
log_info(cds)("sorting heap objects"); log_info(aot)("sorting heap objects");
int len = _source_objs->length(); int len = _source_objs->length();
_source_objs_order = new GrowableArrayCHeap<HeapObjOrder, mtClassShared>(len); _source_objs_order = new GrowableArrayCHeap<HeapObjOrder, mtClassShared>(len);
@ -303,9 +303,9 @@ void ArchiveHeapWriter::sort_source_objs() {
HeapObjOrder os = {i, rank}; HeapObjOrder os = {i, rank};
_source_objs_order->append(os); _source_objs_order->append(os);
} }
log_info(cds)("computed ranks"); log_info(aot)("computed ranks");
_source_objs_order->sort(compare_objs_by_oop_fields); _source_objs_order->sort(compare_objs_by_oop_fields);
log_info(cds)("sorting heap objects done"); log_info(aot)("sorting heap objects done");
} }
void ArchiveHeapWriter::copy_source_objs_to_buffer(GrowableArrayCHeap<oop, mtClassShared>* roots) { void ArchiveHeapWriter::copy_source_objs_to_buffer(GrowableArrayCHeap<oop, mtClassShared>* roots) {
@ -330,7 +330,7 @@ void ArchiveHeapWriter::copy_source_objs_to_buffer(GrowableArrayCHeap<oop, mtCla
} }
} }
log_info(cds)("Size of heap region = %zu bytes, %d objects, %d roots, %d native ptrs", log_info(aot)("Size of heap region = %zu bytes, %d objects, %d roots, %d native ptrs",
_buffer_used, _source_objs->length() + 1, roots->length(), _num_native_ptrs); _buffer_used, _source_objs->length() + 1, roots->length(), _num_native_ptrs);
} }
@ -636,7 +636,7 @@ static void log_bitmap_usage(const char* which, BitMap* bitmap, size_t total_bit
// The whole heap is covered by total_bits, but there are only non-zero bits within [start ... end). // The whole heap is covered by total_bits, but there are only non-zero bits within [start ... end).
size_t start = bitmap->find_first_set_bit(0); size_t start = bitmap->find_first_set_bit(0);
size_t end = bitmap->size(); size_t end = bitmap->size();
log_info(cds)("%s = %7zu ... %7zu (%3zu%% ... %3zu%% = %3zu%%)", which, log_info(aot)("%s = %7zu ... %7zu (%3zu%% ... %3zu%% = %3zu%%)", which,
start, end, start, end,
start * 100 / total_bits, start * 100 / total_bits,
end * 100 / total_bits, end * 100 / total_bits,

View File

@ -22,6 +22,7 @@
* *
*/ */
#include "cds/aotLogging.hpp"
#include "cds/archiveBuilder.hpp" #include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapLoader.inline.hpp" #include "cds/archiveHeapLoader.inline.hpp"
#include "cds/archiveUtils.hpp" #include "cds/archiveUtils.hpp"
@ -168,7 +169,7 @@ public:
} }
} else { } else {
_ptrmap->clear_bit(offset); _ptrmap->clear_bit(offset);
DEBUG_ONLY(log_trace(cds, reloc)("Clearing pointer [" PTR_FORMAT "] -> null @ %9zu", p2i(ptr_loc), offset)); DEBUG_ONLY(log_trace(aot, reloc)("Clearing pointer [" PTR_FORMAT "] -> null @ %9zu", p2i(ptr_loc), offset));
} }
return true; return true;
@ -207,7 +208,7 @@ char* DumpRegion::expand_top_to(char* newtop) {
// This is just a sanity check and should not appear in any real world usage. This // This is just a sanity check and should not appear in any real world usage. This
// happens only if you allocate more than 2GB of shared objects and would require // happens only if you allocate more than 2GB of shared objects and would require
// millions of shared classes. // millions of shared classes.
log_error(cds)("Out of memory in the CDS archive: Please reduce the number of shared classes."); aot_log_error(aot)("Out of memory in the CDS archive: Please reduce the number of shared classes.");
MetaspaceShared::unrecoverable_writing_error(); MetaspaceShared::unrecoverable_writing_error();
} }
} }
@ -233,7 +234,7 @@ void DumpRegion::commit_to(char* newtop) {
assert(commit <= uncommitted, "sanity"); assert(commit <= uncommitted, "sanity");
if (!_vs->expand_by(commit, false)) { if (!_vs->expand_by(commit, false)) {
log_error(cds)("Failed to expand shared space to %zu bytes", aot_log_error(aot)("Failed to expand shared space to %zu bytes",
need_committed_size); need_committed_size);
MetaspaceShared::unrecoverable_writing_error(); MetaspaceShared::unrecoverable_writing_error();
} }
@ -244,7 +245,7 @@ void DumpRegion::commit_to(char* newtop) {
} else { } else {
which = "shared"; which = "shared";
} }
log_debug(cds)("Expanding %s spaces by %7zu bytes [total %9zu bytes ending at %p]", log_debug(aot)("Expanding %s spaces by %7zu bytes [total %9zu bytes ending at %p]",
which, commit, _vs->actual_committed_size(), _vs->high()); which, commit, _vs->actual_committed_size(), _vs->high());
} }
@ -271,16 +272,16 @@ void DumpRegion::append_intptr_t(intptr_t n, bool need_to_mark) {
void DumpRegion::print(size_t total_bytes) const { void DumpRegion::print(size_t total_bytes) const {
char* base = used() > 0 ? ArchiveBuilder::current()->to_requested(_base) : nullptr; char* base = used() > 0 ? ArchiveBuilder::current()->to_requested(_base) : nullptr;
log_debug(cds)("%s space: %9zu [ %4.1f%% of total] out of %9zu bytes [%5.1f%% used] at " INTPTR_FORMAT, log_debug(aot)("%s space: %9zu [ %4.1f%% of total] out of %9zu bytes [%5.1f%% used] at " INTPTR_FORMAT,
_name, used(), percent_of(used(), total_bytes), reserved(), percent_of(used(), reserved()), _name, used(), percent_of(used(), total_bytes), reserved(), percent_of(used(), reserved()),
p2i(base)); p2i(base));
} }
void DumpRegion::print_out_of_space_msg(const char* failing_region, size_t needed_bytes) { void DumpRegion::print_out_of_space_msg(const char* failing_region, size_t needed_bytes) {
log_error(cds)("[%-8s] " PTR_FORMAT " - " PTR_FORMAT " capacity =%9d, allocated =%9d", aot_log_error(aot)("[%-8s] " PTR_FORMAT " - " PTR_FORMAT " capacity =%9d, allocated =%9d",
_name, p2i(_base), p2i(_top), int(_end - _base), int(_top - _base)); _name, p2i(_base), p2i(_top), int(_end - _base), int(_top - _base));
if (strcmp(_name, failing_region) == 0) { if (strcmp(_name, failing_region) == 0) {
log_error(cds)(" required = %d", int(needed_bytes)); aot_log_error(aot)(" required = %d", int(needed_bytes));
} }
} }

View File

@ -136,12 +136,12 @@ class SharedDataRelocator: public BitMapClosure {
_valid_old_base(valid_old_base), _valid_old_end(valid_old_end), _valid_old_base(valid_old_base), _valid_old_end(valid_old_end),
_valid_new_base(valid_new_base), _valid_new_end(valid_new_end), _valid_new_base(valid_new_base), _valid_new_end(valid_new_end),
_delta(delta) { _delta(delta) {
log_debug(cds, reloc)("SharedDataRelocator::_patch_base = " PTR_FORMAT, p2i(_patch_base)); log_debug(aot, reloc)("SharedDataRelocator::_patch_base = " PTR_FORMAT, p2i(_patch_base));
log_debug(cds, reloc)("SharedDataRelocator::_patch_end = " PTR_FORMAT, p2i(_patch_end)); log_debug(aot, reloc)("SharedDataRelocator::_patch_end = " PTR_FORMAT, p2i(_patch_end));
log_debug(cds, reloc)("SharedDataRelocator::_valid_old_base = " PTR_FORMAT, p2i(_valid_old_base)); log_debug(aot, reloc)("SharedDataRelocator::_valid_old_base = " PTR_FORMAT, p2i(_valid_old_base));
log_debug(cds, reloc)("SharedDataRelocator::_valid_old_end = " PTR_FORMAT, p2i(_valid_old_end)); log_debug(aot, reloc)("SharedDataRelocator::_valid_old_end = " PTR_FORMAT, p2i(_valid_old_end));
log_debug(cds, reloc)("SharedDataRelocator::_valid_new_base = " PTR_FORMAT, p2i(_valid_new_base)); log_debug(aot, reloc)("SharedDataRelocator::_valid_new_base = " PTR_FORMAT, p2i(_valid_new_base));
log_debug(cds, reloc)("SharedDataRelocator::_valid_new_end = " PTR_FORMAT, p2i(_valid_new_end)); log_debug(aot, reloc)("SharedDataRelocator::_valid_new_end = " PTR_FORMAT, p2i(_valid_new_end));
} }
bool do_bit(size_t offset); bool do_bit(size_t offset);

View File

@ -27,6 +27,7 @@
#include "cds/archiveUtils.hpp" #include "cds/archiveUtils.hpp"
#include "cds/aotLogging.hpp"
#include "cds/archiveBuilder.hpp" #include "cds/archiveBuilder.hpp"
#include "cds/cdsConfig.hpp" #include "cds/cdsConfig.hpp"
#include "cds/metaspaceShared.hpp" #include "cds/metaspaceShared.hpp"
@ -46,7 +47,7 @@ inline bool SharedDataRelocator::do_bit(size_t offset) {
assert(new_ptr != nullptr, "don't point to the bottom of the archive"); // See ArchivePtrMarker::mark_pointer(). assert(new_ptr != nullptr, "don't point to the bottom of the archive"); // See ArchivePtrMarker::mark_pointer().
assert(_valid_new_base <= new_ptr && new_ptr < _valid_new_end, "must be"); assert(_valid_new_base <= new_ptr && new_ptr < _valid_new_end, "must be");
DEBUG_ONLY(log_trace(cds, reloc)("Patch2: @%8d [" PTR_FORMAT "] " PTR_FORMAT " -> " PTR_FORMAT, DEBUG_ONLY(aot_log_trace(aot, reloc)("Patch2: @%8d [" PTR_FORMAT "] " PTR_FORMAT " -> " PTR_FORMAT,
(int)offset, p2i(p), p2i(old_ptr), p2i(new_ptr))); (int)offset, p2i(p), p2i(old_ptr), p2i(new_ptr)));
*p = new_ptr; *p = new_ptr;
return true; // keep iterating return true; // keep iterating

View File

@ -22,6 +22,7 @@
* *
*/ */
#include "cds/aotLogging.hpp"
#include "cds/archiveHeapLoader.hpp" #include "cds/archiveHeapLoader.hpp"
#include "cds/cdsConfig.hpp" #include "cds/cdsConfig.hpp"
#include "cds/classListWriter.hpp" #include "cds/classListWriter.hpp"
@ -234,7 +235,7 @@ void CDSConfig::ergo_init_classic_archive_paths() {
warning("-XX:+AutoCreateSharedArchive is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info."); warning("-XX:+AutoCreateSharedArchive is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info.");
AutoCreateSharedArchive = false; AutoCreateSharedArchive = false;
} }
log_error(cds)("Not a valid archive (%s)", SharedArchiveFile); aot_log_error(aot)("Not a valid %s (%s)", type_of_archive_being_loaded(), SharedArchiveFile);
Arguments::no_shared_spaces("invalid archive"); Arguments::no_shared_spaces("invalid archive");
} }
} else if (base_archive_path == nullptr) { } else if (base_archive_path == nullptr) {
@ -278,7 +279,7 @@ void CDSConfig::ergo_init_classic_archive_paths() {
void CDSConfig::check_internal_module_property(const char* key, const char* value) { void CDSConfig::check_internal_module_property(const char* key, const char* value) {
if (Arguments::is_incompatible_cds_internal_module_property(key)) { if (Arguments::is_incompatible_cds_internal_module_property(key)) {
stop_using_optimized_module_handling(); stop_using_optimized_module_handling();
log_info(cds)("optimized module handling: disabled due to incompatible property: %s=%s", key, value); aot_log_info(aot)("optimized module handling: disabled due to incompatible property: %s=%s", key, value);
} }
} }
@ -293,7 +294,7 @@ void CDSConfig::check_incompatible_property(const char* key, const char* value)
if (strcmp(key, property) == 0) { if (strcmp(key, property) == 0) {
stop_dumping_full_module_graph(); stop_dumping_full_module_graph();
stop_using_full_module_graph(); stop_using_full_module_graph();
log_info(cds)("full module graph: disabled due to incompatible property: %s=%s", key, value); aot_log_info(aot)("full module graph: disabled due to incompatible property: %s=%s", key, value);
break; break;
} }
} }
@ -359,9 +360,9 @@ bool CDSConfig::has_unsupported_runtime_module_options() {
warning("CDS is disabled when the %s option is specified.", option); warning("CDS is disabled when the %s option is specified.", option);
} else { } else {
if (new_aot_flags_used()) { if (new_aot_flags_used()) {
log_warning(cds)("AOT cache is disabled when the %s option is specified.", option); aot_log_warning(aot)("AOT cache is disabled when the %s option is specified.", option);
} else { } else {
log_info(cds)("CDS is disabled when the %s option is specified.", option); aot_log_info(aot)("CDS is disabled when the %s option is specified.", option);
} }
} }
return true; return true;
@ -549,7 +550,7 @@ bool CDSConfig::check_vm_args_consistency(bool patch_mod_javabase, bool mode_fla
} else if (Arguments::mode() == Arguments::_comp) { } else if (Arguments::mode() == Arguments::_comp) {
// -Xcomp may use excessive CPU for the test tiers. Also, -Xshare:dump runs a small and fixed set of // -Xcomp may use excessive CPU for the test tiers. Also, -Xshare:dump runs a small and fixed set of
// Java code, so there's not much benefit in running -Xcomp. // Java code, so there's not much benefit in running -Xcomp.
log_info(cds)("reduced -Xcomp to -Xmixed for static dumping"); aot_log_info(aot)("reduced -Xcomp to -Xmixed for static dumping");
Arguments::set_mode_flags(Arguments::_mixed); Arguments::set_mode_flags(Arguments::_mixed);
} }
@ -574,11 +575,11 @@ bool CDSConfig::check_vm_args_consistency(bool patch_mod_javabase, bool mode_fla
if (AutoCreateSharedArchive) { if (AutoCreateSharedArchive) {
if (SharedArchiveFile == nullptr) { if (SharedArchiveFile == nullptr) {
log_warning(cds)("-XX:+AutoCreateSharedArchive requires -XX:SharedArchiveFile"); aot_log_warning(aot)("-XX:+AutoCreateSharedArchive requires -XX:SharedArchiveFile");
return false; return false;
} }
if (ArchiveClassesAtExit != nullptr) { if (ArchiveClassesAtExit != nullptr) {
log_warning(cds)("-XX:+AutoCreateSharedArchive does not work with ArchiveClassesAtExit"); aot_log_warning(aot)("-XX:+AutoCreateSharedArchive does not work with ArchiveClassesAtExit");
return false; return false;
} }
} }
@ -594,7 +595,7 @@ bool CDSConfig::check_vm_args_consistency(bool patch_mod_javabase, bool mode_fla
// Always verify non-system classes during CDS dump // Always verify non-system classes during CDS dump
if (!BytecodeVerificationRemote) { if (!BytecodeVerificationRemote) {
BytecodeVerificationRemote = true; BytecodeVerificationRemote = true;
log_info(cds)("All non-system classes will be verified (-Xverify:remote) during CDS dump time."); aot_log_info(aot)("All non-system classes will be verified (-Xverify:remote) during CDS dump time.");
} }
} }
@ -615,11 +616,11 @@ void CDSConfig::prepare_for_dumping() {
#define __THEMSG " is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info." #define __THEMSG " is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info."
if (RecordDynamicDumpInfo) { if (RecordDynamicDumpInfo) {
log_error(cds)("-XX:+RecordDynamicDumpInfo%s", __THEMSG); aot_log_error(aot)("-XX:+RecordDynamicDumpInfo%s", __THEMSG);
MetaspaceShared::unrecoverable_loading_error(); MetaspaceShared::unrecoverable_loading_error();
} else { } else {
assert(ArchiveClassesAtExit != nullptr, "sanity"); assert(ArchiveClassesAtExit != nullptr, "sanity");
log_warning(cds)("-XX:ArchiveClassesAtExit" __THEMSG); aot_log_warning(aot)("-XX:ArchiveClassesAtExit" __THEMSG);
} }
#undef __THEMSG #undef __THEMSG
disable_dumping_dynamic_archive(); disable_dumping_dynamic_archive();
@ -766,7 +767,7 @@ void CDSConfig::log_reasons_for_not_dumping_heap() {
} }
assert(reason != nullptr, "sanity"); assert(reason != nullptr, "sanity");
log_info(cds)("Archived java heap is not supported: %s", reason); aot_log_info(aot)("Archived java heap is not supported: %s", reason);
} }
// This is *Legacy* optimization for lambdas before JEP 483. May be removed in the future. // This is *Legacy* optimization for lambdas before JEP 483. May be removed in the future.
@ -816,7 +817,7 @@ void CDSConfig::stop_dumping_full_module_graph(const char* reason) {
if (_is_dumping_full_module_graph) { if (_is_dumping_full_module_graph) {
_is_dumping_full_module_graph = false; _is_dumping_full_module_graph = false;
if (reason != nullptr) { if (reason != nullptr) {
log_info(cds)("full module graph cannot be dumped: %s", reason); aot_log_info(aot)("full module graph cannot be dumped: %s", reason);
} }
} }
} }
@ -826,7 +827,7 @@ void CDSConfig::stop_using_full_module_graph(const char* reason) {
if (_is_using_full_module_graph) { if (_is_using_full_module_graph) {
_is_using_full_module_graph = false; _is_using_full_module_graph = false;
if (reason != nullptr) { if (reason != nullptr) {
log_info(cds)("full module graph cannot be loaded: %s", reason); aot_log_info(aot)("full module graph cannot be loaded: %s", reason);
} }
} }
} }

View File

@ -23,6 +23,7 @@
*/ */
#include "cds/aotConstantPoolResolver.hpp" #include "cds/aotConstantPoolResolver.hpp"
#include "cds/aotLogging.hpp"
#include "cds/archiveUtils.hpp" #include "cds/archiveUtils.hpp"
#include "cds/classListParser.hpp" #include "cds/classListParser.hpp"
#include "cds/lambdaFormInvokers.hpp" #include "cds/lambdaFormInvokers.hpp"
@ -68,7 +69,7 @@ ClassListParser::ClassListParser(const char* file, ParseMode parse_mode) :
_file_input(do_open(file), /* need_close=*/true), _file_input(do_open(file), /* need_close=*/true),
_input_stream(&_file_input), _input_stream(&_file_input),
_parse_mode(parse_mode) { _parse_mode(parse_mode) {
log_info(cds)("Parsing %s%s", file, aot_log_info(aot)("Parsing %s%s", file,
parse_lambda_forms_invokers_only() ? " (lambda form invokers only)" : ""); parse_lambda_forms_invokers_only() ? " (lambda form invokers only)" : "");
if (!_file_input.is_open()) { if (!_file_input.is_open()) {
char reason[JVM_MAXPATHLEN]; char reason[JVM_MAXPATHLEN];
@ -163,18 +164,18 @@ void ClassListParser::parse_class_name_and_attributes(TRAPS) {
if (message != nullptr) { if (message != nullptr) {
ex_msg = java_lang_String::as_utf8_string(message); ex_msg = java_lang_String::as_utf8_string(message);
} }
log_warning(cds)("%s: %s", PENDING_EXCEPTION->klass()->external_name(), ex_msg); aot_log_warning(aot)("%s: %s", PENDING_EXCEPTION->klass()->external_name(), ex_msg);
// We might have an invalid class name or an bad class. Warn about it // We might have an invalid class name or an bad class. Warn about it
// and keep going to the next line. // and keep going to the next line.
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
log_warning(cds)("Preload Warning: Cannot find %s", _class_name); aot_log_warning(aot)("Preload Warning: Cannot find %s", _class_name);
return; return;
} }
assert(klass != nullptr, "sanity"); assert(klass != nullptr, "sanity");
if (log_is_enabled(Trace, cds)) { if (aot_log_is_enabled(Trace, aot)) {
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
log_trace(cds)("Shared spaces preloaded: %s", klass->external_name()); log_trace(aot)("Shared spaces preloaded: %s", klass->external_name());
} }
if (klass->is_instance_klass()) { if (klass->is_instance_klass()) {
@ -498,7 +499,7 @@ void ClassListParser::check_class_name(const char* class_name) {
void ClassListParser::constant_pool_resolution_warning(const char* msg, ...) { void ClassListParser::constant_pool_resolution_warning(const char* msg, ...) {
va_list ap; va_list ap;
va_start(ap, msg); va_start(ap, msg);
LogTarget(Warning, cds, resolve) lt; LogTarget(Warning, aot, resolve) lt;
LogStream ls(lt); LogStream ls(lt);
print_diagnostic_info(&ls, msg, ap); print_diagnostic_info(&ls, msg, ap);
ls.print("Your classlist may be out of sync with the JDK or the application."); ls.print("Your classlist may be out of sync with the JDK or the application.");
@ -542,7 +543,7 @@ InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS
error("If source location is specified, id must be also specified"); error("If source location is specified, id must be also specified");
} }
if (strncmp(_class_name, "java/", 5) == 0) { if (strncmp(_class_name, "java/", 5) == 0) {
log_info(cds)("Prohibited package for non-bootstrap classes: %s.class from %s", aot_log_info(aot)("Prohibited package for non-bootstrap classes: %s.class from %s",
_class_name, _source); _class_name, _source);
THROW_NULL(vmSymbols::java_lang_ClassNotFoundException()); THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
} }
@ -648,7 +649,7 @@ void ClassListParser::resolve_indy(JavaThread* current, Symbol* class_name_symbo
if (message != nullptr) { if (message != nullptr) {
ex_msg = java_lang_String::as_utf8_string(message); ex_msg = java_lang_String::as_utf8_string(message);
} }
log_warning(cds)("resolve_indy for class %s has encountered exception: %s %s", aot_log_warning(aot)("resolve_indy for class %s has encountered exception: %s %s",
class_name_symbol->as_C_string(), class_name_symbol->as_C_string(),
PENDING_EXCEPTION->klass()->external_name(), PENDING_EXCEPTION->klass()->external_name(),
ex_msg); ex_msg);
@ -688,7 +689,7 @@ void ClassListParser::resolve_indy_impl(Symbol* class_name_symbol, TRAPS) {
BootstrapInfo bootstrap_specifier(pool, pool_index, indy_index); BootstrapInfo bootstrap_specifier(pool, pool_index, indy_index);
Handle bsm = bootstrap_specifier.resolve_bsm(CHECK); Handle bsm = bootstrap_specifier.resolve_bsm(CHECK);
if (!LambdaProxyClassDictionary::is_supported_invokedynamic(&bootstrap_specifier)) { if (!LambdaProxyClassDictionary::is_supported_invokedynamic(&bootstrap_specifier)) {
log_debug(cds, lambda)("is_supported_invokedynamic check failed for cp_index %d", pool_index); log_debug(aot, lambda)("is_supported_invokedynamic check failed for cp_index %d", pool_index);
continue; continue;
} }
bool matched = is_matching_cp_entry(pool, pool_index, CHECK); bool matched = is_matching_cp_entry(pool, pool_index, CHECK);
@ -711,7 +712,7 @@ void ClassListParser::resolve_indy_impl(Symbol* class_name_symbol, TRAPS) {
} }
if (!found) { if (!found) {
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
log_warning(cds)("No invoke dynamic constant pool entry can be found for class %s. The classlist is probably out-of-date.", aot_log_warning(aot)("No invoke dynamic constant pool entry can be found for class %s. The classlist is probably out-of-date.",
class_name_symbol->as_C_string()); class_name_symbol->as_C_string());
} }
} }
@ -773,7 +774,7 @@ Klass* ClassListParser::load_current_class(Symbol* class_name_symbol, TRAPS) {
error("Duplicated ID %d for class %s", id, _class_name); error("Duplicated ID %d for class %s", id, _class_name);
} }
if (id2klass_table()->maybe_grow()) { if (id2klass_table()->maybe_grow()) {
log_info(cds, hashtables)("Expanded id2klass_table() to %d", id2klass_table()->table_size()); log_info(aot, hashtables)("Expanded id2klass_table() to %d", id2klass_table()->table_size());
} }
} }
@ -877,9 +878,9 @@ void ClassListParser::parse_constant_pool_tag() {
} }
if (SystemDictionaryShared::should_be_excluded(ik)) { if (SystemDictionaryShared::should_be_excluded(ik)) {
if (log_is_enabled(Warning, cds, resolve)) { if (log_is_enabled(Warning, aot, resolve)) {
ResourceMark rm; ResourceMark rm;
log_warning(cds, resolve)("Cannot aot-resolve constants for %s because it is excluded", ik->external_name()); log_warning(aot, resolve)("Cannot aot-resolve constants for %s because it is excluded", ik->external_name());
} }
return; return;
} }

View File

@ -57,7 +57,7 @@ void ClassListWriter::write(const InstanceKlass* k, const ClassFileStream* cfs)
assert(is_enabled(), "must be"); assert(is_enabled(), "must be");
if (!ClassLoader::has_jrt_entry()) { if (!ClassLoader::has_jrt_entry()) {
log_warning(cds)("DumpLoadedClassList and CDS are not supported in exploded build"); log_warning(aot)("DumpLoadedClassList and CDS are not supported in exploded build");
DumpLoadedClassList = nullptr; DumpLoadedClassList = nullptr;
return; return;
} }

View File

@ -116,7 +116,7 @@ void CppVtableCloner<T>::initialize(const char* name, CppVtableInfo* info) {
// We already checked (and, if necessary, adjusted n) when the vtables were allocated, so we are // We already checked (and, if necessary, adjusted n) when the vtables were allocated, so we are
// safe to do memcpy. // safe to do memcpy.
log_debug(cds, vtables)("Copying %3d vtable entries for %s", n, name); log_debug(aot, vtables)("Copying %3d vtable entries for %s", n, name);
memcpy(dstvtable, srcvtable, sizeof(intptr_t) * n); memcpy(dstvtable, srcvtable, sizeof(intptr_t) * n);
} }
@ -166,7 +166,7 @@ int CppVtableCloner<T>::get_vtable_length(const char* name) {
break; break;
} }
} }
log_debug(cds, vtables)("Found %3d vtable entries for %s", vtable_len, name); log_debug(aot, vtables)("Found %3d vtable entries for %s", vtable_len, name);
return vtable_len; return vtable_len;
} }

View File

@ -71,9 +71,9 @@ void DumpTimeClassInfo::add_verification_constraint(InstanceKlass* k, Symbol* na
c |= from_is_object ? RunTimeClassInfo::FROM_IS_OBJECT : 0; c |= from_is_object ? RunTimeClassInfo::FROM_IS_OBJECT : 0;
vcflags_array->append(c); vcflags_array->append(c);
if (log_is_enabled(Trace, cds, verification)) { if (log_is_enabled(Trace, aot, verification)) {
ResourceMark rm; ResourceMark rm;
log_trace(cds, verification)("add_verification_constraint: %s: %s must be subclass of %s [0x%x] array len %d flags len %d", log_trace(aot, verification)("add_verification_constraint: %s: %s must be subclass of %s [0x%x] array len %d flags len %d",
k->external_name(), from_name->as_klass_external_name(), k->external_name(), from_name->as_klass_external_name(),
name->as_klass_external_name(), c, vc_array->length(), vcflags_array->length()); name->as_klass_external_name(), c, vc_array->length(), vcflags_array->length());
} }

View File

@ -25,6 +25,7 @@
#include "cds/aotArtifactFinder.hpp" #include "cds/aotArtifactFinder.hpp"
#include "cds/aotClassLinker.hpp" #include "cds/aotClassLinker.hpp"
#include "cds/aotClassLocation.hpp" #include "cds/aotClassLocation.hpp"
#include "cds/aotLogging.hpp"
#include "cds/archiveBuilder.hpp" #include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapWriter.hpp" #include "cds/archiveHeapWriter.hpp"
#include "cds/archiveUtils.inline.hpp" #include "cds/archiveUtils.inline.hpp"
@ -101,7 +102,7 @@ public:
// is caused by dynamic dumping. // is caused by dynamic dumping.
void verify_universe(const char* info) { void verify_universe(const char* info) {
if (VerifyBeforeExit) { if (VerifyBeforeExit) {
log_info(cds)("Verify %s", info); log_info(aot)("Verify %s", info);
// Among other things, this ensures that Eden top is correct. // Among other things, this ensures that Eden top is correct.
Universe::heap()->prepare_for_verify(); Universe::heap()->prepare_for_verify();
Universe::verify(info); Universe::verify(info);
@ -120,8 +121,8 @@ public:
return; return;
} }
log_info(cds,dynamic)("CDS dynamic dump: clinit = " JLONG_FORMAT "ms)", log_info(cds, dynamic)("CDS dynamic dump: clinit = " JLONG_FORMAT "ms)",
ClassLoader::class_init_time_ms()); ClassLoader::class_init_time_ms());
init_header(); init_header();
gather_source_objs(); gather_source_objs();
@ -136,7 +137,7 @@ public:
sort_methods(); sort_methods();
log_info(cds)("Make classes shareable"); log_info(aot)("Make classes shareable");
make_klasses_shareable(); make_klasses_shareable();
char* serialized_data; char* serialized_data;
@ -161,7 +162,7 @@ public:
} }
if (CDSConfig::is_dumping_lambdas_in_legacy_mode()) { if (CDSConfig::is_dumping_lambdas_in_legacy_mode()) {
log_info(cds)("Adjust lambda proxy class dictionary"); log_info(aot)("Adjust lambda proxy class dictionary");
LambdaProxyClassDictionary::adjust_dumptime_table(); LambdaProxyClassDictionary::adjust_dumptime_table();
} }
@ -378,7 +379,7 @@ void DynamicArchiveBuilder::gather_array_klasses() {
} }
} }
} }
log_debug(cds)("Total array klasses gathered for dynamic archive: %d", DynamicArchive::num_array_klasses()); log_debug(aot)("Total array klasses gathered for dynamic archive: %d", DynamicArchive::num_array_klasses());
} }
class VM_PopulateDynamicDumpSharedSpace: public VM_GC_Sync_Operation { class VM_PopulateDynamicDumpSharedSpace: public VM_GC_Sync_Operation {
@ -390,7 +391,7 @@ public:
void doit() { void doit() {
ResourceMark rm; ResourceMark rm;
if (AllowArchivingWithJavaAgent) { if (AllowArchivingWithJavaAgent) {
log_warning(cds)("This %s was created with AllowArchivingWithJavaAgent. It should be used " aot_log_warning(aot)("This %s was created with AllowArchivingWithJavaAgent. It should be used "
"for testing purposes only and should not be used in a production environment", "for testing purposes only and should not be used in a production environment",
CDSConfig::type_of_archive_being_loaded()); CDSConfig::type_of_archive_being_loaded());
} }
@ -445,7 +446,7 @@ void DynamicArchive::setup_array_klasses() {
ArrayKlass::cast(elm)->set_higher_dimension(oak); ArrayKlass::cast(elm)->set_higher_dimension(oak);
} }
} }
log_debug(cds)("Total array klasses read from dynamic archive: %d", _dynamic_archive_array_klasses->length()); log_debug(aot)("Total array klasses read from dynamic archive: %d", _dynamic_archive_array_klasses->length());
} }
} }
@ -501,8 +502,8 @@ void DynamicArchive::dump_at_exit(JavaThread* current) {
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
// One of the prepatory steps failed // One of the prepatory steps failed
oop ex = current->pending_exception(); oop ex = current->pending_exception();
log_error(cds)("Dynamic dump has failed"); aot_log_error(aot)("Dynamic dump has failed");
log_error(cds)("%s: %s", ex->klass()->external_name(), aot_log_error(aot)("%s: %s", ex->klass()->external_name(),
java_lang_String::as_utf8_string(java_lang_Throwable::message(ex))); java_lang_String::as_utf8_string(java_lang_Throwable::message(ex)));
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
CDSConfig::disable_dumping_dynamic_archive(); // Just for good measure CDSConfig::disable_dumping_dynamic_archive(); // Just for good measure
@ -526,14 +527,14 @@ bool DynamicArchive::validate(FileMapInfo* dynamic_info) {
// Check the header crc // Check the header crc
if (dynamic_header->base_header_crc() != base_info->crc()) { if (dynamic_header->base_header_crc() != base_info->crc()) {
log_warning(cds)("Dynamic archive cannot be used: static archive header checksum verification failed."); aot_log_warning(aot)("Dynamic archive cannot be used: static archive header checksum verification failed.");
return false; return false;
} }
// Check each space's crc // Check each space's crc
for (int i = 0; i < MetaspaceShared::n_regions; i++) { for (int i = 0; i < MetaspaceShared::n_regions; i++) {
if (dynamic_header->base_region_crc(i) != base_info->region_crc(i)) { if (dynamic_header->base_region_crc(i) != base_info->region_crc(i)) {
log_warning(cds)("Dynamic archive cannot be used: static archive region #%d checksum verification failed.", i); aot_log_warning(aot)("Dynamic archive cannot be used: static archive region #%d checksum verification failed.", i);
return false; return false;
} }
} }

View File

@ -738,7 +738,7 @@ void FileMapInfo::open_as_output() {
log_info(aot)("Writing binary AOTConfiguration file: %s", _full_path); log_info(aot)("Writing binary AOTConfiguration file: %s", _full_path);
} }
} else { } else {
log_info(cds)("Dumping shared data to file: %s", _full_path); aot_log_info(aot)("Dumping shared data to file: %s", _full_path);
} }
#ifdef _WINDOWS // On Windows, need WRITE permission to remove the file. #ifdef _WINDOWS // On Windows, need WRITE permission to remove the file.
@ -1541,11 +1541,20 @@ bool FileMapInfo::can_use_heap_region() {
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
}; };
LogTarget(Info, cds) lt; if (CDSConfig::new_aot_flags_used()) {
if (lt.is_enabled()) { LogTarget(Info, aot) lt;
LogStream ls(lt); if (lt.is_enabled()) {
ls.print_raw(ss.base()); LogStream ls(lt);
header()->print(&ls); ls.print_raw(ss.base());
header()->print(&ls);
}
} else {
LogTarget(Info, cds) lt;
if (lt.is_enabled()) {
LogStream ls(lt);
ls.print_raw(ss.base());
header()->print(&ls);
}
} }
assert(false, "%s", ss.base()); assert(false, "%s", ss.base());
} }

View File

@ -208,7 +208,7 @@ void FinalImageRecipes::apply_recipes(TRAPS) {
log_error(aot)("%s: %s", PENDING_EXCEPTION->klass()->external_name(), log_error(aot)("%s: %s", PENDING_EXCEPTION->klass()->external_name(),
java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION))); java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION)));
log_error(aot)("Please check if your VM command-line is the same as in the training run"); log_error(aot)("Please check if your VM command-line is the same as in the training run");
MetaspaceShared::unrecoverable_writing_error("Unexpected exception, use -Xlog:cds,exceptions=trace for detail"); MetaspaceShared::unrecoverable_writing_error("Unexpected exception, use -Xlog:aot,exceptions=trace for detail");
} }
} }

View File

@ -150,7 +150,7 @@ void LambdaFormInvokers::regenerate_holder_classes(TRAPS) {
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
if (!PENDING_EXCEPTION->is_a(vmClasses::OutOfMemoryError_klass())) { if (!PENDING_EXCEPTION->is_a(vmClasses::OutOfMemoryError_klass())) {
log_error(cds)("%s: %s", PENDING_EXCEPTION->klass()->external_name(), log_error(aot)("%s: %s", PENDING_EXCEPTION->klass()->external_name(),
java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION))); java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION)));
if (CDSConfig::is_dumping_static_archive()) { if (CDSConfig::is_dumping_static_archive()) {
log_error(aot)("Failed to generate LambdaForm holder classes. Is your classlist out of date?"); log_error(aot)("Failed to generate LambdaForm holder classes. Is your classlist out of date?");

View File

@ -99,7 +99,7 @@ void LambdaProxyClassDictionary::dumptime_init() {
} }
bool LambdaProxyClassDictionary::is_supported_invokedynamic(BootstrapInfo* bsi) { bool LambdaProxyClassDictionary::is_supported_invokedynamic(BootstrapInfo* bsi) {
LogTarget(Debug, cds, lambda) log; LogTarget(Debug, aot, lambda) log;
if (bsi->arg_values() == nullptr || !bsi->arg_values()->is_objArray()) { if (bsi->arg_values() == nullptr || !bsi->arg_values()->is_objArray()) {
if (log.is_enabled()) { if (log.is_enabled()) {
LogStream log_stream(log); LogStream log_stream(log);
@ -268,9 +268,9 @@ InstanceKlass* LambdaProxyClassDictionary::find_lambda_proxy_class(InstanceKlass
const RunTimeLambdaProxyClassInfo* info = _runtime_static_table.lookup(&key, hash, 0); const RunTimeLambdaProxyClassInfo* info = _runtime_static_table.lookup(&key, hash, 0);
InstanceKlass* proxy_klass = find_lambda_proxy_class(info); InstanceKlass* proxy_klass = find_lambda_proxy_class(info);
if (proxy_klass == nullptr) { if (proxy_klass == nullptr) {
if (info != nullptr && log_is_enabled(Debug, cds)) { if (info != nullptr && log_is_enabled(Debug, aot)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds)("Used all static archived lambda proxy classes for: %s %s%s", log_debug(aot)("Used all static archived lambda proxy classes for: %s %s%s",
caller_ik->external_name(), invoked_name->as_C_string(), invoked_type->as_C_string()); caller_ik->external_name(), invoked_name->as_C_string(), invoked_type->as_C_string());
} }
} else { } else {
@ -281,9 +281,9 @@ InstanceKlass* LambdaProxyClassDictionary::find_lambda_proxy_class(InstanceKlass
info = _runtime_dynamic_table.lookup(&key, hash, 0); info = _runtime_dynamic_table.lookup(&key, hash, 0);
proxy_klass = find_lambda_proxy_class(info); proxy_klass = find_lambda_proxy_class(info);
if (proxy_klass == nullptr) { if (proxy_klass == nullptr) {
if (info != nullptr && log_is_enabled(Debug, cds)) { if (info != nullptr && log_is_enabled(Debug, aot)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds)("Used all dynamic archived lambda proxy classes for: %s %s%s", log_debug(aot)("Used all dynamic archived lambda proxy classes for: %s %s%s",
caller_ik->external_name(), invoked_name->as_C_string(), invoked_type->as_C_string()); caller_ik->external_name(), invoked_name->as_C_string(), invoked_type->as_C_string());
} }
} }
@ -306,9 +306,9 @@ InstanceKlass* LambdaProxyClassDictionary::find_lambda_proxy_class(const RunTime
prev_klass->set_next_link(nullptr); prev_klass->set_next_link(nullptr);
proxy_klass = curr_klass; proxy_klass = curr_klass;
proxy_klass->clear_lambda_proxy_is_available(); proxy_klass->clear_lambda_proxy_is_available();
if (log_is_enabled(Debug, cds)) { if (log_is_enabled(Debug, aot)) {
ResourceMark rm; ResourceMark rm;
log_debug(cds)("Loaded lambda proxy: %s ", proxy_klass->external_name()); log_debug(aot)("Loaded lambda proxy: %s ", proxy_klass->external_name());
} }
} }
} }
@ -413,7 +413,7 @@ public:
// In static dump, info._proxy_klasses->at(0) is already relocated to point to the archived class // In static dump, info._proxy_klasses->at(0) is already relocated to point to the archived class
// (not the original class). // (not the original class).
ResourceMark rm; ResourceMark rm;
log_info(cds,dynamic)("Archiving hidden %s", info._proxy_klasses->at(0)->external_name()); log_info(cds, dynamic)("Archiving hidden %s", info._proxy_klasses->at(0)->external_name());
size_t byte_size = sizeof(RunTimeLambdaProxyClassInfo); size_t byte_size = sizeof(RunTimeLambdaProxyClassInfo);
RunTimeLambdaProxyClassInfo* runtime_info = RunTimeLambdaProxyClassInfo* runtime_info =
(RunTimeLambdaProxyClassInfo*)ArchiveBuilder::ro_region_alloc(byte_size); (RunTimeLambdaProxyClassInfo*)ArchiveBuilder::ro_region_alloc(byte_size);

View File

@ -801,7 +801,8 @@ void MetaspaceShared::preload_and_dump(TRAPS) {
} else { } else {
aot_log_error(aot)("%s: %s", PENDING_EXCEPTION->klass()->external_name(), aot_log_error(aot)("%s: %s", PENDING_EXCEPTION->klass()->external_name(),
java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION))); java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION)));
MetaspaceShared::writing_error("Unexpected exception, use -Xlog:cds,exceptions=trace for detail"); MetaspaceShared::writing_error(err_msg("Unexpected exception, use -Xlog:aot%s,exceptions=trace for detail",
CDSConfig::new_aot_flags_used() ? "" : ",cds"));
} }
} }

View File

@ -57,7 +57,7 @@ void RegeneratedClasses::add_class(InstanceKlass* orig_klass, InstanceKlass* reg
Method* regen_m = regen_klass->find_method(orig_m->name(), orig_m->signature()); Method* regen_m = regen_klass->find_method(orig_m->name(), orig_m->signature());
if (regen_m == nullptr) { if (regen_m == nullptr) {
ResourceMark rm; ResourceMark rm;
log_warning(cds)("Method in original class is missing from regenerated class: " INTPTR_FORMAT " %s", log_warning(aot)("Method in original class is missing from regenerated class: " INTPTR_FORMAT " %s",
p2i(orig_m), orig_m->external_name()); p2i(orig_m), orig_m->external_name());
} else { } else {
_renegerated_objs->put((address)orig_m, (address)regen_m); _renegerated_objs->put((address)orig_m, (address)regen_m);

View File

@ -22,6 +22,7 @@
* *
*/ */
#include "cds/aotLogging.hpp"
#include "cds/cdsConfig.hpp" #include "cds/cdsConfig.hpp"
#include "cds/serializeClosure.hpp" #include "cds/serializeClosure.hpp"
#include "classfile/classLoaderData.inline.hpp" #include "classfile/classLoaderData.inline.hpp"
@ -192,7 +193,7 @@ void ClassLoaderDataShared::serialize(SerializeClosure* f) {
// Must be done before ClassLoader::create_javabase() // Must be done before ClassLoader::create_javabase()
_archived_boot_loader_data.restore(null_class_loader_data(), true, false); _archived_boot_loader_data.restore(null_class_loader_data(), true, false);
ModuleEntryTable::set_javabase_moduleEntry(_archived_javabase_moduleEntry); ModuleEntryTable::set_javabase_moduleEntry(_archived_javabase_moduleEntry);
log_info(cds)("use_full_module_graph = true; java.base = " INTPTR_FORMAT, aot_log_info(aot)("use_full_module_graph = true; java.base = " INTPTR_FORMAT,
p2i(_archived_javabase_moduleEntry)); p2i(_archived_javabase_moduleEntry));
} }
} }

View File

@ -105,7 +105,7 @@ void ClassLoaderExt::record_result_for_builtin_loader(s2 classpath_index, Instan
// which requires all the boot classes to be from known locations. This is an // which requires all the boot classes to be from known locations. This is an
// uncommon scenario (even in test cases). Let's simply disable heap object archiving. // uncommon scenario (even in test cases). Let's simply disable heap object archiving.
ResourceMark rm; ResourceMark rm;
log_warning(cds)("CDS heap objects cannot be written because class %s maybe modified by ClassFileLoadHook.", log_warning(aot)("heap objects cannot be written because class %s maybe modified by ClassFileLoadHook.",
result->external_name()); result->external_name());
CDSConfig::disable_heap_dumping(); CDSConfig::disable_heap_dumping();
} }

View File

@ -155,7 +155,7 @@ void CompactHashtableWriter::dump(SimpleCompactHashtable *cht, const char* table
cht->init(base_address, _num_entries_written, _num_buckets, cht->init(base_address, _num_entries_written, _num_buckets,
_compact_buckets->data(), _compact_entries->data()); _compact_buckets->data(), _compact_entries->data());
LogMessage(cds, hashtables) msg; LogMessage(aot, hashtables) msg;
if (msg.is_info()) { if (msg.is_info()) {
double avg_cost = 0.0; double avg_cost = 0.0;
if (_num_entries_written > 0) { if (_num_entries_written > 0) {

View File

@ -427,9 +427,9 @@ ModuleEntry* ModuleEntry::allocate_archived_entry() const {
// For verify_archived_module_entries() // For verify_archived_module_entries()
DEBUG_ONLY(_num_inited_module_entries++); DEBUG_ONLY(_num_inited_module_entries++);
if (log_is_enabled(Info, cds, module)) { if (log_is_enabled(Info, aot, module)) {
ResourceMark rm; ResourceMark rm;
LogStream ls(Log(cds, module)::info()); LogStream ls(Log(aot, module)::info());
ls.print("Stored in archive: "); ls.print("Stored in archive: ");
archived_entry->print(&ls); archived_entry->print(&ls);
} }
@ -535,9 +535,9 @@ void ModuleEntry::restore_archived_oops(ClassLoaderData* loader_data) {
assert(java_lang_Module::loader(module_handle()) == loader_data->class_loader(), assert(java_lang_Module::loader(module_handle()) == loader_data->class_loader(),
"must be set in dump time"); "must be set in dump time");
if (log_is_enabled(Info, cds, module)) { if (log_is_enabled(Info, aot, module)) {
ResourceMark rm; ResourceMark rm;
LogStream ls(Log(cds, module)::info()); LogStream ls(Log(aot, module)::info());
ls.print("Restored from archive: "); ls.print("Restored from archive: ");
print(&ls); print(&ls);
} }

View File

@ -22,6 +22,7 @@
* *
*/ */
#include "cds/aotLogging.hpp"
#include "cds/archiveBuilder.hpp" #include "cds/archiveBuilder.hpp"
#include "cds/cdsConfig.hpp" #include "cds/cdsConfig.hpp"
#include "cds/metaspaceShared.hpp" #include "cds/metaspaceShared.hpp"
@ -489,13 +490,13 @@ void Modules::check_archived_module_oop(oop orig_module_obj) {
// java.lang.Module::ALL_UNNAMED_MODULE // java.lang.Module::ALL_UNNAMED_MODULE
// java.lang.Module::EVERYONE_MODULE // java.lang.Module::EVERYONE_MODULE
// jdk.internal.loader.ClassLoaders$BootClassLoader::unnamedModule // jdk.internal.loader.ClassLoaders$BootClassLoader::unnamedModule
log_info(cds, module)("Archived java.lang.Module oop " PTR_FORMAT " with no ModuleEntry*", p2i(orig_module_obj)); log_info(aot, module)("Archived java.lang.Module oop " PTR_FORMAT " with no ModuleEntry*", p2i(orig_module_obj));
assert(java_lang_Module::name(orig_module_obj) == nullptr, "must be unnamed"); assert(java_lang_Module::name(orig_module_obj) == nullptr, "must be unnamed");
} else { } else {
// This java.lang.Module oop has an ModuleEntry*. Check if the latter is archived. // This java.lang.Module oop has an ModuleEntry*. Check if the latter is archived.
if (log_is_enabled(Info, cds, module)) { if (log_is_enabled(Info, aot, module)) {
ResourceMark rm; ResourceMark rm;
LogStream ls(Log(cds, module)::info()); LogStream ls(Log(aot, module)::info());
ls.print("Archived java.lang.Module oop " PTR_FORMAT " for ", p2i(orig_module_obj)); ls.print("Archived java.lang.Module oop " PTR_FORMAT " for ", p2i(orig_module_obj));
orig_module_ent->print(&ls); orig_module_ent->print(&ls);
} }
@ -599,7 +600,7 @@ Modules::ArchivedProperty& Modules::archived_prop(size_t i) {
void Modules::ArchivedProperty::runtime_check() const { void Modules::ArchivedProperty::runtime_check() const {
ResourceMark rm; ResourceMark rm;
const char* runtime_value = get_flattened_value(); const char* runtime_value = get_flattened_value();
log_info(cds)("archived module property %s: %s", _prop, aot_log_info(aot)("archived module property %s: %s", _prop,
_archived_value != nullptr ? _archived_value : "(null)"); _archived_value != nullptr ? _archived_value : "(null)");
bool disable = false; bool disable = false;
@ -693,8 +694,8 @@ void Modules::serialize_archived_module_info(SerializeClosure* soc) {
archived_prop(i).serialize(soc); archived_prop(i).serialize(soc);
} }
if (soc->reading()) { if (soc->reading()) {
log_info(cds)("optimized module handling: %s", CDSConfig::is_using_optimized_module_handling() ? "enabled" : "disabled"); aot_log_info(aot)("optimized module handling: %s", CDSConfig::is_using_optimized_module_handling() ? "enabled" : "disabled");
log_info(cds)("full module graph: %s", CDSConfig::is_using_full_module_graph() ? "enabled" : "disabled"); aot_log_info(aot)("full module graph: %s", CDSConfig::is_using_full_module_graph() ? "enabled" : "disabled");
} }
} }

View File

@ -955,13 +955,13 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
int total = (int)_items_count; int total = (int)_items_count;
size_t single_array_size = objArrayOopDesc::object_size(total); size_t single_array_size = objArrayOopDesc::object_size(total);
log_info(cds)("allocated string table for %d strings", total); log_info(aot)("allocated string table for %d strings", total);
if (!ArchiveHeapWriter::is_too_large_to_archive(single_array_size)) { if (!ArchiveHeapWriter::is_too_large_to_archive(single_array_size)) {
// The entire table can fit in a single array // The entire table can fit in a single array
objArrayOop array = oopFactory::new_objArray(vmClasses::Object_klass(), total, CHECK); objArrayOop array = oopFactory::new_objArray(vmClasses::Object_klass(), total, CHECK);
_shared_strings_array = OopHandle(Universe::vm_global(), array); _shared_strings_array = OopHandle(Universe::vm_global(), array);
log_info(cds)("string table array (single level) length = %d", total); log_info(aot)("string table array (single level) length = %d", total);
} else { } else {
// Split the table in two levels of arrays. // Split the table in two levels of arrays.
int primary_array_length = (total + _secondary_array_max_length - 1) / _secondary_array_max_length; int primary_array_length = (total + _secondary_array_max_length - 1) / _secondary_array_max_length;
@ -972,7 +972,7 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
// This can only happen if you have an extremely large number of classes that // This can only happen if you have an extremely large number of classes that
// refer to more than 16384 * 16384 = 26M interned strings! Not a practical concern // refer to more than 16384 * 16384 = 26M interned strings! Not a practical concern
// but bail out for safety. // but bail out for safety.
log_error(cds)("Too many strings to be archived: %zu", _items_count); log_error(aot)("Too many strings to be archived: %zu", _items_count);
MetaspaceShared::unrecoverable_writing_error(); MetaspaceShared::unrecoverable_writing_error();
} }
@ -980,7 +980,7 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
objArrayHandle primaryHandle(THREAD, primary); objArrayHandle primaryHandle(THREAD, primary);
_shared_strings_array = OopHandle(Universe::vm_global(), primary); _shared_strings_array = OopHandle(Universe::vm_global(), primary);
log_info(cds)("string table array (primary) length = %d", primary_array_length); log_info(aot)("string table array (primary) length = %d", primary_array_length);
for (int i = 0; i < primary_array_length; i++) { for (int i = 0; i < primary_array_length; i++) {
int len; int len;
if (total > _secondary_array_max_length) { if (total > _secondary_array_max_length) {
@ -993,7 +993,7 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
objArrayOop secondary = oopFactory::new_objArray(vmClasses::Object_klass(), len, CHECK); objArrayOop secondary = oopFactory::new_objArray(vmClasses::Object_klass(), len, CHECK);
primaryHandle()->obj_at_put(i, secondary); primaryHandle()->obj_at_put(i, secondary);
log_info(cds)("string table array (secondary)[%d] length = %d", i, len); log_info(aot)("string table array (secondary)[%d] length = %d", i, len);
assert(!ArchiveHeapWriter::is_too_large_to_archive(secondary), "sanity"); assert(!ArchiveHeapWriter::is_too_large_to_archive(secondary), "sanity");
} }
@ -1064,7 +1064,7 @@ oop StringTable::init_shared_strings_array() {
}; };
_local_table->do_safepoint_scan(copy_into_array); _local_table->do_safepoint_scan(copy_into_array);
log_info(cds)("Archived %d interned strings", index); log_info(aot)("Archived %d interned strings", index);
return array; return array;
}; };

View File

@ -24,6 +24,7 @@
#include "cds/aotClassFilter.hpp" #include "cds/aotClassFilter.hpp"
#include "cds/aotClassLocation.hpp" #include "cds/aotClassLocation.hpp"
#include "cds/aotLogging.hpp"
#include "cds/archiveBuilder.hpp" #include "cds/archiveBuilder.hpp"
#include "cds/archiveUtils.hpp" #include "cds/archiveUtils.hpp"
#include "cds/cdsConfig.hpp" #include "cds/cdsConfig.hpp"
@ -229,7 +230,7 @@ bool SystemDictionaryShared::check_for_exclusion(InstanceKlass* k, DumpTimeClass
// Returns true so the caller can do: return warn_excluded("....."); // Returns true so the caller can do: return warn_excluded(".....");
bool SystemDictionaryShared::warn_excluded(InstanceKlass* k, const char* reason) { bool SystemDictionaryShared::warn_excluded(InstanceKlass* k, const char* reason) {
ResourceMark rm; ResourceMark rm;
log_warning(cds)("Skipping %s: %s", k->name()->as_C_string(), reason); aot_log_warning(aot)("Skipping %s: %s", k->name()->as_C_string(), reason);
return true; return true;
} }
@ -273,7 +274,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
k->set_shared_classpath_index(0); k->set_shared_classpath_index(0);
} else { } else {
ResourceMark rm; ResourceMark rm;
log_info(cds)("Skipping %s because it is dynamically generated", k->name()->as_C_string()); aot_log_info(aot)("Skipping %s because it is dynamically generated", k->name()->as_C_string());
return true; // exclude without warning return true; // exclude without warning
} }
} else { } else {
@ -325,14 +326,14 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
if (UnregisteredClasses::check_for_exclusion(k)) { if (UnregisteredClasses::check_for_exclusion(k)) {
ResourceMark rm; ResourceMark rm;
log_info(cds)("Skipping %s: used only when dumping CDS archive", k->name()->as_C_string()); aot_log_info(aot)("Skipping %s: used only when dumping CDS archive", k->name()->as_C_string());
return true; return true;
} }
InstanceKlass* super = k->java_super(); InstanceKlass* super = k->java_super();
if (super != nullptr && check_for_exclusion(super, nullptr)) { if (super != nullptr && check_for_exclusion(super, nullptr)) {
ResourceMark rm; ResourceMark rm;
log_warning(cds)("Skipping %s: super class %s is excluded", k->name()->as_C_string(), super->name()->as_C_string()); aot_log_warning(aot)("Skipping %s: super class %s is excluded", k->name()->as_C_string(), super->name()->as_C_string());
return true; return true;
} }
@ -342,7 +343,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
InstanceKlass* intf = interfaces->at(i); InstanceKlass* intf = interfaces->at(i);
if (check_for_exclusion(intf, nullptr)) { if (check_for_exclusion(intf, nullptr)) {
ResourceMark rm; ResourceMark rm;
log_warning(cds)("Skipping %s: interface %s is excluded", k->name()->as_C_string(), intf->name()->as_C_string()); aot_log_warning(aot)("Skipping %s: interface %s is excluded", k->name()->as_C_string(), intf->name()->as_C_string());
return true; return true;
} }
} }
@ -824,9 +825,9 @@ void SystemDictionaryShared::check_verification_constraints(InstanceKlass* klass
Symbol* name = vc->name(); Symbol* name = vc->name();
Symbol* from_name = vc->from_name(); Symbol* from_name = vc->from_name();
if (log_is_enabled(Trace, cds, verification)) { if (log_is_enabled(Trace, aot, verification)) {
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
log_trace(cds, verification)("check_verification_constraint: %s: %s must be subclass of %s [0x%x]", log_trace(aot, verification)("check_verification_constraint: %s: %s must be subclass of %s [0x%x]",
klass->external_name(), from_name->as_klass_external_name(), klass->external_name(), from_name->as_klass_external_name(),
name->as_klass_external_name(), record->verifier_constraint_flag(i)); name->as_klass_external_name(), record->verifier_constraint_flag(i));
} }
@ -1042,9 +1043,9 @@ public:
} else { } else {
_writer->add(hash, delta); _writer->add(hash, delta);
} }
if (log_is_enabled(Trace, cds, hashtables)) { if (log_is_enabled(Trace, aot, hashtables)) {
ResourceMark rm; ResourceMark rm;
log_trace(cds,hashtables)("%s dictionary: %s", (_is_builtin ? "builtin" : "unregistered"), info._klass->external_name()); log_trace(aot, hashtables)("%s dictionary: %s", (_is_builtin ? "builtin" : "unregistered"), info._klass->external_name());
} }
// Save this for quick runtime lookup of InstanceKlass* -> RunTimeClassInfo* // Save this for quick runtime lookup of InstanceKlass* -> RunTimeClassInfo*

View File

@ -917,7 +917,7 @@ void InterpreterRuntime::cds_resolve_invoke(Bytecodes::Code bytecode, int method
// Can't link it here since there are no guarantees it'll be prelinked on the next run. // Can't link it here since there are no guarantees it'll be prelinked on the next run.
ResourceMark rm; ResourceMark rm;
InstanceKlass* resolved_iklass = InstanceKlass::cast(link_info.resolved_klass()); InstanceKlass* resolved_iklass = InstanceKlass::cast(link_info.resolved_klass());
log_info(cds, resolve)("Not resolved: class not linked: %s %s %s", log_info(aot, resolve)("Not resolved: class not linked: %s %s %s",
resolved_iklass->is_shared() ? "is_shared" : "", resolved_iklass->is_shared() ? "is_shared" : "",
resolved_iklass->init_state_name(), resolved_iklass->init_state_name(),
resolved_iklass->external_name()); resolved_iklass->external_name());

View File

@ -91,7 +91,7 @@ bool UniqueMetaspaceClosure::do_ref(MetaspaceClosure::Ref* ref, bool read_only)
return false; // Already visited: no need to iterate embedded pointers. return false; // Already visited: no need to iterate embedded pointers.
} else { } else {
if (_has_been_visited.maybe_grow()) { if (_has_been_visited.maybe_grow()) {
log_info(cds, hashtables)("Expanded _has_been_visited table to %d", _has_been_visited.table_size()); log_info(aot, hashtables)("Expanded _has_been_visited table to %d", _has_been_visited.table_size());
} }
return do_unique_ref(ref, read_only); return do_unique_ref(ref, read_only);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -200,11 +200,11 @@ private:
virtual void metaspace_pointers_do(MetaspaceClosure *it) const { virtual void metaspace_pointers_do(MetaspaceClosure *it) const {
Array<T>* array = ArrayRef<T>::dereference(); Array<T>* array = ArrayRef<T>::dereference();
log_trace(cds)("Iter(OtherArray): %p [%d]", array, array->length()); log_trace(aot)("Iter(OtherArray): %p [%d]", array, array->length());
} }
virtual void metaspace_pointers_do_at(MetaspaceClosure *it, address new_loc) const { virtual void metaspace_pointers_do_at(MetaspaceClosure *it, address new_loc) const {
Array<T>* array = (Array<T>*)new_loc; Array<T>* array = (Array<T>*)new_loc;
log_trace(cds)("Iter(OtherArray): %p [%d]", array, array->length()); log_trace(aot)("Iter(OtherArray): %p [%d]", array, array->length());
} }
}; };
@ -222,7 +222,7 @@ private:
} }
private: private:
void metaspace_pointers_do_at_impl(MetaspaceClosure *it, Array<T>* array) const { void metaspace_pointers_do_at_impl(MetaspaceClosure *it, Array<T>* array) const {
log_trace(cds)("Iter(MSOArray): %p [%d]", array, array->length()); log_trace(aot)("Iter(MSOArray): %p [%d]", array, array->length());
for (int i = 0; i < array->length(); i++) { for (int i = 0; i < array->length(); i++) {
T* elm = array->adr_at(i); T* elm = array->adr_at(i);
elm->metaspace_pointers_do(it); elm->metaspace_pointers_do(it);
@ -244,7 +244,7 @@ private:
} }
private: private:
void metaspace_pointers_do_at_impl(MetaspaceClosure *it, Array<T*>* array) const { void metaspace_pointers_do_at_impl(MetaspaceClosure *it, Array<T*>* array) const {
log_trace(cds)("Iter(MSOPointerArray): %p [%d]", array, array->length()); log_trace(aot)("Iter(MSOPointerArray): %p [%d]", array, array->length());
for (int i = 0; i < array->length(); i++) { for (int i = 0; i < array->length(); i++) {
T** mpp = array->adr_at(i); T** mpp = array->adr_at(i);
it->push(mpp); it->push(mpp);

View File

@ -76,7 +76,7 @@ typeArrayOop Annotations::make_java_array(AnnotationArray* annotations, TRAPS) {
} }
void Annotations::metaspace_pointers_do(MetaspaceClosure* it) { void Annotations::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(Annotations): %p", this); log_trace(aot)("Iter(Annotations): %p", this);
it->push(&_class_annotations); it->push(&_class_annotations);
it->push(&_fields_annotations); it->push(&_fields_annotations);
it->push(&_class_type_annotations); it->push(&_class_type_annotations);

View File

@ -207,7 +207,7 @@ void ArrayKlass::metaspace_pointers_do(MetaspaceClosure* it) {
Klass::metaspace_pointers_do(it); Klass::metaspace_pointers_do(it);
ResourceMark rm; ResourceMark rm;
log_trace(cds)("Iter(ArrayKlass): %p (%s)", this, external_name()); log_trace(aot)("Iter(ArrayKlass): %p (%s)", this, external_name());
// need to cast away volatile // need to cast away volatile
it->push((Klass**)&_higher_dimension); it->push((Klass**)&_higher_dimension);

View File

@ -417,7 +417,7 @@ void ConstMethod::copy_annotations_from(ClassLoaderData* loader_data, ConstMetho
} }
void ConstMethod::metaspace_pointers_do(MetaspaceClosure* it) { void ConstMethod::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(ConstMethod): %p", this); log_trace(aot)("Iter(ConstMethod): %p", this);
if (!method()->method_holder()->is_rewritten()) { if (!method()->method_holder()->is_rewritten()) {
it->push(&_constants, MetaspaceClosure::_writable); it->push(&_constants, MetaspaceClosure::_writable);

View File

@ -149,7 +149,7 @@ void ConstantPool::release_C_heap_structures() {
} }
void ConstantPool::metaspace_pointers_do(MetaspaceClosure* it) { void ConstantPool::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(ConstantPool): %p", this); log_trace(aot)("Iter(ConstantPool): %p", this);
it->push(&_tags, MetaspaceClosure::_writable); it->push(&_tags, MetaspaceClosure::_writable);
it->push(&_cache); it->push(&_cache);
@ -501,7 +501,7 @@ static const char* get_type(Klass* k) {
void ConstantPool::remove_unshareable_entries() { void ConstantPool::remove_unshareable_entries() {
ResourceMark rm; ResourceMark rm;
log_info(cds, resolve)("Archiving CP entries for %s", pool_holder()->name()->as_C_string()); log_info(aot, resolve)("Archiving CP entries for %s", pool_holder()->name()->as_C_string());
for (int cp_index = 1; cp_index < length(); cp_index++) { // cp_index 0 is unused for (int cp_index = 1; cp_index < length(); cp_index++) { // cp_index 0 is unused
int cp_tag = tag_at(cp_index).value(); int cp_tag = tag_at(cp_index).value();
switch (cp_tag) { switch (cp_tag) {
@ -560,7 +560,7 @@ void ConstantPool::remove_resolved_klass_if_non_deterministic(int cp_index) {
resolved_klasses()->at_put(resolved_klass_index, nullptr); resolved_klasses()->at_put(resolved_klass_index, nullptr);
} }
LogStreamHandle(Trace, cds, resolve) log; LogStreamHandle(Trace, aot, resolve) log;
if (log.is_enabled()) { if (log.is_enabled()) {
ResourceMark rm; ResourceMark rm;
log.print("%s klass CP entry [%3d]: %s %s", log.print("%s klass CP entry [%3d]: %s %s",

View File

@ -437,7 +437,7 @@ void ConstantPoolCache::remove_resolved_field_entries_if_non_deterministic() {
rfi->remove_unshareable_info(); rfi->remove_unshareable_info();
} }
if (resolved) { if (resolved) {
LogStreamHandle(Trace, cds, resolve) log; LogStreamHandle(Trace, aot, resolve) log;
if (log.is_enabled()) { if (log.is_enabled()) {
ResourceMark rm; ResourceMark rm;
int klass_cp_index = cp->uncached_klass_ref_index_at(cp_index); int klass_cp_index = cp->uncached_klass_ref_index_at(cp_index);
@ -477,7 +477,7 @@ void ConstantPoolCache::remove_resolved_method_entries_if_non_deterministic() {
rme->remove_unshareable_info(); rme->remove_unshareable_info();
} }
if (resolved) { if (resolved) {
LogStreamHandle(Trace, cds, resolve) log; LogStreamHandle(Trace, aot, resolve) log;
if (log.is_enabled()) { if (log.is_enabled()) {
ResourceMark rm; ResourceMark rm;
int klass_cp_index = cp->uncached_klass_ref_index_at(cp_index); int klass_cp_index = cp->uncached_klass_ref_index_at(cp_index);
@ -517,7 +517,7 @@ void ConstantPoolCache::remove_resolved_indy_entries_if_non_deterministic() {
rei->remove_unshareable_info(); rei->remove_unshareable_info();
} }
if (resolved) { if (resolved) {
LogStreamHandle(Trace, cds, resolve) log; LogStreamHandle(Trace, aot, resolve) log;
if (log.is_enabled()) { if (log.is_enabled()) {
ResourceMark rm; ResourceMark rm;
int bsm = cp->bootstrap_method_ref_index_at(cp_index); int bsm = cp->bootstrap_method_ref_index_at(cp_index);
@ -705,7 +705,7 @@ void ConstantPoolCache::dump_cache() {
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI
void ConstantPoolCache::metaspace_pointers_do(MetaspaceClosure* it) { void ConstantPoolCache::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(ConstantPoolCache): %p", this); log_trace(aot)("Iter(ConstantPoolCache): %p", this);
it->push(&_constant_pool); it->push(&_constant_pool);
it->push(&_reference_map); it->push(&_reference_map);
if (_resolved_indy_entries != nullptr) { if (_resolved_indy_entries != nullptr) {

View File

@ -866,9 +866,9 @@ void InstanceKlass::initialize_with_aot_initialized_mirror(TRAPS) {
initialize(CHECK); initialize(CHECK);
return; return;
} }
if (log_is_enabled(Info, cds, init)) { if (log_is_enabled(Info, aot, init)) {
ResourceMark rm; ResourceMark rm;
log_info(cds, init)("%s (aot-inited)", external_name()); log_info(aot, init)("%s (aot-inited)", external_name());
} }
link_class(CHECK); link_class(CHECK);
@ -2567,9 +2567,9 @@ void InstanceKlass::clean_method_data() {
void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) { void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) {
Klass::metaspace_pointers_do(it); Klass::metaspace_pointers_do(it);
if (log_is_enabled(Trace, cds)) { if (log_is_enabled(Trace, aot)) {
ResourceMark rm; ResourceMark rm;
log_trace(cds)("Iter(InstanceKlass): %p (%s)", this, external_name()); log_trace(aot)("Iter(InstanceKlass): %p (%s)", this, external_name());
} }
it->push(&_annotations); it->push(&_annotations);

View File

@ -761,9 +761,9 @@ void Klass::clean_weak_klass_links(bool unloading_occurred, bool clean_alive_kla
} }
void Klass::metaspace_pointers_do(MetaspaceClosure* it) { void Klass::metaspace_pointers_do(MetaspaceClosure* it) {
if (log_is_enabled(Trace, cds)) { if (log_is_enabled(Trace, aot)) {
ResourceMark rm; ResourceMark rm;
log_trace(cds)("Iter(Klass): %p (%s)", this, external_name()); log_trace(aot)("Iter(Klass): %p (%s)", this, external_name());
} }
it->push(&_name); it->push(&_name);

View File

@ -386,7 +386,7 @@ Symbol* Method::klass_name() const {
} }
void Method::metaspace_pointers_do(MetaspaceClosure* it) { void Method::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(Method): %p", this); log_trace(aot)("Iter(Method): %p", this);
if (!method_holder()->is_rewritten()) { if (!method_holder()->is_rewritten()) {
it->push(&_constMethod, MetaspaceClosure::_writable); it->push(&_constMethod, MetaspaceClosure::_writable);

View File

@ -1725,7 +1725,7 @@ bool MethodData::profile_parameters_for_method(const methodHandle& m) {
} }
void MethodData::metaspace_pointers_do(MetaspaceClosure* it) { void MethodData::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(MethodData): %p", this); log_trace(aot)("Iter(MethodData): %p", this);
it->push(&_method); it->push(&_method);
} }

View File

@ -50,7 +50,7 @@ void RecordComponent::deallocate_contents(ClassLoaderData* loader_data) {
} }
void RecordComponent::metaspace_pointers_do(MetaspaceClosure* it) { void RecordComponent::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(RecordComponent): %p", this); log_trace(aot)("Iter(RecordComponent): %p", this);
it->push(&_annotations); it->push(&_annotations);
it->push(&_type_annotations); it->push(&_type_annotations);
} }

View File

@ -367,8 +367,8 @@ void Symbol::make_permanent() {
} }
void Symbol::metaspace_pointers_do(MetaspaceClosure* it) { void Symbol::metaspace_pointers_do(MetaspaceClosure* it) {
if (log_is_enabled(Trace, cds)) { if (log_is_enabled(Trace, aot)) {
LogStream trace_stream(Log(cds)::trace()); LogStream trace_stream(Log(aot)::trace());
trace_stream.print("Iter(Symbol): %p ", this); trace_stream.print("Iter(Symbol): %p ", this);
print_value_on(&trace_stream); print_value_on(&trace_stream);
trace_stream.cr(); trace_stream.cr();

View File

@ -2767,10 +2767,10 @@ JVM_ENTRY(void, JVM_StartThread(JNIEnv* env, jobject jthread))
// creates the module graph, etc. It's safe to not start the other // creates the module graph, etc. It's safe to not start the other
// threads which are launched by class static initializers // threads which are launched by class static initializers
// (ReferenceHandler, FinalizerThread and CleanerImpl). // (ReferenceHandler, FinalizerThread and CleanerImpl).
if (log_is_enabled(Info, cds)) { if (log_is_enabled(Info, aot)) {
ResourceMark rm; ResourceMark rm;
oop t = JNIHandles::resolve_non_null(jthread); oop t = JNIHandles::resolve_non_null(jthread);
log_info(cds)("JVM_StartThread() ignored: %s", t->klass()->external_name()); log_info(aot)("JVM_StartThread() ignored: %s", t->klass()->external_name());
} }
return; return;
} }
@ -3463,7 +3463,7 @@ JVM_ENTRY_NO_ENV(jlong, JVM_GetRandomSeedForDumping())
if (seed == 0) { // don't let this ever be zero. if (seed == 0) { // don't let this ever be zero.
seed = 0x87654321; seed = 0x87654321;
} }
log_debug(cds)("JVM_GetRandomSeedForDumping() = " JLONG_FORMAT, seed); log_debug(aot)("JVM_GetRandomSeedForDumping() = " JLONG_FORMAT, seed);
return seed; return seed;
} else { } else {
return 0; return 0;
@ -3526,7 +3526,7 @@ JVM_ENTRY(jboolean, JVM_NeedsClassInitBarrierForCDS(JNIEnv* env, jclass cls))
// If we cannot cache the class in AOT-initialized state, java.lang.invoke handles // If we cannot cache the class in AOT-initialized state, java.lang.invoke handles
// must emit barriers to ensure class initialization during production run. // must emit barriers to ensure class initialization during production run.
ResourceMark rm(THREAD); ResourceMark rm(THREAD);
log_debug(cds)("NeedsClassInitBarrierForCDS: %s", k->external_name()); log_debug(aot)("NeedsClassInitBarrierForCDS: %s", k->external_name());
return true; return true;
} }
} }

View File

@ -1374,7 +1374,7 @@ void Arguments::no_shared_spaces(const char* message) {
if (CDSConfig::new_aot_flags_used()) { if (CDSConfig::new_aot_flags_used()) {
log_warning(aot)("Unable to use AOT cache: %s", message); log_warning(aot)("Unable to use AOT cache: %s", message);
} else { } else {
log_info(cds)("Unable to use shared archive: %s", message); aot_log_info(aot)("Unable to use shared archive: %s", message);
} }
UseSharedSpaces = false; UseSharedSpaces = false;
} }
@ -3616,10 +3616,11 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
return JNI_ERR; return JNI_ERR;
} }
if ((CDSConfig::is_using_archive() && xshare_auto_cmd_line) || if ((CDSConfig::is_using_archive() && xshare_auto_cmd_line) ||
log_is_enabled(Info, cds)) { log_is_enabled(Info, cds) || log_is_enabled(Info, aot)) {
warning("Shared spaces are not supported in this VM"); warning("Shared spaces are not supported in this VM");
UseSharedSpaces = false; UseSharedSpaces = false;
LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(cds)); LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(cds));
LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(aot));
} }
no_shared_spaces("CDS Disabled"); no_shared_spaces("CDS Disabled");
#endif // INCLUDE_CDS #endif // INCLUDE_CDS

View File

@ -2898,7 +2898,7 @@ public:
{} {}
bool do_entry(AdapterFingerPrint* fp, AdapterHandlerEntry* entry) { bool do_entry(AdapterFingerPrint* fp, AdapterHandlerEntry* entry) {
LogStreamHandle(Trace, cds) lsh; LogStreamHandle(Trace, aot) lsh;
if (ArchiveBuilder::current()->has_been_archived((address)entry)) { if (ArchiveBuilder::current()->has_been_archived((address)entry)) {
assert(ArchiveBuilder::current()->has_been_archived((address)fp), "must be"); assert(ArchiveBuilder::current()->has_been_archived((address)fp), "must be");
AdapterFingerPrint* buffered_fp = ArchiveBuilder::current()->get_buffered_addr(fp); AdapterFingerPrint* buffered_fp = ArchiveBuilder::current()->get_buffered_addr(fp);
@ -2912,11 +2912,11 @@ public:
if (lsh.is_enabled()) { if (lsh.is_enabled()) {
address fp_runtime_addr = (address)buffered_fp + ArchiveBuilder::current()->buffer_to_requested_delta(); address fp_runtime_addr = (address)buffered_fp + ArchiveBuilder::current()->buffer_to_requested_delta();
address entry_runtime_addr = (address)buffered_entry + ArchiveBuilder::current()->buffer_to_requested_delta(); address entry_runtime_addr = (address)buffered_entry + ArchiveBuilder::current()->buffer_to_requested_delta();
log_trace(cds)("Added fp=%p (%s), entry=%p to the archived adater table", buffered_fp, buffered_fp->as_basic_args_string(), buffered_entry); log_trace(aot)("Added fp=%p (%s), entry=%p to the archived adater table", buffered_fp, buffered_fp->as_basic_args_string(), buffered_entry);
} }
} else { } else {
if (lsh.is_enabled()) { if (lsh.is_enabled()) {
log_trace(cds)("Skipping adapter handler %p (fp=%s) as it is not archived", entry, fp->as_basic_args_string()); log_trace(aot)("Skipping adapter handler %p (fp=%s) as it is not archived", entry, fp->as_basic_args_string());
} }
} }
return true; return true;
@ -2964,7 +2964,7 @@ void AdapterHandlerEntry::link() {
if (AOTCodeCache::is_using_adapter()) { if (AOTCodeCache::is_using_adapter()) {
adapter_blob = AdapterHandlerLibrary::link_aot_adapter_handler(this); adapter_blob = AdapterHandlerLibrary::link_aot_adapter_handler(this);
if (adapter_blob == nullptr) { if (adapter_blob == nullptr) {
log_warning(cds)("Failed to link AdapterHandlerEntry (fp=%s) to its code in the AOT code cache", _fingerprint->as_basic_args_string()); log_warning(aot)("Failed to link AdapterHandlerEntry (fp=%s) to its code in the AOT code cache", _fingerprint->as_basic_args_string());
generate_code = true; generate_code = true;
} }
} else { } else {
@ -3052,7 +3052,7 @@ void AdapterHandlerEntry::relocate(address new_base) {
} }
void AdapterHandlerEntry::metaspace_pointers_do(MetaspaceClosure* it) { void AdapterHandlerEntry::metaspace_pointers_do(MetaspaceClosure* it) {
LogStreamHandle(Trace, cds) lsh; LogStreamHandle(Trace, aot) lsh;
if (lsh.is_enabled()) { if (lsh.is_enabled()) {
lsh.print("Iter(AdapterHandlerEntry): %p(%s)", this, _fingerprint->as_basic_args_string()); lsh.print("Iter(AdapterHandlerEntry): %p(%s)", this, _fingerprint->as_basic_args_string());
lsh.cr(); lsh.cr();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,7 @@ import java.util.regex.Pattern;
This is a simple parser for parsing the output of This is a simple parser for parsing the output of
java -Xshare:dump -Xlog:cds+map=debug,cds+map+oops=trace:file=cds.map:none:filesize=0 java -Xshare:dump -Xlog:aot+map=debug,aot+map+oops=trace:file=cds.map:none:filesize=0
The map file contains patterns like this for the heap objects: The map file contains patterns like this for the heap objects:

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -24,7 +24,7 @@
/** /**
* @test * @test
* @bug 8308903 * @bug 8308903
* @summary Test the contents of -Xlog:cds+map * @summary Test the contents of -Xlog:aot+map
* @requires vm.cds * @requires vm.cds
* @library /test/lib * @library /test/lib
* @run driver CDSMapTest * @run driver CDSMapTest
@ -67,7 +67,7 @@ public class CDSMapTest {
String mapName = logName + ".map"; String mapName = logName + ".map";
CDSOptions opts = (new CDSOptions()) CDSOptions opts = (new CDSOptions())
.addPrefix("-Xlog:cds=debug") .addPrefix("-Xlog:cds=debug")
.addPrefix("-Xlog:cds+map=debug,cds+map+oops=trace:file=" + mapName + ":none:filesize=0") .addPrefix("-Xlog:aot+map=debug,aot+map+oops=trace:file=" + mapName + ":none:filesize=0")
.setArchiveName(archiveName) .setArchiveName(archiveName)
.addSuffix(args) .addSuffix(args)
.addSuffix(more); .addSuffix(more);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -100,7 +100,7 @@ public class DeterministicDump {
CDSOptions opts = (new CDSOptions()) CDSOptions opts = (new CDSOptions())
.addPrefix("-Xint") // Override any -Xmixed/-Xcomp flags from jtreg -vmoptions .addPrefix("-Xint") // Override any -Xmixed/-Xcomp flags from jtreg -vmoptions
.addPrefix("-Xlog:cds=debug,gc=debug") .addPrefix("-Xlog:cds=debug,gc=debug")
.addPrefix("-Xlog:cds+map*=trace:file=" + mapName + ":none:filesize=0") .addPrefix("-Xlog:aot+map*=trace:file=" + mapName + ":none:filesize=0")
.setArchiveName(archiveName) .setArchiveName(archiveName)
.addSuffix(args) .addSuffix(args)
.addSuffix(more); .addSuffix(more);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,7 @@ public class SharedStrings {
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
"-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./SharedStrings.jsa", "-XX:SharedArchiveFile=./SharedStrings.jsa",
"-Xlog:cds,cds+hashtables", "-Xlog:cds,aot+hashtables",
// Needed for bootclasspath match, for CDS to work with WhiteBox API // Needed for bootclasspath match, for CDS to work with WhiteBox API
"-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"), "-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"),
"-Xshare:dump"); "-Xshare:dump");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -49,7 +49,7 @@ public class SpaceUtilizationCheck {
// [2] There must be no gap between two consecutive regions. // [2] There must be no gap between two consecutive regions.
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
test("-Xlog:cds=debug"); test("-Xlog:aot=debug,cds=debug");
} }
static void test(String... extra_options) throws Exception { static void test(String... extra_options) throws Exception {

View File

@ -283,7 +283,7 @@ public class AOTFlags {
"-cp", appJar, helloClass); "-cp", appJar, helloClass);
out = CDSTestUtils.executeAndLog(pb, "neg"); out = CDSTestUtils.executeAndLog(pb, "neg");
out.shouldContain("Not a valid archive (hello.aotconfig)"); out.shouldContain("Not a valid shared archive file (hello.aotconfig)");
out.shouldNotHaveExitValue(0); out.shouldNotHaveExitValue(0);
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -36,7 +36,7 @@ import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cds.CDSTestUtils; import jdk.test.lib.cds.CDSTestUtils;
public class ExtraSymbols { public class ExtraSymbols {
static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables"; static final String CDS_LOGGING = "-Xlog:cds,aot+hashtables";
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String appJar = JarBuilder.getOrCreateHelloJar(); String appJar = JarBuilder.getOrCreateHelloJar();
@ -75,8 +75,8 @@ public class ExtraSymbols {
static int numOfEntries(OutputAnalyzer output) { static int numOfEntries(OutputAnalyzer output) {
// Look for this pattern: // Look for this pattern:
// [4.661s][info][cds,hashtables] Shared symbol table stats -------- base: 0x0000000800000000 // [4.661s][info][aot,hashtables] Shared symbol table stats -------- base: 0x0000000800000000
// [4.661s][info][cds,hashtables] Number of entries : 50078 // [4.661s][info][aot,hashtables] Number of entries : 50078
String s = output.firstMatch("Shared symbol table stats[^\n]*\n[^\n]*Number of entries : .*"); String s = output.firstMatch("Shared symbol table stats[^\n]*\n[^\n]*Number of entries : .*");
String subs[] = s.split("[:]"); String subs[] = s.split("[:]");
int numEntries = Integer.parseInt(subs[2].trim()); int numEntries = Integer.parseInt(subs[2].trim());

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -65,7 +65,7 @@ public class LambdaEagerInit {
".class.load. java.util.stream.Collectors[$][$]Lambda.*/0x.*source:.*java.*util.*stream.*Collectors"; ".class.load. java.util.stream.Collectors[$][$]Lambda.*/0x.*source:.*java.*util.*stream.*Collectors";
private static final String lambdaLoadedFromArchive = private static final String lambdaLoadedFromArchive =
".class.load. java.util.stream.Collectors[$][$]Lambda.*/0x.*source:.*shared.*objects.*file"; ".class.load. java.util.stream.Collectors[$][$]Lambda.*/0x.*source:.*shared.*objects.*file";
private static final String cdsLoadedLambdaProxy = ".cds.*Loaded.*lambda.*proxy"; private static final String cdsLoadedLambdaProxy = ".aot.*Loaded.*lambda.*proxy";
private static final String archiveName = mainClass + ".jsa"; private static final String archiveName = mainClass + ".jsa";
private static String appJar; private static String appJar;
@ -75,7 +75,7 @@ public class LambdaEagerInit {
// create base archive with the -Djdk.internal.lambda.disableEagerInitialization=true property // create base archive with the -Djdk.internal.lambda.disableEagerInitialization=true property
CDSOptions opts = (new CDSOptions()) CDSOptions opts = (new CDSOptions())
.addPrefix(testProperty, .addPrefix(testProperty,
"-Xlog:class+load,cds") "-Xlog:class+load,aot,cds")
.setArchiveName(archiveName); .setArchiveName(archiveName);
CDSTestUtils.createArchiveAndCheck(opts); CDSTestUtils.createArchiveAndCheck(opts);
} }
@ -96,7 +96,7 @@ public class LambdaEagerInit {
static void testWithEagerInitializationDisabled() throws Exception { static void testWithEagerInitializationDisabled() throws Exception {
// run with custom base archive without the -Djdk.internal.lambda.disableEagerInitialization=true property // run with custom base archive without the -Djdk.internal.lambda.disableEagerInitialization=true property
CDSOptions runOpts = (new CDSOptions()) CDSOptions runOpts = (new CDSOptions())
.addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug") .addPrefix("-cp", appJar, "-Xlog:class+load,aot=debug,cds=debug")
.setArchiveName(archiveName) .setArchiveName(archiveName)
.setUseVersion(false) .setUseVersion(false)
.addSuffix(mainClass); .addSuffix(mainClass);
@ -110,7 +110,7 @@ public class LambdaEagerInit {
// run with default CDS archive with the -Djdk.internal.lambda.disableEagerInitialization=true property // run with default CDS archive with the -Djdk.internal.lambda.disableEagerInitialization=true property
CDSOptions runOpts = (new CDSOptions()) CDSOptions runOpts = (new CDSOptions())
.setXShareMode("auto") .setXShareMode("auto")
.addPrefix("-cp", appJar, testProperty, "-Xlog:class+load,cds=debug") .addPrefix("-cp", appJar, testProperty, "-Xlog:class+load,aot=debug,cds=debug")
.setUseSystemArchive(true) .setUseSystemArchive(true)
.setUseVersion(false) .setUseVersion(false)
.addSuffix(mainClass); .addSuffix(mainClass);
@ -124,7 +124,7 @@ public class LambdaEagerInit {
// run with default CDS archive without the -Djdk.internal.lambda.disableEagerInitialization=true property // run with default CDS archive without the -Djdk.internal.lambda.disableEagerInitialization=true property
CDSOptions runOpts = (new CDSOptions()) CDSOptions runOpts = (new CDSOptions())
.setXShareMode("auto") .setXShareMode("auto")
.addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug") .addPrefix("-cp", appJar, "-Xlog:class+load,aot=debug,cds=debug")
.setUseSystemArchive(true) .setUseSystemArchive(true)
.setUseVersion(false) .setUseVersion(false)
.addSuffix("-showversion", mainClass); .addSuffix("-showversion", mainClass);

View File

@ -72,16 +72,16 @@ public class LambdaWithJavaAgent {
"-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockDiagnosticVMOptions",
"-XX:+AllowArchivingWithJavaAgent", "-XX:+AllowArchivingWithJavaAgent",
useJavaAgent, useJavaAgent,
"-Xlog:class+load,cds+class=debug,cds") "-Xlog:class+load,cds+class=debug,aot,cds")
.setArchiveName(archiveName); .setArchiveName(archiveName);
OutputAnalyzer output = CDSTestUtils.createArchiveAndCheck(opts); OutputAnalyzer output = CDSTestUtils.createArchiveAndCheck(opts);
output.shouldContain("CDS heap objects cannot be written because class jdk.internal.math.FDBigInteger maybe modified by ClassFileLoadHook") output.shouldContain("heap objects cannot be written because class jdk.internal.math.FDBigInteger maybe modified by ClassFileLoadHook")
.shouldContain("Skipping jdk/internal/math/FDBigInteger: Unsupported location") .shouldContain("Skipping jdk/internal/math/FDBigInteger: Unsupported location")
.shouldMatch(".class.load.*jdk.internal.math.FDBigInteger.*source.*modules"); .shouldMatch(".class.load.*jdk.internal.math.FDBigInteger.*source.*modules");
// run with archive // run with archive
CDSOptions runOpts = (new CDSOptions()) CDSOptions runOpts = (new CDSOptions())
.addPrefix("-cp", appJar, "-Xlog:class+load=debug,cds=debug,class+path=debug", .addPrefix("-cp", appJar, "-Xlog:class+load=debug,aot=debug,cds=debug,class+path=debug",
"-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockDiagnosticVMOptions",
"-XX:+AllowArchivingWithJavaAgent", "-XX:+AllowArchivingWithJavaAgent",
useJavaAgent) useJavaAgent)

View File

@ -48,7 +48,7 @@ public class VerifierTest implements Opcodes {
static final String PASS_RESULT = "Hi, how are you?"; static final String PASS_RESULT = "Hi, how are you?";
static final String VFY_INFO_MESSAGE = static final String VFY_INFO_MESSAGE =
"All non-system classes will be verified (-Xverify:remote) during CDS dump time."; "All non-system classes will be verified (-Xverify:remote) during CDS dump time.";
static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables"; static final String CDS_LOGGING = "-Xlog:cds,aot+hashtables";
enum Testset1Part { enum Testset1Part {
A, B A, B

View File

@ -99,21 +99,21 @@ public class AddExports {
test("FMG should be enabled with '--add-exports java.base/jdk.internal.misc=ALL-UNNAMED'", test("FMG should be enabled with '--add-exports java.base/jdk.internal.misc=ALL-UNNAMED'",
SimpleCDSAppTester.of("nonModuleNeedsJdkAddExport") SimpleCDSAppTester.of("nonModuleNeedsJdkAddExport")
.classpath(nonModuleNeedsJdkAddExportJar) .classpath(nonModuleNeedsJdkAddExportJar)
.addVmArgs("--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "-Xlog:cds") .addVmArgs("--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "-Xlog:aot,cds")
.appCommandLine("com.nomodule.needsjdkaddexport.Main")); .appCommandLine("com.nomodule.needsjdkaddexport.Main"));
test("FMG should be enabled with '--add-exports java.base/jdk.internal.misc=com.needsjdkaddexport'", test("FMG should be enabled with '--add-exports java.base/jdk.internal.misc=com.needsjdkaddexport'",
SimpleCDSAppTester.of("moduleNeedsJdkAddExport") SimpleCDSAppTester.of("moduleNeedsJdkAddExport")
.modulepath(modulePath) .modulepath(modulePath)
.addVmArgs("--add-modules", "com.needsjdkaddexport", .addVmArgs("--add-modules", "com.needsjdkaddexport",
"--add-exports", "java.base/jdk.internal.misc=com.needsjdkaddexport", "-Xlog:cds") "--add-exports", "java.base/jdk.internal.misc=com.needsjdkaddexport", "-Xlog:aot,cds")
.appCommandLine("-m", "com.needsjdkaddexport/com.needsjdkaddexport.Main")); .appCommandLine("-m", "com.needsjdkaddexport/com.needsjdkaddexport.Main"));
test("FMG should be enabled with '--add-exports com.foos/com.foos.internal=com.needsfoosaddexport'", test("FMG should be enabled with '--add-exports com.foos/com.foos.internal=com.needsfoosaddexport'",
SimpleCDSAppTester.of("moduleNeedsFoosAddExport") SimpleCDSAppTester.of("moduleNeedsFoosAddExport")
.modulepath(modulePath) .modulepath(modulePath)
.addVmArgs("--add-modules", "com.needsfoosaddexport", .addVmArgs("--add-modules", "com.needsfoosaddexport",
"--add-exports", "com.foos/com.foos.internal=com.needsfoosaddexport", "-Xlog:cds") "--add-exports", "com.foos/com.foos.internal=com.needsfoosaddexport", "-Xlog:aot,cds")
.appCommandLine("-m", "com.needsfoosaddexport/com.needsfoosaddexport.Main")); .appCommandLine("-m", "com.needsfoosaddexport/com.needsfoosaddexport.Main"));
test("FMG should be enabled with multiple --add-exports", test("FMG should be enabled with multiple --add-exports",
@ -124,7 +124,7 @@ public class AddExports {
"--add-exports", "com.foos/com.foos.internal=ALL-UNNAMED", "--add-exports", "com.foos/com.foos.internal=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.misc=com.foos", "--add-exports", "java.base/jdk.internal.misc=com.foos",
"-Xlog:cds") "-Xlog:aot,cds")
.appCommandLine("-m", "com.needsfoosaddexport/com.needsfoosaddexport.Main")); .appCommandLine("-m", "com.needsfoosaddexport/com.needsfoosaddexport.Main"));
} }
} }

View File

@ -133,13 +133,13 @@ public class AddReads {
return new String[] { return new String[] {
"--add-modules", SUB_MODULE, "--add-modules", SUB_MODULE,
"--add-reads", "com.norequires=" + SUB_MODULE, "--add-reads", "com.norequires=" + SUB_MODULE,
"-Xlog:class+load,cds,class+path=info", "-Xlog:class+load,aot,cds,class+path=info",
}; };
} else { } else {
return new String[] { return new String[] {
"--add-modules", SUB_MODULE, "--add-modules", SUB_MODULE,
"--add-reads", "com.norequires=ALL-UNNAMED", "--add-reads", "com.norequires=ALL-UNNAMED",
"-Xlog:class+load,cds,class+path=info", "-Xlog:class+load,aot,cds,class+path=info",
}; };
} }
} }
@ -184,7 +184,7 @@ public class AddReads {
.modulepath(moduleDir.toString()) .modulepath(moduleDir.toString())
.addVmArgs("--add-modules", SUB_MODULE, .addVmArgs("--add-modules", SUB_MODULE,
"--add-reads", "com.norequires=" + SUB_MODULE, "--add-reads", "com.norequires=" + SUB_MODULE,
"-Xlog:class+load,cds,class+path=info") "-Xlog:class+load,aot,cds,class+path=info")
.appCommandLine("-m", MAIN_MODULE)); .appCommandLine("-m", MAIN_MODULE));
test("FMG should be enabled with '--add-reads com.norequires=org.astro'", test("FMG should be enabled with '--add-reads com.norequires=org.astro'",
@ -193,7 +193,7 @@ public class AddReads {
.modulepath(moduleDir.toString()) .modulepath(moduleDir.toString())
.addVmArgs("--add-modules", SUB_MODULE, .addVmArgs("--add-modules", SUB_MODULE,
"--add-reads", "com.norequires=" + SUB_MODULE, "--add-reads", "com.norequires=" + SUB_MODULE,
"-Xlog:class+load,cds,class+path=info") "-Xlog:class+load,aot,cds,class+path=info")
.appCommandLine("-m", MAIN_MODULE)); .appCommandLine("-m", MAIN_MODULE));
printComment("FMG should be enabled with '--add-reads com.norequires=ALL-UNNAMED"); printComment("FMG should be enabled with '--add-reads com.norequires=ALL-UNNAMED");

View File

@ -75,7 +75,6 @@ public class MethodHandleTest {
return new String[] { return new String[] {
"-Xlog:gc,cds+class=debug", "-Xlog:gc,cds+class=debug",
"-XX:AOTInitTestClass=MethodHandleTestApp", "-XX:AOTInitTestClass=MethodHandleTestApp",
"-Xlog:cds+map,cds+map+oops=trace:file=cds.oops.txt:none:filesize=0",
}; };
} else { } else {
return new String[] {}; return new String[] {};

View File

@ -89,7 +89,6 @@ public class WeakReferenceTest {
return new String[] { return new String[] {
"-Xlog:gc,cds+class=debug", "-Xlog:gc,cds+class=debug",
"-XX:AOTInitTestClass=" + mainClass, "-XX:AOTInitTestClass=" + mainClass,
"-Xlog:cds+map,cds+map+oops=trace:file=cds.oops.txt:none:filesize=0",
}; };
} else { } else {
return new String[] { return new String[] {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -90,14 +90,15 @@ public class LambdasInTwoArchives extends DynamicArchiveTestBase {
String[] launchArgs = { String[] launchArgs = {
"-Xshare:off", "-Xshare:off",
"-XX:DumpLoadedClassList=" + classListFileName, "-XX:DumpLoadedClassList=" + classListFileName,
"-Xlog:aot",
"-Xlog:aot+lambda",
"-Xlog:cds", "-Xlog:cds",
"-Xlog:cds+lambda",
"-cp", appJar, mainClass}; "-cp", appJar, mainClass};
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs); ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(launchArgs);
OutputAnalyzer oa = TestCommon.executeAndLog(pb, "lambda-classes"); OutputAnalyzer oa = TestCommon.executeAndLog(pb, "lambda-classes");
oa.shouldHaveExitValue(0); oa.shouldHaveExitValue(0);
String logOptions = "-Xlog:cds=debug,class+load,cds+class=debug"; String logOptions = "-Xlog:aot=debug,cds=debug,class+load,cds+class=debug";
String baseArchiveName = CDSTestUtils.getOutputFileName("lambda-base.jsa"); String baseArchiveName = CDSTestUtils.getOutputFileName("lambda-base.jsa");
// Static dump based on the class list. // Static dump based on the class list.
dumpBaseArchive(baseArchiveName, dumpBaseArchive(baseArchiveName,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -63,6 +63,7 @@ public class UsedAllArchivedLambdas extends DynamicArchiveTestBase {
"-XX:+UnlockDiagnosticVMOptions", "-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI", "-XX:+WhiteBoxAPI",
use_whitebox_jar, use_whitebox_jar,
"-Xlog:aot=debug",
"-Xlog:cds=debug", "-Xlog:cds=debug",
"-cp", appJar, mainClass, "run") "-cp", appJar, mainClass, "run")
.assertNormalExit(output -> { .assertNormalExit(output -> {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -69,7 +69,7 @@ public class ExceptionDuringDumpAtObjectsInitPhase {
"-Dtest.with.exception=true", "-Dtest.with.exception=true",
gcLog).shouldNotHaveExitValue(0) gcLog).shouldNotHaveExitValue(0)
.shouldContain("Preload Warning: Cannot find jdk/internal/math/FDBigInteger") .shouldContain("Preload Warning: Cannot find jdk/internal/math/FDBigInteger")
.shouldContain("Unexpected exception, use -Xlog:cds,exceptions=trace for detail"); .shouldContain("Unexpected exception, use -Xlog:aot,cds,exceptions=trace for detail");
// 2. Test with OOM // 2. Test with OOM
System.out.println("2. OOM during dump"); System.out.println("2. OOM during dump");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -63,7 +63,7 @@ public class CheckUnsupportedDumpingOptions {
String appClasses[] = {"Hello"}; String appClasses[] = {"Hello"};
for (int i = 0; i < jigsawOptions.length; i++) { for (int i = 0; i < jigsawOptions.length; i++) {
OutputAnalyzer output; OutputAnalyzer output;
output = TestCommon.dump(appJar, appClasses, "-Xlog:cds,cds+hashtables", output = TestCommon.dump(appJar, appClasses, "-Xlog:cds,aot+hashtables",
jigsawOptions[i], optionValues[i]); jigsawOptions[i], optionValues[i]);
output.shouldContain("Cannot use the following option " + output.shouldContain("Cannot use the following option " +
"when dumping the shared archive: " + jigsawOptions[i]) "when dumping the shared archive: " + jigsawOptions[i])

View File

@ -45,7 +45,7 @@ public class AddmodsOption {
final String multiModules = ",,jdk.jconsole,jdk.compiler,,"; final String multiModules = ",,jdk.jconsole,jdk.compiler,,";
final String allSystem = "ALL-SYSTEM"; final String allSystem = "ALL-SYSTEM";
final String allModulePath = "ALL-MODULE-PATH"; final String allModulePath = "ALL-MODULE-PATH";
final String loggingOption = "-Xlog:aot=debug,cds+module=debug,aot+heap=info,cds=debug,module=trace"; final String loggingOption = "-Xlog:aot=debug,aot+module=debug,aot+heap=info,cds=debug,module=trace";
final String versionPattern = "java.[0-9][0-9].*"; final String versionPattern = "java.[0-9][0-9].*";
final String subgraphCannotBeUsed = "subgraph jdk.internal.module.ArchivedBootLayer cannot be used because full module graph is disabled"; final String subgraphCannotBeUsed = "subgraph jdk.internal.module.ArchivedBootLayer cannot be used because full module graph is disabled";
final String warningIncubator = "WARNING: Using incubator modules: jdk.incubator.vector"; final String warningIncubator = "WARNING: Using incubator modules: jdk.incubator.vector";
@ -70,8 +70,8 @@ public class AddmodsOption {
oa.shouldHaveExitValue(0) oa.shouldHaveExitValue(0)
// version of the jdk.httpserver module, e.g. java 22-ea // version of the jdk.httpserver module, e.g. java 22-ea
.shouldMatch(versionPattern) .shouldMatch(versionPattern)
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.jconsole") .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.jconsole")
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.httpserver"); .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.httpserver");
// different --add-modules specified during runtime // different --add-modules specified during runtime
oa = TestCommon.execCommon( oa = TestCommon.execCommon(
@ -161,7 +161,7 @@ public class AddmodsOption {
"-version"); "-version");
try { try {
oa.shouldHaveExitValue(0) oa.shouldHaveExitValue(0)
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.internal.vm.ci"); .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.internal.vm.ci");
} catch (RuntimeException re) { } catch (RuntimeException re) {
// JVMCI compile may not be available // JVMCI compile may not be available
oa.shouldHaveExitValue(1) oa.shouldHaveExitValue(1)
@ -188,8 +188,8 @@ public class AddmodsOption {
"-m", moduleOption, "-m", moduleOption,
"-version"); "-version");
oa.shouldHaveExitValue(0) oa.shouldHaveExitValue(0)
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.compiler") .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.compiler")
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.jconsole"); .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.jconsole");
// dump an archive with ALL-SYSTEM in -add-modules // dump an archive with ALL-SYSTEM in -add-modules
archiveName = TestCommon.getNewArchiveName("muti-modules"); archiveName = TestCommon.getNewArchiveName("muti-modules");
@ -232,6 +232,6 @@ public class AddmodsOption {
"-m", moduleOption, "-m", moduleOption,
"-version"); "-version");
oa.shouldHaveExitValue(0) oa.shouldHaveExitValue(0)
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.httpserver"); .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.httpserver");
} }
} }

View File

@ -41,7 +41,7 @@ public class AddopensOption {
final String moduleOption = "jdk.httpserver/sun.net.httpserver.simpleserver.Main"; final String moduleOption = "jdk.httpserver/sun.net.httpserver.simpleserver.Main";
final String addOpensNio = "java.base/java.nio=ALL-UNNAMED"; final String addOpensNio = "java.base/java.nio=ALL-UNNAMED";
final String addOpensTimeFormat = "java.base/java.time.format=ALL-UNNAMED"; final String addOpensTimeFormat = "java.base/java.time.format=ALL-UNNAMED";
final String loggingOption = "-Xlog:aot=debug,cds+module=debug,aot+heap=info,cds=debug,module=trace"; final String loggingOption = "-Xlog:aot=debug,aot+module=debug,aot+heap=info,cds=debug,module=trace";
final String versionPattern = "java.[0-9][0-9].*"; final String versionPattern = "java.[0-9][0-9].*";
final String subgraphCannotBeUsed = "subgraph jdk.internal.module.ArchivedBootLayer cannot be used because full module graph is disabled"; final String subgraphCannotBeUsed = "subgraph jdk.internal.module.ArchivedBootLayer cannot be used because full module graph is disabled";
final String warningIncubator = "WARNING: Using incubator modules: jdk.incubator.vector"; final String warningIncubator = "WARNING: Using incubator modules: jdk.incubator.vector";
@ -66,7 +66,7 @@ public class AddopensOption {
oa.shouldHaveExitValue(0) oa.shouldHaveExitValue(0)
// version of the jdk.httpserver module, e.g. java 22-ea // version of the jdk.httpserver module, e.g. java 22-ea
.shouldMatch(versionPattern) .shouldMatch(versionPattern)
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.httpserver"); .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.httpserver");
// different --add-opens specified during runtime // different --add-opens specified during runtime
oa = TestCommon.execCommon( oa = TestCommon.execCommon(
@ -151,6 +151,6 @@ public class AddopensOption {
"-m", moduleOption, "-m", moduleOption,
"-version"); "-version");
oa.shouldHaveExitValue(0) oa.shouldHaveExitValue(0)
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.httpserver"); .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.httpserver");
} }
} }

View File

@ -37,7 +37,7 @@ public class ModuleOption {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
final String moduleOption = "jdk.httpserver/sun.net.httpserver.simpleserver.Main"; final String moduleOption = "jdk.httpserver/sun.net.httpserver.simpleserver.Main";
final String incubatorModule = "jdk.incubator.vector"; final String incubatorModule = "jdk.incubator.vector";
final String loggingOption = "-Xlog:aot=debug,cds+module=debug,aot+heap=info,cds=debug,module=trace"; final String loggingOption = "-Xlog:aot=debug,aot+module=debug,aot+heap=info,cds=debug,module=trace";
// Pattern of a module version string. // Pattern of a module version string.
// e.g. JDK 22: "java 22" // e.g. JDK 22: "java 22"
// JDK 22.0.1: "java 22.0.1" // JDK 22.0.1: "java 22.0.1"
@ -62,7 +62,7 @@ public class ModuleOption {
oa.shouldHaveExitValue(0) oa.shouldHaveExitValue(0)
// version of the jdk.httpserver module, e.g. java 22-ea // version of the jdk.httpserver module, e.g. java 22-ea
.shouldMatch(versionPattern) .shouldMatch(versionPattern)
.shouldMatch("cds,module.*Restored from archive: entry.0x.*name jdk.httpserver"); .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.httpserver");
// different module specified during runtime // different module specified during runtime
oa = TestCommon.execCommon( oa = TestCommon.execCommon(

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -62,7 +62,8 @@ public class AOTLinkedLambdas {
CDSOptions opts = (new CDSOptions()) CDSOptions opts = (new CDSOptions())
.addPrefix("-XX:ExtraSharedClassListFile=" + classList, .addPrefix("-XX:ExtraSharedClassListFile=" + classList,
"-XX:+AOTClassLinking", "-XX:+AOTClassLinking",
"-Xlog:cds+resolve=trace", "-Xlog:aot+resolve=trace",
"-Xlog:aot+class=debug",
"-Xlog:cds+class=debug", "-Xlog:cds+class=debug",
"-cp", appJar); "-cp", appJar);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -58,7 +58,7 @@ public class AOTLinkedVarHandles {
CDSOptions opts = (new CDSOptions()) CDSOptions opts = (new CDSOptions())
.addPrefix("-XX:ExtraSharedClassListFile=" + classList, .addPrefix("-XX:ExtraSharedClassListFile=" + classList,
"-XX:+AOTClassLinking", "-XX:+AOTClassLinking",
"-Xlog:cds+resolve=trace", "-Xlog:aot+resolve=trace",
"-Xlog:cds+class=debug", "-Xlog:cds+class=debug",
"-cp", appJar); "-cp", appJar);

View File

@ -81,7 +81,8 @@ public class ResolvedConstants {
SimpleCDSAppTester.of("ResolvedConstantsApp" + (aotClassLinking ? "1" : "0")) SimpleCDSAppTester.of("ResolvedConstantsApp" + (aotClassLinking ? "1" : "0"))
.addVmArgs(aotClassLinking ? "-XX:+AOTClassLinking" : "-XX:-AOTClassLinking", .addVmArgs(aotClassLinking ? "-XX:+AOTClassLinking" : "-XX:-AOTClassLinking",
"-Xlog:cds+resolve=trace", "-Xlog:aot+resolve=trace",
"-Xlog:aot+class=debug",
"-Xlog:cds+class=debug") "-Xlog:cds+class=debug")
.classpath(appJar) .classpath(appJar)
.appCommandLine(mainClass) .appCommandLine(mainClass)
@ -183,14 +184,14 @@ public class ResolvedConstants {
} }
static String ALWAYS(String s) { static String ALWAYS(String s) {
return "cds,resolve.*archived " + s; return ",resolve.*archived " + s;
} }
static String AOTLINK_ONLY(String s) { static String AOTLINK_ONLY(String s) {
if (aotClassLinking) { if (aotClassLinking) {
return ALWAYS(s); return ALWAYS(s);
} else { } else {
return "cds,resolve.*reverted " + s; return ",resolve.*reverted " + s;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -52,9 +52,9 @@ public class ResolvedPutField {
CDSOptions opts = (new CDSOptions()) CDSOptions opts = (new CDSOptions())
.addPrefix("-XX:ExtraSharedClassListFile=" + classList, .addPrefix("-XX:ExtraSharedClassListFile=" + classList,
"-cp", appJar, "-cp", appJar,
"-Xlog:cds+resolve=trace"); "-Xlog:aot+resolve=trace");
CDSTestUtils.createArchiveAndCheck(opts) CDSTestUtils.createArchiveAndCheck(opts)
.shouldMatch("cds,resolve.*Failed to resolve putfield .*ResolvedPutFieldHelper -> ResolvedPutFieldHelper.x:I"); .shouldMatch(",resolve.*Failed to resolve putfield .*ResolvedPutFieldHelper -> ResolvedPutFieldHelper.x:I");
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -40,7 +40,7 @@ public class ExerciseGC {
SharedStringsUtils.buildJarAndWhiteBox("HelloStringGC"); SharedStringsUtils.buildJarAndWhiteBox("HelloStringGC");
SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("HelloStringGC"), SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("HelloStringGC"),
"SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables"); "SharedStringsBasic.txt", "-Xlog:cds,aot+hashtables");
SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringGC", SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringGC",
"-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyBeforeGC"); "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyBeforeGC");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,7 +51,7 @@ public class FlagCombo {
SharedStringsUtils.buildJar("HelloString"); SharedStringsUtils.buildJar("HelloString");
SharedStringsUtils.dump(TestCommon.list("HelloString"), SharedStringsUtils.dump(TestCommon.list("HelloString"),
"SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables"); "SharedStringsBasic.txt", "-Xlog:cds,aot+hashtables");
SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC"); SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC");

View File

@ -157,7 +157,7 @@ public class IncompatibleOptions {
"-XX:+UseCompressedOops", "-XX:+UseCompressedOops",
collectorOption, collectorOption,
"-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("SharedStringsBasic.txt"), "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("SharedStringsBasic.txt"),
"-Xlog:cds,cds+hashtables", "-Xlog:cds,aot+hashtables",
extraOption)); extraOption));
if (expectedWarning != null) { if (expectedWarning != null) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -45,7 +45,7 @@ public class InternSharedString {
SharedStringsUtils.buildJarAndWhiteBox("InternStringTest"); SharedStringsUtils.buildJarAndWhiteBox("InternStringTest");
SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("InternStringTest"), SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("InternStringTest"),
"ExtraSharedInput.txt", "-Xlog:cds,cds+hashtables"); "ExtraSharedInput.txt", "-Xlog:cds,aot+hashtables");
String[] extraMatches = new String[] { String[] extraMatches = new String[] {
InternStringTest.passed_output1, InternStringTest.passed_output1,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,7 @@
* @run driver LargePages * @run driver LargePages
*/ */
public class LargePages { public class LargePages {
static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables"; static final String CDS_LOGGING = "-Xlog:cds,aot+hashtables";
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
SharedStringsUtils.run(args, LargePages::test); SharedStringsUtils.run(args, LargePages::test);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -54,7 +54,7 @@ public class SharedStringsBasic {
.addPrefix(vmOptionsPrefix, .addPrefix(vmOptionsPrefix,
"-cp", appJar, "-cp", appJar,
"-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile, "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile,
"-Xlog:cds,cds+hashtables") "-Xlog:cds,aot+hashtables")
.setArchiveName("./SharedStringsBasic.jsa"); .setArchiveName("./SharedStringsBasic.jsa");
CDSTestUtils.createArchiveAndCheck(opts) CDSTestUtils.createArchiveAndCheck(opts)
.shouldContain("Shared string table stats"); .shouldContain("Shared string table stats");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,7 @@ public class SharedStringsBasicPlus {
SharedStringsUtils.buildJarAndWhiteBox("HelloStringPlus"); SharedStringsUtils.buildJarAndWhiteBox("HelloStringPlus");
SharedStringsUtils.dumpWithWhiteBox( TestCommon.list("HelloStringPlus"), SharedStringsUtils.dumpWithWhiteBox( TestCommon.list("HelloStringPlus"),
"SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables"); "SharedStringsBasic.txt", "-Xlog:cds,aot+hashtables");
SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringPlus"); SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringPlus");
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -71,6 +71,7 @@ public class SharedStringsStress {
OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"), OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"),
TestCommon.concat(vmOptionsPrefix, TestCommon.concat(vmOptionsPrefix,
"-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile, "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile,
"-Xlog:aot",
"-Xlog:gc+region+cds", "-Xlog:gc+region+cds",
"-Xlog:gc+region=trace")); "-Xlog:gc+region=trace"));
TestCommon.checkDump(dumpOutput); TestCommon.checkDump(dumpOutput);
@ -78,7 +79,7 @@ public class SharedStringsStress {
dumpOutput.shouldContain("string table array (secondary)"); dumpOutput.shouldContain("string table array (secondary)");
OutputAnalyzer execOutput = TestCommon.exec(appJar, OutputAnalyzer execOutput = TestCommon.exec(appJar,
TestCommon.concat(vmOptionsPrefix, "-Xlog:cds", "HelloString")); TestCommon.concat(vmOptionsPrefix, "-Xlog:aot,cds", "HelloString"));
TestCommon.checkExec(execOutput); TestCommon.checkExec(execOutput);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -45,7 +45,7 @@ public class SharedStringsWbTest {
SharedStringsUtils.buildJarAndWhiteBox("SharedStringsWb"); SharedStringsUtils.buildJarAndWhiteBox("SharedStringsWb");
SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("SharedStringsWb"), SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("SharedStringsWb"),
"SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables"); "SharedStringsBasic.txt", "-Xlog:cds,aot+hashtables");
SharedStringsUtils.runWithArchiveAndWhiteBox("SharedStringsWb"); SharedStringsUtils.runWithArchiveAndWhiteBox("SharedStringsWb");
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -52,7 +52,7 @@ public class SysDictCrash {
"-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5", "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5",
"-cp", ".", "-cp", ".",
"-XX:SharedBaseAddress=0", "-XX:SharedBaseAddress=0",
"-showversion", "-Xlog:cds,cds+hashtables") "-showversion", "-Xlog:cds,aot+hashtables")
.setArchiveName("./SysDictCrash.jsa"); .setArchiveName("./SysDictCrash.jsa");
OutputAnalyzer output = CDSTestUtils.createArchive(opts); OutputAnalyzer output = CDSTestUtils.createArchive(opts);
try { try {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -255,7 +255,7 @@ public class CDSTestUtils {
for (String p : opts.prefix) cmd.add(p); for (String p : opts.prefix) cmd.add(p);
cmd.add("-Xshare:dump"); cmd.add("-Xshare:dump");
cmd.add("-Xlog:cds,cds+hashtables"); cmd.add("-Xlog:cds,aot+hashtables");
if (opts.archiveName == null) if (opts.archiveName == null)
opts.archiveName = getDefaultArchiveName(); opts.archiveName = getDefaultArchiveName();
cmd.add("-XX:SharedArchiveFile=" + opts.archiveName); cmd.add("-XX:SharedArchiveFile=" + opts.archiveName);