summaryrefslogtreecommitdiff
path: root/test/unit/test_asyncify.py
Commit message (Collapse)AuthorAgeFilesLines
* Add an Asyncify option to propagate the addList (#5935)かめのこにょこにょこ2024-04-011-0/+9
| | | | | The new asyncify flag --pass-arg=asyncify-propagate-addlist changes the behavior of --pass-arg=asyncify-addlist : with it, callers of functions in the asyncify-addlist will be also instrumented.
* Remove various testing spam (#6109)Alon Zakai2023-11-141-1/+1
| | | | | Avoid some common warnings and stop printing various stdout/stderr stuff. Helps #6104
* Add a test for too many locals in Asyncify (#4110)Alon Zakai2021-08-271-0/+15
| | | Followup to #4108
* Improve testing on Windows (#3142)Wouter van Oortmerssen2020-09-171-1/+2
| | | | | | This PR contains: - Changes that enable/disable tests on Windows to allow for better local testing. - Also changes many abort() into Fatal() when it is really just exiting on error. This is because abort() generates a dialog window on Windows which is not great in automated scripts. - Improvements to CMake to better work with the project in IDEs (VS).
* Skip tests that fail on windows and enable all the rest (#3035)Alon Zakai2020-08-111-1/+1
| | | | | | | | | | | | | | This lets us run most tests at least on that platform. Add a new function for skipping those tests, skip_if_on_windows, so that it's easy to find which tests are disabled on windows for later fixing efforts. This fixes a few minor issues for windows, like comparisons should ignore \r in some cases. Rename all passes tests that use --dwarfdump to contain "dwarf" in their name, which makes it easy to skip those (and is clearer anyhow).
* Asyncify: Add an "add list", rename old lists (#2910)Alon Zakai2020-06-121-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Asyncify does a whole-program analysis to figure out the list of functions to instrument. In emscripten-core/emscripten#10746 (comment) we realized that we need another type of list there, an "add list" which is a list of functions to add to the instrumented functions list, that is, that we should definitely instrument. The use case in that link is that we disable indirect calls, but there is one special indirect call that we do need to instrument. Being able to add just that one can be much more efficient than assuming all indirect calls in a big codebase need instrumentation. Similar issues can come up if we add a profile-guided option to asyncify, which we've discussed. The existing lists were not good enough to allow that, so a new option is needed. I took the opportunity to rename the old ones to something better and more consistent, so after this PR we have 3 lists as follows: * The old "remove list" (previously "blacklist") which removes functions from the list of functions to be instrumented. * The new "add list" which adds to that list (note how add/remove are clearly parallel). * The old "only list" (previously "whitelist") which simply replaces the entire list, and so only those functions are instrumented and no other. This PR temporarily still supports the old names in the commandline arguments, to avoid immediate breakage for our CI.
* Asyncify: Fix wasm-only instrumentation of unnamed imports (#2682)Alon Zakai2020-03-051-5/+14
| | | | | | | | | | | | | We assumed that the imports were already named (in their internal name) properly. When processing a binary file without names, or if the names don't match in general, that's not true. To fix this, use ModuleUtils::renameFunctions to do a proper renaming up front. Also fix renameFunctions to not assert on the case of renaming a function to the same name it already has. Helps #2680
* Use wat over wast for text format filenames (#2518)Sam Clegg2019-12-081-9/+9
|
* Use package name in imports (NFC) (#2462)Heejin Ahn2019-11-221-13/+13
| | | | | Don't directly import names from shared.py and support.py, and use prefixes instead. Also this reorders imports based on PEP recommendation.
* Warning improvements (#2438)Alon Zakai2019-11-151-1/+1
| | | | | | | | If wasm-opt is run with no passes, warn, as we've gotten reports that people assume a tool called "wasm-opt" should optimize automatically (but we follow llvm's opt convention of not doing so). Add a --quiet (-q) flag that suppresses this minor warning, and the other minor warning where there is no output file.
* asyncify: support *-matching in whitelist and blacklist (#2344)Beuc2019-09-231-1/+6
| | | See emscripten-core/emscripten#9381 for rationale.
* Support response files, and use that in Asyncify (#2319)Alon Zakai2019-08-301-0/+14
| | | See emscripten-core/emscripten#9206, the asyncify names can need complex escaping, so this provides an escape hatch.
* Switch python indentation from 2-space to 4-space (#2299)Sam Clegg2019-08-161-40/+40
| | | | | | | | pep8 specifies 4 space indentation. The use of 2 spaces is, I believe a historical anomaly where certain large organizations such as google chose 2 over 4 and have yet to make the switch. Since there isn't too much code in binaryen today it seems reasonable to make the switch.
* Proper Asyncify list name handling (#2275)Alon Zakai2019-07-311-0/+2
| | | | | The lists are comma separated, but the names can have internal commas since they are human-readable. This adds awareness of bracketing things, so void foo(int, double) is parsed as a single function name, properly. Helps emscripten-core/emscripten#9128
* Python3-ify check.py and auto_update_tests.py (#2270)Alon Zakai2019-07-311-2/+2
| | | | | I fixed flatten.bin.txt which seems to have just had some corrupted data, and I removed some fancy unicode from the spec comments tests, which I'm not sure it's important enough to figure out how to fix. Fixes #1691
* Asyncify: whitelist and blacklist support (#2264)Alon Zakai2019-07-261-0/+21
| | | | | | | | | 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.
* Bysyncify => Asyncify (#2226)Alon Zakai2019-07-151-0/+29
After some discussion this seems like a less confusing name: what the pass does is "asyncify" code, after all. The one downside is the name overlaps with the old emscripten "Asyncify" utility, which we'll need to clarify in the docs there. This keeps the old --bysyncify flag around for now, which is helpful for avoiding temporary breakage on CI as we move the emscripten side as well.