[lworld] RFR: 8288135: [lworld] Implement HotSpot flag -XX:+EnablePrimitiveClasses [v10]

David Simms dsimms at openjdk.org
Tue Oct 4 07:21:32 UTC 2022


On Tue, 4 Oct 2022 07:10:03 GMT, David Simms <dsimms at openjdk.org> wrote:

>> src/hotspot/share/classfile/classFileParser.cpp line 3328:
>> 
>>> 3326:       recognized_modifiers |= JVM_ACC_MODULE;
>>> 3327:     }
>>> 3328:     // JVM_ACC_VALUE, JVM_ACC_PRIMITIVE, and JVM_ACC_IDENTITY are defined depending on version and feature flag
>> 
>> The implementation doesn't seem to match the comment nor the intent of the patch. JVM_ACC_VALUE and JVM_ACC_IDENTITY should be controlled by the class file version (tested with supports_inline_types()), but JVM_ACC_PRIMITIVE should be controlled by the class file version and the EnablePrimitiveClasses flag.
>
> Agree the comment doesn't quite match. Let me check the behavior is correct:
> 
> Currently (in this patch); 
> - if the classfile is new enough to be aware of the existence (`supports_inline_types()`) of new flags, the are placed in the recognized set, and later feature checks produce errors to use the appropriate switches
> - older classfiles we simply ignore modifiers that were not defined at the time of that version, if one took a new primitive, and downgraded it's version, the VM will quietly ignore these modifiers (but probably take issue with other classfile features, like static factory with special naming)
> - `ACC_SUPER `and `ACC_IDENTITY` overlap requires special handling based on both version and feature flag (`EnableValhalla`)
> 
> Is this your view too ?

Comment removed, it seems superfluous (the code describes itself).

-------------

PR: https://git.openjdk.org/valhalla/pull/727



More information about the valhalla-dev mailing list