Skip to content

Commit

Permalink
8301715: CDS should be disabled in exploded JDK
Browse files Browse the repository at this point in the history
Reviewed-by: ccheung, coleenp
  • Loading branch information
Matias Saavedra Silva authored and coleenp committed Mar 20, 2023
1 parent 80e9797 commit eb73fa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/hotspot/share/cds/filemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2570,6 +2570,7 @@ GrowableArray<const char*>* FileMapInfo::_non_existent_class_paths = nullptr;
// region of the archive, which is not mapped yet.
bool FileMapInfo::initialize() {
assert(UseSharedSpaces, "UseSharedSpaces expected.");
assert(Arguments::has_jimage(), "The shared archive file cannot be used with an exploded module build.");

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

if (!Arguments::has_jimage()) {
log_info(cds)("The shared archive file cannot be used with an exploded module build.");
return false;
}

if (!open_for_read() || !init_from_file(_fd) || !validate_header()) {
if (_is_static) {
log_info(cds)("Initialize static archive failed.");
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,11 @@ jint Arguments::parse_vm_init_args(const JavaVMInitArgs *vm_options_args,
return result;
}

// Disable CDS for exploded image
if (!has_jimage()) {
no_shared_spaces("CDS disabled on exploded JDK");
}

// We need to ensure processor and memory resources have been properly
// configured - which may rely on arguments we just processed - before
// doing the final argument processing. Any argument processing that
Expand Down

1 comment on commit eb73fa8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.