A Survey of JIT-Compilation Technologies

Sergey Postnov

Abstract


This survey focuses on the principles of JIT compilation ("just-in-time" compilation) of programs. Briefly discusses the history of the development of technologies for dynamic compilation of programs in different programming languages. The implementation of JIT compilation technology in Java virtual machines is discussed in detail. The classification of JIT compilers is given. The basic JIT compilation technology, its features, and examples of its implementation in compilers for the Java language are described. The potentially achievable complexity and degree of optimization of the compilation order are discussed. A comparison is made between JIT compilation and binary dynamic compilation. Attention is paid to the security risks inherent in the JIT compiler. In particular, we analyze vulnerabilities of JIT compilers in relation to code implementation and reuse attacks. Measures to counter this type of attack are described. An overview of modern principles for developing JIT compilers, including using machine learning methods, is given.


Full Text:

PDF (Russian)

References


S.Z. Sverdlov, Konstruirovanie kompiljatorov. Saarbrucken: Lambert Academic Publishing, 2015.

J. Aycock, “A Brief History of Just-In-Time”, ACM Computing Surveys, vol. 35, No. 2, pp. 97–113, June 2003.

J. McCarthy, “Recursive functions of symbolic expressions and their computation by machine, part I”, Commun. ACM, vol. 3, No. 4, pp. 184–195, 1960.

University of Michigan Executive System for the IBM 7090 Computer, Vol. 1-2, University of Michigan: Ann Arbor, MI, 1966.

K. Thompson, “Regular expression search algorithm”, Commun. ACM, vol. 11, No. 6, pp. 419–422, June 1968.

J. G. Mitchell, A. J. Perlis, H. R. van Zoeren, “LC2: A language for conversational computing”, Interactive Systems for Experimental Applied Mathematics, M. Klerer and J. Reinfelds, Eds. New York: Academic Press, 1968.

P. S. Abrams, “An APL machine”, Ph.D. dissertation, Stanford University, Stanford, CA, Stanford Linear Accelerator Center (SLAC), Rep. 114, 1970.

R.L. Johnston, “The dynamic incremental compiler of APL3000”, in APL’79 Conference Proceedings, APL Quote Quad 9, 4 (June), Pt. 1, pp.82–87, 1977.

E. J. van Dyke, “A dynamic incremental compiler for an interpretive language”, Hewlett-Packard J., vol. 28, No. 11, pp. 17–24, July 1977.

G.J. Hansen, “Adaptive systems for the dynamic run-time optimization of programs”, Ph.D. dissertation. Carnegie-Mellon University, Pittsburgh, PA, 1974.

T.S. Ng, A. Cantoni, “Run time interaction with FORTRAN using mixed code”, The Comput.J.,.vol. 19, No. 1, pp. 91–92, 1976.

L.P. Deutsch, A.M. Schiffman, “Efficient implementation of the Smalltalk-80 system”, in Proceedings of POPL ’84, pp. 297–302, 1984.

U. Hölzle, “Adaptive optimization for Self: Reconciling high performance with exploratory programming”, Ph.D. dissertation, Carnegie-Mellon University, Pittsburgh, PA, 1994.

M. Franz, “Code-generation on-the-fly: A key to portable software”, Ph.D. dissertation. ETH Zurich, Zurich, Switzerland., 1994.

M. Franz, T. Kistler, “Slim binaries”, Commun. ACM, vol. 40, No. 12, pp. 87–94, Dec. 1997.

T. Cramer, R. Friedman, T. Miller, D. Seberger, R. Wilson, M. Wolczko, “Compiling Java just in time”, IEEE Micro, vol. 17, No. 3, pp. 36–43, May/June 1997.

The Java HotSpot virtual machine, White paper, Sun Microsystems, Santa Clara, CA, 2001.

A.-R. Adl-Tabatabai, M. Cierniak, G.-Y. Lueh, V.M. Parikh, J.M. Stichnoth, “Fast, effective code generation in a just-in-time Java compiler”, PLDI ’98, pp. 280–290, 1998.

M.G. Burke, J.-D. Choi, S. Fink, D. Grove, M. Hind, V. Sarkar, M. J. Serrano, V. C. Sreedhar, H. Srinivasan, “The Jalape ˜ no dynamic optimizing compiler for Java”, Proceedings of JAVA ’99, pp. 129–141, 1999.

A. J. C. Bik, M. Girkar, M.R. Haghighat, “Experiences with Java JIT optimization”, In Innovative Architecture for Future Generation High-Performance Processors and Systems, , Los Alamitos, CA: IEEE Computer Society Press, pp. 87–94, 1999.

K. Ishizaki, M. Kawahito, T. Yasue, M. Takeuchi, T. Ogasawara, T. Suganuma, T. Onodera, H. Komatsu, T. Nakatani, “Design, implementation, and evaluation of optimizations in a just-in-time compiler”, Proceedings of JAVA ’99, pp. 119–128, 1999.

B.-S. Yang, S.-M. Moon, S. Park, J. Lee, S. Lee, J. Park, Y. C. Chung, S. Kim, K. Ebcio˘glu, E. Altman, “LaTTe: A Java VM just-in-time compiler with fast and efficient register allocation”, In Proceedings of the International Conference on Parallel Architectures and Compilation Techniques, Los Alamitos, CA : IEEE Computer Society Press,. pp. 128–138, 1999.

A. Azevedo, A. Nicolau, J. Hummel, “Java annotation-aware just-in-time (AJIT) compilation system”, Proceedings of JAVA ’99, pp.142–151, 1999.

M.P. Plezbert, R. K. Cytron, “Does “just in time” = “better late then never”?”, Proceedings of POPL ’97, pp. 120–131, 1997.

M. Arnold, S.J. Fink, D. Grove, M. Hind, P.F. Sweeney, “A Survey of Adaptive Optimization in Virtual Machines”, Proc. IEEE, vol. 93 , Is. 2, pp. 449 – 466, Feb. 2005.

Y. Ding, M. Zhou, Z. Zhao, S. Eisenstat, X. Shen, “Finding the Limit: Examining the Potential and Complexityof Compilation Scheduling for JIT-Based Runtime Systems”, SIGARCH Comput. Archit. News, vol. 42, No. 1, pp. 607–622, Feb. 2014.

J. Brock, C. Ding, X. Xu, Y. Zhang, “PAYJIT: Space-Optimal JIT Compilation and Its Practical Implementation”, Proc. 27th International Conference on Compiler Construction (CC 2018), New York, NY, USA: ACM, pp. 71–81, 2018.

The Compiler design handbook: optimizations and machine code generation, Ed. by Y.N. Srikant, P. Shankar, 2nd ed., CRC Press, 2018.

B. Tang, H Ying, W. Wang, H. Tang, “Eternal War in Software Security: A Survey of Control Flow Protection”, Advances in Computer Science Research, vol. 59, pp. 716-725, 2017.

Z. Shen, W. Chen, “A Survey of Research on Runtime Rerandomization Under Memory Disclosure”, IEEE Access, vol. 7, pp. 105432-105440, 2019.

https://jandemooij.nl/blog/2015/12/29/wx-jit-code-enabled-in-firefox/

https://www.phoronix.com/scan.php?page=news_item&px=W-XOR-E-Firefox

R. Gawlik, T. Holz, “SoK: Make JIT-Spray Great Again”, In Proc. Of 12th {USENIX} Workshop on Offensive Technologies ({WOOT}), Baltimore, MD, paperID 220582, 2018.

S. Oaks, Java Performance: The Definitive Guide, O'Reilly Media, Inc., 2014.

https://www.cs.purdue.edu/homes/rompf/papers/essertel-preprint201907.pdf

D. Cono D’Elia, C. Demetrescu, “On-stack replacement, distilled”, Proc. 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 166–180, June 2018.

M. Festa, N. Gervasoni, S. Cherubin, G. Agosta, “Continuous Program Optimization via Advanced Dynamic Compilation Techniques”, Proc. 10th and 8th Workshop on Parallel Programming and Run-Time Management Techniques for Many-core Architectures and Design Tools and Architectures for Multicore Embedded Computing Platforms (PARMA-DITAM 2019), New York, NY, USA, ACM, Article 2, pp. 1–6, 2019.

S. Benkner, F. Franchetti, H.M. Gerndt, J.K. Hollingsworth, “Automatic Application Tuning for HPC Architectures”, Dagstuhl Reports, vol. 3, No. 9, pp. 214–244, 2014.

B. Saleil, M. Feeley, “Building JIT compilers for dynamic languages with low development effort”, Proc. 10th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages (VMIL 2018), New York, NY, USA, ACM, pp. 36–46, 2018.

B. Saleil, “Simple Optimizing JIT Compilation of Higher-Order Dynamic Programming Languages”, Ph.D. dissertation, Université de Montréal, Montréal, 2019.

J. Cavazos, J.E.B. Moss, ‘Inducing heuristics to decide whether to schedule”, ACM SIGPLAN Not., vol. 39, is. 6, pp. 183–194, May 2004.

A.H. Ashouri, W. Killian, J. Cavazos, G. Palermo, C. Silvano, “A Survey on Compiler Autotuning using Machine Learning”, ACM Comput. Surv., vol. 51, No. 5, Article 96, pp. 96:1-96:8, September 2018.

R.N. Sanchez, J.N. Amaral, D. Szafron, M. Pirvu, M. Stoodley, “Using machines to learn method-specific compilation strategies”, Proc. 9th Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO ’11), IEEE Computer Society, USA, pp. 257–266, 2011.

G. Fursin et al., “MILEPOST GCC: machine learning based research compiler”, Proc. GCC Developers' Summit 2008, Ottawa, Canada, p. 1-6, 2008. (https://hal.inria.fr/inria-00294704/)

G. Fursin et al., “Milepost GCC: Machine Learning Enabled Self-tuning Compiler”, Int. J. Parallel Prog., vol. 39, pp. 296–327, 2011.

S, Kulkarni, J, Cavazos, “Mitigating the compiler optimization phase-ordering problem using machine learning”, ACM SIGPLAN Not., vol. 47, No. 10, pp. 147–162, October 2012.

https://chrisseaton.com/truffleruby/jokerconf17/

https://aboullaite.me/understanding-jit-compiler-just-in-time-compiler/

http://llvm.org/

C. Lattner et al., “MLIR: A Compiler Infrastructure for the End of Moore’s Law”, arXiv:2002.11054v2, March 2020.

https://www.gnu.org/software/lightning/

https://developers.redhat.com/blog/2020/01/20/mir-a-lightweight-jit-compiler-project/

J. Paras, X. Mo, A. Jain, A. Tumanov, J.E. Gonzalez, I. Stoica, “The OoO VLIW JIT Compiler for GPU Inference”, arXiv:1901.10008, January 2019.


Refbacks

  • There are currently no refbacks.


Abava  Кибербезопасность MoNeTec 2024

ISSN: 2307-8162