44f8e21c82
Introduce a helper library to trim components based on what we believe it is needed for modular bytecode compilation. The script is configured to accept a set of entry points, so unreachable libraries can be removed entirely. The contents of the retained libraries is trimmed to remove method bodies, constructor bodies, and initializers, except for where they may be needed. In the near future, this should be expanded to: * include proper unit testing in the CFE * review whether additional trimming operations can be made * consider an explicit representation of trimmed content, to help the CFE recover when assumptions are not met (e.g. sentinel markers to establish whether a value has been trimmed) * CFE produces trimmed data directly if needed, without having to first produce the full dill. Tests that specifically stress that we don't over-trim include: apply_mixin (requires preserving method bodies), const_body (requires preserving initializers). TEST=existing and new e2e dynamic module aot tests. b/394936876 Change-Id: I26db8385bdfe1664b2aea234ec8bb896c7c21230 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418702 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This package contains experimental dynamic modules API.
Status: experimental
NOTE: This package is currently experimental and not published or included in the SDK.
Do not take dependency on this package unless you are prepared for breaking changes and possibly removal of this code at any point in time.