Skip to content

Conversation

alexet
Copy link
Contributor

@alexet alexet commented Sep 3, 2025

Use forceLocal to achieve this in SSA.

The WrappedInvocation part of dispatch 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 made overlay[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)

@Copilot Copilot AI review requested due to automatic review settings September 3, 2025 17:15
@github-actions github-actions bot added the Java label Sep 3, 2025
Copilot

This comment was marked as outdated.

@alexet alexet force-pushed the alexet/java-global-virtual-dispatch branch from ca97e45 to 802cc77 Compare September 3, 2025 17:17
@Copilot Copilot AI review requested due to automatic review settings September 3, 2025 17:17
@alexet alexet force-pushed the alexet/java-global-virtual-dispatch branch from 802cc77 to f754d3a Compare September 3, 2025 17:17
Copy link
Contributor

@Copilot Copilot AI left a 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 uses forceLocal 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

@alexet alexet closed this Sep 4, 2025
@alexet alexet reopened this Sep 4, 2025
@alexet alexet force-pushed the alexet/java-global-virtual-dispatch branch from f754d3a to 1d8c324 Compare September 4, 2025 17:59
@alexet alexet requested a review from aschackmull September 5, 2025 10:22
@alexet alexet marked this pull request as ready for review September 5, 2025 10:22
@alexet alexet requested a review from a team as a code owner September 5, 2025 10:22
@alexet alexet added the no-change-note-required This PR does not need a change note label Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants