sdk
sdk copied to clipboard
[dart2wasm] Support cross module inlining & better inlining in dart2wasm
We should start allowing dart2wasm to inline functions across wasm modules. A function can inline a target function if the target is guaranteed to be loaded when the calling function executes.
The most important case: A deferred module calls a function that's present in the main module.
This will have several benefits:
- deferred module code may get smaller/faster
- main module (and others) may not have to export functions (if all uses are inlined)
- we rely less on
wasm-optto do heavy lifting
The current inlining heuristics are very crude and could be improved (very conservative atm & based on AST node count).