dart-sdk/sdk/lib
Daco Harkes ac5e3d38c3 [vm/ffi] Introduce SizedNativeType
Both `sizeOf` and `AllocatorAlloc.call` use the new type as bound.
This prevents runtime errors on trying to call these two static
methods with unsized native types. All tests testing for these runtime
errors have been deleted.

The `NativeTypes` implementing `SizedNativeType` are as follows:
* The native integer types, `Float`, and `Double`.
* `AbiSpecificInteger` and it's subtypes.
* `Struct` and `Union` and their subtypes. The

The `NativeTypes` not implementing `SizedNativeType` are as follows:
* `Void` has no size.
* `Opaque` and subtypes have unknown size.
* `Handle` is considered opaque. Cannot be used as field in compounds.
* `Array` does not carry a size in its type. Can be used as fields in
  compounds with an annotation specifying the size.
* `NativeFunction` is considered opaque. Would have variable size.
* `VarArgs` is only a marker in function signatures.

`Struct`s and `Union`s can have only `SizedNativeType`s and `Array`s
as fields. Documentation for these is in flux in another CL, so we
should update it there.

This CL also replaces a bunch of `extends NativeType` with
`implements` clauses and made `NativeType` itself `abstract`.

TEST=Dart SDK build
TEST=ffi test suite

Bug: https://github.com/dart-lang/sdk/issues/54542
CoreLibraryReviewExempt: VM and dart2wasm feature only.
Change-Id: Ib4f6b58f7204bd063ace20133162798d8c9483e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345221
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-12 10:13:39 +00:00
..
_http [io] Use _addConnection instead _add in _HttpParser 2023-12-12 18:25:19 +00:00
_internal [vm/ffi] Introduce SizedNativeType 2024-01-12 10:13:39 +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 [doc/async] Remove excessive statement from Timer.periodic() documentation 2024-01-09 09:10:44 +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 [dart2wasm] Start using WebAssembly.String imports 2023-12-08 10:04:41 +00:00
developer [vm/compiler] Tag non-ffi force-optimized functions idempotent. 2023-08-18 18:27:58 +00:00
ffi [vm/ffi] Introduce SizedNativeType 2024-01-12 10:13:39 +00:00
html [docs] move several older dart: web libraries into a 'legacy' category 2024-01-11 18:18:59 +00:00
indexed_db [docs] move several older dart: web libraries into a 'legacy' category 2024-01-11 18:18:59 +00:00
internal Hide the existence of EfficientLengthIterable better. 2023-09-12 11:08:42 +00:00
io [io] Changed Minimum Limit for Trimming File or Dir Path in Windows 2024-01-11 10:53:09 +00:00
isolate Refer to unnamed constructors in doc comments with '.new' 2023-10-17 14:42:38 +00:00
js [docs] move several older dart: web libraries into a 'legacy' category 2024-01-11 18:18:59 +00:00
js_interop [dart:js_interop] Add support for dynamically importing modules 2024-01-03 01:00:19 +00:00
js_interop_unsafe [dart:js_interop_unsafe] Add has helper 2024-01-03 01:00:19 +00:00
js_util [docs] move several older dart: web libraries into a 'legacy' category 2024-01-11 18:18:59 +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] move several older dart: web libraries into a 'legacy' category 2024-01-11 18:18:59 +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] move several older dart: web libraries into a 'legacy' category 2024-01-11 18:18:59 +00:00
web_gl [docs] move several older dart: web libraries into a 'legacy' category 2024-01-11 18:18:59 +00:00
web_sql web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
analysis_options.yaml [vm/ffi] Support varargs 2023-01-20 10:30:41 +00:00
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