dart-sdk/pkg/vm
Daco Harkes aa6abbf464 [cfe/ffi] Transform FfiNatives in a single pass
Before this CL, `FfiNative`s were first transformed to `asFunction`
calls, which were then immediately transformed to `_asFunctionInternal`
calls.

This caused the the static checks to be done in two steps, the second
step happening after the first transform. It is cleaner to first do all
checks.

This refactoring enables implementing `_asFunctionInternal` variants
for `FfiNative`s that don't use a `Pointer` for the address.

Besides the transform change, this CL
- moves shared logic over to pkg/vm/lib/transformations/ffi/common.dart,
- splits up the ffi-native tests in to positive and negative tests, and
- adds negative tests for mismatches between Dart and native types.

These new tests do _not yet_ pass on the analyzer. This is tracked in:
https://github.com/dart-lang/sdk/issues/49412

TEST=tests/ffi/ffi_native_test.dart
TEST=tests/ffi/vmspecific_static_checks_ffinative_test.dart

Closes: https://github.com/dart-lang/sdk/issues/49413
Change-Id: I5baded43eab7ff1dc1ffb16550b2a638e4b7a34e
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-mac-release-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250843
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-07-08 12:36:09 +00:00
..
bin [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
lib [cfe/ffi] Transform FfiNatives in a single pass 2022-07-08 12:36:09 +00:00
test [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
testcases/transformations [vm] New implementation of sync* based on suspend/resume stubs 2022-06-27 18:19:12 +00:00
tool [vm/infra] Improve IL testing framework 2021-11-16 12:39:11 +00:00
analysis_options.yaml [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
LICENSE Update LICENSE 2021-04-07 10:28:38 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
pubspec.yaml [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
README.md

This package hosts VM specific Dart code and helper scripts.