-
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] Support packed
Struct
s backend
With packed structs, the x64 non-Windows ABI only put structs in CPU/FPU registers when all it fields happen to be aligned. This CL introduces the `NativeType::ContainsUnalignedMembers` query for calling convention calculations. Bug: #38158 tools/build.py run_ffi_unit_tests && tools/test.py ffi_unit TEST=runtime/vm/compiler/ffi/native_calling_convention_test.cc TEST=runtime/vm/compiler/ffi/native_type_test.cc These tests are exercised on vm-precomp-ffi-qemu-linux-release-arm-try. Change-Id: I504f67ae22a6af375d5eb57ff26b58d340099df8 Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186142 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Clement Skau <cskau@google.com>
- Loading branch information
Showing
33 changed files
with
390 additions
and
9 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
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
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
M(r0 int64) Compound(size: 8) | ||
M(r1 int64) Compound(size: 8) | ||
M(r2 int64) Compound(size: 8) | ||
M(r3 int64) Compound(size: 8) | ||
M(r4 int64) Compound(size: 8) | ||
M(r5 int64) Compound(size: 8) | ||
M(r6 int64) Compound(size: 8) | ||
M(r7 int64) Compound(size: 8) | ||
S+0 Compound(size: 8) | ||
S+8 Compound(size: 8) | ||
=> | ||
M(r0 int64) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
M(r0 int64) Compound(size: 8) | ||
M(r1 int64) Compound(size: 8) | ||
M(r2 int64) Compound(size: 8) | ||
M(r3 int64) Compound(size: 8) | ||
M(r4 int64) Compound(size: 8) | ||
M(r5 int64) Compound(size: 8) | ||
M(r6 int64) Compound(size: 8) | ||
M(r7 int64) Compound(size: 8) | ||
S+0 Compound(size: 8) | ||
S+8 Compound(size: 8) | ||
=> | ||
M(r0 int64) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
M(r0 int64) Compound(size: 8) | ||
M(r1 int64) Compound(size: 8) | ||
M(r2 int64) Compound(size: 8) | ||
M(r3 int64) Compound(size: 8) | ||
M(r4 int64) Compound(size: 8) | ||
M(r5 int64) Compound(size: 8) | ||
M(r6 int64) Compound(size: 8) | ||
M(r7 int64) Compound(size: 8) | ||
S+0 Compound(size: 8) | ||
S+8 Compound(size: 8) | ||
=> | ||
M(r0 int64) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
M(r0 int64) Compound(size: 8) | ||
M(r1 int64) Compound(size: 8) | ||
M(r2 int64) Compound(size: 8) | ||
M(r3 int64) Compound(size: 8) | ||
M(r4 int64) Compound(size: 8) | ||
M(r5 int64) Compound(size: 8) | ||
M(r6 int64) Compound(size: 8) | ||
M(r7 int64) Compound(size: 8) | ||
S+0 Compound(size: 8) | ||
S+8 Compound(size: 8) | ||
=> | ||
M(r0 int64) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
M(r1 int32, r2 int32) Compound(size: 8) | ||
M(r3 int32, S+0 int32) Compound(size: 8) | ||
M(S+4 int32, S+8 int32) Compound(size: 8) | ||
M(S+12 int32, S+16 int32) Compound(size: 8) | ||
M(S+20 int32, S+24 int32) Compound(size: 8) | ||
M(S+28 int32, S+32 int32) Compound(size: 8) | ||
M(S+36 int32, S+40 int32) Compound(size: 8) | ||
M(S+44 int32, S+48 int32) Compound(size: 8) | ||
M(S+52 int32, S+56 int32) Compound(size: 8) | ||
M(S+60 int32, S+64 int32) Compound(size: 8) | ||
=> | ||
P(r0 uint32) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
M(r1 int32, r2 int32) Compound(size: 8) | ||
M(r3 int32, S+0 int32) Compound(size: 8) | ||
M(S+4 int32, S+8 int32) Compound(size: 8) | ||
M(S+12 int32, S+16 int32) Compound(size: 8) | ||
M(S+20 int32, S+24 int32) Compound(size: 8) | ||
M(S+28 int32, S+32 int32) Compound(size: 8) | ||
M(S+36 int32, S+40 int32) Compound(size: 8) | ||
M(S+44 int32, S+48 int32) Compound(size: 8) | ||
M(S+52 int32, S+56 int32) Compound(size: 8) | ||
M(S+60 int32, S+64 int32) Compound(size: 8) | ||
=> | ||
P(r0 uint32) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
M(r1 int32, r2 int32) Compound(size: 8) | ||
M(r3 int32, S+0 int32) Compound(size: 8) | ||
M(S+4 int32, S+8 int32) Compound(size: 8) | ||
M(S+12 int32, S+16 int32) Compound(size: 8) | ||
M(S+20 int32, S+24 int32) Compound(size: 8) | ||
M(S+28 int32, S+32 int32) Compound(size: 8) | ||
M(S+36 int32, S+40 int32) Compound(size: 8) | ||
M(S+44 int32, S+48 int32) Compound(size: 8) | ||
M(S+52 int32, S+56 int32) Compound(size: 8) | ||
M(S+60 int32, S+64 int32) Compound(size: 8) | ||
=> | ||
P(r0 uint32) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
S+4 Compound(size: 8) | ||
S+12 Compound(size: 8) | ||
S+20 Compound(size: 8) | ||
S+28 Compound(size: 8) | ||
S+36 Compound(size: 8) | ||
S+44 Compound(size: 8) | ||
S+52 Compound(size: 8) | ||
S+60 Compound(size: 8) | ||
S+68 Compound(size: 8) | ||
S+76 Compound(size: 8) | ||
=> | ||
P(S+0 uint32, ret:eax uint32) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
S+4 Compound(size: 8) | ||
S+12 Compound(size: 8) | ||
S+20 Compound(size: 8) | ||
S+28 Compound(size: 8) | ||
S+36 Compound(size: 8) | ||
S+44 Compound(size: 8) | ||
S+52 Compound(size: 8) | ||
S+60 Compound(size: 8) | ||
S+68 Compound(size: 8) | ||
S+76 Compound(size: 8) | ||
=> | ||
P(S+0 uint32, ret:eax uint32) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
S+0 Compound(size: 8) | ||
S+8 Compound(size: 8) | ||
S+16 Compound(size: 8) | ||
S+24 Compound(size: 8) | ||
S+32 Compound(size: 8) | ||
S+40 Compound(size: 8) | ||
S+48 Compound(size: 8) | ||
S+56 Compound(size: 8) | ||
S+64 Compound(size: 8) | ||
S+72 Compound(size: 8) | ||
=> | ||
M(eax uint32, edx uint32) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
S+0 Compound(size: 8) | ||
S+8 Compound(size: 8) | ||
S+16 Compound(size: 8) | ||
S+24 Compound(size: 8) | ||
S+32 Compound(size: 8) | ||
S+40 Compound(size: 8) | ||
S+48 Compound(size: 8) | ||
S+56 Compound(size: 8) | ||
S+64 Compound(size: 8) | ||
S+72 Compound(size: 8) | ||
=> | ||
P(rdi int64, ret:rax int64) Compound(size: 8) |
12 changes: 12 additions & 0 deletions
12
runtime/vm/compiler/ffi/unit_tests/struct8bytesPackedx10/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,12 @@ | ||
S+0 Compound(size: 8) | ||
S+8 Compound(size: 8) | ||
S+16 Compound(size: 8) | ||
S+24 Compound(size: 8) | ||
S+32 Compound(size: 8) | ||
S+40 Compound(size: 8) | ||
S+48 Compound(size: 8) | ||
S+56 Compound(size: 8) | ||
S+64 Compound(size: 8) | ||
S+72 Compound(size: 8) | ||
=> | ||
P(rdi int64, ret:rax int64) Compound(size: 8) |
Oops, something went wrong.