8240245: Avoid calling is_shared_class_visible() in SystemDictionary::load_shared_class()

SystemDitionary::load_shared_class can avoid calling is_shared_class_visible if dumptime and runtime do not use modulepath and boot classpath appending.

Reviewed-by: iklam, ccheung
This commit is contained in:
Yumin Qi 2020-06-10 23:16:27 -07:00
parent 6d8c81f694
commit 96fadefaa3
14 changed files with 496 additions and 17 deletions

View file

@ -1528,6 +1528,19 @@ void ClassLoader::initialize_module_path(TRAPS) {
FileMapInfo::allocate_shared_path_table();
}
}
// Helper function used by CDS code to get the number of module path
// entries during shared classpath setup time.
int ClassLoader::num_module_path_entries() {
Arguments::assert_is_dumping_archive();
int num_entries = 0;
ClassPathEntry* e= ClassLoader::_module_path_entries;
while (e != NULL) {
num_entries ++;
e = e->next();
}
return num_entries;
}
#endif
jlong ClassLoader::classloader_time_ms() {