JBR-7351 DCEVM: Respect explicit -XX:+ClassUnloading option

Ensure that ClassUnloading is not disabled if the -XX:+ClassUnloading flag is explicitly set by the user. Display a warning about potential instability in this configuration.
This commit is contained in:
Vladimir Dvorak
2024-07-07 09:33:30 +02:00
committed by Vitaly Provodin
parent 22d990ac7e
commit 7b2ddd448f

View File

@@ -3765,8 +3765,12 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
setup_hotswap_agent();
if (AllowEnhancedClassRedefinition) {
ClassUnloading = false;
ClassUnloadingWithConcurrentMark = false;
if (!FLAG_IS_CMDLINE(ClassUnloading)) {
ClassUnloading = false;
ClassUnloadingWithConcurrentMark = false;
} else {
warning("The JVM is unstable when using -XX:+AllowEnhancedClassRedefinition and -XX:+ClassUnloading together!");
}
}
#if !INCLUDE_CDS