[lworld] RFR: 8274800: [lworld] Primitive classes can't be retransformed
Frederic Parain
fparain at openjdk.java.net
Wed Dec 8 01:23:33 UTC 2021
On Wed, 8 Dec 2021 00:49:49 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:
>> Fix for java.lang.instrument.Instrumentation.retransformClasses()
>>
>> Cases for retransformation primitive to identity (and identity to primitive) classes and changing primitive class fields (so default_value becomes invalid) are handled by existing code and spec changes are not required.
>>
>> Also added serviceability test to hotspot_valhalla group
>
> src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp line 886:
>
>> 884:
>> 885: // JVMSpec| u2 access_flags;
>> 886: write_u2(ik()->access_flags().get_flags() & (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_INLINE));
>
> Would it better to consider adding JVM_ACC_INLINE to JVM_RECOGNIZED_CLASS_MODIFIERS?
> Also, I see other definitions of the JVM_RECOGNIZED_CLASS_MODIFIERS in files:
>
> src/hotspot/share/include/jvm_constants.h
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
>
> Do we want this modifier added there as well?
The problem is that JVM_RECOGNIZED_CLASS_MODIFIERS contains all modifiers defined for JDK8 and earlier, but the validity of new modifiers depends on class file version (see classFileParser.cpp where JVM_RECOGNIZED_CLASS_MODIFIERS is also used).
-------------
PR: https://git.openjdk.java.net/valhalla/pull/588
More information about the valhalla-dev
mailing list