Skip to content

Commit e9cd695

Browse files
natebiggsCommit Queue
authored andcommitted
[dart2wasm] Disallow inlining code from main module into dynamic module.
This inlining would require increasing the exported surface area of the main module and would increase the complexity of the contract between modules. Change-Id: I6d0bc50600b93ea86842cdf136fd7da6e30109bb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428202 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Nate Biggs <[email protected]>
1 parent da58ca0 commit e9cd695

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/dart2wasm/lib/translator.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,11 @@ class Translator with KernelNodes {
16331633

16341634
bool shouldInline(Reference target, w.FunctionType signature) {
16351635
if (!options.inlining) return false;
1636+
if (isDynamicSubmodule && moduleForReference(target) == mainModule) {
1637+
// We avoid inlining code from the main module into dynamic submodules
1638+
// so that we can avoid needing to export more code.
1639+
return false;
1640+
}
16361641

16371642
// Unchecked entry point functions perform very little, mainly optional
16381643
// parameter handling and then call the real body function.

0 commit comments

Comments
 (0)