Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8319943

MethodHandleStatics should not call CDS.isDumpingClassList()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 23
    • None
    • hotspot

      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()

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: