paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Partial Evaluation, Whole-Program Compilation

部分求值与全程序编译
PLDI 9(PLDI)2025匹配度 1/10 · 论文属于编译原理与部分求值方向,目标是从解释器自动派生 AOT 编译器,与用户关注的“静态分析×LLM/Agent”“浮点程序分析”“贝叶斯程序分析”等核心方向无直接交集。引用 1 inbox
Chris Fallin, Maxwell Bernstein
crossref: 2026-09-10

AI 速览

一句话:提出部分求值变换,将现有解释器无需剖面地AOT特化为动态语言编译器,并在真实引擎上取得显著加速。

动态语言运行时设计面临速度与正确性的张力:JIT多层编译及后端隐式语义导致复杂且易错的实现。本文提出一种部分求值器,无需 tracing/profiling 即可提前编译整个访客语言函数。该变换在 SSA 中间表示上展开解释器函数,并对其及常规控制流做部分求值,从而驱动访客语言编译,可直接应用于几乎未修改的 C/C++ 解释器,生成提前编译器。其在 SpiderMonkey 解释器层取得 2.17× 加速,在 PUC-Rio Lua 上取得 1.84× 加速,并展望从第一性原理派生更多 JIT 后端能力且保持正确性。

问题
动态语言运行时的JIT虽快,但多层编译和后端隐式语义带来巨大复杂度与正确性风险,需要从单一语义来源自动派生编译代码。
方法
在标准SSA中间表示上展开解释器函数,并对其及常规控制流进行部分求值,从而无需tracing/profiling即可将整个访客语言函数提前编译,且适用于几乎未修改的C/C++解释器。
评估
将方法应用于SpiderMonkey解释器层取得2.17×加速,应用于PUC-Rio Lua解释器取得1.84×加速;并讨论了进一步从第一性原理派生JIT后端能力的方向。
原文摘要(Abstract)

There is a tension in dynamic language runtime design between speed and correctness. State-of-the-art JIT compilation, the result of enormous industrial investment and significant research, achieves heroic speedups at the cost of complexity. This complexity leads to subtle and sometimes catastrophic correctness bugs. Much of this complexity comes from the existence of multiple tiers and the need to maintain correspondence between these separate definitions of the language’s semantics; it also comes from the indirect nature of the semantics implicitly encoded in a compiler backend. One way to address this complexity is to automatically derive, as much as possible, the compiled code from a single source-of-truth, such as the interpreter tier. In this work, we introduce a partial evaluator that can compile a whole guest-language function ahead-of-time, without tracing or profiling, “for free.” This transform unrolls an interpreter function expressed in a standard compiler intermediate representation (static single assignment or SSA) and uses partial evaluation of the interpreter function and its regular control flow to drive the guest-language compilation. The effect of this is that the transform is applicable to almost unmodified existing interpreters in systems languages such as C or C++, producing ahead-of-time guest-language compilers. We show the effectiveness of this new tool by applying it to the interpreter tier of an existing industrial JavaScript engine, SpiderMonkey, yielding 2.17× speedups, and the PUC-Rio Lua interpreter, yielding 1.84× speedups. Finally, we outline an approach to carry this work further, deriving more of the capabilities of a JIT backend from first principles while retaining correctness.

链接与引用

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

BibTeX
@article{paperbot3074,
  title = {Partial Evaluation, Whole-Program Compilation},
  author = {Chris Fallin and Maxwell Bernstein},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {PLDI},
  year = {2025},
  doi = {10.1145/3729259}
}