Pointer traversals pose significant overhead to the execution of object-oriented programs, since every access to an object’s state requires a pointer dereference. Eliminating redundant pointer traversals reduces both instructions executed as well as redundant memory accesses to relieve pressure on the memory subsystem. We describe an approach to elimination of redundant access expressions that combines partial redundancy elimination (PRE) with type-based alias analysis (TBAA). To explore the potential of this approach we have implemented an optimization framework for Java class files incorporating TBAA-based PRE over pointer access expressions. The framework is implemented as a classfile-to-classfile transformer; optimized classes can then be run in any standard Java execution environment. Our experiments demonstrate improvements in the execution of optimized code for several Java benchmarks running in diverse execution environments: the standard interpreted JDK virtual machine, a virtual machine using “just-in-time” compilation, and native binaries compiled off-line (“way-ahead-of-time”). We isolate the impact of access path PRE using TBAA, and demonstrate that Java’s requirement of precise exceptions can noticeably impact code-motion optimizations like PRE.
@inproceedings{Hosking+1999IWAOOS, author = {Hosking, Antony L. and Nystrom, Nathaniel and Whitlock, David and Cutts, Quintin and Diwan, Amer}, title = {Partial Redundancy Elimination for Access Path Expressions}, booktitle = {ECOOP Workshop on Aliasing in Object Oriented Systems}, series = {IWAOOS}, year = {1999}, editor = {Noble, James and Vitek, Jan and Lea, Doug and Almeida, Paulo Sergio}, month = {June}, address = {Lisbon, Portugal}, doi = {10.1007/3-540-46589-8_8} }