CDS.isDumpingClassList() is wrong, as the classlist is not being dumped when writing the dynamic archive. I.e., the "|| DynamicDumpSharedSpaces" part should be removed.
https://github.com/openjdk/jdk/blob/50f41d63704037dc0f9f1ad03eb8d53cb26052ce/src/hotspot/share/prims/jvm.cpp#L3727-L3733
JVM_LEAF(jboolean, JVM_IsDumpingClassList(JNIEnv *env))
#if INCLUDE_CDS
return ClassListWriter::is_enabled() || DynamicDumpSharedSpaces;
#else
return false;
#endif // INCLUDE_CDS
JVM_END
The reason for the existing code is MethodHandleStatics uses CDS.isDumpingClassList() to determine whether to trace the lambda forms:
https://github.com/openjdk/jdk/blob/50f41d63704037dc0f9f1ad03eb8d53cb26052ce/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java#L137-L139
if (CDS.isDumpingClassList()) {
CDS.traceLambdaFormInvoker("[LF_RESOLVE]", holder.getName(), name, shortenSignature(basicTypeSignature(type)));
}
But this should be guarded by a new method CDS.isTracingLambdaFormInvokers()
https://github.com/openjdk/jdk/blob/50f41d63704037dc0f9f1ad03eb8d53cb26052ce/src/hotspot/share/prims/jvm.cpp#L3727-L3733
JVM_LEAF(jboolean, JVM_IsDumpingClassList(JNIEnv *env))
#if INCLUDE_CDS
return ClassListWriter::is_enabled() || DynamicDumpSharedSpaces;
#else
return false;
#endif // INCLUDE_CDS
JVM_END
The reason for the existing code is MethodHandleStatics uses CDS.isDumpingClassList() to determine whether to trace the lambda forms:
https://github.com/openjdk/jdk/blob/50f41d63704037dc0f9f1ad03eb8d53cb26052ce/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java#L137-L139
if (CDS.isDumpingClassList()) {
CDS.traceLambdaFormInvoker("[LF_RESOLVE]", holder.getName(), name, shortenSignature(basicTypeSignature(type)));
}
But this should be guarded by a new method CDS.isTracingLambdaFormInvokers()
- duplicates
-
JDK-8327138 Clean up status management in cdsConfig.hpp and CDS.java
- Resolved