[dart2wasm] Dynamic modules

Missing from this implementation:
- Closure/dynamic calls with differing signatures
- Overrides with extra optional parameters
- Records with same shape defined in different dynamic modules
- Avoiding running TFA on dynamic module.
- Recompilation of only updateable functions from main module.
- Persist wasm def types from main module.

Testing is currently done locally via the dynamic_modules package test suite:
dart pkg/dynamic_modules/test/runner/main.dart --runtime=dart2wasm

Immediately after this lands we can introduce a new step to one of the wasm test matrix configurations that runs the above test suite (the VM has a similar configuration).

Change-Id: I3386d84be11b773842d45f4268a62a54c47e352b
Tested: Tested via new tests in dynamic_modules package. Tests run locally but will add to existing config.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397721
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
This commit is contained in:
Nate Biggs
2025-02-11 13:59:46 -08:00
committed by Commit Queue
parent aec2f8cd89
commit a4a4ca8a41
72 changed files with 4367 additions and 796 deletions
+4 -2
View File
@@ -41,7 +41,8 @@ Component loadComponentSourceFromBytes(Uint8List bytes,
return component;
}
Future writeComponentToBinary(Component component, String path) {
Future writeComponentToBinary(Component component, String path,
{bool includeSource = true}) {
IOSink sink;
if (path == 'null' || path == 'stdout') {
sink = stdout.nonBlocking;
@@ -51,7 +52,8 @@ Future writeComponentToBinary(Component component, String path) {
Future future;
try {
new BinaryPrinter(sink).writeComponentFile(component);
new BinaryPrinter(sink, includeSources: includeSource)
.writeComponentFile(component);
} finally {
if (sink == stdout.nonBlocking) {
future = sink.flush();