Why the signature of arrangeDowncall/arrangeUpcall in CallArranger.java is inconsistent between Aarch64 and x64?

Jorn Vernee jorn.vernee at oracle.com
Thu Feb 2 16:49:18 UTC 2023


Hi,

The AArch64 CallArranger has several different subclasses (for different 
OSes). The arrangeDowncall/arrangeUpcall method calls (indirectly 
through getBindings) several overridden instance methods in these 
subclasses (see the `abstract` methods in the AArch64 CallArranger), so 
it has to be non-static.

For the x64 implementations of CallArranger we don't have any subclasses 
of CallArranger, so there the method can be static.

Jorn

On 02/02/2023 00:55, Cheng Jin wrote:
>
> Hi there,
>
> Can anybody explain why the “static” keyword was removed from 
> arrangeDowncall/arrangeUpcall on Aarch64 (since JDK18) in 
> src/java.base/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java?
>
>    public MethodHandle arrangeDowncall(MethodType mt, 
> FunctionDescriptor cDesc, LinkerOptions options) {
>
> ...
>
>     }
>
>     public MemorySegment arrangeUpcall(MethodHandle target, MethodType 
> mt, FunctionDescriptor cDesc, SegmentScope session) {
>
> ...
>
>     }
>
> It remains unchanged on x64 in 
> src/java.base/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java 
> & 
> src/java.base/share/classes/jdk/internal/foreign/abi/x64/windows/CallArranger.java
>
>     public static MethodHandle arrangeDowncall(MethodType mt, 
> FunctionDescriptor cDesc, LinkerOptions options) {
>
> ...
>
>     }
>
>     public static MemorySegment arrangeUpcall(MethodHandle target, 
> MethodType mt, FunctionDescriptor cDesc, SegmentScope scope) {
>
> ...
>
> }
>
> I am wondering whether there was special reason for this or anything 
> else I am unaware of.  Thanks.
>
> Best Regards
>
> Cheng Jin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230202/92f73034/attachment.htm>


More information about the panama-dev mailing list