Commit Graph

4 Commits

Author SHA1 Message Date
Daco Harkes ba5e72ebe4 [vm] Replace TARGET_OS_IOS with TARGET_OS_MACOS_IOS
TEST=Manually tested in Flutter iOS build.

Closes https://github.com/dart-lang/sdk/issues/44230.

Change-Id: I47b3bb9eb1fe567e6f14b1c01548b0c0d9b2a683
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173267
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-11-30 16:04:12 +00:00
Daco Harkes 73160d74bc [vm/ffi] Revert erroneous assertions
Reverts adding the asserts from https://dart-review.googlesource.com/c/sdk/+/129081/47/runtime/vm/compiler/ffi/abi.cc

Change-Id: I2575cfa717a464f92c29ac8e5439d1173ce13cf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134337
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-02-05 16:53:10 +00:00
Daco Harkes 8408232522 [vm/ffi] Replace FFI compiler pipeline
Introduces NativeRepresentation and NativeLocation for the compilation of FFI.

NativeRepresentations are able to express all representations (or types) of the native ABIs we bind to with FFI, this is more representations that than that are used in Dart itself.
NativeLocations are able to express all locations of the native ABIs we bind to with FFI, this is more types of locations than that are used for the Dart calling convention.
See the documentation in the respective files.

These NativeLocations and NativeRepresentations are computed by the NativeCallingConvention and consumed by the Marshaller and Assemblers.

This reenginering is required for go/dart-ffi-by-value, hardfp (Arm S and D fpu registers), and iOS 64 bit (non-word-aligned stack arguments).

In addition, by using the NativeRepresentations we also get slightly reduced code size:

* The tracking of sizes is improved, so less sign/zero-extension operations are required.
* UnboxedWidthExtenderInstr is fully removed, the size extension is done inside the native moves, coalescing moves and size extension when possible.
* BitCastInstr is only used when really needed. This reduces code-size on arm32 softfp.

This fixes the iOS arm64 calling convention, manually tested with https://github.com/flutter/flutter/pull/46078 and https://dart-review.googlesource.com/c/sdk/+/131074.

Fixes: https://github.com/dart-lang/sdk/issues/39637
Issue: https://github.com/dart-lang/sdk/issues/36309
Issue: https://github.com/dart-lang/sdk/issues/36730

Change-Id: I8878bc0f314277bab4ca22f417c6295ecc017720
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129081
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-05 08:46:07 +00:00
Daco Harkes 41b0a6b8c0 [vm/ffi] Split up compiler/ffi.cc into separate files
This CL is a code cleanup landed separately from https://dart-review.googlesource.com/c/sdk/+/129081 to make the CL size smaller.

Refactorings:
* Split up runtime/vm/compiler/ffi.{cc,h} in multiple files.
* Move FrameRebase to compiler/ffi and prevent it from modifying Locations.
* Remove use of <algorithm>.

Change-Id: Ice2a96470a3242a731255383b9647fabab107ac5
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133224
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 15:34:59 +00:00