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

[lworld] AccessFlags location and release need futher work for Valhalla (IDENTITY and SUPER)

XMLWordPrintable

      The jdk-25+21 merge brought in JDK-8297271 "AccessFlag.maskToAccessFlags should be specific to class file version"

      Valhalla appears to have some further work to do here. Current state:

      1) jdk/classfile/AdvancedTransformationsTest.java fails with: "java.lang.IllegalArgumentException: Unmatched bit position 0x20 for location INNER_CLASS"

      2) tools/javap/T4975569.java fails with: "Error: Access Flags: Unmatched bit position 0x20 for location INNER_CLASS"

      Problem listings these for now.

      AccessFlag.java appears to contain some discrepancies when it comes to inner class allowing SUPER. It appears Valhalla uses SUPER in SET_CLASS_INNER_CLASS (location set), but that is not so in mainline. Doesn't mention in super in inner class in JEP401 (just IDENTITY, which of course == ACC_SUPER).

      INNER_CLASS was declared with IDENTITY or SUPER, was tweaked back (during merge) to "if preview() then IDENTITY" (not "else SUPER"). Otherwise java/lang/reflect/AccessFlag/VersionedLocationsTest.java would fail.

      It appears java/lang/reflect/AccessFlag/VersionedLocationsTest.java needs to be run with and without @enablePreview.

      I don't believe the current version checking uses minor (aka preview), so it is difficult to map IDENTITY with "latest version + preview" vs "latest version". So correctly allowing IDENTITY for preview but not previous releases is not currently possible

      ...it is entirely possible further (yet merged) changes resolve some of this ?

            liach Chen Liang
            dsimms David Simms
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: