RFR: 8262901: [macos_aarch64] NativeCallTest expected:<-3.8194101E18> but was:<3.02668882E10>

Danil Bubnov duke at openjdk.java.net
Wed Dec 1 16:25:40 UTC 2021


This is the fix of aarch64 jvmci calling convention.

On MacOS/aarch64 "Function arguments may consume slots on the stack that are not multiples of 8 bytes" [1], but current approach uses only wordsize or bigger slots, which is incorrect (that is why tests were failing [4]). Now arguments consume the right amount of bytes.

Another problem is that current approach don't make 16-byte alignment of Stack Pointer [1][2][3]. However, tests not fail on Linux/aarch64 and Windows/aarch64. They pass because in this tests all functions have even number of argumets, that is why 16-byte alignment comes automatically. But if you try to add or delete one argumets, tests will fail with SIGBUS.

I've tested this patch on MacOS/aarch64 and Linux/aarch64, all tests have passed.

Also I don't understand, why current tests (NativeCallTest) use only int, long, float and double as arguments types. Is it possible to add functions with another types like byte or short? I tried, but it fails on every platform.

[1] https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
[2] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#the-stack
[3] https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-160#stack
[4] https://bugs.openjdk.java.net/browse/JDK-8262901

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

Commit messages:
 - Remove NativeCallTest from ProblemList for macosx-aarch64
 - Add stack alignment and MacOS specific code

Changes: https://git.openjdk.java.net/jdk/pull/6641/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6641&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262901
  Stats: 25 lines in 4 files changed: 18 ins; 1 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6641.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6641/head:pull/6641

PR: https://git.openjdk.java.net/jdk/pull/6641


More information about the hotspot-compiler-dev mailing list