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

Danil Bubnov duke at openjdk.java.net
Thu Dec 2 07:00:52 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

Danil Bubnov has updated the pull request incrementally with one additional commit since the last revision:

  Add test with an odd number of arguments

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6641/files
  - new: https://git.openjdk.java.net/jdk/pull/6641/files/c76331bc..2ff8c037

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6641&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6641&range=00-01

  Stats: 73 lines in 2 files changed: 73 ins; 0 del; 0 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