-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Data flow: Track precise types during field flow #3456
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
Data flow: Track precise types during field flow #3456
Conversation
fd10536
to
7b2796b
Compare
7b2796b
to
2c243ad
Compare
I haven't looked at the code, but I note that the CPP-Differences job shows only one result change, which is caused by build-system wobble, and mostly unchanged performance. The slowdown on Wireshark may be significant, but it's not large enough to block this PR. |
👍 FYI, the C++ specific parts are in 2d7470f. |
Ping @aschackmull. |
Ping. |
I'm looking at this, but it's slow going, sorry. Found a bug in |
PR against this PR: hvitved#2 |
Updated Differences jobs: C++ and Java have completed, and they still show now change in neither performance nor results, as expected. |
I had to restart the C# job (https://jenkins.internal.semmle.com/job/Changes/job/CSharp-Differences/224/), which also shows no change in performance nor results. |
Overview
This PR factors type information out of the language-specific
Content
entities, and instead uses the actual stores to record type information. That is, when tracking flow through a field-write,x.f = y
, we use the type ofx
during the subsequent flow calculations, rather than the result ofgetContainerType()
on the content entity corresponding tof
.This means that we are now able to eliminate flow like in the example below:
While this change may not have a big impact on field flow, it is crucial in the implementation of (typed) collection flow: If we kept type information in the
Content
class:then a generic element read such as
would have to match all
TCollectionContent(t)
entities, which does not scale.Performance
I have started Difference jobs for
I also ran @aschackmull 's tuple counting benchmark on JDK, which revealed that most relations had similar sizes; most notably,
flowCandFwdConsCand
increased by 56%, but from a mere 10711 tuples to 16710 tuples.Notes for review
Commit-by-commit review is encouraged. The actual work happens in f1cd535; the other PRs deal with syncing, renaming, and follow-up changes.