[foreign-memaccess+abi] RFR: 8300294: Add tests for by-value unions and structs with nested fixed-length arrays

Jorn Vernee jvernee at openjdk.org
Thu Feb 9 14:18:11 UTC 2023


On Thu, 9 Feb 2023 10:18:31 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/foreign/abi/aarch64/TypeClass.java line 80:
>> 
>>> 78:             } else {
>>> 79:                 // padding or value layouts
>>> 80:                 out.add(member);
>> 
>> Note here that groups with padding will be rejected later when each field is checked in `isHomogeneousFloatAggregate`
>
> Does the order in which you collect the layouts matter? E.g. this will do a depth-first visit of the layout tree - I see that the code above does an indexed get on the scalar layout list, so I believe the order does matter.
> 
> My impression is that it's ok: the depth-first visit returns layouts in the order in which they are laid out in memory, which seems to make sense for an ABI.

It doesn't matter for the classification, all the ValueLayouts just need to be the same. Later when computing the struct storages in CallArranger, it also doesn't really matter. There we look at the carrier, byte size, and maybe alignment. But since all the layouts are again the same, they could technically be processed in any order.

-------------

PR: https://git.openjdk.org/panama-foreign/pull/780


More information about the panama-dev mailing list