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

Leyden ArchiveReflectionData optimization does not work with excluded classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • repo-leyden
    • repo-leyden
    • hotspot

      https://github.com/openjdk/leyden/blob/09af3d438237b9fe80b1b7b5fe3327fb1e696643/src/hotspot/share/classfile/systemDictionaryShared.cpp#L296-L304

        if (is_jfr_event_class(k)) {
          // We cannot include JFR event classes because they need runtime-specific
          // instrumentation in order to work with -XX:FlightRecorderOptions:retransform=false.
          // There are only a small number of these classes, so it's not worthwhile to
          // support them and make CDS more complicated.
          if (!CDSConfig::is_dumping_reflection_data()) { // FIXME: !!! HACK !!!
            return warn_excluded(k, "JFR event class");
          }
        }

      Currently, java.lang.Class::reflectionData can reference a Java mirror of an excluded class. This will cause AOT assembly phase to fail.

      The above HACK is to partially work around this problem by excluding fewer classes. However, it still doesn't work because other types of classes can be excluded (e.g., signed classes or unverifiable classes).

      A proper fix is to pre-scan the signature of all the fields/methods/constructors, and avoid AOT-generation of reflectionData if any of the signatures refer to an excluded class.

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

              Created:
              Updated: