RFR: 8189685: need PerfMemory class update and a volatile_static_field support in VMStructs [v3]
Chris Plummer
cjplummer at openjdk.org
Wed Aug 23 23:40:25 UTC 2023
On Wed, 23 Aug 2023 23:31:16 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
>> But in that case the use of the macro doesn't make much sense. Regardless of the field type, vmstructs doesn't deal with volatile pointers to fields. It deals with volatile fields (that can be pointers or scalar). I think if anything the macro has always been wrong and should contain `volatile type * dummy`. It probably never fails because it is taking a non-volatile type and assigning it to a volatile type, which always works if the types are otherwise the same.
>
> Well of course that change blows up
>
> invalid conversion from 'ClassLoaderData* volatile*' to 'volatile ClassLoaderData**'
>
> There's something I'm not understanding here. I use to understand the volatile ordering syntax and how to read it properly, but that was long long ago.
I take back the following statement:
> It probably never fails because it is taking a non-volatile type and assigning it to a volatile type, which always works if the types are otherwise the same.
Since the field type is volatile, the current approach must be correct. Otherwise there would be cast errors if the LHS did not have volatile in the right place.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15373#discussion_r1303641251
More information about the hotspot-runtime-dev
mailing list