Skip to content

Commit f07600d

Browse files
author
duke
committedMar 20, 2023
Automatic merge of jdk:master into master
2 parents 42b6e2f + eb73fa8 commit f07600d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
 

‎src/hotspot/share/cds/filemap.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -2570,6 +2570,7 @@ GrowableArray<const char*>* FileMapInfo::_non_existent_class_paths = nullptr;
25702570
// region of the archive, which is not mapped yet.
25712571
bool FileMapInfo::initialize() {
25722572
assert(UseSharedSpaces, "UseSharedSpaces expected.");
2573+
assert(Arguments::has_jimage(), "The shared archive file cannot be used with an exploded module build.");
25732574

25742575
if (JvmtiExport::should_post_class_file_load_hook() && JvmtiExport::has_early_class_hook_env()) {
25752576
// CDS assumes that no classes resolved in vmClasses::resolve_all()
@@ -2580,11 +2581,6 @@ bool FileMapInfo::initialize() {
25802581
return false;
25812582
}
25822583

2583-
if (!Arguments::has_jimage()) {
2584-
log_info(cds)("The shared archive file cannot be used with an exploded module build.");
2585-
return false;
2586-
}
2587-
25882584
if (!open_for_read() || !init_from_file(_fd) || !validate_header()) {
25892585
if (_is_static) {
25902586
log_info(cds)("Initialize static archive failed.");

‎src/hotspot/share/runtime/arguments.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,11 @@ jint Arguments::parse_vm_init_args(const JavaVMInitArgs *vm_options_args,
21392139
return result;
21402140
}
21412141

2142+
// Disable CDS for exploded image
2143+
if (!has_jimage()) {
2144+
no_shared_spaces("CDS disabled on exploded JDK");
2145+
}
2146+
21422147
// We need to ensure processor and memory resources have been properly
21432148
// configured - which may rely on arguments we just processed - before
21442149
// doing the final argument processing. Any argument processing that

0 commit comments

Comments
 (0)
Please sign in to comment.