[lworld] RFR: 8349945: Implement strict static fields (proposed JVM feature) [v3]
Dan Heidinga
heidinga at openjdk.org
Mon May 26 13:36:04 UTC 2025
On Fri, 23 May 2025 20:26:57 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> This patch enables and implements verification for fields with the ACC_STATIC and ACC_STRICT modifiers. To enforce strictness on static fields, the reads and writes on the field are tracked dynamically to ensure that the field is written before being read and written to before.
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
>
> Chen and Dan comments and cleanup
There are a couple of other corner cases for dealing with reflection we should probably test. Assume a single `strict static final` field :
* bytecode write; reflective read; bytecode write --> error for write after read
* reflective write; bytecode read, bytecode write --> error for write after read
* reflective write; bytecode read, reflective write --> error for write after read
* reflective write; reflective read, reflective write --> error for write after read
This ensures we've covered the mix of reflective vs bytecode reads and writes and ensures all paths correctly set and check the bits.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1465#issuecomment-2909781422
More information about the valhalla-dev
mailing list