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

[lworld] The JVM should inject the IdentityObject interface to types which need it

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      In the LW3 user model, the `java.lang.IdentityObject` interface is used to identity types which instances are guaranteed to have an identity. This interface can be explicitly specified by the user, or might be automatically injected by the JVM according to a pre-determined set of rules:

      The JVM injects the `IdentityObject` interface if:
        - the type being created is an array type (currently all arrays have identity)
        - the type being loaded is not a value type, it is an invalid inline super (see JDK-8243204) but none of its super is an invalid inline super.

      If the `IdentityObject` interface has been injected to a given type, this interface won't be visible through reflection code on this type (because reflection is supposed to reflect the content of the class file, and the injected interface doesn't appear in the class file). If the `IdentityObject` interface was explicitly implement, and declared in the class file, it will be visible through reflection.

      Note: for arrays, the injected interface will be visible through reflection, to be consistent with the two other interfaces injected to arrays: `Cloneable` and `Serializable`.


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fparain Frederic Parain
              Reporter:
              fparain Frederic Parain
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: