paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Two Approaches to Fast Bytecode Frontend for Static Analysis

面向静态分析的快速字节码前端的两种方法
OOPSLA 9(OOPSLA2)2025匹配度 4/10 · 论文聚焦 Java 字节码前端与类型推断,属于静态分析基础设施,与用户核心关注的 PL→AI(将静态分析用于 ML/Agentic 程序)、AI→PL(LLM 改进静态分析)、浮点程序分析和贝叶斯程序分析均无直接交集。其工程实现与性能优化可作为静态分析工具链参考,但研究匹配度有限。引用 0 inbox
Chenxi Li, Haoran Lin, Tian Tan, Yue Li
crossref: 2026-09-10

AI 速览

一句话:提出模式感知的三地址码翻译与剪枝式类型推断,构建高效且可靠的 Java 字节码前端。

在 Java 静态分析框架中,字节码前端负责将基于栈的复杂 Java 字节码转换为更易分析的、基于寄存器的带类型三地址码,其效率对大规模应用的整体分析性能影响重大,而 Soot、WALA 等主流框架的前端效率不足。本文针对前端两个关键阶段提出新方法:在三地址码翻译阶段,识别字节码中的常见模式以实现更高效的处理(模式感知翻译);在类型推断阶段,发现传统算法存在冗余计算,据此提出剪枝式类型推断。二者共同构成新前端,并可额外生成 SSA IR,提升对各类静态分析技术的可用性。作者在 Tai-e 中实现该前端,并在多种 Java 应用上进行评估,结果显示其效率显著优于 Soot、WALA 和 SootUp,平均分别快 14.2 倍、14.5 倍和 75.2 倍;附加实验还表明其在处理字节码时比这些工具更可靠,为 Java 静态分析提供了更稳健的基础。

问题
Java 静态分析框架的字节码前端需要将栈式字节码转换为可分析的、基于寄存器的带类型三地址码,其效率直接决定大规模 Java 应用的分析性能,但 Soot、WALA 等主流前端效率低下,影响用户体验。
方法
提出两种方法:利用字节码常见模式的模式感知三地址码翻译,以及消除传统算法冗余计算的剪枝式类型推断,二者组合成新前端,并支持生成 SSA IR。
评估
在静态分析框架 Tai-e 中实现该前端,并在多个 Java 应用上与 Soot、WALA、SootUp 对比效率与处理字节码的可靠性,平均加速分别达 14.2×、14.5× 与 75.2×。
原文摘要(Abstract)

In static analysis frameworks for Java, the bytecode frontend serves as a critical component, transforming complex, stack-based Java bytecode into a more analyzable register-based, typed 3-address code representation. This transformation often significantly influences the overall performance of analysis frameworks, particularly when processing large-scale Java applications, rendering the efficiency of the bytecode frontend paramount for static analysis. However, the bytecode frontends of currently dominant Java static analysis frameworks, Soot and WALA, despite being time-tested and widely adopted, exhibit limitations in efficiency, hindering their ability to offer a better user experience. To tackle efficiency issues, we introduce a new bytecode frontend. Typically, bytecode frontends consist of two key stages: (1) translating Java bytecode to untyped 3-address code, and (2) performing type inference on this code. For 3-address code translation, we identified common patterns in bytecode that enable more efficient processing than traditional methods. For type inference, we found that traditional algorithms often include redundant computations that hinder performance. Leveraging these insights, we propose two novel approaches: pattern-aware 3-address code translation and pruning-based type inference, which together form our new frontend and lead to significant efficiency improvements. Besides, our approach can also generate SSA IR, enhancing its usability for various static analysis techniques. We implemented our new bytecode frontend in Tai-e, a recent state-of-the-art static analysis framework for Java, and evaluated its performance across a diverse set of Java applications. Experimental results demonstrate that our frontend significantly outperforms Soot, WALA, and SootUp (an overhaul of Soot)—in terms of efficiency, being on average 14.2×, 14.5×, and 75.2× faster than Soot, WALA, and SootUp, respectively. Moreover, additional experiments reveal that our frontend exhibits superior reliability in processing Java bytecode compared to these tools, thus providing a more robust foundation for Java static analysis.

链接与引用

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

BibTeX
@article{paperbot2894,
  title = {Two Approaches to Fast Bytecode Frontend for Static Analysis},
  author = {Chenxi Li and Haoran Lin and Tian Tan and Yue Li},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763081}
}