[lworld] RFR: 8349945: Implement strict static fields (proposed JVM feature)
Dan Heidinga
heidinga at openjdk.org
Thu May 22 12:21:04 UTC 2025
On Tue, 20 May 2025 22:15:29 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.
src/hotspot/share/oops/fieldInfo.hpp line 317:
> 315: _fs_modification_watched, // field modification is watched by JVMTI
> 316: _fs_strict_static_unset, // JVM_ACC_STRICT static field has not yet been set
> 317: _fs_strict_static_unread, // SS field has not yet been read (EnforceStrictStatics=2 only)
Suggestion:
_fs_strict_static_unread, // SS field has not yet been read
Minor comment update - I think we removed the various modes so we don't need to mention them in the comments
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1465#discussion_r2102418109
More information about the valhalla-dev
mailing list