[lworld] RFR: 8349945: Implement strict static fields (proposed JVM feature)
Chen Liang
liach at openjdk.org
Wed May 21 18:55:03 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.
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/Brbefore_BAD.jasm line 24:
> 22: */
> 23:
> 24: identity class Brbefore_BAD version 69:65535
Can't this be compiled with javac? I don't think we are going to add any checks for strict initialization on the javac side as pre-write reads cannot be detected because they can easily happen in nested method calls.
Even if we decide to use jasm, I think the best practice seems to leave the source to generate the jasm in a .test file, and comment in the jasm what was changed.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1465#discussion_r2100957443
More information about the valhalla-dev
mailing list