[JS Interop] Scan configureAll in the entire module, not just the start function#8727
[JS Interop] Scan configureAll in the entire module, not just the start function#8727kripken wants to merge 8 commits into
Conversation
|
If we want to avoid this overhead, and it would be nice to, some options:
|
Doing this as an opt-in pass but requiring manual annotations by default might be a good compromise. Still maybe surprising for users who expect us to handle configureAll correctly by default, though :/ However, requiring manual annotations is the only solution that is robust for arbitrary usage of configureAll because figuring out what functions are passed to it is undecidable in general. |
|
Good idea, let's do that: #8733 |
This adds `@binaryen.js.called` to functions called from any `configureAll`, even one not from the start function. Addresses the issue in #8727, where fuzzing the start function can lead to situations where a function is referred to from configureAll but not marked as js-called, which can break optimizations. By using this in the fuzzer, we can fuzz even files with interesting configureAll calls.
Nice finding from fuzzing the start function + PreserveImportsExportsJS: it made
some configureAll function and called it not from the start. We did not handle
that.
Unfortunately we have a
const Modulewhich causes a headache in ModuleUtilshere. I added a small workaround for that - but maybe there is a better way?