Function duplication is widely used by JIT compilers to efficiently implement dynamic languages. When the source language supports higher order functions, the called function's identity is not generally known when compiling a call site, thus limiting the use of function duplication. This paper presents a JIT compilation technique enabling function duplication in the presence of higher order functions. Unlike existing techniques, our approach uses dynamic dispatch at call sites instead of relying on a conservative analysis to discover function identity. We have implemented the technique in a JIT compiler for Scheme. Experiments show that it is efficient at removing type checks, allowing the removal of almost all the run time type checks for several benchmarks. This allows the compiler to generate code up to 50% faster. We show that the technique can be used to duplicate functions using other run time information opening up new applications such as register allocation based duplication and aggressive inlining.
@InProceedings{saleil_et_al:LIPIcs.ECOOP.2017.23, author = {Saleil, Baptiste and Feeley, Marc}, title = {{Interprocedural Specialization of Higher-Order Dynamic Languages Without Static Analysis}}, booktitle = {31st European Conference on Object-Oriented Programming (ECOOP 2017)}, pages = {23:1--23:23}, series = {Leibniz International Proceedings in Informatics (LIPIcs)}, ISBN = {978-3-95977-035-4}, ISSN = {1868-8969}, year = {2017}, volume = {74}, editor = {M\"{u}ller, Peter}, publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik}, address = {Dagstuhl, Germany}, URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ECOOP.2017.23}, URN = {urn:nbn:de:0030-drops-72711}, doi = {10.4230/LIPIcs.ECOOP.2017.23}, annote = {Keywords: Just-in-time compilation, Interprocedural optimization, Dynamic language, Higher-order function, Scheme} }
Feedback for Dagstuhl Publishing