一句话:提出选择性对象敏感指针分析理论框架 Moon,通过图可达性识别可提升精度的对象,实现大幅加速且精度损失极小。
上下文敏感指针分析能显著提升精度,但常带来高昂效率开销。现有选择性上下文敏感方法多由特定代码模式驱动,缺乏系统识别哪些程序元素真正受益于上下文敏感的理论基础。本文提出一种新的基础理论,对真正能提升精度的对象集合给出可靠的过近似,并将该上界的识别转化为典型指针流图(PFG)上的图可达性问题,每个问题可在上下文不敏感下高效求解。基于该理论,作者实现了选择性上下文敏感分析框架 Moon,它在变量流图(VFG)上进行后向与前向遍历,系统识别所有受益对象,并通过精心设计的折衷限制选择范围。在 30 个 Java 程序上的实验表明,Moon 对 2-object 和 3-object 敏感分析分别取得 37.2 倍和 382.0 倍加速,精度损失仅 0.1% 和 0.2%,在效率与精度平衡上显著优于先前方法。
Context sensitivity is a foundational technique in pointer analysis, critical and essential for improving precision but often incurring significant efficiency costs. Recent advances focus on selective context-sensitive analysis, where only a subset of program elements, such as methods or heap objects, are analyzed under context sensitivity while the rest are analyzed under context insensitivity, aiming to balance precision with efficiency. However, despite the proliferation of such approaches, existing methods are typically driven by specific code patterns, therefore lacking a comprehensive theoretical foundation for systematically identifying code scenarios that benefit from context sensitivity. This paper presents a novel and foundational theory that establishes a sound over-approximation of the ground truth, i.e., objects that really improve precision under context sensitivity. The proposed theory reformulates the identification of this upper bound into graph reachability problems over a typical Pointer Flow Graph (PFG), each of which can be efficiently solved under context insensitivity, respectively. Building on this theoretical foundation, we introduce our selective context-sensitive analysis approach, Moon . Moon performs both backward and forward traversal on a Variable Flow Graph (VFG), an optimized variant of PFG designed to facilitate efficient traversal. This traversal systematically identifies all objects that improve precision under context sensitivity. Our theoretical foundation, along with carefully designed trade-offs within our approach, allows Moon to limit the scope of objects to be selected, leading to an effective balance between its analysis precision and efficiency. Extensive experiments with Moon across 30 Java programs demonstrate that Moon achieves 37.2 X and 382.0 X speedups for 2-object-sensitive and 3-object-sensitive analyses, respectively with negligible precision losses of only 0.1% and 0.2%. These results highlight that the balance between efficiency and precision achieved by Moon significantly outperforms all previous approaches.
@article{paperbot2929,
title = {Towards a Theoretically-Backed and Practical Framework for Selective Object-Sensitive Pointer Analysis},
author = {Chaoyue Zhang and Longlong Lu and Yifei Lu and Minxue Pan and Xuandong Li},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA2},
year = {2025},
doi = {10.1145/3763111}
}