Stack allocation and synchronization optimizations for Java using escape analysis

Stack allocation and synchronization optimizations for Java using escape analysis
复制标题

DOI:
10.1145/945885.945892
复制
发表时间:
2003-11
期刊:
ACM Trans. Program. Lang. Syst.
影响因子:
--
通讯作者:
Jong-Deok Choi;Manish Gupta;M. Serrano;V. Sreedhar;S. Midkiff
Jong-Deok Choi;Manish Gupta;M. Serrano;V. Sreedhar;S. Midkiff
中科院分区:
其他
文献类型:
--
作者:
Jong-Deok Choi;Manish Gupta;M. Serrano;V. Sreedhar;S. Midkiff

文献摘要

被引文献

相似文献

本文提供了一个Java转义分析框架,用于确定(1)对象在其创建方法返回后是否不可访问,从而允许在堆栈上分配该对象,以及(2)对象在其生命周期内是否只能从单个线程访问,从而允许删除该对象上不必要的同步操作。我们引入了一种新的用于escape分析的程序抽象,即连接图,它用于建立对象和对象引用之间的可达性关系。我们展示了可以为每种方法简洁地总结连接图,这样在不同的调用上下文中可以使用相同的摘要信息,而不会在分析中引入不精确性。我们提出了一种过程间算法,该算法使用上述属性有效地计算连接图并识别方法和线程的非转义对象。我们的框架在IBM Java高性能编译器中的原型实现的实验结果非常有希望。在10个基准测试中有3个测试中,在堆栈上分配的对象的百分比超过了用户代码中所有动态创建对象的70%(中位数为19%);在这10个程序中消除了11%到92%的互斥锁操作(中值为51%),在内存为512 MB的333 mhz PowerPC工作站上,总体执行时间减少了2%到23%(中值为7%)。
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.