From d26f90bba43c1672232f51bc90c8194a31aea065 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 12 Jun 2020 17:15:22 -0700 Subject: Asyncify: Add an "add list", rename old lists (#2910) 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. --- test/passes/asyncify_pass-arg=asyncify-addlist@foo.wast | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/passes/asyncify_pass-arg=asyncify-addlist@foo.wast (limited to 'test/passes/asyncify_pass-arg=asyncify-addlist@foo.wast') diff --git a/test/passes/asyncify_pass-arg=asyncify-addlist@foo.wast b/test/passes/asyncify_pass-arg=asyncify-addlist@foo.wast new file mode 100644 index 000000000..beb89a66a --- /dev/null +++ b/test/passes/asyncify_pass-arg=asyncify-addlist@foo.wast @@ -0,0 +1,13 @@ +(module + (memory 1 2) + (import "env" "import" (func $import)) + (func $foo ;; doesn't look like it needs instrumentation, but in add list + (call $nothing) + ) + (func $bar ;; doesn't look like it needs instrumentation, and not in add list + (call $nothing) + ) + (func $nothing + ) +) + -- cgit v1.2.3