RFR: 8343140: JfrJavaSupport uses the wrong accessors for sub-int fields
Daniel Jeliński
djelinski at openjdk.org
Thu Nov 7 21:15:45 UTC 2024
On Thu, 7 Nov 2024 17:17:34 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> This test fixes the accessor used by `read_boolean_field` to access boolean fields of the `jdk.jfr.internal.dcmd.Argument` record. It also fixes the read accessors for `short` and `char` types, and marks the write accessors for `boolean`, `short` and `char` as unimplemented.
>>
>> The existing accessor reads the boolean field as int. This results in unaligned access, and probably reads incorrect value on big-endian CPUs.
>>
>> No new tests. I'm sure a test would be useful, but I have no idea how to write one. Existing tier1-3 tests continue to pass.
>
> src/hotspot/share/jfr/jni/jfrJavaSupport.cpp line 347:
>
>> 345: case T_SHORT:
>> 346: Unimplemented();
>> 347: break;
>
> Why not implement these, while we are at it?
because it's more work, and we probably "Ain't Gonna Need It". The method is 6 years old, and is only used in one place.
That being said, if you think these types might be useful in a predictable future, I can implement them.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21952#discussion_r1833377658
More information about the hotspot-jfr-dev
mailing list