[foreign] RFR: 8223808: initial port for AArch64

Nick Gasson nick.gasson at arm.com
Tue May 14 06:29:26 UTC 2019


Hi,

A few months ago I asked about a port of the foreign branch for AArch64, 
and in the last couple of weeks I had some time to do some work on it. 
I'm sending what I have for review now as I think Dmitry was also 
planning to start looking at this.

http://cr.openjdk.java.net/~ngasson/foreign/8223808/webrev.0/

With this patch 49/53 tests under test/jdk/java/foreign/ pass on 
AArch64. The failures are:

java/foreign/StructByValueTest.java
java/foreign/UnalignedStructTest.java
java/foreign/Upcall/StructUpcall.java
java/foreign/LongDoubleTest.java

Currently passing a >16B struct by value doesn't work, because in this 
case we need to pass a pointer to a copy of the struct in one of the 
integer registers, but I couldn't immediately figure out how to modify 
CallingSequenceBuilderImpl to do this. Although I believe this is the 
same as the Windows x64 ABI (?) so I'll check the implementation there.

Returning a struct by value doesn't work yet as we need to pass a 
pointer to the temporary storage in the "indirect result location 
register" (r8).

Passing / returning long double doesn't work, I haven't investigated why.

Jextract also builds and runs, but some of the tests fail for the 
reasons above.

Because I based this patch on the existing code for x86 there's a lot of 
duplication now, particularly in universalNativeInvoker_aarch64.cpp. I 
think all of the Shuffle* classes could be moved to some shared code, 
with very minimal platform specific #ifdefs. Similarly for some of the 
code in SharedUtils.java. If you're ok with this I can work on it in a 
separate patch?


Thanks,
Nick


More information about the panama-dev mailing list