dart-sdk/sdk/lib
Daco Harkes bf683bacbb Reland "[vm/ffi] Introduce Struct.create and Union.create"
Analyzer fix https://github.com/dart-lang/sdk/issues/54754 has
landed. A new version of package:analyzer and package:dartdoc have
been released. `pub global activate dartdoc` should now work.

Patchset 1 is identical to the original CL.
The only difference is an extra test testing with negative offsets.

=== Original CL description ===

Structs and unions can now be created from an existing typed data
with the new `create` methods.

The typed data argument to these `create` methods is optional. If
the typed data argument is omitted, a new typed data of the right
size will be allocated.

Compound field reads and writes are unchecked. (These are
TypedDataBase loads and stores, rather than TypedData loads and stores.
And Pointers have no byte length.) Therefore the `create` method taking
existing TypedData objects check whether the length in bytes it at
least the size of the compound.

TEST=pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart
TEST=pkg/vm/testcases/transformations/ffi/struct_typed_data.dart
TEST=tests/ffi/structs_typed_data_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

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

Change-Id: Id7f30bcd4a6ae55a8298b39c9eadf4e80bc699a9
CoreLibraryReviewExempt: FFI is a VM and WASM only feature.
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349260
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-02-01 18:28:03 +00:00
..
_http [io] Use _addConnection instead _add in _HttpParser 2023-12-12 18:25:19 +00:00
_internal [dart2wasm] Fix type substitution bug if records are involved 2024-02-01 11:38:58 +00:00
_wasm Move Wasm{Object,Int,Float}Array -> WasmArray, use extensions on WasmArray for static dispatc0h 2023-12-12 17:05:49 +00:00
async Mention future callback ordering is undefined 2024-01-26 19:32:14 +00:00
cli [vm] Disable dart:cli waitFor by default 2023-09-14 10:08:29 +00:00
collection [collection] Update example code in dartdoc 2023-12-28 23:37:27 +00:00
convert Remove Utf8Decoder._convertIntercepted hook 2023-11-23 12:25:26 +00:00
core Add extra documentation to Enum to point to EnumName. 2024-01-23 09:34:32 +00:00
developer [sdk] Mark dart:developer APIs with since information 2024-01-22 14:58:12 +00:00
ffi Reland "[vm/ffi] Introduce Struct.create and Union.create" 2024-02-01 18:28:03 +00:00
html [docs] update the messaging for dart:html and related libraries 2024-01-22 21:28:02 +00:00
indexed_db [docs] update the messaging for dart:html and related libraries 2024-01-22 21:28:02 +00:00
internal Hide the existence of EfficientLengthIterable better. 2023-09-12 11:08:42 +00:00
io [doc,io]: Document how errors with File.openRead are exposed 2024-01-17 18:43:50 +00:00
isolate Refer to unnamed constructors in doc comments with '.new' 2023-10-17 14:42:38 +00:00
js [docs] update the messaging for dart:html and related libraries 2024-01-22 21:28:02 +00:00
js_interop [web docs] add package:web to the main sdk docs - api.dart.dev 2024-01-26 15:54:59 +00:00
js_interop_unsafe [dart:js_interop_unsafe] Add has helper 2024-01-03 01:00:19 +00:00
js_util [docs] update the messaging for dart:html and related libraries 2024-01-22 21:28:02 +00:00
math Adding class modifiers to dart:math. 2023-03-13 14:01:26 +00:00
mirrors [vm] Add minimal support for mirrors of extension type members 2023-12-07 21:48:50 +00:00
svg [docs] update the messaging for dart:html and related libraries 2024-01-22 21:28:02 +00:00
typed_data Revert "[typed_data] Deprecate unmodifiable views" 2023-10-27 15:22:54 +00:00
vmservice [vm] Pass offset and script uri for expression compilation 2023-10-12 10:22:38 +00:00
web_audio [docs] update the messaging for dart:html and related libraries 2024-01-22 21:28:02 +00:00
web_gl [docs] update the messaging for dart:html and related libraries 2024-01-22 21:28:02 +00:00
web_sql [docs] update dart:html template files 2024-01-12 18:17:13 +00:00
analysis_options.yaml
libraries.json [dart2wasm] Start using WebAssembly.String imports 2023-12-08 10:04:41 +00:00
libraries.yaml [dart2wasm] Start using WebAssembly.String imports 2023-12-08 10:04:41 +00:00
PRESUBMIT.py [build] Python 3.12 compatibility. 2023-12-12 18:19:35 +00:00
vmservice_libraries.json
vmservice_libraries.yaml