-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vm/ffi] Fix variadic arguments on MacOS Arm64
Non-variadic arguments on the stack on MacOS Arm64 are aligned to the value size (which can be smaller than word size). However, for varargs, the arguments on the stack seem to be aligned to the word size. This CL introduces an alignment strategy constant for primitives on the stack in varargs and uses it in the native calling convention calculation. TEST=runtime/vm/compiler/ffi/native_calling_convention_test.cc with runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_macos.expect TEST=tests/ffi/function_varargs_generated_native_leaf_test.dart Closes: #55471 Change-Id: I51d20c3933a2cea9b110954ddec92fb91b9c3ecd Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362762 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Tess Strickland <sstrickl@google.com>
- Loading branch information
Showing
35 changed files
with
685 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_android.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32 | ||
r1 int32 | ||
r2 int32 | ||
r3 int32 | ||
r4 int32 | ||
r5 int32 | ||
r6 int32 | ||
r7 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
=> | ||
r0 int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_fuchsia.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32 | ||
r1 int32 | ||
r2 int32 | ||
r3 int32 | ||
r4 int32 | ||
r5 int32 | ||
r6 int32 | ||
r7 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
=> | ||
r0 int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_ios.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
S+32 int32 | ||
S+40 int32 | ||
S+48 int32 | ||
S+56 int32 | ||
S+64 int32 | ||
S+72 int32 | ||
S+80 int32 | ||
=> | ||
r0 int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_linux.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32 | ||
r1 int32 | ||
r2 int32 | ||
r3 int32 | ||
r4 int32 | ||
r5 int32 | ||
r6 int32 | ||
r7 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
=> | ||
r0 int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_macos.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
S+32 int32 | ||
S+40 int32 | ||
S+48 int32 | ||
S+56 int32 | ||
S+64 int32 | ||
S+72 int32 | ||
S+80 int32 | ||
=> | ||
r0 int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm64_win.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32 | ||
r1 int32 | ||
r2 int32 | ||
r3 int32 | ||
r4 int32 | ||
r5 int32 | ||
r6 int32 | ||
r7 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
=> | ||
r0 int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm_android.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32[int16] | ||
r1 int32[int16] | ||
r2 int32[int16] | ||
r3 int32[int16] | ||
S+0 int32[int16] | ||
S+4 int32[int16] | ||
S+8 int32[int16] | ||
S+12 int32[int16] | ||
S+16 int32[int16] | ||
S+20 int32[int16] | ||
S+24 int32[int16] | ||
S+28 int32[int16] | ||
=> | ||
r0 int32[int16] |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm_ios.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32[int16] | ||
r1 int32[int16] | ||
r2 int32[int16] | ||
r3 int32[int16] | ||
S+0 int32[int16] | ||
S+4 int32[int16] | ||
S+8 int32[int16] | ||
S+12 int32[int16] | ||
S+16 int32[int16] | ||
S+20 int32[int16] | ||
S+24 int32[int16] | ||
S+28 int32[int16] | ||
=> | ||
r0 int32[int16] |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/arm_linux.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
r0 int32[int16] | ||
r1 int32[int16] | ||
r2 int32[int16] | ||
r3 int32[int16] | ||
S+0 int32[int16] | ||
S+4 int32[int16] | ||
S+8 int32[int16] | ||
S+12 int32[int16] | ||
S+16 int32[int16] | ||
S+20 int32[int16] | ||
S+24 int32[int16] | ||
S+28 int32[int16] | ||
=> | ||
r0 int32[int16] |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/ia32_android.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
S+0 int32[int16] | ||
S+4 int32[int16] | ||
S+8 int32[int16] | ||
S+12 int32[int16] | ||
S+16 int32[int16] | ||
S+20 int32[int16] | ||
S+24 int32[int16] | ||
S+28 int32[int16] | ||
S+32 int32[int16] | ||
S+36 int32[int16] | ||
S+40 int32[int16] | ||
S+44 int32[int16] | ||
=> | ||
eax int16 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/ia32_linux.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
S+0 int32[int16] | ||
S+4 int32[int16] | ||
S+8 int32[int16] | ||
S+12 int32[int16] | ||
S+16 int32[int16] | ||
S+20 int32[int16] | ||
S+24 int32[int16] | ||
S+28 int32[int16] | ||
S+32 int32[int16] | ||
S+36 int32[int16] | ||
S+40 int32[int16] | ||
S+44 int32[int16] | ||
=> | ||
eax int16 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/ia32_win.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
S+0 int32[int16] | ||
S+4 int32[int16] | ||
S+8 int32[int16] | ||
S+12 int32[int16] | ||
S+16 int32[int16] | ||
S+20 int32[int16] | ||
S+24 int32[int16] | ||
S+28 int32[int16] | ||
S+32 int32[int16] | ||
S+36 int32[int16] | ||
S+40 int32[int16] | ||
S+44 int32[int16] | ||
=> | ||
eax int16 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/riscv32_linux.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
a0 int32[int16] | ||
a1 int32[int16] | ||
a2 int32[int16] | ||
t3 int32[int16] | ||
t4 int32[int16] | ||
t5 int32[int16] | ||
a6 int32[int16] | ||
a7 int32[int16] | ||
S+0 int32[int16] | ||
S+4 int32[int16] | ||
S+8 int32[int16] | ||
S+12 int32[int16] | ||
=> | ||
a0 int32[int16] |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/riscv64_linux.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
a0 int64[int32] | ||
a1 int64[int32] | ||
a2 int64[int32] | ||
t3 int64[int32] | ||
t4 int64[int32] | ||
t5 int64[int32] | ||
a6 int64[int32] | ||
a7 int64[int32] | ||
S+0 int64[int32] | ||
S+8 int64[int32] | ||
S+16 int64[int32] | ||
S+24 int64[int32] | ||
=> | ||
a0 int64[int32] |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/x64_fuchsia.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
rdi int32 | ||
rsi int32 | ||
rdx int32 | ||
rcx int32 | ||
r8 int32 | ||
r9 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
S+32 int32 | ||
S+40 int32 | ||
=> | ||
rax int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/x64_ios.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
rdi int32 | ||
rsi int32 | ||
rdx int32 | ||
rcx int32 | ||
r8 int32 | ||
r9 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
S+32 int32 | ||
S+40 int32 | ||
=> | ||
rax int32 |
14 changes: 14 additions & 0 deletions
14
runtime/vm/compiler/ffi/unit_tests/variadic_less_than_word/x64_linux.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
rdi int32 | ||
rsi int32 | ||
rdx int32 | ||
rcx int32 | ||
r8 int32 | ||
r9 int32 | ||
S+0 int32 | ||
S+8 int32 | ||
S+16 int32 | ||
S+24 int32 | ||
S+32 int32 | ||
S+40 int32 | ||
=> | ||
rax int32 |
Oops, something went wrong.