paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Context Sensitivity without Contexts: A Cut-Shortcut Approach to Fast and Precise Pointer Analysis

无上下文的上下文敏感:一种面向快速精确指针分析的 Cut-Shortcut 方法
PLDI 7(PLDI)2023匹配度 3/10 · 论文是通用 Java 指针分析,具备形式化证明与工业级实现,但不涉及 LLM/Agentic、浮点程序分析或贝叶斯程序分析,与用户当前主攻的交叉方向不直接匹配。引用 27 inbox
Wenjie Ma, Shengyuan Yang, Tian Tan, Xiaoxing Ma, Chang Xu, Yue Li
crossref: 2026-09-10

AI 速览

一句话:提出 Cut-Shortcut,通过切割与捷径边在不使用上下文的情况下实现快速且精确的 Java 指针分析。

上下文敏感能提升 Java 指针分析精度,但需按上下文克隆分析每个方法,效率开销大;选择性方法只对部分方法应用上下文,未消除瓶颈。本文提出 Cut-Shortcut:从指针流图(PFG)看,上下文克隆主要过滤被调方内部合并的虚假对象流,因此可切断引入精度损失的边,并添加绕过方法的 Shortcut 边来模拟该效果,实现“无上下文的上下文敏感”。作者识别三类通用程序模式,给出安全的 Cut/Shortcut 算法并证明可靠性;在 Doop(Datalog)和 Tai-e(Java)中实现并评估大型复杂程序。结果显示,多数程序上它甚至快于上下文不敏感分析,同时达到与可扩展上下文敏感分析相当的高精度,首次实现良好效率-精度折中。

问题
上下文敏感指针分析精度高,但需按上下文克隆分析每个方法,带来严重效率开销;已有选择性上下文敏感方法未能从根本上消除该瓶颈。
方法
提出 Cut-Shortcut,在指针流图上安全切断引入精度损失的边,并添加绕过被调方法的 Shortcut 边,以模拟上下文克隆对虚假对象流的过滤效果,并对算法进行形式化与可靠性证明。
评估
在 Doop(Datalog)和 Tai-e(Java)两个框架中实现两个版本,并在近期文献使用的大型复杂 Java 程序上评估;多数程序上甚至快于上下文不敏感分析,同时取得与可扩展上下文敏感分析相当的高精度。
原文摘要(Abstract)

Over the past decades, context sensitivity has been considered as one of the most effective ideas for improving the precision of pointer analysis for Java. Different from the extremely fast context-insensitivity approach, context sensitivity requires every program method to be analyzed under different contexts for separating the static abstractions of different dynamic instantiations of the method’s variables and heap objects, and thus reducing spurious object flows introduced by method calls. However, despite great precision benefits, as each method is equivalently cloned and analyzed under each context, context sensitivity brings heavy efficiency costs. Recently, numerous selective context-sensitive approaches have been put forth for scaling pointer analysis to large and complex Java programs by applying contexts only to the selected methods while analyzing the remaining ones context-insensitively; however, because the selective approaches do not fundamentally alter the primary methodology of context sensitivity (and do not thus remove its efficiency bottleneck), they produce much improved but still limited results. In this work, we present a fundamentally different approach called Cut-Shortcut for fast and precise pointer analysis for Java. Its insight is simple: the main effect of cloning methods under different contexts is to filter spurious object flows that have been merged inside a callee method; from the view of a typical pointer flow graph (PFG), such effect can be simulated by cutting off (Cut) the edges that introduce precision loss to certain pointers and adding Shortcut edges directly from source pointers to the target ones circumventing the method on PFG. As a result, we can achieve the effect of context sensitivity without contexts. We identify three general program patterns and develop algorithms based on them to safely cut off and add shortcut edges on PFG, formalize them and formally prove the soundness. To comprehensively validate Cut-Shortcut’s effectiveness, we implement two versions of Cut-Shortcut for two state-of-the-art pointer analysis frameworks for Java, one in Datalog for the declarative Doop and the other in Java for the imperative Tai-e, and we consider all the large and complex programs used in recent literatures that meet the experimental requirements. The evaluation results are extremely promising: Cut-Shortcut is even able to run faster than context insensitivity for most evaluated programs while obtaining high precision that is comparable to context sensitivity (if scalable) in both frameworks. This is for the first time that we have been able to achieve such a good efficiency and precision trade-off for those hard-to-analyze programs, and we hope Cut-Shortcut could offer new perspectives for developing more effective pointer analysis for Java in the future.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1956,
  title = {Context Sensitivity without Contexts: A Cut-Shortcut Approach to Fast and Precise Pointer Analysis},
  author = {Wenjie Ma and Shengyuan Yang and Tian Tan and Xiaoxing Ma and Chang Xu and Yue Li},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591242}
}