mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 17:18:04 +00:00
bdefe5fa7e
The dart2wasm compiler treats wasm arrays of objects/ints/floats pretty much the same, there's no reason to have complicated class hierarchy and different kinds of wasm array classes. Also: We rely on all operations on wasm arrays (and other built-in types) to be handled on the call site. Wasm arrays are not dart objects, don't support virtual dispatch. So we make operations operating on the wasm types extensions. This also makes now loads and stores into the wasm arrays simple `[]` and `[]=` operations. We still have special extensions for reading/writing to integer/double arrays that not only read/write but also sign-extend/zero-extend and operate on Dart's `int` / `double`. The compiler will allow `WasmArray<X>(length)` for types `X` that have default-value in wasm arrays (nullable / integer / double types) and have another `WasmArray<X>.filled(length, X)` for non-nullable reference types. Overall this reduces LOCs and simplifies things Change-Id: I885bed3dfd1c602dc7b0747c69927d464376383d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340881 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Ömer Ağacan <omersa@google.com> |
||
---|---|---|
.. | ||
OWNERS | ||
wasm_sources.gni | ||
wasm_types.dart |