On Mon, 7 Nov 2022 09:40:03 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> 
wrote:

>> src/java.base/share/classes/jdk/internal/foreign/abi/x64/windows/CallArranger.java
>>  line 165:
>> 
>>> 163:                 assert forArguments : "no stack returns";
>>> 164:                 // stack
>>> 165:                 long alignment = Math.max(layout.byteAlignment(), 
>>> STACK_SLOT_SIZE);
>> 
>> This is also missing part of the changes from: 
>> https://github.com/openjdk/panama-foreign/pull/728/ but other changes to the 
>> shared code are present. The `layout` parameter is not needed here. (see the 
>> changes to this file in the original PR)
>
> Actually, this patch is missing most of the stuff in PR 728. I was under the 
> impression that, in order to fully support that, some VM changes were needed 
> (e.g. to have better granularity in call shuffling - as per 
> https://github.com/openjdk/panama-foreign/pull/699). As a result, this PR 
> only contains changes to SharedUtil (to remove unused alignment functions) - 
> but nothing else.

699 is not needed for this. 728 is a pure Java change that simply rejects 
layouts that don't have their natural alignment (so, it will rejects packed 
structs for instance, since the implementation doesn't support them on all 
platforms). All the other changes from 728 are here (most notably the code in 
AbstractLinker that checks the alignment), except the change that ignores the 
`layout` here and turns the code around the line above into an `assert`.

The mac stack spilling patch requires 699 though 
(https://github.com/openjdk/panama-foreign/pull/746). I will put that in the PR 
with the VM changes.

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

PR: https://git.openjdk.org/jdk/pull/10872

Reply via email to