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

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

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 14
    • 13
    • core-libs

    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

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

              Dates

                Created:
                Updated:
                Resolved: