-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java: Make Virtual Dispatch Global, but keep SSA local. #20357
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
base: main
Are you sure you want to change the base?
Conversation
ca97e45
to
802cc77
Compare
802cc77
to
f754d3a
Compare
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.
Pull Request Overview
Makes Virtual Dispatch computations global while keeping SSA computations local using the forceLocal
mechanism. This change aims to improve performance by allowing Virtual Dispatch predicates to be computed once globally while ensuring SSA predicates remain local to avoid unnecessary recomputation.
- Changes overlay annotations from
[local?]
to[global]
for Virtual Dispatch modules - Keeps SSA module as
[local?]
but usesforceLocal
for specific predicates - Introduces wrapper predicates with
forceLocal
to maintain local computation for certain SSA operations
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll | Changes overlay from [local?] to [global] for unification computations |
java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll | Changes overlay from [local?] to [global] for virtual dispatch analysis |
java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll | Changes overlay from [local?] to [global] for object flow dispatch analysis |
java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll | Changes overlay from [local?] to [global] for dispatch flow computations |
java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll | Keeps [local?] but adds [global] overlays for specific predicates and introduces forceLocal wrappers |
java/ql/lib/semmle/code/java/dataflow/SSA.qll | Keeps [local?] but adds forceLocal wrapper for non-local update detection |
f754d3a
to
1d8c324
Compare
aebe611
to
6aab030
Compare
Use forceLocal to achive this.
This allows us to merge them without redundent annoations for now.
6aab030
to
0d538ec
Compare
I have added a commit that removes the redundant annotations and instead adjusts the annotations script. This should mean that this can be merged without waiting for the next release and we can revert that commit then. |
Use forceLocal to achieve this in SSA.
The
WrappedInvocation
part ofdispatch
stays local as it is used from some local modules. I am not sure this is ideal, but it doesn't seem like a source of FPs in practice.I have added explicit
overlay[global]
annotations so that the SSA library compiles when madeoverlay[local]
.This needs a nightly compiler to compile without warnings so it can't be merged until that is released (2.23.1 barring hotfixes)Now compiles with the latest release with a commit to revert once the next release happens.