Escape analysis for Java
- 1 October 1999
- proceedings article
- Published by Association for Computing Machinery (ACM)
- Vol. 34 (10) , 1-19
- https://doi.org/10.1145/320384.320386
Abstract
This paper presents a simple and efficient data flow algorithm for escape analysis of objects in Java programs to determine (i) if an object can be allocated on the stack; (ii) if an object is accessed only by a single thread during its lifetime, so that synchronization operations on that object can 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 summarized for each method such that the same summary information may be used effectively in different calling contexts. We present an interprocedural algorithm that uses the above property to efficiently compute the connection graph and identify the non-escaping 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 three out of the ten benchmarks (with a median of 19%), 11% to 92% of all lock operations are eliminated in those ten 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 128 MB memory.Keywords
This publication has 18 references indexed in Scilit:
- Removing unnecessary synchronization in JavaPublished by Association for Computing Machinery (ACM) ,1999
- Escape analysis for object-oriented languagesPublished by Association for Computing Machinery (ACM) ,1999
- Efficient and precise modeling of exceptions for the analysis of Java programsPublished by Association for Computing Machinery (ACM) ,1999
- Interprocedural pointer alias analysisACM Transactions on Programming Languages and Systems, 1999
- The Jalapeño dynamic optimizing compiler for JavaPublished by Association for Computing Machinery (ACM) ,1999
- Thin locksPublished by Association for Computing Machinery (ACM) ,1998
- Constructing compact models of concurrent Java programsPublished by Association for Computing Machinery (ACM) ,1998
- Automatic inline allocation of objectsPublished by Association for Computing Machinery (ACM) ,1997
- From region inference to von Neumann machines via region representation inferencePublished by Association for Computing Machinery (ACM) ,1996
- Lifetime analysis of dynamically allocated objectsPublished by Association for Computing Machinery (ACM) ,1988