Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asyncify: whitelist and blacklist support #2264

Merged
merged 13 commits into from
Jul 26, 2019
Merged

Asyncify: whitelist and blacklist support #2264

merged 13 commits into from
Jul 26, 2019

Conversation

kripken
Copy link
Member

@kripken kripken commented Jul 25, 2019

The blacklist means "functions here are to be ignored and not instrumented, we can assume they never unwind." The whitelist means "only these functions, and no others, can unwind." I had hoped such lists would not be necessary, since Asyncify's overhead is much smaller than the old Asyncify and Emterpreter, but as projects have noticed, the overhead to size and speed is still significant. The lists give power users a way to reduce any unnecessary overhead.

A slightly tricky thing is escaping of names: we escape names from the names section (see #2261 #1646). The lists arrive in human-readable format, so we escape them before comparing to the internal escaped names. To enable that I refactored wasm-binary a little bit to provide the escaping logic, cc @yurydelendik

If both lists are specified, an error is shown (since that is meaningless). If a name appears in a list that is not in the module, we show a warning, which will hopefully help people debug typos etc. I had hoped to make this an error, but the problem is that due to inlining etc. a single list will not always work for both unoptimized and optimized builds (a function may vanish when optimizing, due to duplicate function elimination or inlining).

Fixes #2218. Emscripten support will appear in a PR there.

@kripken kripken requested review from tlively and aheejin July 25, 2019 19:37
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Just a couple comments

src/passes/Asyncify.cpp Outdated Show resolved Hide resolved
test/unit/test_asyncify.py Outdated Show resolved Hide resolved
@kripken kripken merged commit ccd95f8 into master Jul 26, 2019
@kripken kripken deleted the lists branch July 26, 2019 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Asyncify/Bysyncify] Mechanism to exclude indirect calls in certain functions
2 participants