RFR: 7903632: struct accessor info is not derived from toplevel layout decl
Jorn Vernee
jvernee at openjdk.org
Tue Jan 16 16:32:48 UTC 2024
On Tue, 16 Jan 2024 16:14:31 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This PR dials back the code generation updates a little when it comes to struct getter/setter, so that both their layouts and offsets is now derived from the toplevel struct layout - using layout paths, as before.
>
> This allows clients to e.g. tweak layouts in a single place (the topelevel struct layout declaration) to adjust things such as endianness.
I think not creating the VarHandle is probably a bit better. We still end up generating the var handle for the field layout any way (since it's used in the MS getter/setter), but there is more chance of sharing the VarHandle with other use sites, since we don't bake in any offset computations.
-------------
Marked as reviewed by jvernee (Committer).
PR Review: https://git.openjdk.org/jextract/pull/181#pullrequestreview-1824061343
More information about the jextract-dev
mailing list