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

Reexamine the initialization of LangReflectAccess shared secret at AccessibleObject::<clinit>

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:

      Description

      Currently Modifier::<clinit> set up LangReflectAccess shared secret.
      ReflectionFactory lazily initializes LangReflectAccess by calling
      Modifier.isPublic to ensure <clinit> is called.

      One observation is that when ReflectionFactory methods are called,
      there is a Method, Field or Constructor object in hand. In addition,
      Method class is initialized very early during startup by the VM and
      so does AccessibleObject class.

      The ReflectionFactory::newField and newMethod that don't take
      Field/Method parameter are unused (I suspect they were
      used by the VM native reflection implementation previously).

      This issue suggests to examine moving setLangReflectAccess to
      AccessibleObject class initializer. This will need to look into any
      impact to the order of classes loaded during early startup.

      This suggested patch has been verified by J9.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mchung Mandy Chung
              Reporter:
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: