ABSTRACT
This paper presents a method for creating formally correct just-in-time (JIT) compilers. The tractability of our approach is demonstrated through, what we believe is the first, verification of a JIT compiler with respect to a realistic semantics of self-modifying x86 machine code. Our semantics includes a model of the instruction cache. Two versions of the verified JIT compiler are presented: one generates all of the machine code at once, the other one is incremental i.e. produces code on-demand. All proofs have been performed inside the HOL4 theorem prover.
- HOL4 proof scripts, verified x86 code and other supporting material: http://www.cl.cam.ac.uk/~mom22/jit/.Google Scholar
- Andrew W. Appel. Foundational proof-carrying code. In Logic in Computer Science (LICS). IEEE, 2001. Google ScholarDigital Library
- John Aycock. A brief history of just-in-time. ACM Computing Surveys, 35:97--113, 2003. Google ScholarDigital Library
- R. S. Boyer and J S. Moore. Proving theorems about pure LISP functions. JACM, 22(1):129--144, 1975. Google ScholarDigital Library
- Robert S. Boyer and Yuan Yu. Automated proofs of object code for a widely used microprocessor. J. ACM, 43(1):166--192, 1996. Google ScholarDigital Library
- Hongxu Cai, Zhong Shao, and Alexander Vaynberg. Certified selfmodifying code. In Jeanne Ferrante and Kathryn S. McKinley, editors, Programming Language Design and Implementation (PLDI), pages 66--77. ACM, 2007. Google ScholarDigital Library
- Maulik A. Dave. Compiler verification: a bibliography. SIGSOFT Softw. Eng. Notes, 28(6):2--2, 2003. Google ScholarDigital Library
- R. Gerth. Formal verification of self modifying code. In Int. Conf. for Young Computer Scientists, pages 305--313. International Academic Publishers, China, 1991.Google Scholar
- Michael J. C. Gordon. Mechanizing programming logics in higher order logic. In Current Trends in Hardware Verification and Automated Theorem Proving. Springer, 1989. Google ScholarDigital Library
- David S. Hardin, Eric W. Smith, and William D. Young. A robust machine code proof framework for highly secure applications. In Panagiotis Manolios and Matthew Wilding, editors, Proceedings of the Sixth International Workshop on the ACL2 Theorem Prover and Its Applications, 2006. Google ScholarDigital Library
- C. A. R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576--580, 1969. Google ScholarDigital Library
- Intel. Intel 64 and IA-32 Architectures Software Developers Manual. Intel Corporation, March 2009.Google Scholar
- Xavier Leroy. Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In Principles of Programming Languages (POPL), pages 42--54. ACM Press, 2006. Google ScholarDigital Library
- John Matthews, J. Strother Moore, Sandip Ray, and Daron Vroon. Verification condition generation via theorem proving. In Logic Programming and Automated Reasoning (LPAR), volume 4246 of LNCS, pages 362--376. Springer, 2006. Google ScholarDigital Library
- John McCarthy. Recursive functions of symbolic expressions and their computation by machine, part I. Communications of the ACM, 1960. Google ScholarDigital Library
- Andrew McCreight, Zhong Shao, Chunxiao Lin, and Long Li. A general framework for certifying garbage collectors and their mutators. In Jeanne Ferrante and Kathryn S. McKinley, editors, Proceedings of the Conference on Programming Language Design and Implementation (PLDI), pages 468--479. ACM, 2007. Google ScholarDigital Library
- J Strother Moore. Symbolic simulation: An ACL2 approach. In Ganesh Gopalakrishnan and Phillip J. Windley, editors, Formal Methods in Computer-Aided Design (FMCAD), pages 334--350, 1998. Google ScholarDigital Library
- J. Gregory Morrisett, DavidWalker, Karl Crary, and Neal Glew. From System F to typed assembly language. In Principles of Programming Languages (POPL), pages 85--97. ACM Press, 1998. Google ScholarDigital Library
- Magnus O. Myreen. Formal verification of machine-code programs. PhD thesis, University of Cambridge, 2009.Google Scholar
- Magnus O. Myreen and Michael J.C. Gordon. Verified LISP implementations on ARM, x86 and PowerPC. In Stefan Berghofer, Tobias Nipkow, Christian Urban, and MakariusWenzel, editors, Theorem Proving in Higher Order Logics (TPHOLs), LNCS. Springer, 2009. Google ScholarDigital Library
- Magnus O. Myreen, Konrad Slind, and Michael J. C. Gordon. Machine-code verification for multiple architectures -- An application of decompilation into logic. In Alessandro Cimatti and Robert B. Jones, editors, Formal Methods in Computer Aided Design (FMCAD). IEEE, 2008. Google ScholarDigital Library
- Magnus O. Myreen, Konrad Slind, and Michael J.C. Gordon. Extensible proof-producing compilation. In Michael I. Schwartzbach Oege de Moor, editor, Compiler Construction (CC), LNCS. Springer, 2009. Google ScholarDigital Library
- George C. Necula. Proof-carrying code. In Principles of Programming Languages (POPL), pages 106--119. ACM, 1997. Google ScholarDigital Library
- John Reynolds. Separation logic: A logic for shared mutable data structures. In Proceedings of Logic in Computer Science (LICS). IEEE Computer Society, 2002. Google ScholarDigital Library
- Susmit Sarkar, Pater Sewell, Francesco Zappa Nardelli, Scott Owens, Tom Ridge, Thomas Braibant Magnus O. Myreen, and Jade Alglave. The semantics of x86-CC multiprocessor machine code. In Principles of Programming Languages (POPL). ACM, 2009. Google ScholarDigital Library
- Konrad Slind and Michael Norrish. A brief overview of HOL4. In Otmane Aït Mohamed, César Muñoz, and Sofiène Tahar, editors, Theorem Proving in Higher Order Logics (TPHOLs), LNCS, pages 28--32. Springer, 2008. Google ScholarDigital Library
- Gang Tan and Andrew W. Appel. A compositional logic for control flow. In E. Allen Emerson and Kedar S. Namjoshi, editors, Proceedings of Verification, Model Checking and Abstract Interpretation (VMCAI), LNCS. Springer, 2006. Google ScholarDigital Library
- Paul Tyma. Why are we using Java again? Commun. ACM, 41(6):38--42, 1998. Google ScholarDigital Library
- Dachuan Yu, Nadeem A. Hamid, and Zhong Shao. Building certified libraries for PCC: Dynamic storage allocation. Science of Computer Programming, 50(1-3):101--127, 2004. Google ScholarDigital Library
Index Terms
- Verified just-in-time compiler on x86
Recommendations
Verified just-in-time compiler on x86
POPL '10This paper presents a method for creating formally correct just-in-time (JIT) compilers. The tractability of our approach is demonstrated through, what we believe is the first, verification of a JIT compiler with respect to a realistic semantics of self-...
A Formally Verified Compiler Back-end
This article describes the development and formal verification (proof of semantic preservation) of a compiler back-end from Cminor (a simple imperative intermediate language) to PowerPC assembly code, using the Coq proof assistant both for programming ...
Pervasive Compiler Verification -- From Verified Programs to Verified Systems
We report in this paper on the formal verification of a simple compiler for the C-like programming language C0. The compiler correctness proof meets the special requirements of pervasive system verification and allows to transfer correctness properties ...
Comments