RFR: 8305755: [JVMCI] missing barriers in CompilerToVM.readFieldValue for Reference.referent

Erik Österlund eosterlund at openjdk.org
Fri Apr 7 19:25:42 UTC 2023


On Fri, 7 Apr 2023 17:30:39 GMT, Tom Rodriguez <never at openjdk.org> wrote:

> Add missing GC barrier for reflective read.  I'm not sure the idiom I've chosen it the correct one so please correct me if there's a better way to write this.  In testing, this resolved the issue.

There are comments suggesting we need to read with Java volatile semantics. It was acquire before, which isn't always strong enough for Java volatiles. With the acquire dropped, I suppose it's even less okay. Looks like you want to use MO_SEQ_CST on these accesses, which precisely matches Java volatiles.

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

Changes requested by eosterlund (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13389#pullrequestreview-1376513021


More information about the hotspot-compiler-dev mailing list