commit | aa6abbf464f740f06ba97ad08068a3806cf49b36 | [log] [tgz] |
---|---|---|
author | Daco Harkes <dacoharkes@google.com> | Fri Jul 08 12:36:09 2022 +0000 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Jul 08 12:36:09 2022 +0000 |
tree | aeab661cd056341d6e6ed297ec408470027203ab | |
parent | 9d2da55f70e4bc87b57e61cfe6b53653abac320f [diff] |
[cfe/ffi] Transform `FfiNative`s 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>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.