mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 02:24:40 +02:00
8213713: Minor issues during MetaspaceShared::initialize_runtime_shared_and_meta_spaces
1)Populate MetaspaceShared::_core_spaces_size early at mapping time; 2)Fix FileMapInfo::validate_shared_path_table to report failure properly; 3)Remove dead code in FileMapInfo::validate_shared_path_table. Reviewed-by: iklam, ccheung
This commit is contained in:
parent
d7d4bc9fdd
commit
f049167354
3 changed files with 17 additions and 6 deletions
|
@ -287,6 +287,12 @@ bool SharedClassPathEntry::validate(bool is_class_path) {
|
|||
" the shared archive file: %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
if (PrintSharedArchiveAndExit && !ok) {
|
||||
// If PrintSharedArchiveAndExit is enabled, don't report failure to the
|
||||
// caller. Please see above comments for more details.
|
||||
ok = true;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
@ -479,16 +485,17 @@ bool FileMapInfo::validate_shared_path_table() {
|
|||
if (i < module_paths_start_index) {
|
||||
if (shared_path(i)->validate()) {
|
||||
log_info(class, path)("ok");
|
||||
} else {
|
||||
assert(!UseSharedSpaces, "UseSharedSpaces should be disabled");
|
||||
return false;
|
||||
}
|
||||
} else if (i >= module_paths_start_index) {
|
||||
if (shared_path(i)->validate(false /* not a class path entry */)) {
|
||||
log_info(class, path)("ok");
|
||||
} else {
|
||||
assert(!UseSharedSpaces, "UseSharedSpaces should be disabled");
|
||||
return false;
|
||||
}
|
||||
} else if (!PrintSharedArchiveAndExit) {
|
||||
_validating_shared_path_table = false;
|
||||
_shared_path_table = NULL;
|
||||
_shared_path_table_size = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1919,6 +1919,7 @@ bool MetaspaceShared::map_shared_spaces(FileMapInfo* mapinfo) {
|
|||
assert(ro_top == md_base, "must be");
|
||||
assert(md_top == od_base, "must be");
|
||||
|
||||
_core_spaces_size = mapinfo->core_spaces_size();
|
||||
MetaspaceObj::set_shared_metaspace_range((void*)mc_base, (void*)od_top);
|
||||
return true;
|
||||
} else {
|
||||
|
@ -1951,7 +1952,8 @@ void MetaspaceShared::initialize_shared_spaces() {
|
|||
FileMapInfo *mapinfo = FileMapInfo::current_info();
|
||||
_cds_i2i_entry_code_buffers = mapinfo->cds_i2i_entry_code_buffers();
|
||||
_cds_i2i_entry_code_buffers_size = mapinfo->cds_i2i_entry_code_buffers_size();
|
||||
_core_spaces_size = mapinfo->core_spaces_size();
|
||||
// _core_spaces_size is loaded from the shared archive immediatelly after mapping
|
||||
assert(_core_spaces_size == mapinfo->core_spaces_size(), "sanity");
|
||||
char* buffer = mapinfo->misc_data_patching_start();
|
||||
clone_cpp_vtables((intptr_t*)buffer);
|
||||
|
||||
|
|
|
@ -100,6 +100,8 @@ class MetaspaceShared : AllStatic {
|
|||
}
|
||||
static void commit_shared_space_to(char* newtop) NOT_CDS_RETURN;
|
||||
static size_t core_spaces_size() {
|
||||
assert(DumpSharedSpaces || UseSharedSpaces, "sanity");
|
||||
assert(_core_spaces_size != 0, "sanity");
|
||||
return _core_spaces_size;
|
||||
}
|
||||
static void initialize_dumptime_shared_and_meta_spaces() NOT_CDS_RETURN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue