dart-sdk/pkg/dart2wasm
Aske Simon Christensen 51c4e03928 [dart2wasm] Type parameters and optional parameters for closures
Changes the representation of closures to include a vtable with entry
points for the various ways in which the function can be called.

For each combination of type parameter count and positional parameter
count, the names of named parameters occurring together with that
combination are partitioned into clusters such that any combination of
names that occurs together is contained within a single cluster.

Each combination of type parameter count and positional parameter
count gets a vtable layout for signatures without named parameters,
plus one for each cluster of parameter names belonging to the
combination.

Each vtable layout will have an entry for each number of positional
arguments from 0 up to the maximum number for the signature, followed
by an entry for each (non-empty) combination of argument names from
its cluster that occurs in a function call in the program.

This layout scheme is consistent with function subtyping in the sense
that if signature B is a subtype of signature A, then the Wasm struct
for the vtable layout corresponding to B is a subtype of the Wasm struct for the vtable layout corresponding to A, i.e. the fields in the layout
for A is a prefix of the fields in the layout for B.

Change-Id: I36569be5251cc0cca4373b08c48d37c214478c3c
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256822
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-12 10:04:46 +00:00
..
bin [dart2wasm] Implement js_util.instanceof. 2022-09-09 20:40:34 +00:00
lib [dart2wasm] Type parameters and optional parameters for closures 2022-09-12 10:04:46 +00:00
analysis_options.yaml
dart2wasm.md [dart2wasm] Coerce types on imports/exports to externref or funcref 2022-09-09 18:10:34 +00:00
OWNERS
pubspec.yaml