Escape analysis
Bruno Blanchet · ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL) · 1998
We describe an escape analysis [32, 14], used to determine whether the lifetime of data exceeds its static scope.We give a new correctness proof starting directly from a semantics. Contrary to previous proofs, it takes into account all the features of functional languages, including imperative features and polymorphism. The analysis has been designed so that it can be implemented under the small complexity bound of O(n log2 n) where n is the size of the analyzed program. We have included it in the Caml Special Light compiler (an implementation of ML), and applied it to very large programs. We plan to apply these techniques to the Java programming language.Escape analysis has been applied to stack allocation. We improve the optimization technique by determining minimal lifetime for stack allocated data, and using inlining. We manage to stack allocate 25% of data in the theorem prover Coq. We analyzed the effect of this optimization, and noticed that its main effect is to improve data locality, which is important for efficiency.
Cited by 84 works. doi:10.1145/268946.268949 Open-access PDF
Authors
References
- Abstract interpretation
- The Definition of Standard ML
- Applications of Path Compression on Balanced Trees
- Systematic design of program analysis frameworks
- Finding Dominators in Directed Graphs
- A flexible approach to interprocedural data flow analysis and programs with recursive data structures
- Interprocedural may-alias analysis for pointers
- Lifetime analysis of dynamically allocated objects
- A semantic model of reference counting and its abstraction (detailed summary)
- Garbage collection can be faster than stack allocation