-
Enhancement
-
Resolution: Fixed
-
P4
-
13
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.
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.
- relates to
-
JDK-8227831 Avoid using volatile for write-once, read-many class field
-
- Closed
-
-
JDK-8219378 NPE in ReflectionFactory.newMethodAccessor when langReflectAccess not initialized
-
- Closed
-