[foreign-memaccess] RFR 8228447: Remove kinds from value layouts

John Rose john.r.rose at oracle.com
Mon Jul 22 23:00:16 UTC 2019


On Jul 22, 2019, at 2:30 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> * long, int, short, byte -> integer register
> * float, double -> SSE register
> 
> But we can't sadly, do much else. At least that's the conclusion I've reached when it comes to aggregates. Yes, we could have, in principle, different systems to communicate ABI info on different types - e.g. use carriers for scalar values, and use layouts for aggregates. But, if you go down that path, it still means that your layout must be able to capture the float vs. int distinction on its own (otherwise how do you classify struct { int x; } vs. struct { float f; } ?).

You could go a little farther with carriers in structs by inspecting the accessor signature for x and f.

But I agree that relying only on carriers demands a lot from them, which is why the “kind” attribute is part of the LDL document in the first place.

Turning a hard-wired “kind” property into a soft-wired annotation is fine thing to do.

> To solve this problem, there are two options: enhance the layouts with something like annotations - which is what I've described. Or we could enhance the carrier system to cover aggregates - e.g. StructWithOneInt.class - but if you look at the ABI (esp. SysV) there are so many combinations to pass small structs into registers that having one single carrier for each combination is just overkill. And, needless to say, such carrier would end up replicating some of the structural info already available in the layout.

Yes; I agree.

— John



More information about the panama-dev mailing list