mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:32:49 +00:00
4 commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
Daco Harkes | 92e5746494 |
Reland "[vm/ffi] Add class modifiers"
This is a reland of commit
|
||
Zach Anderson | 7471994270 |
Revert "[vm/ffi] Add class modifiers"
This reverts commit
|
||
Daco Harkes | 1755f89092 |
[vm/ffi] Add class modifiers
Adds class modifiers to `dart:ffi`. Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`, and `AbiSpecificInteger` to be `final class`es. Does not remove the manual error checking, so some errors will show up twice now in language version 3.0. In language version <3.0, only the FFI-specific error will show up. In a follow-up CL, we will try to make the language-errors to show up also <3.0 so that we can remove the FFI-specific errors. Examples of duplicated errors: pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart TEST=pkg/analyzer/test/ (for the analyzer) TEST=pkg/front_end/testcases/ (for the CFE) TEST=test/ffi/ (for the VM) CoreLibraryReviewExempt: No need for dart2js to review. Bug: https://github.com/dart-lang/sdk/issues/51683 Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3 Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223 Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Devon Carew <devoncarew@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Jackson Gardner <jacksongardner@google.com> Reviewed-by: Lasse Nielsen <lrn@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
Daco Harkes | acdf82de17 |
[vm/ffi] ABI-specific integers
This CL adds support for users defining integers which are mapped to differing sizes and signedness based on the application binary interface the Dart VM is running on. Notable implementation design decisions: - ABIs are open world, so that adding an ABI to the Dart VM does not break existing definitions. Thus, we only figure out in the VM that we're missing a mapping. We throw compile-time errors. - In AOT, these show up in the precompilation step. - In JIT, these show up as `_CompileTimeError` at runtime. Note that these can be caught. So in subsequent compilation steps we need to ensure that we also throw the same compile-time error. - We match on the call-sites (streaming_flowgraph_builder) rather than method bodies (kernel_to_il) of AbiSpecific loads and stores so that we can compile for the int-size of the call site. API design decisions: https://github.com/dart-lang/sdk/issues/42563#issuecomment-981774001 Closes: https://github.com/dart-lang/sdk/issues/42563 TEST=tests/ffi_2/abi_*_test.dart TEST=tests/ffi/function_*_generated_test.dart TEST=tests/ffi/vmspecific_static_checks_test.dart Change-Id: I8c8df36fab939b6fb614c5f1ee8e1bf46b6e9521 Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,benchmark-linux-try,dart-sdk-linux-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-fuchsia-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64c-try,vm-kernel-mac-debug-x64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221501 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> |