[lworld] RFR: 8349945: Implement strict static fields (proposed JVM feature) [v4]
Chen Liang
liach at openjdk.org
Fri May 30 00:38:05 UTC 2025
On Thu, 29 May 2025 17:02:48 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 with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>
> - Merge branch 'lworld' into implement_strict_statics_8349945
> - Dan comments and new test case
> - Chen and Dan comments and cleanup
> - Copyrights
> - Added reflective tests and problem listed test
> - Added tests
> - 8349945: Implement strict static fields (proposed JVM feature)
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/StrictStaticTests.java line 150:
> 148: System.out.println(vererrs);
> 149: var cm = ClassFile.of().parse(classBytes);
> 150: System.out.println("" + cm + cm.fields() + cm.methods() + cm.methods().get(0).code().orElseThrow().elementList());
Suggestion:
System.out.println(cm.toDebugString());
Note we can't fail here: ClassFile.verify is not up-to-date with strict fields. I don't know who originally wrote the `VerificationTable` code that is supposed to be on parity with `stackMapTable.cpp`, but that code is complex and is bound to diverge from whatever we have in the C++ code there.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1465#discussion_r2114943440
More information about the valhalla-dev
mailing list