paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Optimistic Stack Allocation and Dynamic Heapification for Managed Runtimes

面向托管运行时的乐观栈分配与动态堆化
PLDI 8(PLDI)2024匹配度 2/10 · 该论文属于传统编译/运行时方向,核心是静态逃逸分析与托管运行时栈分配,并未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,因此与用户当前关注的 PL 与 AI 交叉方向基本无关;仅在静态分析的方法论和工业落地偏好上有间接共鸣。引用 6 inbox
Aditya Anand, Solai Adithya, Swapnil Rustagi, Priyam Seth, Vijay Sundaresan, Daryl Maier, V. Krishna Nandivada, Manas Thakur
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出静态分析引导的乐观栈分配与动态堆化机制,在托管运行时中更精确地栈分配对象并降低 GC 开销。

托管面向对象语言运行时通常将对象分配在堆上并依赖垃圾回收。JIT 逃逸分析虽可优化内存访问与 GC,但受编译时间限制,分析范围与精度有限;而精确的静态分析结果又难以在非封闭世界运行时中安全使用。本文提出一种静态与动态结合方案:利用精确静态逃逸分析的结果,在 JIT 编译时进行乐观栈分配;通过新颖的动态堆化机制处理可能使乐观假设失效的语言特性;并借助静态分析支持的栈排序减少堆化检查开销。作者分别在 Soot 优化框架和 Eclipse OpenJ9 VM 的分级基础设施中实现静态与运行时组件。与现有逃逸分析相比,该方案能在栈上分配更多对象,显著减少 GC 周期,并带来可观性能提升,尤其适合受限内存环境。

问题
托管 OOP 运行时中,JIT 逃逸分析因编译时间限制精度不足,而精确静态分析的结论又难以在非封闭世界运行时中安全高效使用。
方法
结合精确静态逃逸分析、JIT 乐观栈分配、动态堆化和由静态分析支持的栈排序,以在保证可靠性的同时降低检查开销。
评估
在 Soot 优化框架与 Eclipse OpenJ9 VM 分级基础设施中实现,并与现有逃逸分析对比;结果显示更多对象可栈分配、GC 周期显著减少,在受限内存环境下有可观性能提升。
原文摘要(Abstract)

The runtimes of managed object-oriented languages such as Java allocate objects on the heap, and rely on automatic garbage collection (GC) techniques for freeing up unused objects. Most such runtimes also consist of just-in-time (JIT) compilers that optimize memory access and GC times by employing escape analysis: an object that does not escape (outlive) its allocating method can be allocated on (and freed up with) the stack frame of the corresponding method. However, in order to minimize the time spent in JIT compilation, the scope of such useful analyses is quite limited, thereby restricting their precision significantly. On the contrary, even though it is feasible to perform precise program analyses statically, it is not possible to use their results in a managed runtime without a closed-world assumption. In this paper, we propose a static+dynamic scheme that allows one to harness the results of a precise static escape analysis for allocating objects on stack, while taking care of both soundness and efficiency concerns in the runtime. Our scheme comprises of three key ideas. First, using the results of a statically performed escape analysis, it performs optimistic stack allocation during JIT compilation. Second, it handles the challenges associated with features that may invalidate the optimism, using a novel idea of dynamic heapification. Third, it uses another novel notion of stack ordering, again supported by a static analysis, to reduce the overheads associated with the checks that determine the need for heapification. The static and the runtime components of our approach are implemented in the Soot optimization framework and in the tiered infrastructure of the Eclipse OpenJ9 VM, respectively. To evaluate the benefits, we compare our scheme with the existing escape analysis and find that it succeeds in allocating a much larger number of objects on the stack. Furthermore, the enhanced stack allocation leads to a significant reduction in the number of GC cycles and brings decent performance improvements, especially suited for constrained-memory environments.

链接与引用

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

BibTeX
@article{AnandARSSMNT24,
  title = {Optimistic Stack Allocation and Dynamic Heapification for Managed Runtimes},
  author = {Aditya Anand and Solai Adithya and Swapnil Rustagi and Priyam Seth and Vijay Sundaresan and Daryl Maier and V. Krishna Nandivada and Manas Thakur},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656389}
}