7615acbccc
This will allow a customer to pass `--read-program-split=<constraints>.json` to the dart2wasm compiler, which will then make use of the constraints to reduce the number of wasm modules emitted. We parametrize the dart2js program split builder code to allow re-using of this code with Kernel AST. The changes to `import_set.dart` we copy from dart2js to dart2wasm's implementation. We also add testing support that partitions an application and dumps the partitioning into expectation files: * `pkg/dart2wasm/test/deferred_loading/partition_tests`: Custom tests for dart2wasm containing the Dart code as well as partitioning. * `pkg/dart2wasm/test/deferred_loading/partition_tests_dart2js`: Partition expectation files for the existing tests in `pkg/compiler/test/custom_split/data/<testname>/main.dart`. For the dart2js tests we dump normal partitioning and partitioning under the constraints. Change-Id: I9648899e45435d2a5ceb78126fb62ff00aae692d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480921 Reviewed-by: Nate Biggs <natebiggs@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>