Stack allocation and synchronization optimizations for Java using escape analysis
Authors:
Open Access
- 1 November 2003
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 25 (6) , 876-910
Abstract
This article presents an escape analysis framework for Java to determine (1) if an object is not reachable after its method of creation returns, allowing the object to be allocated on the stack, and (2) if an object is reachable only from a single thread during its lifetime, allowing unnecessary synchronization operations on that object to be removed. We introduce a new program abstraction for escape analysis, the connection graph , that is used to establish reachability relationships between objects and object references. We show that the connection graph can be succinctly summarized for each method such that the same summary information may be used in different calling contexts without introducing imprecision into the analysis. We present an interprocedural algorithm that uses the above property to efficiently compute the connection graph and identify the nonescaping objects for methods and threads. The experimental results, from a prototype implementation of our framework in the IBM High Performance Compiler for Java, are very promising. The percentage of objects that may be allocated on the stack exceeds 70% of all dynamically created objects in the user code in three out of the ten benchmarks (with a median of 19%); 11% to 92% of all mutex lock operations are eliminated in those 10 programs (with a median of 51%), and the overall execution time reduction ranges from 2% to 23% (with a median of 7%) on a 333-MHz PowerPC workstation with 512 MB memory.Keywords
This publication has 37 references indexed in Scilit:
- Incrementalized pointer and escape analysis2001
- Effective synchronization removal for Java2000
- Modular interprocedural pointer analysis using access paths2000
- Basic compiler algorithms for parallel programs1999
- Thin locks1998
- Constructing compact models of concurrent Java programs1998
- Solving shape-analysis problems in languages with destructive updatingACM Transactions on Programming Languages and Systems, 1998
- Flow-insensitive interprocedural alias analysis in the presence of pointers1995
- Context-sensitive interprocedural points-to analysis in the presence of function pointers1994
- Lifetime analysis of dynamically allocated objects1988