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

@ -1467,6 +1467,12 @@ bool Arguments::add_property(const char* prop, PropertyWriteable writeable, Prop
value = &prop[key_len + 1];
}
if (is_internal_module_property(key) ||
strcmp(key, "jdk.module.main") == 0) {
MetaspaceShared::disable_optimized_module_handling();
log_info(cds)("Using optimized module handling disabled due to incompatible property: %s=%s", key, value);
}
if (strcmp(key, "java.compiler") == 0) {
process_java_compiler_argument(value);
// Record value in Arguments, but let it get passed to Java.
@ -2510,6 +2516,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
// -bootclasspath/a:
} else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
Arguments::append_sysclasspath(tail);
MetaspaceShared::disable_optimized_module_handling();
log_info(cds)("Using optimized module handling disabled due to bootclasspath was appended");
// -bootclasspath/p:
} else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
jio_fprintf(defaultStream::output_stream(),