[lworld] RFR: 8353236: [lworld] Better documentation for Valhalla Unsafe intrinsics [v2]
Quan Anh Mai
qamai at openjdk.org
Thu Apr 10 05:33:40 UTC 2025
On Wed, 9 Apr 2025 14:02:42 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>>
>> more explanation
>
> src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 73:
>
>> 71: * control path may eventually reach an invocation of an {@code Unsafe} method
>> 72: * with illegal arguments, the symptoms of undefined behavior may be present
>> 73: * even before the invocation of the {@code Unsafe} method.
>
> I think you can talk in a more JIT-oriented manner, that while Unsafe is mostly set up to be the hooks between core libraries and hotspot runtime, hotspot compiler may interpret the input values and perform aggressive optimizations with contracts that cannot be explicitly expressed by Java program semantics.
Done, not only the JIT, but the runtime may exhibit unpredictable behaviors in the presence of UB, too.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1425#discussion_r2036533697
More information about the valhalla-dev
mailing list