Commit Graph

7 Commits

Author SHA1 Message Date
Mayank Patke c66f91be23 [dynamic_modules] Update pubspec to 3.8 and reformat.
Change-Id: I7cdfb0000996a711bdee9b1618c20a21bbdda814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427620
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Auto-Submit: Mayank Patke <fishythefish@google.com>
2025-05-08 14:52:34 -07:00
Nate Biggs a4a4ca8a41 [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>
2025-02-11 13:59:46 -08:00
Nate Biggs e303f5435b Add dart2wasm support to pkg/dynamic_modules.
Also introduce some tests that include some potential pitfalls in the  wasm implementation.

Change-Id: I904930db992d45414b6e214b68ca542ca29419e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-12-16 18:37:32 -08:00
Alexander Markov a36dbc78ff [vm, dynamic_modules] Support loading of dynamic modules from unmodifiable view
TEST=pkg/dynamic_modules/test/data/load_unmodifiable_view
Fixes https://github.com/dart-lang/sdk/issues/57039

Change-Id: I5b04acd458da437b6ce4cf4b36e0c60c3d3458aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393920
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-11-06 20:23:58 +00:00
Sigmund Cherem 25bc18c3b3 Add support for AOT in dynamic_modules tests
* Introduce steps to execute tests in AOT (using gen-kernel,
  dart2bytecode, and aot compiler)
* Accept using filesystem-scheme to provide dynamic_interfaces.yaml input
* Accept empty dynamic_interfaces.yaml
* Make temporary test changes to get them running:
   * include core types in dynamic_interfaces that we may want to have
     by default
   * rename entrypoint to `main`

Most existing test pass, the two tests that validate that a library
cannot be defined twice fail (expectation is to throw, bytecode ignores
the second definition).

To run locally:
```
./tool/build.py -m release --dart-dynamic-modules create_sdk
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dart pkg/dynamic_modules/test/runner/main.dart -r aot
```

Tested: CL adds additional test coverage, currently ran manually, integrated in CI in child CL
Change-Id: I4868e765855d9951bff160c18b846aa628f5e0b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383928
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-10 04:09:21 +00:00
Sigmund Cherem 9c91f31c10 DDC implementation of experimental dynamic modules.
In particular,

* Provides a DDC implementation for dynamic modules, where the download
  and instantiation of the module is delegated to the embedder of the
  program.

* Exposes an embedding API to allow embedders to define the loading logic.

* Adds a flag to compile code as a dynamic module. This includes
  generating an entrypoint trampoline and checks to validate that a
  dynamic module doesn't stump over previously defined libraries.

* Adds test coverage for DDC under `pkg/dynamic_modules/test/`.

Test suite can be run by executing:
```
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/dart-sdk/bin/dart \
    pkg/dynamic_modules/test/runner/main.dart -t ddc
```

Once we provide integration of test configuration results to that test
runner, we will add it as part of the test matrix.


Change-Id: I626b5fefe9a27546cc6d1630d17e812544a711c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379748
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-10 00:55:02 +00:00
Sigmund Cherem 99cff54882 Add test framework for experimental dynamic modules API.
This CL introduces a test runner and test cases under
`pkg/dynamic_modules/test/`. These tests are end-to-end tests that
specifically target the dynamic modules semantics. This includes:
* semantics expecations on the program evolutions (e.g. libraries
  defined only once)
* individual cases around the dynamic interface (callable, extensible,
  overrides).

We should continue to add more test as we discover coner cases worth validating
(e.g. mixins, constants, etc).

The suite is not yet integrated to the test matrix, my plan is to do so
after we have some initial targets set up.

Change-Id: I2a63946c36d99baacb6fb7edc01c4ef377ce20b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379921
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-09-05 22:24:25 +00:00