dart-sdk/sdk/lib/_internal
Martin Kustermann fd954d426f [dart2wasm] Better handling of list/map/set literals
If the literals are

* empty: call function with zero arguments
* non-empty: call function taking `WasmArray<Object?>`

=> This avoids making a call for each element we add.

Reorganize the map/set mixins:

* pull out the `createIndex` into it's own mixin
* make mutable set/map implementations use that mixin
* remove compiler-knowledge about how to create hash mask
  (instead set the hashmask field in `_createIndex()`)

=> Function creating map/set from `WasmArray<Object?>` can create index
=> Allows the above

Outline functions (for now only for list/map/set literal creation
functions):

* Often many call sites use literals with instantiated types
* Make outlined functions that will populate those instantiated types
  and forward the arguments

This turns e.g. `<A, B>{}` (if `A`/`B` are instantiated, e.g. `int`)

  global.get A
  global.get B
  call _WasmDefaultMap._default

into

  call createEmpty<A, B>

  createEmpty<A, B>:
    global.get A
    global.get B
    call _WasmDefaultMap._default


All together this

* reduces flute size by a bit more than 0.5%
* makes some benchmarks faster

Change-Id: I13c7e6060470d74769a3d49816671aceb2cd3aab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356500
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-03-11 13:07:47 +00:00
..
js_dev_runtime [ddc] Cleanup dynamic calls in native_typed_data 2024-03-06 00:51:15 +00:00
js_runtime Make all platforms return null from Error.stackTrace until thrown. 2024-02-27 23:01:06 +00:00
js_shared [js_dev_runtime] dart format --fix 2024-01-30 20:41:20 +00:00
sdk_library_metadata [dart2js] Convert some collections of const ints to enums 2024-02-23 19:52:50 +00:00
vm [vm] Introduce pragma vm:deeply-immutable 2024-03-07 18:33:58 +00:00
vm_shared/lib [vm] Introduce pragma vm:deeply-immutable 2024-03-07 18:33:58 +00:00
wasm [dart2wasm] Better handling of list/map/set literals 2024-03-11 13:07:47 +00:00
wasm_js_compatibility/lib [dart:js_interop] Move JS types to extension types 2023-12-06 21:59:58 +00:00
allowed_experiments.json Retire 3.3 experiments in the 3.4 release. 2024-03-04 16:09:31 +00:00
fix_data.yaml Remove duplicated FileMode fixes 2021-10-11 13:58:43 +00:00