Title
Practical Inlining of Functions with Free Variables.
Abstract
A long-standing practical challenge in the optimization of higher-order languages is inlining functions with free variables. Inlining code statically at a function call site is safe if the compiler can guarantee that the free variables have the same bindings at the inlining point as they do at the point where the function is bound as a closure (code and free variables). There have been many attempts to create a heuristic to check this correctness condition, from Shivers' kCFA-based reflow analysis to Might's Delta-CFA and anodization, but all of those have performance unsuitable for practical compiler implementations. In practice, modern language implementations rely on a series of tricks to capture some common cases (e.g., closures whose free variables are only top-level identifiers such as +) and rely on hand-inlining by the programmer for anything more complicated. This work provides the first practical, general approach for inlining functions with free variables. We also provide a proof of correctness, an evaluation of both the execution time and performance impact of this optimization, and some tips and tricks for implementing an efficient and precise control-flow analysis.
Year
Venue
Field
2013
CoRR
Heuristic,Closure (computer programming),Programmer,Programming language,Identifier,Subroutine,Free variables and bound variables,Computer science,Correctness,Compiler,Theoretical computer science
DocType
Volume
Citations 
Journal
abs/1306.1919
0
PageRank 
References 
Authors
0.34
16
4
Name
Order
Citations
PageRank
Lars Bergstrom1815.23
Matthew Fluet229620.32
John H. Reppy389984.36
Nora Sandler451.12