RFR: 8331734: Atomic MemorySegment VarHandle operations fails for element layouts
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed May 8 16:39:16 UTC 2024
On Wed, 8 May 2024 15:32:27 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> * `x_handle` is really meant to provide access to a memory segment modelling (at least) one struct with layout `POINT_LAYOUT`. As such, the initial segment/offset combo should (a) be adequately aligned (according to `POINT_LAYOUT.byteAlignment()`) and have sufficient size (according to `POINT_LAYOUT.byteSize()`)
An example of this approach is attempted here:
https://github.com/openjdk/jdk/compare/master...mcimadamore:jdk:bad_align_segment_var_handle+size_checks?expand=1
Again, no significant performance regression is observed - the root layout checks dominate the value layout checks, and it seems like C2 is able to spot that.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19124#issuecomment-2100970680
More information about the core-libs-dev
mailing list