Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT Compiler
Aurèle Barrière, Sandrine Blazy, David Pichardie
Abstract
Modern Just-in-Time compilers (or JITs) typically interleave several mechanisms to execute a program. For faster startup times and to observe the initial behavior of an execution, interpretation can be initially used. But after a while, JITs dynamically produce native code for parts of the program they execute often. Although some time is spent compiling dynamically, this mechanism makes for much faster times for the remaining of the program execution. Such compilers are complex pieces of software with various components, and greatly rely on a precise interplay between the different languages being executed, including on-stack-replacement. Traditional static compilers like CompCert have been mechanized in proof assistants, but JITs have been scarcely formalized so far, partly due to their impure nature and their numerous components. This work presents a model JIT with dynamic generation of native code, implemented and formally verified in Coq. Although some parts of a JIT cannot be written in Coq, we propose a proof methodology to delimit, specify and reason on the impure effects of a JIT. We argue that the daunting task of formally verifying a complete JIT should draw on existing proofs of native code generation. To this end, our work successfully reuses CompCert and its correctness proofs during dynamic compilation. Finally, our prototype can be extracted and executed.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Formally verified speculation and deoptimization in a JIT compiler cites CompCertM: CompCert with C-assembly linking and lightweight modular verification
- End-to-End Mechanized Proof of a JIT-Accelerated eBPF Virtual Machine for IoT cites Formally verified speculation and deoptimization in a JIT compiler
- Mohabi: Disaggregating and Sandboxing the Firefox JavaScript Engine cites Towards a verified range analysis for JavaScript JITs
- Mohabi: Disaggregating and Sandboxing the Firefox JavaScript Engine cites Formally verified speculation and deoptimization in a JIT compiler
- Mohabi: Disaggregating and Sandboxing the Firefox JavaScript Engine cites Icarus: Trustworthy Just-In-Time Compilers with Symbolic Meta-Execution
- Translation Validation for JIT Compiler in the V8 JavaScript Engine cites Towards a verified range analysis for JavaScript JITs
- Translation Validation for JIT Compiler in the V8 JavaScript Engine cites Formally verified speculation and deoptimization in a JIT compiler
- Cakes That Bake Cakes: Dynamic Computation in CakeML cites Formally verified speculation and deoptimization in a JIT compiler
- Cakes That Bake Cakes: Dynamic Computation in CakeML cites Interaction trees: representing recursive and impure programs in Coq
- Cakes That Bake Cakes: Dynamic Computation in CakeML cites CompCertM: CompCert with C-assembly linking and lightweight modular verification
- Icarus: Trustworthy Just-In-Time Compilers with Symbolic Meta-Execution cites Towards a verified range analysis for JavaScript JITs
- Icarus: Trustworthy Just-In-Time Compilers with Symbolic Meta-Execution cites Formally verified speculation and deoptimization in a JIT compiler
Cited by top-tier papers7
- Translation Validation for JIT Compiler in the V8 JavaScript EngineSeungwan Kwon, Jaeseong Kwon, Wooseok Kang, Juneyoung Lee et al.ICSE 2024 · 19 citations
- End-to-End Mechanized Proof of a JIT-Accelerated eBPF Virtual Machine for IoTShenghao Yuan, Frédéric Besson, Jean-Pierre TalpinCAV 2024 · 18 citations
- Icarus: Trustworthy Just-In-Time Compilers with Symbolic Meta-ExecutionNaomi Smith, Abhishek Sharma, John Renner, David Thien et al.SOSP 2024 · 17 citations
- Cakes That Bake Cakes: Dynamic Computation in CakeMLThomas Sewell, Magnus O. Myreen, Yong Kiam Tan, Ramana Kumar et al.PLDI 2023 · 16 citations
- Mohabi: Disaggregating and Sandboxing the Firefox JavaScript EngineAbhishek Sharma, Anand Balaji, Zachary Yedidia, Anthony Du et al.OSDI 2026 · 1 citation
Builds on5
- Interaction trees: representing recursive and impure programs in CoqLi-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur et al.POPL 2020 · 133 citations
- CompCertM: CompCert with C-assembly linking and lightweight modular verificationYoungju Song, Minki Cho, Dongjoo Kim, Yonghyun Kim et al.POPL 2020 · 49 citations
- Formally verified speculation and deoptimization in a JIT compilerAurèle Barrière, Sandrine Blazy, Olivier Flückiger, David Pichardie et al.POPL 2021 · 38 citations
- Two Mechanisations of WebAssembly 1.0Conrad Watt, Xiaojia Rao, Jean Pichon-Pharabod, Martin Bodin et al.FM 2021 · 32 citations
- Towards a verified range analysis for JavaScript JITsFraser Brown, John Renner, Andres Nötzli, Sorin Lerner et al.PLDI 2020 · 28 citations
Related papers
- Fully Verified Instruction SchedulingZiteng Yang, Jun Shirako, Vivek SarkarOOPSLA 2024 · 1 citation
- Verified Density Compilation for a Probabilistic Programming LanguageJoseph Tassarotti, Jean-Baptiste TristanPLDI 2023 · 6 citations
- Certified and efficient instruction scheduling: application to interlocked VLIW processorsCyril Six, Sylvain Boulmé, David MonniauxOOPSLA 2020 · 21 citations
- Verified Extraction from Coq to OCamlYannick Forster, Matthieu Sozeau, Nicolas TabareauPLDI 2024 · 13 citations
- Specification and verification in the field: Applying formal methods to BPF just-in-time compilers in the Linux kernelLuke Nelson, Jacob Van Geffen, Emina Torlak, Xi WangOSDI 2020 · 72 citations
