-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Asyncify-verbose: show multiple reasons why a function is processed #6457
Conversation
src/ir/module-utils.h
Outdated
work.push(func.get()); | ||
} | ||
} | ||
while (!work.empty()) { | ||
auto* func = work.pop(); | ||
for (auto* caller : map[func].calledBy) { | ||
logVisit(map[caller], func); | ||
// If we don't already have the property, and we are not forbidden | ||
// from getting it, then it propagates back to us now. | ||
if (!hasProperty(map[caller]) && canHaveProperty(map[caller])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this code makes a lot of map lookups (map[caller]
). Worth caching?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good finds!
This looks like the right approach to me, good ideas.
For testing, I opened #6467 now to fix the existing test. Once that lands we can merge it in here and verify it still passes + update as necessary.
#6467 landed so merging in main here will add it. |
Great! I edited the test to test a function that calls two asyncified functions, so both callees should now be logged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with those minor text changes.
It looks like a clang formatting error showed up on CI here. |
Head branch was pushed to by a user without write access
The asyncify_verbose.wast test is failing on the Windows builder on the main branch. Did this this commit perhaps introduce some non-determinism in the output? |
More likely that it exposed some non-determinism that already existed? I don't know how I'm pretty sure that this PR doesn't change how the tree is walked, only how it logs as it goes. But if it was being walked differently on different platforms, I'm a little surprised the non-determinism didn't present earlier, as that should've resulted in a different function being logged when only one function was logged... maybe before now there were no tests that had a diamond call tree? I did add that in this PR. |
@curiousdannii I think that's the explanation, yeah - the new test exposed existing nondeterminism. I opened #6479 |
#6457 added a test that exposed existing nondeterminism.
Partially solves emscripten-core/emscripten#17380
This doesn't actually make a tree, but it will at least show when a function calls more than one Asyncified function.