paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Translation Validation for JIT Compiler in the V8 JavaScript Engine

V8 JavaScript 引擎中 JIT 编译器的翻译验证
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 4/10 · 论文属于形式化验证与编译器正确性方向,使用 SMT 翻译验证和 fuzzing,与用户画像中的静态分析/形式化验证有方法邻近性;但它不涉及 LLM/Agent 与 PL 的交叉,也不涉及浮点程序分析或贝叶斯程序分析,因此与当前核心研究方向匹配度较低。引用 20 inbox
Seungwan Kwon, Jaeseong Kwon, Wooseok Kang, Juneyoung Lee, Kihong Heo
crossref: 2026-09-12

AI 速览

一句话:提出 TurboTV:基于 SMT 的分阶段翻译验证器,验证 V8 TurboFan JIT 编译的正确性并发现 LLVM 新误编译。

JS 引擎已成为众多软件系统的关键组成部分,而 JIT 编译的广泛采用使得引擎正确性难以保障。本文提出 TurboTV,一个面向 V8 中 JavaScript JIT 编译器 TurboFan 的翻译验证器(translation validation),其核心思想是用 SMT 编码形式化定义 TurboFan IR 的语义,从而检查某次具体编译是否语义正确。为提升验证效率,作者针对 JS JIT 编译器设计了分阶段验证策略,把整体正确性检查分解为若干更简单的子问题;同时利用 fuzzing 生成大量 JS 函数以触发 TurboFan 的各类优化遍并对其编译结果进行验证。作者在多种 JS 与 LLVM 程序集上评估:TurboTV 以较低误报率有效验证了大量 TurboFan 编译,发现了一个新的 LLVM 误编译;此外还展示了跨语言翻译验证能力——与现成的 LLVM 翻译验证工具协作,验证从 LLVM IR 到 TurboFan IR 的翻译链。

问题
JS 引擎的 JIT 编译器优化复杂且快速演进,如何对 TurboFan 的每一次具体编译结果进行可扩展、可信的正确性检查,是保障 JS 引擎可靠性的关键难题。
方法
将 TurboFan IR 的语义形式化为 SMT 编码,把编译正确性问题归约为 SMT 查询;针对 JS JIT 编译流程设计分阶段验证策略以分解验证任务,并结合 fuzzing 生成触发各类优化遍的 JS 函数进行实用化翻译验证,还可与现成 LLVM 验证工具组合实现跨语言验证。
评估
在若干 JS 程序集与 LLVM 程序集上评估 TurboTV,结果表明其能以较低误报率有效验证大量 TurboFan 编译,并发现了一个新的 LLVM 误编译;同时验证了 LLVM IR 到 TurboFan IR 的跨语言翻译链。
原文摘要(Abstract)

We present TurboTV, a translation validator for the JavaScript (JS) just-in-time (JIT) compiler of V8. While JS engines have become a crucial part of various software systems, their emerging adaption of JIT compilation makes it increasingly challenging to ensure their correctness. We tackle this problem with an SMT-based translation validation (TV) that checks whether a specific compilation is semantically correct. We formally define the semantics of IR of TurboFan (JIT compiler of V8) as SMT encoding. For efficient validation, we design a staged strategy for JS JIT compilers. This allows us to decompose the whole correctness checking into simpler ones. Furthermore, we utilize fuzzing to achieve practical TV. We generate a large number of JS functions using a fuzzer to trigger various optimization passes of TurboFan and validate their compilation using TurboTV. Lastly, we demonstrate that TurboTV can also be used for cross-language TV. We show that TurboTV can validate the translation chain from LLVM IR to TurboFan IR, collaborating with an off-the-shelf TV tool for LLVM. We evaluated TurboTV on various sets of JS and LLVM programs. TurboTV effectively validated a large number of compilations of TurboFan with a low false positive rate and discovered a new miscompilation in LLVM.

链接与引用

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

BibTeX
@inproceedings{paperbot11376,
  title = {Translation Validation for JIT Compiler in the V8 JavaScript Engine},
  author = {Seungwan Kwon and Jaeseong Kwon and Wooseok Kang and Juneyoung Lee and Kihong Heo},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639189}
}