paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CoSSJIT: Combining Static Analysis and Speculation in JIT Compilers

CoSSJIT:在JIT编译器中结合静态分析与推测
OOPSLA 9(OOPSLA2)2025匹配度 3/10 · 论文聚焦静态分析与JIT推测在JVM栈分配中的结合,属于程序分析和编译器优化,但未涉及用户核心关注的PL↔AI、LLM/Agent、浮点程序分析或贝叶斯程序分析等交叉方向;其工业JVM落地与静态分析工程实现有一定参考价值。引用 3 inbox
Aditya Anand, Vijay Sundaresan, Daryl Maier, Manas Thakur
crossref: 2026-09-10

AI 速览

一句话:提出 CoSSJIT,将静态分析与 JIT 运行时推测结合,用于生产 JVM 上的激进栈分配,栈分配提升 5.7 倍。

JIT 编译器常为效率牺牲分析精度,而提前编译器虽能做精确的流敏感过程间分析,却在运行时可特化场景下过于保守。本文提出 CoSSJIT,首次在 JIT 编译中结合静态分析与推测优化,并在生产 JVM 上实现激进栈分配。方法上,识别静态分析保守但 JIT 推测可获精度的场景,提出“推测条件”并插入静态过程间数据流分析器,使其生成可在运行时特化的部分结果;再扩展生产 JIT 编译器,用推测条件的解析值增强静态分析结果。评估显示,栈分配提升 5.7 倍并转化为性能收益,同时保证 JIT 编译期间的功能正确性。

问题
JIT 编译器为效率牺牲分析精度,而提前静态编译器在可从运行时特化获益的场景下过于保守,难以兼顾精度与效率。
方法
提出 CoSSJIT,识别静态分析保守但 JIT 推测可提供精度的场景,引入“推测条件”并接入静态过程间数据流分析,生成运行时特化的部分结果,再扩展生产 JIT 编译器用解析后的条件增强分析结果。
评估
在生产 Java 虚拟机上实现并用于激进栈分配,栈分配提升 5.7 倍并转化为性能收益,同时保持 JIT 编译期间的功能正确性。
原文摘要(Abstract)

Just-in-time (JIT) compilers typically sacrifice the precision of program analysis for efficiency, but are capable of performing sophisticated speculative optimizations based on run-time profiles to generate code that is specialized to a given execution. On the contrary, ahead-of-time static compilers can often afford precise flow-sensitive interprocedural analysis, but produce conservative results in scenarios where higher precision could be derived from run-time specialization. In this paper, we propose the first-of-its-kind approach to enrich static analysis with the possibility of speculative optimization during JIT compilation, as well as its usage to perform aggressive stack allocation on a production Java Virtual Machine (JVM). Our approach of combining static analysis with JIT speculation – named CoSSJIT – involves three key contributions. First, we identify the scenarios where a static analysis would make conservative assumptions but a JIT could deliver precision based on run-time speculation. Second, we present the notion of ‘‘speculative conditions’’ and plug them into a static interprocedural dataflow analyzer (whose aim is to identify heap objects that can be allocated on stack), to generate partial results that can be specialized at run-time. Finally, we extend a production JIT compiler to read and enrich static-analysis results with the resolved values of speculative conditions, leading to a practical approach that efficiently combines the best of both worlds. Cherries on the cake: Using CoSSJIT , we obtain 5.7× improvement in stack allocation (translating to performance), while building on a system that ensures functional correctness during JIT compilation.

链接与引用

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

BibTeX
@article{paperbot2885,
  title = {CoSSJIT: Combining Static Analysis and Speculation in JIT Compilers},
  author = {Aditya Anand and Vijay Sundaresan and Daryl Maier and Manas Thakur},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763149}
}